text stringlengths 17 1.47k | positive stringlengths 673 4.43k | negative stringlengths 677 2.81k |
|---|---|---|
Fix script addition to package.son | 'use strict';
var generators = require('yeoman-generator');
var extend = require('deep-extend');
module.exports = generators.Base.extend({
constructor: function () {
generators.Base.apply(this, arguments);
this.option('coveralls', {
required: false,
defaults: false,
desc: 'Use React syntax... | 'use strict';
var generators = require('yeoman-generator');
var extend = require('deep-extend');
module.exports = generators.Base.extend({
constructor: function () {
generators.Base.apply(this, arguments);
this.option('coveralls', {
required: false,
defaults: false,
desc: 'Use React syntax... |
Clean up Travis CI/JSHint gripes. | 'use strict';
angular.module('confRegistrationWebApp')
.controller('AdminDataCtrl', function ($scope, registrations, conference) {
$scope.conference = conference;
$scope.blocks = [];
$scope.reversesort = false;
angular.forEach(conference.registrationPages, function (page) {
angular.forEach(pa... | 'use strict';
angular.module('confRegistrationWebApp')
.controller('AdminDataCtrl', function ($scope, registrations, conference) {
$scope.conference = conference;
$scope.blocks = [];
$scope.reversesort = false;
angular.forEach(conference.registrationPages, function (page) {
angular.forEach(pa... |
Add updateTaskImplementationCode() method to TaskImplService |
package pingis.services;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import pingis.entities.TaskImplementation;
import pingis.repositories.TaskImplementationRepository;
import pingis.repo... |
package pingis.services;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import pingis.entities.TaskImplementation;
import pingis.repositories.TaskImplementationRepository;
import pingis.repositories.TaskRepository;
import pingis.repositories.UserRepositor... |
Add universal_newlines paramter to run call | import discord
import asyncio
import os
import signal
import sys
from subprocess import run
#Set up Client State
CLIENT_TOKEN=os.environ['TOKEN']
#Create Discord client
client = discord.Client()
#Handle shutdown gracefully
def sigterm_handler(signum, frame):
print('Logging out...', flush=True)
raise Keyboar... | import discord
import asyncio
import os
import signal
import sys
from subprocess import run
#Set up Client State
CLIENT_TOKEN=os.environ['TOKEN']
#Create Discord client
client = discord.Client()
#Handle shutdown gracefully
def sigterm_handler(signum, frame):
print('Logging out...', flush=True)
raise Keyboar... |
Remove the shadow below status bar that occurs in version greater than M. | package com.githang.statusbar;
import android.annotation.TargetApi;
import android.os.Build;
import android.view.View;
import android.view.Window;
import android.view.WindowManager;
/**
* 兼容M版本
*
* @author 黄浩杭 (huanghaohang@parkingwang.com)
* @version 2016-06-20
* @since 2016-06-20
*/
class StatusBarCompatM {
... | package com.githang.statusbar;
import android.annotation.TargetApi;
import android.os.Build;
import android.view.View;
import android.view.Window;
import android.view.WindowManager;
/**
* 兼容M版本
*
* @author 黄浩杭 (huanghaohang@parkingwang.com)
* @version 2016-06-20
* @since 2016-06-20
*/
class StatusBarCompatM {
... |
Remove entry point mecodesktop script
MacroecoDesktop is now called using the python -c syntax instead of an
entry script. | from setuptools import setup, find_packages
setup(
name = 'macroeco',
version = 1.0,
packages = find_packages(),
# entry_points = {'console_scripts': ['mecodesktop=macroeco:mecodesktop',],},
package_data = {'': ['*.txt', '*.csv']},
author = 'Justin Kitzes and Mark Wilber',
author_email = '... | from setuptools import setup, find_packages
setup(
name = 'macroeco',
version = 1.0,
packages = find_packages(),
entry_points = {'console_scripts': ['mecodesktop=macroeco:mecodesktop',],},
package_data = {'': ['*.txt', '*.csv']},
author = 'Justin Kitzes and Mark Wilber',
author_email = 'jk... |
QS-1341: Make report optional in CardContent | import React, { PropTypes, Component } from 'react';
import CardContent from '../ui/CardContent';
export default class CardContentList extends Component {
static propTypes = {
contents : PropTypes.array.isRequired,
userId : PropTypes.number.isRequired,
otherUserId : PropTypes.... | import React, { PropTypes, Component } from 'react';
import CardContent from '../ui/CardContent';
export default class CardContentList extends Component {
static propTypes = {
contents : PropTypes.array.isRequired,
userId : PropTypes.number.isRequired,
otherUserId : PropTypes.... |
Add a test on failed arg introspection in chained decorators
This is a consequence of not preserving function signature. So this
could be fixed by preserving signature or by some workaround. | import pytest
from funcy.decorators import *
def test_decorator_no_args():
@decorator
def inc(call):
return call() + 1
@inc
def ten():
return 10
assert ten() == 11
def test_decorator_with_args():
@decorator
def add(call, n):
return call() + n
@add(2)
de... | import pytest
from funcy.decorators import *
def test_decorator_no_args():
@decorator
def inc(call):
return call() + 1
@inc
def ten():
return 10
assert ten() == 11
def test_decorator_with_args():
@decorator
def add(call, n):
return call() + n
@add(2)
de... |
Add path_only support to URLArgument | from __future__ import absolute_import
import string
import urlparse
from pale.arguments.string import StringArgument
from pale.errors import ArgumentError
class URLArgument(StringArgument):
path_only = False
def validate_url(self, original_string):
"""Returns the original string if it was valid, r... | from __future__ import absolute_import
import string
import urlparse
from pale.arguments.string import StringArgument
from pale.errors import ArgumentError
class URLArgument(StringArgument):
def validate_url(self, original_string):
"""Returns the original string if it was valid, raises an argument
... |
Make the automatic object transformer able to transform doctrine collections | <?php
namespace FOQ\ElasticaBundle\Transformer;
use RuntimeException;
use Traversable;
use ArrayAccess;
/**
* AutomaticObjectToArrayTransformer
* Tries to convert objects by generating getters
* based on the required keys
*/
class ObjectToArrayAutomaticTransformer implements ObjectToArrayTransformerInterface
{
... | <?php
namespace FOQ\ElasticaBundle\Transformer;
use RuntimeException;
use Traversable;
/**
* AutomaticObjectToArrayTransformer
* Tries to convert objects by generating getters
* based on the required keys
*/
class ObjectToArrayAutomaticTransformer implements ObjectToArrayTransformerInterface
{
/**
* Tra... |
Use "submission_id" instead of "instance_id" parameter to send to KPI for RESTservice | # coding: utf-8
import logging
import re
import requests
from django.conf import settings
from onadata.apps.restservice.RestServiceInterface import RestServiceInterface
from onadata.apps.logger.models import Instance
class ServiceDefinition(RestServiceInterface):
id = 'kpi_hook'
verbose_name = 'KPI Hook POST... | # coding: utf-8
import logging
import re
import requests
from django.conf import settings
from onadata.apps.restservice.RestServiceInterface import RestServiceInterface
from onadata.apps.logger.models import Instance
class ServiceDefinition(RestServiceInterface):
id = 'kpi_hook'
verbose_name = 'KPI Hook POST... |
Use finally to clean up (hello @sunesimonsen). | var mockfs = require('mock-fs');
var fs = require('fs');
var MountFs = require('mountfs');
var rewriteMockFsOptions = require('./lib/rewriteMockFsOptions');
module.exports = {
name: 'unexpected-fs',
installInto: function (expect) {
expect.addAssertion('with fs mocked out', function (expect, subject, va... | var mockfs = require('mock-fs');
var fs = require('fs');
var MountFs = require('mountfs');
var rewriteMockFsOptions = require('./lib/rewriteMockFsOptions');
module.exports = {
name: 'unexpected-fs',
installInto: function (expect) {
expect.addAssertion('with fs mocked out', function (expect, subject, va... |
Throw separate exception for each failed doc
Sentry will `{clipped}` your exception if it's too long. | <?php
namespace App;
use Exception;
use ScoutEngines\Elasticsearch\ElasticsearchEngine as BaseEngine;
class ElasticsearchEngine extends BaseEngine
{
/**
* Update the given model in the index.
*
* @param Collection $models
* @return void
*/
public function update($models)
{
... | <?php
namespace App;
use Exception;
use ScoutEngines\Elasticsearch\ElasticsearchEngine as BaseEngine;
class ElasticsearchEngine extends BaseEngine
{
/**
* Update the given model in the index.
*
* @param Collection $models
* @return void
*/
public function update($models)
{
... |
Handle stack variation in Node v0.8 | var tape = require('../');
var tap = require('tap');
var concat = require('concat-stream');
var stripFullStack = require('./common').stripFullStack;
var testWrapper = require('./anonymous-fn/test-wrapper');
tap.test('inside anonymous functions', function (tt) {
tt.plan(1);
var test = tape.createHarness()... | var tape = require('../');
var tap = require('tap');
var concat = require('concat-stream');
var stripFullStack = require('./common').stripFullStack;
var testWrapper = require('./anonymous-fn/test-wrapper');
tap.test('inside anonymous functions', function (tt) {
tt.plan(1);
var test = tape.createHarness()... |
Select complete textbox content on click | document.addEventListener("DOMContentLoaded", function () {
var qr_cellsize = 8;
var qr_margin = 2 * qr_cellsize;
var qr_levels = ["M", "L"];
var createImage = function(payload) {
for (var levelIndex in qr_levels) {
for (var typeNum = 1; typeNum <= 10; typeNum++) {
try {
var qr = qr... | document.addEventListener("DOMContentLoaded", function () {
var qr_cellsize = 8;
var qr_margin = 2 * qr_cellsize;
var qr_levels = ["M", "L"];
var createImage = function(payload) {
for (var levelIndex in qr_levels) {
for (var typeNum = 1; typeNum <= 10; typeNum++) {
try {
var qr = qr... |
Stop sending request immediately, instead, sending the request if user stops changing the value for some time. | import React, { Component } from 'react';
import UserList from './UserList';
import LocationBox from './LocationBox';
import $ from 'jquery';
module.exports = React.createClass({
getInitialState: function() {
return {
location: 'Shanghai',
pendingSearch: null,
users: []
};
},
searc... | import React, { Component } from 'react';
import UserList from './UserList';
import LocationBox from './LocationBox';
import $ from 'jquery';
module.exports = React.createClass({
getInitialState: function() {
return {
location: 'Shanghai',
users: []
};
},
searchUsers: function(location) ... |
Fix typo in sandbox attribute name. | import logging
logger = logging.getLogger(__name__)
# Source: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/iframe#attr-sandbox
allowable_sandbox_tokens = set(
[
"allow-downloads-without-user-activation",
"allow-forms",
"allow-modals",
"allow-orientation-lock",
... | import logging
logger = logging.getLogger(__name__)
# Source: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/iframe#attr-sandbox
allowable_sandbox_tokens = set(
[
"allow-downloads-without-user-activation",
"allow-forms",
"allow-modals",
"allow-orientation-lock",
... |
Fix css and fix small typo in installer | define(function(require, exports, module) {
main.consumes = ["Plugin", "installer", "c9"];
main.provides = ["installer.darwin"];
return main;
function main(options, imports, register) {
var Plugin = imports.Plugin;
var installer = imports.installer;
var c9 = imports.c9;
... | define(function(require, exports, module) {
main.consumes = ["Plugin", "installer", "c9"];
main.provides = ["installer.darwin"];
return main;
function main(options, imports, register) {
var Plugin = imports.Plugin;
var installer = imports.installer;
var c9 = imports.c9;
... |
Add a fix for Safari to the default config
Uglifying ES6 doesn't work currently with Safari due to a webkit bug.
Adding this mangle option fixes that. | 'use strict';
module.exports = {
name: 'ember-cli-uglify',
included(app) {
this._super.included.apply(this, arguments);
const defaults = require('lodash.defaultsdeep');
let defaultOptions = {
enabled: app.env === 'production',
uglify: {
compress: {
// this is adversely... | 'use strict';
module.exports = {
name: 'ember-cli-uglify',
included(app) {
this._super.included.apply(this, arguments);
const defaults = require('lodash.defaultsdeep');
let defaultOptions = {
enabled: app.env === 'production',
uglify: {
compress: {
// this is adversely... |
Use triple equals for argument sniffing in proxy function; this lets "null" clear a style on when using 2 arguments | // From jQuery (src/css.js)
var cssNumber = {
boxFlex: true, columnCount: true, fillOpacity: true,
fontWeight: true, lineHeight: true, opacity: true,
orphans: true, widows: true, zIndex: true, zoom: true
};
function camelCase(prop){
return prop.replace(/-[a-z]/g, function(match){
return match[1... | // From jQuery (src/css.js)
var cssNumber = {
boxFlex: true, columnCount: true, fillOpacity: true,
fontWeight: true, lineHeight: true, opacity: true,
orphans: true, widows: true, zIndex: true, zoom: true
};
function camelCase(prop){
return prop.replace(/-[a-z]/g, function(match){
return match[1... |
ZON-3409: Update to version with celery. | from setuptools import setup, find_packages
setup(
name='zeit.campus',
version='1.6.4.dev0',
author='Zeit Online',
author_email='zon-backend@zeit.de',
url='http://www.zeit.de/',
description="vivi section Campus",
packages=find_packages('src'),
package_dir={'': 'src'},
include_packa... | from setuptools import setup, find_packages
setup(
name='zeit.campus',
version='1.6.4.dev0',
author='Zeit Online',
author_email='zon-backend@zeit.de',
url='http://www.zeit.de/',
description="vivi section Campus",
packages=find_packages('src'),
package_dir={'': 'src'},
include_packa... |
Clarify current model of time series scoring | package macrobase.analysis.outlier;
import java.util.List;
import macrobase.conf.MacroBaseConf;
import macrobase.conf.MacroBaseDefaults;
import macrobase.datamodel.Datum;
public abstract class TimeSeriesOutlierDetector extends OutlierDetector {
protected final int tupleWindowSize;
private int currentTupleWin... | package macrobase.analysis.outlier;
import java.util.List;
import macrobase.conf.MacroBaseConf;
import macrobase.conf.MacroBaseDefaults;
import macrobase.datamodel.Datum;
public abstract class TimeSeriesOutlierDetector extends OutlierDetector {
protected final int tupleWindowSize;
private int currentTupleWin... |
Call session_write_close() when saving session | <?php
declare(strict_types=1);
namespace Vision\Session\Extension;
use Vision\Session\SessionInterface;
use SessionHandlerInterface;
use RuntimeException;
class NativeExtension implements ExtensionInterface
{
private $started = false;
public function __construct(SessionHandlerInterface $handler = null)
... | <?php
declare(strict_types=1);
namespace Vision\Session\Extension;
use Vision\Session\SessionInterface;
use SessionHandlerInterface;
use RuntimeException;
class NativeExtension implements ExtensionInterface
{
private $started = false;
public function __construct(SessionHandlerInterface $handler = null)
... |
Fix self.model is not set. | import importlib
import logging
from volttron.platform.agent import utils
_log = logging.getLogger(__name__)
utils.setup_logging()
__version__ = "0.1"
__all__ = ['Model']
class Model(object):
def __init__(self, config, **kwargs):
self.model = None
config = self.store_model_config(config)
... | import importlib
import logging
from volttron.platform.agent import utils
_log = logging.getLogger(__name__)
utils.setup_logging()
__version__ = "0.1"
__all__ = ['Model']
class Model(object):
def __init__(self, config, **kwargs):
self.model = None
config = self.store_model_config(config)
... |
Install requirements depending on python version | import sys
from setuptools import setup, find_packages
install_requires = [
'prompt_toolkit',
'python-keystoneclient'
]
test_requires = []
if sys.version_info[0] == 2:
install_requires.append('pathlib')
test_requires.append('mock')
setup(
name='contrail-api-cli',
version='0.1a2',
descri... | from setuptools import setup, find_packages
install_requires = [
'prompt_toolkit',
'pathlib',
'python-keystoneclient'
]
test_requires = [
'mock'
]
setup(
name='contrail-api-cli',
version='0.1a2',
description="Simple CLI program to browse Contrail API server",
long_description=open('RE... |
Fix HTTP error code when bad authentication to 401
…instead of 400/404, so client can deal with it correctly (#537) | <?php
namespace App\Http\Middleware;
use Closure;
use Tymon\JWTAuth\Exceptions\JWTException;
use Tymon\JWTAuth\Exceptions\TokenExpiredException;
class GetUserFromToken extends BaseMiddleware
{
/**
* Handle an incoming request.
*
* @param \Illuminate\Http\Request $request
* @param \Closure ... | <?php
namespace App\Http\Middleware;
use Closure;
use Tymon\JWTAuth\Exceptions\JWTException;
use Tymon\JWTAuth\Exceptions\TokenExpiredException;
class GetUserFromToken extends BaseMiddleware
{
/**
* Handle an incoming request.
*
* @param \Illuminate\Http\Request $request
* @param \Closure ... |
Change config security pass env variable to meet standard naming convention | package com.hpe.caf.cipher.jasypt;
import com.hpe.caf.api.BootstrapConfiguration;
import com.hpe.caf.api.Cipher;
import com.hpe.caf.api.CipherException;
import com.hpe.caf.api.ConfigurationException;
import org.jasypt.util.text.BasicTextEncryptor;
/**
* Implementation of a SecurityProvider that uses Jasypt to prov... | package com.hpe.caf.cipher.jasypt;
import com.hpe.caf.api.BootstrapConfiguration;
import com.hpe.caf.api.Cipher;
import com.hpe.caf.api.CipherException;
import com.hpe.caf.api.ConfigurationException;
import org.jasypt.util.text.BasicTextEncryptor;
/**
* Implementation of a SecurityProvider that uses Jasypt to prov... |
Add reference for phantomJSPath option
In certain instances, it seems building the phantomjs server the path
to the binary is not always correct and seems to default to /usr/local/bin.
Setting the value exclusively should resolve this. | var path = require("path"),
childProcess = require('child_process'),
phantomjs = require('phantomjs'),
fs = require("fs");
module.exports = function(options, html, id, cb) {
var htmlFilePath = path.resolve(path.join(options.tmpDir, id + ".html"));
fs.writeFile(htmlFilePath, html, function (err) {... | var path = require("path"),
childProcess = require('child_process'),
phantomjs = require('phantomjs'),
fs = require("fs");
module.exports = function(options, html, id, cb) {
var htmlFilePath = path.resolve(path.join(options.tmpDir, id + ".html"));
fs.writeFile(htmlFilePath, html, function (err) {... |
Add link to 404 example page | import React, {Component, PropTypes} from 'react';
import {IndexLink, Link} from 'react-router';
import {connect} from 'react-redux';
@connect(
state => ({
loggedIn: state.auth.loggedIn
})
)
export default class Header extends Component {
static propTypes = {
loggedIn: PropTypes.bool
}
render() {
... | import React, {Component, PropTypes} from 'react';
import {IndexLink, Link} from 'react-router';
import {connect} from 'react-redux';
@connect(
state => ({
loggedIn: state.auth.loggedIn
})
)
export default class Header extends Component {
static propTypes = {
loggedIn: PropTypes.bool
}
render() {
... |
Tweak example client for new board format | <?
$board = json_decode($_POST['board']);
if($_GET['strategy'] == 2) {
foreach($board as $x => $col) {
foreach($col as $y => $cell) {
if($cell == 2) {
$x1 = $x;
$y1 = $y;
} elseif($cell == 9) {
$x2 =... | <?
$board = json_decode($_POST['board']);
if($_POST['player'] == 2) {
foreach($board as $x => $col) {
foreach($col as $y => $cell) {
if($cell == 1) {
$x1 = $x;
$y1 = $y;
} elseif($cell == 2) {
$x2 = ... |
Put spaces between joined members in group updates | /* vim: ts=4:sw=4:expandtab
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distribu... | /* vim: ts=4:sw=4:expandtab
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distribu... |
Add left padding to item decoration | package me.echeung.cdflabs.utils;
import android.content.Context;
import android.graphics.Canvas;
import android.graphics.drawable.Drawable;
import android.support.v4.content.ContextCompat;
import android.support.v7.widget.RecyclerView;
import android.view.View;
import me.echeung.cdflabs.R;
public class DividerItemD... | package me.echeung.cdflabs.utils;
import android.content.Context;
import android.graphics.Canvas;
import android.graphics.drawable.Drawable;
import android.support.v4.content.ContextCompat;
import android.support.v7.widget.RecyclerView;
import android.view.View;
import me.echeung.cdflabs.R;
public class DividerItemD... |
BB-4106: Refactor ThemeExtension
- add space | <?php
namespace Oro\Component\Layout\Extension;
use Oro\Component\Layout\Extension\Theme\PathProvider\PathProviderInterface;
abstract class AbstractLayoutUpdateLoaderExtension extends AbstractExtension
{
/** @var array */
protected $resources;
/**
* Filters resources by paths
*
* @param a... | <?php
namespace Oro\Component\Layout\Extension;
use Oro\Component\Layout\Extension\Theme\PathProvider\PathProviderInterface;
abstract class AbstractLayoutUpdateLoaderExtension extends AbstractExtension
{
/** @var array */
protected $resources;
/**
* Filters resources by paths
*
* @param a... |
Move (back) to call-based jsonp | loadCommands([ // eslint-disable-line no-undef
{
Name: 'help',
Info: 'Returns a help message to get you started with RemindMeBot.',
Usage: 'r>help'
},
{
Name: 'remindme',
Info: 'Creates a reminder. Pass without args to start a guided tour.',
Usage: 'r>remindme... | (function () { // eslint-disable-line no-undef
const commands = [
{
Name: 'help',
Info: 'Returns a help message to get you started with RemindMeBot.',
Usage: 'r>help'
},
{
Name: 'remindme',
Info: 'Creates a reminder. Pass without ar... |
Fix params in nested route | import Ember from 'ember';
import AuthenticatedRouteMixin from 'ember-simple-auth/mixins/authenticated-route-mixin';
export default Ember.Route.extend(AuthenticatedRouteMixin, {
model(params) {
var parentParams = this.paramsFor('experiments.info');
return this.store.findRecord('experiment', paren... | import Ember from 'ember';
export default Ember.Route.extend({
model(params) {
return this.store.findRecord('experiment', params.experiment_id).then((experiment) => {
// When page loads, creates new session, but doesn't save to store
var session = this.store.createRecord(experiment.... |
Add canonical cases to test | import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.runners.Parameterized;
import org.junit.runners.Parameterized.Parameters;
import java.util.Arrays;
import java.util.Collection;
import static org.junit.Assert.assertEquals;
@RunWith(Parameterized.class)
public class BinaryTest {
private St... | import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.runners.Parameterized;
import org.junit.runners.Parameterized.Parameters;
import java.util.Arrays;
import java.util.Collection;
import static org.junit.Assert.assertEquals;
@RunWith(Parameterized.class)
public class BinaryTest {
private St... |
Add a more informative error message when Dockerfile is unavailable during s2i |
package io.quarkus.container.image.openshift.deployment;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.nio.file.Path;
import io.dekorate.kubernetes.decorator.NamedResourceDecorator;
import io.fabric8.kubernetes.api.model.ObjectMeta;
import io.fabric8.openshift.ap... |
package io.quarkus.container.image.openshift.deployment;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.nio.file.Path;
import io.dekorate.kubernetes.decorator.NamedResourceDecorator;
import io.fabric8.kubernetes.api.model.ObjectMeta;
import io.fabric8.openshift.ap... |
Update test to ensure that default configuration values are available via getConfOpt | from synapse.tests.common import *
import synapse.lib.config as s_config
class ConfTest(SynTest):
def test_conf_base(self):
defs = (
('fooval',{'type':'int','doc':'what is foo val?','defval':99}),
('enabled',{'type':'bool','doc':'is thing enabled?','defval':0}),
)
... | from synapse.tests.common import *
import synapse.lib.config as s_config
class ConfTest(SynTest):
def test_conf_base(self):
defs = (
('fooval',{'type':'int','doc':'what is foo val?','defval':99}),
('enabled',{'type':'bool','doc':'is thing enabled?','defval':0}),
)
... |
Replace occurences of 'startCode' with 'code' | var validator = require('validator'),
iz = require('iz');
var assessmentValidator = {};
var validate = function (assessment) {
var toReturn = true;
var results = [
validator.isLength(assessment.id, 2),
validator.isLength(assessment.title, 2),
validator.isLength(assessment.instructi... | var validator = require('validator'),
iz = require('iz');
var assessmentValidator = {};
var validate = function (assessment) {
var toReturn = true;
var results = [
validator.isLength(assessment.id, 2),
validator.isLength(assessment.title, 2),
validator.isLength(assessment.instructi... |
Add rules to eslint config | // http://eslint.org/
module.exports = {
"extends": "eslint:recommended",
// http://eslint.org/docs/user-guide/configuring#specifying-environments
"env": {
"browser": true,
},
// http://eslint.org/docs/user-guide/configuring#specifying-globals
"globals": {
// false means it sho... | // http://eslint.org/
module.exports = {
"extends": "eslint:recommended",
// http://eslint.org/docs/user-guide/configuring#specifying-environments
"env": {
"browser": true,
},
// http://eslint.org/docs/user-guide/configuring#specifying-globals
"globals": {
// false means it sho... |
Add rollup and bundle options
This enables inline sourcemaps | 'use strict';
var rollup = require('rollup');
// @param args {Object} - Config object of custom preprocessor.
// @param config {Object} - Config object of rollupPreprocessor.
// @param logger {Object} - Karma's logger.
// @helper helper {Object} - Karma's helper functions.
function createPreprocessor (args, config, l... | 'use strict';
var rollup = require('rollup');
// @param args {Object} - Config object of custom preprocessor.
// @param config {Object} - Config object of rollupPreprocessor.
// @param logger {Object} - Karma's logger.
// @helper helper {Object} - Karma's helper functions.
function createPreprocessor (args, config, l... |
Remove extra bind from NoteForm submit button
Already bound in the view events hash | var NoteForm = FormView.extend({
tagName: 'div',
initialize: function() {
// Supply the model with a reference to it's own view object, so it can
// remove itself from the page when destroy() gets called.
this.model.view = this;
if (this.model.id) {
this.id = this.el.id = this.model.id;
... | var NoteForm = FormView.extend({
tagName: 'div',
initialize: function() {
// Supply the model with a reference to it's own view object, so it can
// remove itself from the page when destroy() gets called.
this.model.view = this;
if (this.model.id) {
this.id = this.el.id = this.model.id;
... |
Add rel="noopener" for external anchors
Recommended by Lighthouse https://developers.google.com/web/tools/lighthouse/audits/noopener | import React, {PureComponent} from 'react';
import classNames from 'classnames';
import {Link as RoutedLink} from 'react-router-dom';
import styles from './Link.scss';
export default class Link extends PureComponent {
static defaultProps = {
selected: false,
};
routedLink() {
const {url, selected, clas... | import React, {PureComponent} from 'react';
import classNames from 'classnames';
import {Link as RoutedLink} from 'react-router-dom';
import styles from './Link.scss';
export default class Link extends PureComponent {
static defaultProps = {
selected: false,
};
routedLink() {
const {url, selected, clas... |
Add todo about field groups | /* global $ */
import Ember from 'ember';
import { translationMacro as t } from 'ember-i18n';
export default Ember.Controller.extend({
i18n: Ember.inject.service(),
actions: {
navigationClick(fieldGroupId) {
$('html, body').animate({
scrollTop: $('#field-group-' + ... | /* global $ */
import Ember from 'ember';
import { translationMacro as t } from 'ember-i18n';
export default Ember.Controller.extend({
i18n: Ember.inject.service(),
actions: {
navigationClick(fieldGroupId) {
$('html, body').animate({
scrollTop: $('#field-group-' + ... |
Fix in publish to example folder | 'use strict';
module.exports = function(grunt) {
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
concat: {
dist: {
src: ['src/**/*.js'],
dest: 'dist/<%= pkg.name %>.js'
}
},
uglify: {
dist: {
files: {
'dist/<%= pkg.name %>.min.js': ['<... | 'use strict';
module.exports = function(grunt) {
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
concat: {
dist: {
src: ['src/**/*.js'],
dest: 'dist/<%= pkg.name %>.js'
}
},
uglify: {
dist: {
files: {
'dist/<%= pkg.name %>.min.js': ['<... |
Fix bug with exists property | <?php namespace ThibaudDauce\MoloquentInheritance;
use ReflectionClass;
trait MoloquentInheritanceTrait {
public $parentClasses;
/**
* Boot the moloquent inheritance for a model.
*
* @return void
*/
public static function bootMoloquentInheritanceTrait()
{
static::addGloba... | <?php namespace ThibaudDauce\MoloquentInheritance;
use ReflectionClass;
trait MoloquentInheritanceTrait {
public $parentClasses;
/**
* Boot the moloquent inheritance for a model.
*
* @return void
*/
public static function bootMoloquentInheritanceTrait()
{
static::addGloba... |
Remove developer debug window during screen share
Right now when you try to share your screen it opens a developer window. | 'use strict';
const electron = require('electron');
const { remote } = require('electron');
const selfBrowserWindow = remote.getCurrentWindow();
selfBrowserWindow.webContents.once('dom-ready', () => {
window.JitsiMeetElectron = {
/**
* Get sources available for screensharing. The callback is invo... | 'use strict';
const electron = require('electron');
const { remote } = require('electron');
const selfBrowserWindow = remote.getCurrentWindow();
selfBrowserWindow.webContents.openDevTools({ mode: 'detach' });
selfBrowserWindow.webContents.once('dom-ready', () => {
window.JitsiMeetElectron = {
/**
... |
Reduce bottom padding on alert panel | var classNames = require('classnames');
var React = require('react');
var Panel = require('./Panel');
var AlertPanel = React.createClass({
displayName: 'AlertPanel',
defaultProps: {
className: '',
icon: null
},
propTypes: {
title: React.PropTypes.string,
icon: React.PropTypes.node,
icon... | var classNames = require('classnames');
var React = require('react');
var Panel = require('./Panel');
var AlertPanel = React.createClass({
displayName: 'AlertPanel',
defaultProps: {
icon: null
},
propTypes: {
title: React.PropTypes.string,
icon: React.PropTypes.node,
iconClassName: React.Pr... |
Test basic a-frame tag (not react component) | import 'aframe';
import 'babel-polyfill';
import {Animation, Entity, Scene} from 'aframe-react';
import React from 'react';
import ReactDOM from 'react-dom';
import Camera from './components/Camera';
import Cursor from './components/Cursor';
import Sky from './components/Sky';
class SpaceScene extends React.Component... | import 'aframe';
import 'babel-polyfill';
import {Animation, Entity, Scene} from 'aframe-react';
import React from 'react';
import ReactDOM from 'react-dom';
import Camera from './components/Camera';
import Cursor from './components/Cursor';
import Sky from './components/Sky';
class SpaceScene extends React.Component... |
Add space between import and class declaration
All heil PEP. | from pygame.mixer import Sound
class SelectStateSFX(object):
"""Plays sound effects that are used by both the Character Select
State and the Stage Select State.
Class Constants:
SCROLL_PATH: A String for the file path to the scroll items
sound effect.
CONFIRM_PATH: A String fo... | from pygame.mixer import Sound
class SelectStateSFX(object):
"""Plays sound effects that are used by both the Character Select
State and the Stage Select State.
Class Constants:
SCROLL_PATH: A String for the file path to the scroll items
sound effect.
CONFIRM_PATH: A String for... |
Change to "ask for forgiveness", as the 'client_roles' condition could get too complicated | """Facility to render node graphs using pydot"""
import os
import pydot
from kitchen.settings import STATIC_ROOT, REPO
def generate_node_map(nodes):
"""Generates a graphviz nodemap"""
graph = pydot.Dot(graph_type='digraph')
graph_nodes = {}
# Create nodes
for node in nodes:
label = node['... | """Facility to render node graphs using pydot"""
import os
import pydot
from kitchen.settings import STATIC_ROOT, REPO
def generate_node_map(nodes):
"""Generates a graphviz nodemap"""
graph = pydot.Dot(graph_type='digraph')
graph_nodes = {}
# Create nodes
for node in nodes:
label = node['... |
Disable keyboard support on tree, so it doesn't trap scrolling. | // Auto-magically referenced. Yay.
$(document).ready(function() {
var rubyFolders = gon.folders;
if (!rubyFolders) {
return;
}
var folders = {};
var currentId = gon.currentFolder.id;
// Convert all the folders to tree nodes.
rubyFolders.forEach(function(folder) {
var nameAndCount = folder.n... | // Auto-magically referenced. Yay.
$(document).ready(function() {
var rubyFolders = gon.folders;
if (!rubyFolders) {
return;
}
var folders = {};
var currentId = gon.currentFolder.id;
// Convert all the folders to tree nodes.
rubyFolders.forEach(function(folder) {
var nameAndCount = folder.n... |
Test: Add manual document launch test | /**
PSPDFKit
Copyright (c) 2015-2016 PSPDFKit GmbH. All rights reserved.
THIS SOURCE CODE AND ANY ACCOMPANYING DOCUMENTATION ARE PROTECTED BY INTERNATIONAL COPYRIGHT LAW
AND MAY NOT BE RESOLD OR REDISTRIBUTED. USAGE IS BOUND TO THE PSPDFKIT LICENSE AGREEMENT.
UNAUTHORIZED REPRODUCTION OR DISTRIBUTION IS SUBJECT ... | /**
PSPDFKit
Copyright (c) 2015-2016 PSPDFKit GmbH. All rights reserved.
THIS SOURCE CODE AND ANY ACCOMPANYING DOCUMENTATION ARE PROTECTED BY INTERNATIONAL COPYRIGHT LAW
AND MAY NOT BE RESOLD OR REDISTRIBUTED. USAGE IS BOUND TO THE PSPDFKIT LICENSE AGREEMENT.
UNAUTHORIZED REPRODUCTION OR DISTRIBUTION IS SUBJECT ... |
Add a ModeType enum for later benefit | def _enum(**enums):
return type('Enum', (), enums)
ModeType = _enum(List=0, ParamOnUnset=1, Param=2, NoParam=3, Status=4)
def unescapeEndpointDescription(desc):
result = []
escape = []
depth = 0
desc = iter(desc)
for char in desc:
if char == "\\":
try:
char ... | def unescapeEndpointDescription(desc):
result = []
escape = []
depth = 0
desc = iter(desc)
for char in desc:
if char == "\\":
try:
char = desc.next()
except StopIteration:
raise ValueError ("Endpoint description not valid: escaped end o... |
Make it easier to set image alt text | <?php
/*
* This file is part of the league/commonmark package.
*
* (c) Colin O'Dell <colinodell@gmail.com>
*
* Original code based on the CommonMark JS reference parser (http://bitly.com/commonmarkjs)
* - (c) John MacFarlane
*
* For the full copyright and license information, please view the LICENSE
* file t... | <?php
/*
* This file is part of the league/commonmark package.
*
* (c) Colin O'Dell <colinodell@gmail.com>
*
* Original code based on the CommonMark JS reference parser (http://bitly.com/commonmarkjs)
* - (c) John MacFarlane
*
* For the full copyright and license information, please view the LICENSE
* file t... |
admin_programme: Add google+ icon to admin form. | # -*- coding: utf-8 -*-
from django import forms
from crispy_forms.helper import FormHelper
from crispy_forms.layout import Submit, Layout, Fieldset, ButtonHolder
from Instanssi.ext_programme.models import ProgrammeEvent
class ProgrammeEventForm(forms.ModelForm):
def __init__(self, *args, **kwargs):
super... | # -*- coding: utf-8 -*-
from django import forms
from crispy_forms.helper import FormHelper
from crispy_forms.layout import Submit, Layout, Fieldset, ButtonHolder
from Instanssi.ext_programme.models import ProgrammeEvent
class ProgrammeEventForm(forms.ModelForm):
def __init__(self, *args, **kwargs):
super... |
Make `baseUrl` non-final as we should be able to override it. | /*
* Copyright 2021, Yurii Serhiichuk
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agree... | /*
* Copyright 2021, Yurii Serhiichuk
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agree... |
Add a TODO explaining why tasks.CompletionQueue needs a capacity limit | __all__ = [
'SocketServer',
]
import errno
import logging
from g1.asyncs.bases import servers
from g1.asyncs.bases import tasks
LOG = logging.getLogger(__name__)
LOG.addHandler(logging.NullHandler())
class SocketServer:
def __init__(self, socket, handler):
self._socket = socket
self._handl... | __all__ = [
'SocketServer',
]
import errno
import logging
from g1.asyncs.bases import servers
from g1.asyncs.bases import tasks
LOG = logging.getLogger(__name__)
LOG.addHandler(logging.NullHandler())
class SocketServer:
def __init__(self, socket, handler):
self._socket = socket
self._handl... |
Change to alternative batch class | #!/usr/bin/env python
import os
import sys
import glob
import clawpack.tests as clawtests
class FaultTest(clawtests.Test):
def __init__(self, deformation_file):
super(FaultTest, self).__init__()
self.type = "compsys"
self.name = "guerrero_gap"
self.prefix = os.path.basename(def... | #!/usr/bin/env python
import os
import sys
import glob
import clawpack.clawutil.tests as clawtests
class FaultTest(clawtests.Test):
def __init__(self, deformation_file):
super(FaultTest, self).__init__()
self.type = "compsys"
self.name = "guerrero_gap"
self.prefix = os.path.bas... |
Use success button for saving | @extends('layout.dashboard')
@section('content')
<div class="header">
<span class='uppercase'>
<i class="fa fa-user"></i> {{ Lang::get('cachet.dashboard.user') }}
</span>
</div>
<div class='content-wrapper'>
<div class="row">
<div class="col-sm-12">
... | @extends('layout.dashboard')
@section('content')
<div class="header">
<span class='uppercase'>
<i class="fa fa-user"></i> {{ Lang::get('cachet.dashboard.user') }}
</span>
</div>
<div class='content-wrapper'>
<div class="row">
<div class="col-sm-12">
... |
Change versionup to write package.json using 2 space indentation. Add some doco. | var _ = require('underscore'),
fs = require('fs'),
Toolbelt = require('./toolbelt').Toolbelt,
toolbelt = new Toolbelt();
// Charlotte takes care of stuffs that can't be done easily from shell
function Charlotte() {
var CONF_FILE = 'package.json',
conf = JSON.parse(fs.readFileSync(CONF_FILE));
... | var _ = require('underscore'),
fs = require('fs'),
Toolbelt = require('./toolbelt').Toolbelt,
toolbelt = new Toolbelt();
function Charlotte() {
var CONF_FILE = 'package.json',
conf = JSON.parse(fs.readFileSync(CONF_FILE));
function versionup(type) {
var version = ((conf.version) ?... |
Allow null peer alias in table
if an identity request fails or doesn’t occur before a message packet
is available, allow the incomplete peer to be saved. The public key is
what’s important. | package pro.dbro.ble.data.model;
import net.simonvt.schematic.annotation.AutoIncrement;
import net.simonvt.schematic.annotation.DataType;
import net.simonvt.schematic.annotation.NotNull;
import net.simonvt.schematic.annotation.PrimaryKey;
import static net.simonvt.schematic.annotation.DataType.Type.BLOB;
import stati... | package pro.dbro.ble.data.model;
import net.simonvt.schematic.annotation.AutoIncrement;
import net.simonvt.schematic.annotation.DataType;
import net.simonvt.schematic.annotation.NotNull;
import net.simonvt.schematic.annotation.PrimaryKey;
import static net.simonvt.schematic.annotation.DataType.Type.BLOB;
import stati... |
Update trove classifier to Stable. Update my info. | #!/usr/bin/env python
try:
from setuptools import setup
except ImportError:
from distutils.core import setup
readme = open('README.rst').read()
history = open('HISTORY.rst').read().replace('.. :changelog:', '')
setup(
name='binaryornot',
version='0.4.0',
description=(
'Ultra-lightweight ... | #!/usr/bin/env python
try:
from setuptools import setup
except ImportError:
from distutils.core import setup
readme = open('README.rst').read()
history = open('HISTORY.rst').read().replace('.. :changelog:', '')
setup(
name='binaryornot',
version='0.4.0',
description=(
'Ultra-lightweight... |
Update dependency from mypy-lang to mypy | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
import codecs
from setuptools import setup
def read(fname):
file_path = os.path.join(os.path.dirname(__file__), fname)
return codecs.open(file_path, encoding='utf-8').read()
setup(
name='pytest-mypy',
version='0.2.0',
author='Daniel Bader'... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
import codecs
from setuptools import setup
def read(fname):
file_path = os.path.join(os.path.dirname(__file__), fname)
return codecs.open(file_path, encoding='utf-8').read()
setup(
name='pytest-mypy',
version='0.2.0',
author='Daniel Bader'... |
Update the name of the app | <?php
use Symfony\Component\Console\Application;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Output\OutputInterface;
use Symfony\Component\Filesystem\Filesystem;
use Symfony\Component\Finder\Finder;
$console = new Application('SMAR... | <?php
use Symfony\Component\Console\Application;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Output\OutputInterface;
use Symfony\Component\Filesystem\Filesystem;
use Symfony\Component\Finder\Finder;
$console = new Application('Sile... |
Fix Grunt file for local testing | module.exports = function(grunt) {
// TODO: platforms shouldn't be hardcoded here
var platforms = ['win64'];
// Build up array of destinations for Twister deamon files
var destinations = {files: []};
platforms.forEach(function (platform) {
destinations.files.push({
expand: ... | module.exports = function(grunt) {
// TODO: platforms shouldn't be hardcoded here
var platforms = ['win64'];
// Build up array of destinations for Twister deamon files
var destinations = {files: []};
platforms.forEach(function (platform) {
destinations.files.push({
expand: ... |
Update the admin interface and demo site generator
Update the admin interface to feature a fully responsive, fully retina, cleaned up look and feel based on Bootstrap 3. Simultaniously updated the generated demo site to be more in line with what we use as a starting point for our websites.
While this commit is squash... | <?php
namespace Kunstmaan\TaggingBundle\Form;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\FormBuilderInterface;
use Kunstmaan\TaggingBundle\Entity\TagManager;
use Kunstmaan\TaggingBundle\Form\DataTransformer\TagsTransformer;
use Symfony\Component\OptionsResolver\OptionsResolverInterface;
cla... | <?php
namespace Kunstmaan\TaggingBundle\Form;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\FormBuilderInterface;
use Kunstmaan\TaggingBundle\Entity\TagManager;
use Kunstmaan\TaggingBundle\Form\DataTransformer\TagsTransformer;
use Symfony\Component\OptionsResolver\OptionsResolverInterface;
cla... |
Add pdb and cif property | 'use strict';
const common = module.exports = {};
common.getBasename = function (filename) {
let base = filename.replace(/.*\//, '');
return base.replace(/\.[0-9]+$/, '');
};
common.getExtension = function (filename) {
let extension = common.getBasename(filename);
return extension.replace(/.*\./, '')... | 'use strict';
const common = module.exports = {};
common.getBasename = function (filename) {
let base = filename.replace(/.*\//, '');
return base.replace(/\.[0-9]+$/, '');
};
common.getExtension = function (filename) {
let extension = common.getBasename(filename);
return extension.replace(/.*\./, '')... |
Initialize OL6 view projection with OL2 one | import { mainLizmap, mainEventDispatcher } from '../modules/Globals.js';
import olMap from 'ol/Map';
import View from 'ol/View';
/** Class initializing Openlayers Map. */
export default class Map {
constructor() {
this._olMap = new olMap({
view: new View({
center: [0, 0],
... | import { mainLizmap, mainEventDispatcher } from '../modules/Globals.js';
import olMap from 'ol/Map';
import View from 'ol/View';
/** Class initializing Openlayers Map. */
export default class Map {
constructor() {
this._olMap = new olMap({
view: new View({
center: [0, 0],
... |
Fix pep8 violation in 29e3a0c. | from django.db import connections
from django.db.migrations.executor import MigrationExecutor
from prometheus_client import Gauge
unapplied_migrations = Gauge(
'django_migrations_unapplied_total',
'Count of unapplied migrations by database connection',
['connection'])
applied_migrations = Gauge(
'djan... | from django.db import connections
from django.db.migrations.executor import MigrationExecutor
from prometheus_client import Gauge
unapplied_migrations = Gauge(
'django_migrations_unapplied_total',
'Count of unapplied migrations by database connection',
['connection'])
applied_migrations = Gauge(
'djan... |
Refactor userlistremove for realtime removal | import React from "react";
const fs = window.require("fs");
const global = require("../app/global");
import IO from "../app/IO";
const UserListRemove = React.createClass({
getInitialState: function() {
return {
collection: []
};
},
componentDidMount: function() {
this.... | import React from "react";
const fs = window.require("fs");
const global = require("../app/global");
import IO from "../app/IO";
const UserListRemove = React.createClass({
render: function() {
let collection = [];
collection = this.createCollectionArray();
return (
<div class... |
Fix test under python 3.4 | import h2o
import socket
import threading
import unittest
import urllib.request
SIMPLE_PATH = b'/simple'
SIMPLE_BODY = b'<h1>It works!</h1>'
class E2eTest(unittest.TestCase):
def setUp(self):
config = h2o.Config()
host = config.add_host(b'default', 65535)
host.add_path(SIMPLE_PATH).add_ha... | import h2o
import socket
import threading
import unittest
import urllib.request
SIMPLE_PATH = b'/simple'
SIMPLE_BODY = b'<h1>It works!</h1>'
class E2eTest(unittest.TestCase):
def setUp(self):
config = h2o.Config()
host = config.add_host(b'default', 65535)
host.add_path(SIMPLE_PATH).add_ha... |
Fix addRouteObject when primary is already an object | import fp from 'mostly-func';
const defaultOptions = {
field: 'primary',
select: '*'
};
/**
* Add route service object to hook.params
*/
export default function addRouteObject (name, opts) {
opts = Object.assign({}, defaultOptions, opts);
return async context => {
let options = Object.assign({}, opts);... | import fp from 'mostly-func';
const defaultOptions = {
field: 'primary',
select: '*'
};
/**
* Add route service object to hook.params
*/
export default function addRouteObject (name, opts) {
opts = Object.assign({}, defaultOptions, opts);
return async context => {
let options = Object.assign({}, opts);... |
Revert "Attempt to catch IE console logs with Stephane's fix"
This reverts commit 39088b4e1d5ae0986db615be82ab5dabb1610fe8. | //To get sjhint to ignore protrator calls ad this to .jshint "browser","element","by","expect","protractor","beforeEach"
describe('Sign-In Page', function() { //jshint ignore:line
var EC = protractor.ExpectedConditions;
beforeEach(function() {
browser.get('/signin');
browser.driver.sleep(1);
browser.w... | //To get sjhint to ignore protrator calls ad this to .jshint "browser","element","by","expect","protractor","beforeEach"
describe('Sign-In Page', function() { //jshint ignore:line
var EC = protractor.ExpectedConditions;
beforeEach(function() {
browser.get('/signin');
browser.driver.sleep(1);
browser.w... |
[Event] Change toString method in event | //@@author A0147984L
package seedu.address.model.task;
public interface ReadOnlyEvent extends ReadOnlyTask {
TaskDate getStartDate();
TaskTime getStartTime();
/**
* Formats the person as text, showing all contact details.
*/
default String getAsText() {
final StringBuilder builder =... | //@@author A0147984L
package seedu.address.model.task;
public interface ReadOnlyEvent extends ReadOnlyTask {
TaskDate getStartDate();
TaskTime getStartTime();
/**
* Formats the person as text, showing all contact details.
*/
default String getAsText() {
final StringBuilder builder =... |
Add sweet alert with timer when performing reorder | import UserProfileStore from '../../stores/UserProfileStore';
export default function moveTreeNode(context, payload, done) {
let userid = context.getStore(UserProfileStore).userid;
if (userid != null && userid !== '') {
let {selector, sourceNode, targetNode, targetIndex} = payload;
let sourceS... | import UserProfileStore from '../../stores/UserProfileStore';
export default function moveTreeNode(context, payload, done) {
let userid = context.getStore(UserProfileStore).userid;
if (userid != null && userid !== '') {
let {selector, sourceNode, targetNode, targetIndex} = payload;
let sourceS... |
ISSUE-35: Check if class has parent class. | <?php
declare(strict_types=1);
namespace BowlOfSoup\NormalizerBundle\Service\Extractor;
use Doctrine\Persistence\Proxy;
class MethodExtractor extends AbstractExtractor
{
/** @var string */
public const TYPE = 'method';
/**
* Extract all annotations for a (reflected) class method.
*
* @pa... | <?php
declare(strict_types=1);
namespace BowlOfSoup\NormalizerBundle\Service\Extractor;
use Doctrine\Persistence\Proxy;
class MethodExtractor extends AbstractExtractor
{
/** @var string */
public const TYPE = 'method';
/**
* Extract all annotations for a (reflected) class method.
*
* @pa... |
Disable Mix for page load tests | <?php
declare(strict_types=1);
namespace Tests\Feature;
use Illuminate\Testing\Fluent\AssertableJson;
use Tests\TestCase;
class SimpleRequestsTest extends TestCase
{
/**
* Test simple, non-CAS requests load without any authentication.
*/
public function testUnauthenticatedRequests(): void
{
... | <?php
declare(strict_types=1);
namespace Tests\Feature;
use Illuminate\Testing\Fluent\AssertableJson;
use Tests\TestCase;
class SimpleRequestsTest extends TestCase
{
/**
* Test simple, non-CAS requests load without any authentication.
*/
public function testUnauthenticatedRequests(): void
{
... |
BB-2045: Update EntityAclExtension to use custom permissions
- fixed permissions configuration | <?php
namespace Oro\Bundle\SecurityBundle\Migrations\Schema;
use Doctrine\DBAL\Types\Type;
use Psr\Log\LoggerInterface;
use Oro\Bundle\MigrationBundle\Migration\ParametrizedSqlMigrationQuery;
class LoadBasePermissionsQuery extends ParametrizedSqlMigrationQuery
{
/**
* {@inheritdoc}
*/
protected f... | <?php
namespace Oro\Bundle\SecurityBundle\Migrations\Schema;
use Doctrine\DBAL\Types\Type;
use Psr\Log\LoggerInterface;
use Oro\Bundle\MigrationBundle\Migration\ParametrizedSqlMigrationQuery;
class LoadBasePermissionsQuery extends ParametrizedSqlMigrationQuery
{
/**
* {@inheritdoc}
*/
protected f... |
Add py3.6 to supported version | import esipy
import io
from setuptools import setup
# install requirements
install_requirements = [
"requests",
"pyswagger",
"six",
"pytz",
]
# test requirements
test_requirements = [
"coverage",
"coveralls",
"httmock",
"nose",
"mock",
"future",
"pytho... | import esipy
import io
from setuptools import setup
# install requirements
install_requirements = [
"requests",
"pyswagger",
"six",
"pytz",
]
# test requirements
test_requirements = [
"coverage",
"coveralls",
"httmock",
"nose",
"mock",
"future",
"pytho... |
Replace usage of deprecated model.attributes | var Sequelize = require('sequelize'),
_ = require('lodash');
module.exports = function(target) {
if (target instanceof Sequelize.Model) {
// Model
createHook(target);
} else {
// Sequelize instance
target.afterDefine(createHook);
}
}
function createHook(model) {
model.addHook('beforeFindA... | var Sequelize = require('sequelize'),
_ = require('lodash');
module.exports = function(target) {
if (target instanceof Sequelize.Model) {
// Model
createHook(target);
} else {
// Sequelize instance
target.afterDefine(createHook);
}
}
function createHook(model) {
model.addHook('beforeFindA... |
Change deferred object function to always() | require([
'backbone',
'collections/category_collection',
'collections/catalog_collection',
'collections/enterprise_customer_collection',
'ecommerce',
'routers/coupon_router',
'utils/navigate'
],
function(Backbone,
CategoryCollection,
CatalogCollection,
... | require([
'backbone',
'collections/category_collection',
'collections/catalog_collection',
'collections/enterprise_customer_collection',
'ecommerce',
'routers/coupon_router',
'utils/navigate'
],
function(Backbone,
CategoryCollection,
CatalogCollection,
... |
Fix FeatureRepo load left join to stories | <?php
namespace Neblion\ScrumBundle\Entity;
use Doctrine\ORM\EntityRepository;
/**
* FeatureRepository
*
* This class was generated by the Doctrine ORM. Add your own custom
* repository methods below.
*/
class FeatureRepository extends EntityRepository
{
public function load($id)
{
return $this-... | <?php
namespace Neblion\ScrumBundle\Entity;
use Doctrine\ORM\EntityRepository;
/**
* FeatureRepository
*
* This class was generated by the Doctrine ORM. Add your own custom
* repository methods below.
*/
class FeatureRepository extends EntityRepository
{
public function load($id)
{
return $this-... |
Fix React Hot Loader, use ‘react-hot-loader/webpack.’ | import path from 'path';
const isProduction = process.env.NODE_ENV === 'production';
export default {
context: path.join(__dirname, '../'),
entry: undefined,
output: undefined,
// Resolve the `./src` directory so we can avoid writing
// ../../styles/base.css
resolve: {
modulesDirectories: [
'n... | import path from 'path';
const isProduction = process.env.NODE_ENV === 'production';
export default {
context: path.join(__dirname, '../'),
entry: undefined,
output: undefined,
// Resolve the `./src` directory so we can avoid writing
// ../../styles/base.css
resolve: {
modulesDirectories: [
'n... |
Improve fenced code block parser's handling of closing fences. | <?php
namespace FluxBB\Markdown\Parser;
use FluxBB\Markdown\Common\Text;
use FluxBB\Markdown\Node\CodeBlock;
class FencedCodeBlockParser extends AbstractParser
{
/**
* Parse the given block content.
*
* Any newly created nodes should be pushed to the stack. Any remaining content should be passed ... | <?php
namespace FluxBB\Markdown\Parser;
use FluxBB\Markdown\Common\Text;
use FluxBB\Markdown\Node\CodeBlock;
class FencedCodeBlockParser extends AbstractParser
{
/**
* Parse the given block content.
*
* Any newly created nodes should be pushed to the stack. Any remaining content should be passed ... |
Add redis_client to unit test | <?php
namespace Noxlogic\RateLimitBundle\Tests\DependencyInjection;
use Noxlogic\RateLimitBundle\DependencyInjection\Configuration;
use Symfony\Bundle\FrameworkBundle\Tests\Functional\WebTestCase;
use Symfony\Component\Config\Definition\Processor;
/**
* ConfigurationTest
*/
class ConfigurationTest extends WebTestC... | <?php
namespace Noxlogic\RateLimitBundle\Tests\DependencyInjection;
use Noxlogic\RateLimitBundle\DependencyInjection\Configuration;
use Symfony\Bundle\FrameworkBundle\Tests\Functional\WebTestCase;
use Symfony\Component\Config\Definition\Processor;
/**
* ConfigurationTest
*/
class ConfigurationTest extends WebTestC... |
Return stub request object on concurrent request | var qajax = require("qajax");
var uniqueCalls = [];
function removeCall(options) {
uniqueCalls.splice(uniqueCalls.indexOf(options.url), 1);
}
var qajaxWrapper = function (options) {
if (!options.concurrent) {
if (uniqueCalls.indexOf(options.url) > -1) {
return {
error: () => { return this; },
... | var qajax = require("qajax");
var qajaxWrapper = function (options) {
var response = {
status: null,
body: null
};
var parseResponse = function (xhr) {
response.status = xhr.status;
try {
response.body = JSON.parse(xhr.responseText);
} catch (e) {
response.body = xhr.responseText... |
Remove conditional of window width for start carrousel logos | /**
* The Footer view.
*/
define([
'jquery',
'backbone',
'slick'
], function($,Backbone,slick) {
'use strict';
var FooterView = Backbone.View.extend({
el: '#footerView',
initialize: function() {
// CACHE
this.$logos = $('#footer-logos');
this.$footerFixed = $('#footerFixed');
... | /**
* The Footer view.
*/
define([
'jquery',
'backbone',
'slick'
], function($,Backbone,slick) {
'use strict';
var FooterView = Backbone.View.extend({
el: '#footerView',
initialize: function() {
// CACHE
this.$logos = $('#footer-logos');
this.$footerFixed = $('#footerFixed');
... |
Add check do we have Add Company button in Create Company Form test | <?php
namespace Tests;
use App\User;
use App\Company;
use Illuminate\Foundation\Testing\WithoutMiddleware;
use Illuminate\Foundation\Testing\DatabaseMigrations;
use Illuminate\Foundation\Testing\DatabaseTransactions;
class CompanyCreateFormTest extends \TestCase
{
use DatabaseTransactions;
public function ... | <?php
namespace Tests;
use App\User;
use App\Company;
use Illuminate\Foundation\Testing\WithoutMiddleware;
use Illuminate\Foundation\Testing\DatabaseMigrations;
use Illuminate\Foundation\Testing\DatabaseTransactions;
class CompanyCreateFormTest extends \TestCase
{
use DatabaseTransactions;
public function ... |
Reduce amount of information in reference links | define(['rules/rules.module'
],
function() {
angular.module('rules').factory('references',
[
function() {
function generateReference(query) {
var bindings = [];
angular.forEach(query.bindings, function(binding) {
if ('id' in binding) {
... | define(['rules/rules.module'
],
function() {
angular.module('rules').factory('references',
[
function() {
function generateReference(query) {
var url = ('#/rules/explain?inference=' +
encodeURIComponent(angular.toJson(query, false)));
var referen... |
Exclude more categories to make generating site faster | <?php
get_header();
if (have_posts()) {
while (have_posts()) {
the_post();
?>
<div class="blogPost">
<?php the_content(); ?>
<?php
if (is_page("tags")) {
?>
<ul class="tagList">
<?php
wp_list_categories(
array(
"hierarchical" => 1,
... | <?php
get_header();
if (have_posts()) {
while (have_posts()) {
the_post();
?>
<div class="blogPost">
<?php the_content(); ?>
<?php
if (is_page("tags")) {
?>
<ul class="tagList">
<?php
wp_list_categories(
array(
"hierarchical" => 1,
... |
Fix issue with Accept-Language header for certain system languages.
The proper Locale was not being used when calling String.format(), which
was causing the resulting HTTP requests to fail.
Bug: T118910
Change-Id: I09e8c57d92eb969de816ed5025ad17f66aec386c | package org.wikipedia.interlanguage;
import android.support.annotation.NonNull;
import java.util.Locale;
public final class AcceptLanguageUtil {
private static final float APP_LANGUAGE_QUALITY = .9f;
private static final float SYSTEM_LANGUAGE_QUALITY = .8f;
/**
* @return The value that should go in... | package org.wikipedia.interlanguage;
import android.support.annotation.NonNull;
public final class AcceptLanguageUtil {
private static final float APP_LANGUAGE_QUALITY = .9f;
private static final float SYSTEM_LANGUAGE_QUALITY = .8f;
/**
* @return The value that should go in the Accept-Language heade... |
Remove text align center from status and toasts in the header. | import { HeaderService } from "./header.service.js";
export class HeaderTemplate {
static update(render) {
const start = Date.now();
/* eslint-disable indent */
render`
<nav class="flex flex-row bt bb mw9 center shadow-2">
<div class="flex flex-wrap flex-row ju... | import { HeaderService } from "./header.service.js";
export class HeaderTemplate {
static update(render) {
const start = Date.now();
/* eslint-disable indent */
render`
<nav class="flex flex-row bt bb tc mw9 center shadow-2">
<div class="flex flex-wrap flex-row... |
Raise Exception when there's an HTTP error | import urllib
from extutils import get_filename
from template import render
import requests
import yaml
import jsonschema
SCHEMA = {
'$schema': 'http://json-schema.org/draft-04/schema#',
'description': 'Describes the extract extension handler input',
'type':'object',
'properties': {
'url': {
... | import urllib
from extutils import get_filename
from template import render
import requests
import yaml
import jsonschema
SCHEMA = {
'$schema': 'http://json-schema.org/draft-04/schema#',
'description': 'Describes the extract extension handler input',
'type':'object',
'properties': {
'url': {
... |
Create BLL for profile - edit js files | $(document).ready(function () {
var tokenKey = sessionStorage.getItem()
function AppViewModel() {
var self = this;
self.FirstName = ko.observable("");
self.SecondName = ko.observable("");
self.About = ko.observable("");
self.Picture = ko.observable("");
self.fullName = ko.computed(f... | $(document).ready(function () {
function AppViewModel() {
var self = this;
self.FirstName = ko.observable("");
self.SecondName = ko.observable("");
self.About = ko.observable("");
self.Picture = ko.observable("");
self.fullName = ko.computed(function () {
return self.FirstName()... |
Add default value for customer getAll | export default function CustomersResource({apiHandler}) {
return {
async getAll({limit = null, offset = null, sort = null, expand = '', filter = '', q = '', criteria = ''} = {}) {
const params = {
limit,
offset,
sort,
expand,
... | export default function CustomersResource({apiHandler}) {
return {
async getAll({limit = null, offset = null, sort = null, expand = '', filter = '', q = '', criteria = ''}) {
const params = {
limit,
offset,
sort,
expand,
... |
Change the way the test works with the command | /*
global describe
global it
*/
const chai = require('chai')
const exec = require('child_process').exec
const path = require('path')
var assert = chai.assert
console.log('Testing the app')
var cmd = 'node ' + path.join(__dirname, '../index.js') + ' '
describe('Conversion Params', function () {
// Further code... | const chai = require('chai')
const exec = require('child_process').exec
var assert = chai.assert
console.log('Testing the app')
describe('Conversion Params', function () {
// Further code for tests goes here
it('If no params', function (done) {
// Test implementation goes here
exec('currencyconv',
... |
Make tab spacing on render optional
Added a very simple optional variable when using `render()` to allow alternate line indentations (or none). | <?php
/**
* @package Opengraph
* @author Axel Etcheverry <axel@etcheverry.biz>
* @copyright Copyright (c) 2011 Axel Etcheverry (http://www.axel-etcheverry.com)
* Displays <a href="http://creativecommons.org/licenses/MIT/deed.fr">MIT</a>
* @license http://creativecommons.org/licenses/MIT/deed.fr ... | <?php
/**
* @package Opengraph
* @author Axel Etcheverry <axel@etcheverry.biz>
* @copyright Copyright (c) 2011 Axel Etcheverry (http://www.axel-etcheverry.com)
* Displays <a href="http://creativecommons.org/licenses/MIT/deed.fr">MIT</a>
* @license http://creativecommons.org/licenses/MIT/deed.fr ... |
Remove unnecessary conditional in argument parsing | import ircbotframe
import sys
class Handler:
def __init__(self, host, port=6667, name="MediaWiki", description="MediaWiki recent changes bot", channels=[]):
self.channels = channels
self.bot = ircbotframe.ircBot(host, port, name, description)
self.bot.bind("376", self.endMOTD)
self.... | import ircbotframe
import sys
class Handler:
def __init__(self, host, port=6667, name="MediaWiki", description="MediaWiki recent changes bot", channels=[]):
self.channels = channels
self.bot = ircbotframe.ircBot(host, port, name, description)
self.bot.bind("376", self.endMOTD)
self.... |
Fix task channel registration when installing module from UI
I noticed that when we install a new module via UI, its
channel does not get registered. The reason for that is that when
entities bundle is getting restarted, what unregisters the ChannelService,
the ChannelService did not get registered back on, due to the... | package org.motechproject.tasks.osgi;
import org.eclipse.gemini.blueprint.service.exporter.OsgiServiceRegistrationListener;
import org.motechproject.tasks.service.ChannelService;
import org.osgi.framework.BundleContext;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.a... | package org.motechproject.tasks.osgi;
import org.eclipse.gemini.blueprint.service.exporter.OsgiServiceRegistrationListener;
import org.motechproject.tasks.service.ChannelService;
import org.osgi.framework.BundleContext;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.a... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.