text
stringlengths
17
1.47k
positive
stringlengths
673
4.43k
negative
stringlengths
677
2.81k
Remove Emulation logs directory one time at the beggining of the test suite+ Fix system call
<?php namespace Ivory\LuceneSearchBundle\Tests\Emulation; use Symfony\Bundle\FrameworkBundle\Test\WebTestCase as BaseWebTestCase; use Symfony\Component\HttpKernel\Util\Filesystem; /** * Web test case * * @author GeLo <geloen.eric@gmail.com> */ class WebTestCase extends BaseWebTestCase { /** * @var boole...
<?php namespace Ivory\LuceneSearchBundle\Tests\Emulation; use Symfony\Bundle\FrameworkBundle\Test\WebTestCase as BaseWebTestCase; use Symfony\Component\HttpKernel\Util\Filesystem; /** * Web test case * * @author GeLo <geloen.eric@gmail.com> */ class WebTestCase extends BaseWebTestCase { /** * @var boole...
Expand example to use done()
var async = require('async'); var timetree = require('../'); var util = require('util'); function somethingSynchronous() { var i = 100000, numbers = []; while (i--) { numbers.push(i); } return numbers.reduce(function(a,b) { return a * b; }) } function databaseLookup(id, callback) { setTime...
var async = require('async'); var timetree = require('../'); var util = require('util'); var timer = timetree('example'); return async.waterfall( [ function(callback) { var subTimer = timer.split('task1'); return setTimeout(function() { subTimer.end(); ...
Use POST instead of GET
/* Global variables to cache the user and tweet data. */ var user; var tweet_data; function submit_username() { var val = $('#usernamefield').val(); /* We can use the cache and return. */ if (user == val) { generate_tweet(tweet_data); return false; } user = val; $('#tweet').ht...
/* Global variables to cache the user and tweet data. */ var user; var tweet_data; function submit_username() { var val = $('#usernamefield').val(); /* We can use the cache and return. */ if (user == val) { generate_tweet(tweet_data); return false; } user = val; $('#tweet').ht...
Use T attribute to get transpose
# -*- coding: utf-8 -*- # Copyright (c) 2015, Vispy Development Team. # Distributed under the (new) BSD License. See LICENSE.txt for more info. """ Circular Layout =============== This module contains several graph layouts which rely heavily on circles. """ import numpy as np from ..util import straight_line_vertice...
# -*- coding: utf-8 -*- # Copyright (c) 2015, Vispy Development Team. # Distributed under the (new) BSD License. See LICENSE.txt for more info. """ Circular Layout =============== This module contains several graph layouts which rely heavily on circles. """ import numpy as np from ..util import straight_line_vertice...
Fix can not read property of undefined error
var once = require('once'); module.exports = function () { var collections = [].slice.call(arguments); if(!Array.isArray(collections[0])) { collections = [ collections ]; } return Promise.all( collections.map(function(plugins) { var i = -1; return new Promise...
var once = require('once'); module.exports = function () { var collections = [].slice.call(arguments); if(!Array.isArray(collections[0])) { collections = [ collections ]; } return Promise.all( collections.map(function(plugins) { var i = -1; return new Promise...
Fix indentation on single file
"use strict"; module.exports = function(connection, parsed, data, callback) { if (!parsed.attributes || parsed.attributes.length !== 1 || !parsed.attributes[0] || ["STRING", "LITERAL", "ATOM"].indexOf(parsed.attributes[0].type) < 0 ) { connection.send({ tag: parsed.tag, command:...
"use strict"; module.exports = function(connection, parsed, data, callback) { if (!parsed.attributes || parsed.attributes.length !== 1 || !parsed.attributes[0] || ["STRING", "LITERAL", "ATOM"].indexOf(parsed.attributes[0].type) < 0 ) { connection.send({ tag: parsed...
ref: Disable select for update on build mutation
from zeus.config import db, nplusone from zeus.models import Build, ItemStat, Revision from zeus.pubsub.utils import publish from .base_build import BaseBuildResource from ..schemas import BuildSchema build_schema = BuildSchema() class BuildDetailsResource(BaseBuildResource): # def select_resource_for_update(se...
from zeus.config import db, nplusone from zeus.models import Build, ItemStat, Revision from zeus.pubsub.utils import publish from .base_build import BaseBuildResource from ..schemas import BuildSchema build_schema = BuildSchema() class BuildDetailsResource(BaseBuildResource): def select_resource_for_update(self...
Add missing commands to default help prompt
import backend.Core; import java.io.IOException; import parse.GreetParser; import parse.StepParser; public class App { public String getGreeting() { return "Hello world."; } /** * Main entry point to G2Tutorial. * * @param args commandline arguments */ public static void main(String[] args) {...
import backend.Core; import java.io.IOException; import parse.GreetParser; import parse.StepParser; public class App { public String getGreeting() { return "Hello world."; } /** * Main entry point to G2Tutorial. * * @param args commandline arguments */ public static void main(String[] args) {...
Update registry class and interface references
<?php /* * This file is part of the Sylius package. * * (c) Paweł Jędrzejewski * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Sylius\Bundle\PricingBundle\Calculator; use Sylius\Bundle\PricingBundle\Model\PriceableInte...
<?php /* * This file is part of the Sylius package. * * (c) Paweł Jędrzejewski * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Sylius\Bundle\PricingBundle\Calculator; use Sylius\Bundle\PricingBundle\Model\PriceableInte...
Allow karma to load plugins automatically
var webpack = require('webpack'); // TODO: use BowerWebpackPlugin // var BowerWebpackPlugin = require('bower-webpack-plugin'); var webpackCommon = require('./webpack.common.config.js'); // Put in separate file? var webpackTestConfig = { devtool: 'inline-source-map', plugins: [ new webpack.ResolverPlugin...
var webpack = require('webpack'); // TODO: use BowerWebpackPlugin // var BowerWebpackPlugin = require('bower-webpack-plugin'); var webpackCommon = require('./webpack.common.config.js'); // Put in separate file? var webpackTestConfig = { devtool: 'inline-source-map', plugins: [ new webpack.ResolverPlugin...
Fix for MPLY-8221. Survey now handle a null survey url and urls that don't start with http or https. Buddy: Vimmy
// Copyright eeGeo Ltd (2012-2016), All Rights Reserved package com.eegeo.surveys; import com.eegeo.entrypointinfrastructure.MainActivity; import android.app.AlertDialog; import android.content.DialogInterface; import android.content.Intent; import android.net.Uri; public class SurveyView { private MainActivity ...
// Copyright eeGeo Ltd (2012-2016), All Rights Reserved package com.eegeo.surveys; import com.eegeo.entrypointinfrastructure.MainActivity; import android.app.AlertDialog; import android.content.DialogInterface; import android.content.Intent; import android.net.Uri; public class SurveyView { private MainActivity ...
Fix "import star" feature support `dict.keys()` returns `dict_keys` object in py3, which does not support indexing.
import sys from functools import partial, update_wrapper from django.utils import six def proxy(attr, default): def wrapper(self): # It has to be most recent, # to override settings in tests from django.conf import settings value = getattr(settings, attr, default) if callab...
import sys from functools import partial, update_wrapper from django.utils import six def proxy(attr, default): def wrapper(self): # It has to be most recent, # to override settings in tests from django.conf import settings value = getattr(settings, attr, default) if callab...
Add entry point for generating reports
# This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this file, # You can obtain one at http://mozilla.org/MPL/2.0/. from setuptools import setup, find_packages PACKAGE_VERSION = '0.1' deps = [ 'flask', 'Jinja2', 'manifestp...
# This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this file, # You can obtain one at http://mozilla.org/MPL/2.0/. from setuptools import setup, find_packages PACKAGE_VERSION = '0.1' deps = [ 'flask', 'Jinja2', 'manifestp...
BAP-457: Delete user error - fix bug
/** * Delete action with confirm dialog, triggers REST DELETE request * * @class OroApp.DatagridActionDelete * @extends OroApp.DatagridAction */ OroApp.DatagridActionDelete = OroApp.DatagridAction.extend({ /** @property Backbone.BootstrapModal */ errorModal: undefined, /** @property Backbone.Bootst...
/** * Delete action with confirm dialog, triggers REST DELETE request * * @class OroApp.DatagridActionDelete * @extends OroApp.DatagridAction */ OroApp.DatagridActionDelete = OroApp.DatagridAction.extend({ /** @property Backbone.BootstrapModal */ errorModal: undefined, /** @property Backbone.Bootst...
Use the same name for the servers for the memcached and memcache service providers
<?php namespace GeekCache\Cache; class MemcachedServiceProvider { public function __construct($container) { $this->container = $container; } public function register() { $this->container['geekcache.memcached'] = $this->container->share(function ($c) { $memcached = new \...
<?php namespace GeekCache\Cache; class MemcachedServiceProvider { public function __construct($container) { $this->container = $container; } public function register() { $this->container['geekcache.memcached'] = $this->container->share(function ($c) { $memcached = new \...
FIX - override ngModel.$isEmpty to work as in input type checkbox.
/** * @author xialei <xialeistudio@gmail.com> */ angular.module('angular-icheck', []) .directive('iCheck', [function () { return { restrict: 'EA', transclude: true, require: 'ngModel', replace: true, template: '<div class="angular-icheck">\n <...
/** * @author xialei <xialeistudio@gmail.com> */ angular.module('angular-icheck', []) .directive('iCheck', [function () { return { restrict: 'EA', transclude: true, require: 'ngModel', replace: true, template: '<div class="angular-icheck">\n <...
Add SSL to cx-freeze packages
import importlib from cx_Freeze import setup, Executable backend_path = importlib.import_module("bcrypt").__path__[0] backend_path = backend_path.replace("bcrypt", ".libs_cffi_backend") # Dependencies are automatically detected, but it might need # fine tuning. build_exe_options = { "include_files": [ ("...
import importlib from cx_Freeze import setup, Executable backend_path = importlib.import_module("bcrypt").__path__[0] backend_path = backend_path.replace("bcrypt", ".libs_cffi_backend") # Dependencies are automatically detected, but it might need # fine tuning. build_exe_options = { "include_files": [ ("...
Return proper result for Q012
'use strict'; var Transmittal = require('../models/transmittal'); module.exports = { isValidTimestamp: function(activityYear, respondentID, timestamp, callback) { Transmittal.findOne({'activity_year': activityYear - 1, 'respondent_id': respondentID}, function(err, data) { if (err) { ...
'use strict'; var Transmittal = require('../models/transmittal'); module.exports = { isValidTimestamp: function(activityYear, respondentID, timestamp, callback) { Transmittal.findOne({'activity_year': activityYear - 1, 'respondent_id': respondentID}, function(err, data) { if (err) { ...
Add the URL to the exception messsage.
<?php namespace CommerceGuys\Platform\Cli\Api; use Guzzle\Http\Exception\ClientErrorResponseException; use Guzzle\Service\Client; use Guzzle\Http\Message\RequestInterface; use Guzzle\Common\Exception\ExceptionCollection; class PlatformClient extends Client { /** * @{inheritdoc} * * Catch ClientEr...
<?php namespace CommerceGuys\Platform\Cli\Api; use Guzzle\Http\Exception\ClientErrorResponseException; use Guzzle\Service\Client; use Guzzle\Http\Message\RequestInterface; use Guzzle\Common\Exception\ExceptionCollection; class PlatformClient extends Client { /** * @{inheritdoc} * * Catch ClientEr...
Call Experiment.publish in run method
import traceback from laboratory.observation import Observation, Test from laboratory import exceptions class Experiment(object): def __init__(self, name='Experiment', raise_on_mismatch=False): self.name = name self.raise_on_mismatch = raise_on_mismatch self._control = None self...
import traceback from laboratory.observation import Observation, Test from laboratory import exceptions class Experiment(object): def __init__(self, name='Experiment', raise_on_mismatch=False): self.name = name self.raise_on_mismatch = raise_on_mismatch self._control = None self...
Make entity manager available to all entity services
<?php namespace SimplyTestable\ApiBundle\Services; use Doctrine\ORM\EntityManager; use SimplyTestable\ApiBundle\Entity\WebSite; use webignition\NormalisedUrl\NormalisedUrl; abstract class EntityService { /** * * @var \Doctrine\ORM\EntityManager */ protected $entityManager; ...
<?php namespace SimplyTestable\ApiBundle\Services; use Doctrine\ORM\EntityManager; use SimplyTestable\ApiBundle\Entity\WebSite; use webignition\NormalisedUrl\NormalisedUrl; abstract class EntityService { /** * * @var \Doctrine\ORM\EntityManager */ private $entityManager; ...
Change User to use Django's AbstractBaseUser
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models from django.contrib.auth.models import PermissionsMixin from django.contrib.auth.base_user import AbstractBaseUser from .managers import UserManager class User(AbstractBaseUser, PermissionsMixin): email = models.EmailFiel...
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models class User(models.Model): MALE = -1 UNDEFINED = 0 FEMALE = 1 GENDER_CHOICES = ( (MALE, 'Male'), (UNDEFINED, 'Undefined'), (FEMALE, 'Female') ) school = models.ForeignKey('unich...
Change mapping to avoid warning
from django.conf import settings from django.contrib.auth.models import User from django.db import models class UserMetadata(models.Model): user = models.OneToOneField( User, related_name="metadata", on_delete=models.CASCADE ) tos_version = models.IntegerField(default=0) tos_accepted = models....
from django.conf import settings from django.contrib.auth.models import User from django.db import models class UserMetadata(models.Model): user = models.ForeignKey( User, related_name="metadata", unique=True, on_delete=models.CASCADE ) tos_version = models.IntegerField(default=0) tos_accepted...
Add unit test for valid blacklist
#!/usr/bin/env python3 import argparse from passgen import make_parser, sanitize_input import unittest class PassGenTestCase(unittest.TestCase): def setUp(self): self.parse_args = make_parser().parse_args def test_duplicate_flags(self): for duplicate_flag in ['dd', 'll', 'uu', 'pp', 'ss']: ...
#!/usr/bin/env python3 import argparse from passgen import make_parser, sanitize_input import unittest class PassGenTestCase(unittest.TestCase): def setUp(self): self.parse_args = make_parser().parse_args def test_duplicate_flags(self): for duplicate_flag in ['dd', 'll', 'uu', 'pp', 'ss']: ...
[WEB-465] Fix typo in "powerful apps"
import React from 'react'; import Helmet from 'react-helmet'; import Hero from './Hero'; const LandingPageHero = ({ title, headline }, { modals }) => { return ( <div> <Helmet title={title} /> <Hero headline={headline} textline={`Increase your productivity, focus on new features, and s...
import React from 'react'; import Helmet from 'react-helmet'; import Hero from './Hero'; const LandingPageHero = ({ title, headline }, { modals }) => { return ( <div> <Helmet title={title} /> <Hero headline={headline} textline={`Increase your productivity, focus on new features, and s...
Fix double error message when "tour" is missing
'use strict'; angular.module('alienUiApp').factory('restTechnicalErrorInterceptor', ['$rootScope', '$q', '$window', 'toaster', '$translate', function($rootScope, $q, $window, toaster, $translate) { var extractErrorMessage = function(rejection) { if (UTILS.isDefinedAndNotNull(rejection.data)) { if ...
'use strict'; angular.module('alienUiApp').factory('restTechnicalErrorInterceptor', ['$rootScope', '$q', '$window', 'toaster', '$translate', function($rootScope, $q, $window, toaster, $translate) { var extractErrorMessage = function(rejection) { if (UTILS.isDefinedAndNotNull(rejection.data)) { if ...
Update test case for new version of IUCN
<?php namespace Tests\AppBundle\API\Listing; use Symfony\Component\HttpFoundation\ParameterBag; use Tests\AppBundle\API\WebserviceTestCase; class TraitsTest extends WebserviceTestCase { public function testExecute() { $default_db = $this->default_db; $service = $this->webservice->factory('li...
<?php namespace Tests\AppBundle\API\Listing; use Symfony\Component\HttpFoundation\ParameterBag; use Tests\AppBundle\API\WebserviceTestCase; class TraitsTest extends WebserviceTestCase { public function testExecute() { $default_db = $this->default_db; $service = $this->webservice->factory('li...
Use separate variable names for Visual Studio config/platform.
# -*- coding: utf-8 -*- from nimp.commands._command import * from nimp.utilities.build import * #------------------------------------------------------------------------------- class VsBuildCommand(Command): def __init__(self): Command.__init__(self, 'vs-build', 'Builds a Visual Studio project') #--...
# -*- coding: utf-8 -*- from nimp.commands._command import * from nimp.utilities.build import * #------------------------------------------------------------------------------- class VsBuildCommand(Command): def __init__(self): Command.__init__(self, 'vs-build', 'Builds a Visual Studio project') #--...
Make sure we match the original API for reporter use
'use strict'; var fs = require('fs'), jshintPlugin = require('gulp-jshint'), cache = require('gulp-cache'); var jshintVersion = '0.2.4'; // Add on to the original plugin jshintPlugin.cached = function (opt) { var jshintOpts; if (typeof opt === 'string') { jshintOpts = fs.readFileSync(opt); ...
'use strict'; var fs = require('fs'), jshintPlugin = require('gulp-jshint'), cache = require('gulp-cache'); var jshintVersion = '0.2.4'; var task = { // Allow the original if needed. original: jshintPlugin, // Or, the cached version cached: function (opt) { var jshintOpts; if...
Add bidict to required packages
from setuptools import setup, find_packages setup( name='ssbio', version='0.1', author='Nathan Mih', author_email='nmih@ucsd.edu', license='MIT', url='http://github.com/nmih/ssbio', description='Various tools and functions to enable structural systems biology', packages=find_packages(),...
from setuptools import setup, find_packages setup( name='ssbio', version='0.1', author='Nathan Mih', author_email='nmih@ucsd.edu', license='MIT', url='http://github.com/nmih/ssbio', description='Various tools and functions to enable structural systems biology', packages=find_packages(),...
Fix Thread CPU time metric name.
package com.ea.orbit.metrics.jvm; import com.codahale.metrics.Gauge; import com.codahale.metrics.Metric; import com.codahale.metrics.MetricSet; import java.lang.management.ManagementFactory; import java.lang.management.ThreadInfo; import java.lang.management.ThreadMXBean; import java.util.HashMap; import java.util.Ma...
package com.ea.orbit.metrics.jvm; import com.codahale.metrics.Gauge; import com.codahale.metrics.Metric; import com.codahale.metrics.MetricSet; import java.lang.management.ManagementFactory; import java.lang.management.ThreadInfo; import java.lang.management.ThreadMXBean; import java.util.HashMap; import java.util.Ma...
Remove history from long description
#!/usr/bin/env python # -*- coding: utf-8 -*- from setuptools import setup with open('README.rst') as readme_file: readme = readme_file.read() setup( name='gnsq', version='1.0.0', description='A gevent based python client for NSQ.', long_description=readme, long_description_content_type='tex...
#!/usr/bin/env python # -*- coding: utf-8 -*- from setuptools import setup with open('README.rst') as readme_file: readme = readme_file.read() with open('HISTORY.rst') as history_file: history = history_file.read().replace('.. :changelog:', '') setup( name='gnsq', version='1.0.0', description='...
Set the AMD module name in the UMD build
import path from 'path'; const projectRoot = path.join(__dirname, '..'); export default { cache: true, entry: [ path.join(projectRoot, 'src', 'hibp.js'), ], output: { library: 'hibp', libraryTarget: 'umd', umdNamedDefine: true, path: path.join(projectRoot, 'dist'), }, module: { rul...
import path from 'path'; const projectRoot = path.join(__dirname, '..'); export default { cache: true, entry: [ path.join(projectRoot, 'src', 'hibp.js'), ], output: { library: 'hibp', libraryTarget: 'umd', path: path.join(projectRoot, 'dist'), }, module: { rules: [ { test...
Modify error message log UI
import React, { PropTypes } from 'react'; import VarOneStore from '../../stores/varOne-store'; import connectToStores from 'alt/utils/connectToStores'; @connectToStores export default class VarOneLogModal extends React.Component { static propTypes = { msg: PropTypes.string, port: PropTypes.string, inpu...
import React, { PropTypes } from 'react'; import VarOneStore from '../../stores/varOne-store'; import connectToStores from 'alt/utils/connectToStores'; @connectToStores export default class VarOneLogModal extends React.Component { static propTypes = { msg: PropTypes.string, port: PropTypes.string, inpu...
Add prefix 'wi' to database table name.
<?php namespace WiContactAPI\V1\Rest\Contact; use Doctrine\ORM\Mapping as ORM; /** * @ORM\Entity(repositoryClass="WiContactAPI\V1\Rest\Contact\ContactCollection") * @ORM\Table(name="wi_contacts") */ class ContactEntity { /** * * @var int @ORM\Id * @ORM\Column(type="integer")...
<?php namespace WiContactAPI\V1\Rest\Contact; use Doctrine\ORM\Mapping as ORM; /** * @ORM\Entity(repositoryClass="WiContactAPI\V1\Rest\Contact\ContactCollection") * @ORM\Table(name="contacts") */ class ContactEntity { /** * * @var int @ORM\Id * @ORM\Column(type="integer") ...
Change the interface layout to reflect the changes we spoke about in icq git-svn-id: 00f83033766efed07e2b0af284f6d6b8c92b3c53@408254 13f79535-47bb-0310-9956-ffa450edef68
/*********************************************************************** * Copyright (c) 1999-2006 The Apache Software Foundation. * * All rights reserved. * * ------------------------------------------------------------------- * * Licensed under the Apache...
/*********************************************************************** * Copyright (c) 1999-2006 The Apache Software Foundation. * * All rights reserved. * * ------------------------------------------------------------------- * * Licensed under the Apache...
Return shipping methods with ordered keys
<?php /** * @author Krzysztof Gzocha <krzysztof.gzocha@xsolve.pl> */ namespace Team3\Order; /** * Class ShippingMethodCollection * @package Team3\Order */ class ShippingMethodCollection implements ShippingMethodCollectionInterface { /** * @var ShippingMethodInterface[] */ protected $shippingMet...
<?php /** * @author Krzysztof Gzocha <krzysztof.gzocha@xsolve.pl> */ namespace Team3\Order; /** * Class ShippingMethodCollection * @package Team3\Order */ class ShippingMethodCollection implements ShippingMethodCollectionInterface { /** * @var ShippingMethodInterface[] */ protected $shippingMet...
Fix unused import which could creates crashes
import os import socket import time from RAXA.settings import PROJECT_ROOT from backend.io.connector import Connector class Tellstick(Connector): TYPE = 'Tellstick' def is_usable(self): return self.connector.version.startswith('RAXA') def update(self): s = socket.socket(socket.AF_INET, s...
import os import socket import tftpy import time from RAXA.settings import PROJECT_ROOT from backend.io.connector import Connector class Tellstick(Connector): TYPE = 'Tellstick' def is_usable(self): return self.connector.version.startswith('RAXA') def update(self): s = socket.socket(sock...
Fix file size prop warning
import React from "react"; import PropTypes from "prop-types"; import { Col, Row } from "react-bootstrap"; import { byteSize } from "../../utils"; import { Icon, ListGroupItem, RelativeTime } from "../../base"; export default class File extends React.Component { static propTypes = { id: PropTypes.string,...
import React from "react"; import PropTypes from "prop-types"; import { Col, Row } from "react-bootstrap"; import { byteSize } from "../../utils"; import { Icon, ListGroupItem, RelativeTime } from "../../base"; export default class File extends React.Component { static propTypes = { id: PropTypes.string,...
Fix translations not loaded in test
<?php namespace Backend\Modules\Error\Tests\Action; use Backend\Core\Language\Language; use Backend\Core\Tests\BackendWebTestCase; use Symfony\Bundle\FrameworkBundle\Client; use Symfony\Component\HttpFoundation\Response; class IndexTest extends BackendWebTestCase { public function testAuthenticationIsNotNeeded(C...
<?php namespace Backend\Modules\Error\Tests\Action; use Backend\Core\Language\Language; use Backend\Core\Tests\BackendWebTestCase; use Symfony\Bundle\FrameworkBundle\Client; use Symfony\Component\HttpFoundation\Response; class IndexTest extends BackendWebTestCase { public function testAuthenticationIsNotNeeded(C...
Clean only volumes of type host_path
""".. Ignore pydocstyle D400. ==================== Clean test directory ==================== Command to run on local machine:: ./manage.py cleantestdir """ import re import shutil from itertools import chain from pathlib import Path from django.core.management.base import BaseCommand from resolwe.storage impo...
""".. Ignore pydocstyle D400. ==================== Clean test directory ==================== Command to run on local machine:: ./manage.py cleantestdir """ import re import shutil from itertools import chain from pathlib import Path from django.core.management.base import BaseCommand from resolwe.storage impo...
Use docs as project homepage
import re from setuptools import find_packages, setup with open('netsgiro/__init__.py') as fh: metadata = dict(re.findall("__([a-z]+)__ = '([^']+)'", fh.read())) with open('README.rst') as fh: long_description = fh.read() setup( name='netsgiro', version=metadata['version'], description='File ...
import re from setuptools import find_packages, setup with open('netsgiro/__init__.py') as fh: metadata = dict(re.findall("__([a-z]+)__ = '([^']+)'", fh.read())) with open('README.rst') as fh: long_description = fh.read() setup( name='netsgiro', version=metadata['version'], description='File ...
Allow query without table to run
import collections from collections import namedtuple from six import string_types from aq.errors import QueryParsingError from aq.select_parser import select_stmt, ParseException TableId = namedtuple('TableId', ('database', 'table', 'alias')) QueryMetadata = namedtuple('QueryMetadata', ('tables',)) class SelectPa...
from collections import namedtuple import collections from six import string_types from aq.errors import QueryParsingError from aq.select_parser import select_stmt, ParseException TableId = namedtuple('TableId', ('database', 'table', 'alias')) QueryMetadata = namedtuple('QueryMetadata', ('tables',)) class SelectP...
Return url root when no id exists
"use strict"; /** * Model for individual books. */ define([ "underscore", "backbone" ], function(_, Backbone) { var Book = Backbone.Model.extend({ idAttribute: "_id", defaults: { 'type': 'book', 'public': true }, url: function(){ var url...
"use strict"; /** * Model for individual books. */ define([ "underscore", "backbone" ], function(_, Backbone) { var Book = Backbone.Model.extend({ idAttribute: "_id", defaults: { 'type': 'book', 'public': true }, url: function(){ return ...
Update factory name to ngCrypto
/** * Angular crypto-js * https://github.com/janppires/angular-crypto-js.git **/ (function(angular, CryptoJS){ 'use strict'; angular .module('angular-crypto-js', []) .factory('ngCrypto', [ngCrypto]); function ngCrypto(){ return { md5Hex : md5Hex, s...
/** * Angular crypto-js * https://github.com/janppires/angular-crypto-js.git **/ (function(angular, CryptoJS){ 'use strict'; angular .module('angular-crypto-js', []) .factory('cryptoJs', [cryptoJs]); function cryptoJs(){ return { md5Hex : md5Hex, s...
Set title to 4line, change fontsize to 17px
(function (env) { "use strict"; env.ddg_spice_wikinews = function(api_result){ if (api_result.error) { return Spice.failed('wikinews'); } DDG.require('moment.js', function(){ Spice.add({ id: "wikinews", name: "Wikinews", ...
(function (env) { "use strict"; env.ddg_spice_wikinews = function(api_result){ if (api_result.error) { return Spice.failed('wikinews'); } DDG.require('moment.js', function(){ Spice.add({ id: "wikinews", name: "Wikinews", ...
Fix for request timer not always working.
from time import time from logging import getLogger # From: https://djangosnippets.org/snippets/1866/ def sizify(value): """ Simple kb/mb/gb size snippet """ #value = ing(value) if value < 512: ext = 'B' elif value < 512000: value = value / 1024.0 ext = 'kB' elif val...
from time import time from logging import getLogger # From: https://djangosnippets.org/snippets/1866/ def sizify(value): """ Simple kb/mb/gb size snippet """ #value = ing(value) if value < 512: ext = 'B' elif value < 512000: value = value / 1024.0 ext = 'kB' elif val...
Throw error when selector is not unique
var Browser = require('../interfaces/browser.js'); var objectAssign = require('object-assign'); /** * An adapter of WebdriverIO for use with Mugshot * * @implements {Browser} * @class * * @param webdriverioInstance - An instance of WebdriverIO */ function WebDriverIOAdaptor(webdriverioInstance) { this._webdri...
var Browser = require('../interfaces/browser.js'); var objectAssign = require('object-assign'); /** * An adapter of WebdriverIO for use with Mugshot * * @implements {Browser} * @class * * @param webdriverioInstance - An instance of WebdriverIO */ function WebDriverIOAdaptor(webdriverioInstance) { this._webdri...
Use a context manager for reading README.md.
import io import os from setuptools import setup version_txt = os.path.join(os.path.dirname(__file__), 'aghasher', 'version.txt') with open(version_txt, 'r') as f: version = f.read().strip() with io.open('README.md', encoding='utf8') as f: long_description = f.read() setup( author='Daniel Steinberg', ...
import io import os from setuptools import setup version_txt = os.path.join(os.path.dirname(__file__), 'aghasher', 'version.txt') with open(version_txt, 'r') as f: version = f.read().strip() setup( author='Daniel Steinberg', author_email='ds@dannyadam.com', classifiers=[ 'Development Status ::...
Handle App::abort() no longer exist. Signed-off-by: crynobone <e1a543840a942eb68427510a8a483282a7bfeddf@gmail.com>
<?php namespace Orchestra\Support\Traits; use Illuminate\Support\Facades\App; use Orchestra\Support\Facades\Messages; use Illuminate\Support\Facades\Redirect; use Symfony\Component\HttpKernel\Exception\HttpException use Symfony\Component\HttpKernel\Exception\NotFoundHttpException trait ControllerResponseTrait { /...
<?php namespace Orchestra\Support\Traits; use Illuminate\Support\Facades\App; use Illuminate\Support\Facades\Redirect; use Orchestra\Support\Facades\Messages; trait ControllerResponseTrait { /** * Queue notification and redirect. * * @param string $to * @param string $message * @param...
Add padding to button item
import Item from './item'; export default class ButtonItem extends Item { constructor() { super(); this._root .classed('button', true) .styles({ 'background': '#FFF', 'cursor': 'pointer', 'height': '3em', 'justify-content': 'center', 'padding': '0.5em 0' ...
import { select } from 'd3'; import Item from './item'; export default class ButtonItem extends Item { constructor() { super(); this._root .classed('button', true) .styles({ 'background': '#FFF', 'cursor': 'pointer', 'height': '3em', 'justify-content': 'center' ...
Refresh page after user creation Former-commit-id: 375fb1e0b2c00dd37d17c20ce9a7abb68163176f
function viewUsers(view) { getUsers( success = function (data) { //console.log(data); populateUsersTable(data); }, error = function (jqxhr) { handleApiError(jqxhr); } ); function populateUsersTable(data) { var usersHtml = templates.userList(data); var isEditor = false;...
function viewUsers(view) { getUsers( success = function (data) { //console.log(data); populateUsersTable(data); }, error = function (jqxhr) { handleApiError(jqxhr); } ); function populateUsersTable(data) { var usersHtml = templates.userList(data); var isEditor = false;...
Remove unnecessary checks for V2 tokens
/* global btoa */ const V2TOKEN_ABORT_TIMEOUT = 3000 export function getAccessToken () { return new Promise(function (resolve, reject) { if (typeof window === 'undefined') { return reject(new Error('getV2Token should be used in browser')) } else if (!window.parent) { return reject(new Error('getV...
/* global btoa */ const V2TOKEN_ABORT_TIMEOUT = 3000 export function getAccessToken () { return new Promise(function (resolve, reject) { if (typeof window === 'undefined') { return reject(new Error('getV2Token should be used in browser')) } else if (!window.parent) { return reject(new Error('getV...
Make API read-only and publically available.
from django.contrib.auth.models import User from tastypie.resources import ModelResource from tastypie import fields from tastypie.authentication import BasicAuthentication from tastypie.authorization import DjangoAuthorization, Authorization from tastypie.constants import ALL, ALL_WITH_RELATIONS from builds.models im...
from django.contrib.auth.models import User from tastypie.resources import ModelResource from tastypie import fields from tastypie.authentication import BasicAuthentication from tastypie.authorization import DjangoAuthorization, Authorization from tastypie.constants import ALL, ALL_WITH_RELATIONS from builds.models im...
Increase soft keyboard launch delay
package co.smartreceipts.android.widget; import android.content.Context; import android.content.res.Configuration; import android.view.View; import android.view.inputmethod.InputMethodManager; public class ShowSoftKeyboardOnFocusChangeListener implements View.OnFocusChangeListener { /** * After we resume Sm...
package co.smartreceipts.android.widget; import android.content.Context; import android.content.res.Configuration; import android.view.View; import android.view.inputmethod.InputMethodManager; public class ShowSoftKeyboardOnFocusChangeListener implements View.OnFocusChangeListener { /** * After we resume Sm...
Add get registration count to service
<?php namespace Shaygan\AffiliateBundle\Entity; use Doctrine\ORM\EntityRepository; /** * ReferralRegistrationRepository * * This class was generated by the Doctrine ORM. Add your own custom * repository methods below. */ class ReferralRegistrationRepository extends EntityRepository { public function getReg...
<?php namespace Shaygan\AffiliateBundle\Entity; use Doctrine\ORM\EntityRepository; /** * ReferralRegistrationRepository * * This class was generated by the Doctrine ORM. Add your own custom * repository methods below. */ class ReferralRegistrationRepository extends EntityRepository { public function getReg...
Add additional assertions around objectcontroller errors
describe('lib/rules/disallow-objectcontroller', function () { var checker = global.checker({ plugins: ['./lib/index'] }); describe('not configured', function() { it('should report with undefined', function() { global.expect(function() { checker.configure({disallowObjectCont...
describe('lib/rules/disallow-objectcontroller', function () { var checker = global.checker({ plugins: ['./lib/index'] }); describe('not configured', function() { it('should report with undefined', function() { global.expect(function() { checker.configure({disallowObjectCont...
Mark snapshots as inactive if any are not valid
from __future__ import absolute_import from flask.ext.restful import reqparse from changes.api.base import APIView from changes.config import db from changes.models import SnapshotImage, SnapshotStatus class SnapshotImageDetailsAPIView(APIView): parser = reqparse.RequestParser() parser.add_argument('status'...
from __future__ import absolute_import from flask.ext.restful import reqparse from changes.api.base import APIView from changes.config import db from changes.models import SnapshotImage, SnapshotStatus class SnapshotImageDetailsAPIView(APIView): parser = reqparse.RequestParser() parser.add_argument('status'...
Fix exception handling in integrity decorator
import functools import logging from weblib.error import ResponseNotValid def integrity(integrity_func, integrity_errors=(ResponseNotValid,), ignore_errors=()): """ Args: :param integrity_func: couldb callable or string contains name of method to call """ def build_d...
import functools import logging from weblib.error import ResponseNotValid def integrity(integrity_func, integrity_errors=(ResponseNotValid,), ignore_errors=()): """ Args: :param integrity_func: couldb callable or string contains name of method to call """ def build_d...
Revert "Move DocSearch styles before headComponents" This reverts commit 1232ccbc0ff6c5d9e80de65cefb352c404973e2f.
import React from 'react' import PropTypes from 'prop-types' export default function HTML(props) { return ( <html {...props.htmlAttributes}> <head> <meta charSet="utf-8" /> <meta httpEquiv="x-ua-compatible" content="ie=edge" /> <meta ...
import React from 'react' import PropTypes from 'prop-types' export default function HTML(props) { return ( <html {...props.htmlAttributes}> <head> <meta charSet="utf-8" /> <meta httpEquiv="x-ua-compatible" content="ie=edge" /> <meta ...
Update basic app to reflect change in api
window.addEvent("domready", function() { var BasicApp = new Class({ Extends: App, initialize: function(element, options) { this.parent(element, options); this.renderer = new BasicRenderer(); this.camera = new Camera(); this.camera.perspective(45, this....
window.addEvent("domready", function() { var BasicApp = new Class({ Extends: App, initialize: function(element, options) { this.parent(element, options); this.renderer = new BasicRenderer(); this.camera = new Camera(); this.camera.perspective(45, this....
Enforce other tasks to ran after init
/* * grunt-browser-sync * https://github.com/shakyshane/grunt-browser-sync * * Copyright (c) 2013 Shane Osbourne * Licensed under the MIT license. */ 'use strict'; module.exports = function (grunt) { grunt.registerMultiTask("browserSync", "Keep your browsers in sync", function () { var done = this...
/* * grunt-browser-sync * https://github.com/shakyshane/grunt-browser-sync * * Copyright (c) 2013 Shane Osbourne * Licensed under the MIT license. */ 'use strict'; module.exports = function (grunt) { grunt.registerMultiTask("browserSync", "Keep your browsers in sync", function () { var done = this...
Revert "first attempt to improve performance"
package com.ideaheap; import java.util.Comparator; import java.util.Map; import java.util.Set; import java.util.stream.Collectors; public class StreamsBasedCalculator { public Map<String, String> getStringTransition( final Set<String> stringSet, final Map<String, Double> stringCosts) { r...
package com.ideaheap; import java.util.Comparator; import java.util.Map; import java.util.Set; import java.util.stream.Collectors; public class StreamsBasedCalculator { public Map<String, String> getStringTransition( final Set<String> stringSet, final Map<String, Double> stringCosts) { r...
Allow looser version of nose TravisCI provides `nose` already installed: - http://docs.travis-ci.com/user/languages/python/#Pre-installed-packages However it's now at a later version and causes our tests to fail: pkg_resources.VersionConflict: (nose 1.3.4 (/home/travis/virtualenv/python2.7.8/lib/python2.7/site-...
#!/usr/bin/env python2 import os from setuptools import setup, find_packages from plugins import __version__ repo_directory = os.path.dirname(__file__) try: long_description = open(os.path.join(repo_directory, 'README.rst')).read() except: long_description = None setup( name='gds-nagios-plugins', ve...
#!/usr/bin/env python2 import os from setuptools import setup, find_packages from plugins import __version__ repo_directory = os.path.dirname(__file__) try: long_description = open(os.path.join(repo_directory, 'README.rst')).read() except: long_description = None setup( name='gds-nagios-plugins', ve...
Allow data=None, even though the spec doesn't allow it
import pymongo import bson from datastore import DataStore class MongoDBDataStore(pymongo.Connection, DataStore): def _store(self, uid, content, data=None): """Store the given dict of content at uid. Nothing returned.""" doc = dict(uid=uid) if data: doc.update(data=bson.Binary(...
import pymongo import bson from datastore import DataStore class MongoDBDataStore(pymongo.Connection, DataStore): def _store(self, uid, content, data): """Store the given dict of content at uid. Nothing returned.""" doc = dict(uid=uid, data=bson.Binary(data)) doc.update(content) se...
Hide groups the user is already member of in user add group form.
<?php namespace User\Form; use App\Entity\User; use Doctrine\ORM\EntityRepository; use Symfony\Component\Form\AbstractType; use Symfony\Component\Form\FormBuilderInterface; use Symfony\Component\OptionsResolver\OptionsResolverInterface; class AddGroupType extends AbstractType { private $user; function __con...
<?php namespace User\Form; use App\Entity\User; use Doctrine\ORM\EntityRepository; use Symfony\Component\Form\AbstractType; use Symfony\Component\Form\FormBuilderInterface; use Symfony\Component\OptionsResolver\OptionsResolverInterface; class AddGroupType extends AbstractType { private $user; function __con...
Change buttons state for color and color picker after a click.
var session = null; // instead of windows.onload $(document).ready( function() { // hide iphone/ipad URL bar //setTimeout(function() { window.scrollTo(0, 1) }, 100); $(".logout").click( function ( event ) { if (!confirm("Leave Poietic Generator?")) { return false; } ret...
var session = null; // instead of windows.onload $(document).ready( function() { // hide iphone/ipad URL bar //setTimeout(function() { window.scrollTo(0, 1) }, 100); $(".logout").click( function ( event ) { if (!confirm("Leave Poietic Generator?")) { return false; } ret...
Add Trip and Step ModelForms
from django.contrib.auth.forms import AuthenticationForm from django import forms from django.core.validators import MinLengthValidator from .models import PoolingUser, Trip, Step from users.forms import UserCreationForm class LoginForm(AuthenticationForm): username = forms.CharField(widget=forms.EmailInput(attrs...
from django.contrib.auth.forms import AuthenticationForm from django import forms from django.core.validators import MinLengthValidator from .models import PoolingUser from users.forms import UserCreationForm class LoginForm(AuthenticationForm): username = forms.CharField(widget=forms.EmailInput(attrs={'placehold...
Increase startup attempts from 1 to 3 in MongoDB container
/* * 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 agreed to in writing, software * distribut...
/* * 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 agreed to in writing, software * distribut...
Use invokeLater for ui build
package com.izforge.izpack.installer.base; import com.izforge.izpack.api.data.AutomatedInstallData; import com.izforge.izpack.installer.manager.PanelManager; import javax.swing.*; /** * Installer frame controller * * @author Anthonin Bonnefoy */ public class InstallerController { private InstallerFrame inst...
package com.izforge.izpack.installer.base; import com.izforge.izpack.api.data.AutomatedInstallData; import com.izforge.izpack.installer.manager.PanelManager; /** * Installer frame controller * * @author Anthonin Bonnefoy */ public class InstallerController { private InstallerFrame installerFrame; private...
Change docker-py dependency error to a warning, update fix command Signed-off-by: Joffrey F <2e95f49799afcec0080c0aeb8813776d949e0768@docker.com>
from __future__ import absolute_import from __future__ import print_function from __future__ import unicode_literals import subprocess import sys # Attempt to detect https://github.com/docker/compose/issues/4344 try: # We don't try importing pip because it messes with package imports # on some Linux distros (...
from __future__ import absolute_import from __future__ import print_function from __future__ import unicode_literals import subprocess import sys # Attempt to detect https://github.com/docker/compose/issues/4344 try: # We don't try importing pip because it messes with package imports # on some Linux distros (...
Add check against missing library versions @tomByrer, Please check your PR. Now it outputs just bootstrap library for Bootstrap CDN.
'use strict'; var fs = require('fs'); var path = require('path'); var sortVersions = require('../lib/sort_versions'); module.exports = function(output, target, scrape) { return function(cb) { console.log('Starting to update ' + target + ' data'); scrape(function(err, libraries) { if...
'use strict'; var fs = require('fs'); var path = require('path'); var sortVersions = require('../lib/sort_versions'); module.exports = function(output, target, scrape) { return function(cb) { console.log('Starting to update ' + target + ' data'); scrape(function(err, libraries) { if...
Remove `apollo-federation` and `apollo-gateway` from Jest module not-mapping.
const { defaults } = require("jest-config"); module.exports = { testEnvironment: "node", setupFiles: [ "<rootDir>/../apollo-server-env/dist/index.js" ], preset: "ts-jest", testMatch: null, testRegex: "/__tests__/.*\\.test\\.(js|ts)$", testPathIgnorePatterns: [ "/node_modules/", ...
const { defaults } = require("jest-config"); module.exports = { testEnvironment: "node", setupFiles: [ "<rootDir>/../apollo-server-env/dist/index.js" ], preset: "ts-jest", testMatch: null, testRegex: "/__tests__/.*\\.test\\.(js|ts)$", testPathIgnorePatterns: [ "/node_modules/", ...
Correct a mistake from 1ae32f5
var jsdom = require("jsdom"); function assign (destination, source) { for (var key in source) { if (source.hasOwnProperty(key)) { destination[key] = source[key]; } } return destination; } var jsdomBrowser = function (baseBrowserDecorator, config) { baseBrowserDecorator(this); this.name = "...
var jsdom = require("jsdom"); function assign (destination, source) { for (var key in source) { if (source.hasOwnProperty(key)) { destination[key] = source[key]; } } return destination; } var jsdomBrowser = function (baseBrowserDecorator, config) { baseBrowserDecorator(this); this.name = "...
Break line in an odd place to keep the build from breaking.
import decimal from django.conf import settings from django.core.management.base import BaseCommand import stripe class Command(BaseCommand): help = "Make sure your Stripe account has the plans" def handle(self, *args, **options): stripe.api_key = settings.STRIPE_SECRET_KEY for plan in set...
import decimal from django.conf import settings from django.core.management.base import BaseCommand import stripe class Command(BaseCommand): help = "Make sure your Stripe account has the plans" def handle(self, *args, **options): stripe.api_key = settings.STRIPE_SECRET_KEY for plan in set...
Deploy should remember to generate markers
import os from optparse import make_option from django.core.management import call_command from django.core.management.base import NoArgsCommand class Command(NoArgsCommand): option_list = NoArgsCommand.option_list + ( make_option('--develop', action='store_true', dest='develo...
import os from optparse import make_option from django.core.management import call_command from django.core.management.base import NoArgsCommand class Command(NoArgsCommand): option_list = NoArgsCommand.option_list + ( make_option('--develop', action='store_true', dest='develo...
Remove stylint from gulp watch
var gulp = require('gulp'); var stylus = require('gulp-stylus'); var stylint = require('gulp-stylint'); var concat = require('gulp-concat'); var uglify = require('gulp-uglify'); var stylFiles = './assets/styl/*.styl'; function bsjs(file) { return './assets/bootstrap-stylus-5.0.2/js/' + file + '.js' }; var bootstr...
var gulp = require('gulp'); var stylus = require('gulp-stylus'); var stylint = require('gulp-stylint'); var concat = require('gulp-concat'); var uglify = require('gulp-uglify'); var stylFiles = './assets/styl/*.styl'; function bsjs(file) { return './assets/bootstrap-stylus-5.0.2/js/' + file + '.js' }; var bootstr...
Add archive description to validator and point to my repo for demo
/** * This is the default configuration file for the Superdesk application. By default, * the app will use the file with the name "superdesk.config.js" found in the current * working directory, but other files may also be specified using relative paths with * the SUPERDESK_CONFIG environment variable or the grunt -...
/** * This is the default configuration file for the Superdesk application. By default, * the app will use the file with the name "superdesk.config.js" found in the current * working directory, but other files may also be specified using relative paths with * the SUPERDESK_CONFIG environment variable or the grunt -...
Update project name from dejavu to PyDejavu
from setuptools import setup, find_packages # import os, sys def parse_requirements(requirements): # load from requirements.txt with open(requirements) as f: lines = [l for l in f] # remove spaces stripped = map((lambda x: x.strip()), lines) # remove comments nocomments...
from setuptools import setup, find_packages # import os, sys def parse_requirements(requirements): # load from requirements.txt with open(requirements) as f: lines = [l for l in f] # remove spaces stripped = map((lambda x: x.strip()), lines) # remove comments nocomments...
Increment minor version number for new release (v0.02).
from setuptools import setup, find_packages import sys, os setup(name='cc.license', version='0.02', description="License selection based on ccREL-based metadata.", classifiers=[], keywords='', author='Creative Commons', author_email='software@creativecommons.org', url='http://...
from setuptools import setup, find_packages import sys, os setup(name='cc.license', version='0.01', description="License selection based on ccREL-based metadata.", classifiers=[], keywords='', author='Creative Commons', author_email='software@creativecommons.org', url='http://...
Use only the height to decide whether to zoom in or out.
# Sample extension: zoom a window to maximum height import re import sys class ZoomHeight: menudefs = [ ('windows', [ ('_Zoom Height', '<<zoom-height>>'), ]) ] windows_keydefs = { '<<zoom-height>>': ['<Alt-F2>'], } unix_keydefs = { '<<zoom-height>>': ...
# Sample extension: zoom a window to maximum height import re import sys class ZoomHeight: menudefs = [ ('windows', [ ('_Zoom Height', '<<zoom-height>>'), ]) ] windows_keydefs = { '<<zoom-height>>': ['<Alt-F2>'], } unix_keydefs = { '<<zoom-height>>': ...
Handle no roles on users table
import React, {PropTypes} from 'react' const UsersTable = ({users}) => ( <div className="panel panel-minimal"> <div className="panel-body"> <table className="table v-center"> <thead> <tr> <th>User</th> <th>Roles</th> <th>Permissions</th> </tr>...
import React, {PropTypes} from 'react' const UsersTable = ({users}) => ( <div className="panel panel-minimal"> <div className="panel-body"> <table className="table v-center"> <thead> <tr> <th>User</th> <th>Roles</th> <th>Permissions</th> </tr>...
Remove references to gulpish git
var gulp = require('gulp'); var chug = require('gulp-chug'); var clean = require('gulp-clean'); var jshint = require('gulp-jshint'); gulp.task('watch', function () { gulp.watch('./src/**/*.js'); gulp.watch([ './src/template/decode/**/*', '!./src/template/decode/build{,/**}' ], ['decode'])...
var gulp = require('gulp'); var bump = require('gulp-bump'); var chug = require('gulp-chug'); var clean = require('gulp-clean'); var git = require('gulp-git'); var jshint = require('gulp-jshint'); gulp.task('watch', function () { gulp.watch('./src/**/*.js'); gulp.watch([ './src/template/decode/**/*',...
Add 'password' to comment on required credentials
'use strict'; // Bitazza uses Alphapoint, also used by ndax // In order to use private endpoints, the following are required: // - 'apiKey' // - 'secret', // - 'uid' (userId in the api info) // - 'login' (the email address used to log into the UI) // - 'password' (the password used to log into the UI) const ndax = re...
'use strict'; // Bitazza uses Alphapoint, also used by ndax // In order to use private endpoints, the following are required: // - 'apiKey' // - 'secret', // - 'uid' (userId in the api info) // - 'login' (the email address used to log into the UI) const ndax = require ('./ndax.js'); // -----------------------------...
Fix test customer collection find
package me.pagarme; import me.pagar.model.Address; import me.pagar.model.Customer; import me.pagar.model.PagarMeException; import me.pagar.model.Phone; import org.junit.Assert; import org.junit.Before; import org.junit.Test; import java.util.Collection; public class CustomerTest extends BaseTest { private Custo...
package me.pagarme; import me.pagar.model.Address; import me.pagar.model.Customer; import me.pagar.model.PagarMeException; import me.pagar.model.Phone; import org.junit.Assert; import org.junit.Before; import org.junit.Test; import java.util.Collection; public class CustomerTest extends BaseTest { private Custo...
Improve API to colorize an icon Move the details to this library. Usage example: icons.colorize(myButton, ["#FF0000", "#00FF00"]);
define(function () { icons = {}; icons.load = function (iconInfo, callback) { if ("uri" in iconInfo) { source = iconInfo.uri; } else if ("name" in iconInfo) { source = "lib/sugar-html-graphics/icons/" + iconInfo.name + ".svg"; } fillColor = iconI...
define(function () { icons = {}; icons.load = function (iconInfo, callback) { if ("uri" in iconInfo) { source = iconInfo.uri; } else if ("name" in iconInfo) { source = "lib/sugar-html-graphics/icons/" + iconInfo.name + ".svg"; } fillColor = iconI...
Use nodejs native crypto module
import mongo from '../db' import utils from '../utils' import crypto from 'crypto' /** * User :: { * id: String, * username: String, * password: String, * createdAt: String * } */ /** String -> String -> User */ function createUser(username, password) { return { "id": utils.UUID(), ...
import mongo from '../db' import utils from '../utils' /** * User :: { * id: String, * username: String, * password: String, * createdAt: String * } */ /** String -> String -> User */ function createUser(username, password) { return { "id": utils.UUID(), "username": username, ...
Use an update view instead of form view
from django.conf import settings from django.contrib.auth.decorators import login_required from django.contrib.sites.models import Site from django.core.urlresolvers import reverse from django.utils.datastructures import MultiValueDictKeyError from django.views.generic import TemplateView, UpdateView from incuna.utils ...
from django.conf import settings from django.contrib.auth.decorators import login_required from django.contrib.sites.models import Site from django.core.urlresolvers import reverse from django.views.generic import FormView, TemplateView from django.utils.datastructures import MultiValueDictKeyError from incuna.utils im...
Change deprecated call to res.json(status, body) Fixes #74
'use strict'; /** * Module dependencies. */ var mongoose = require('mongoose'), ExperimentSchema = mongoose.model('ExperimentSchema'); /** * List of Experiment schemas */ exports.list = function(req, res) { ExperimentSchema.find({}, function(err, schemas) { if (err) { res.json(500, {...
'use strict'; /** * Module dependencies. */ var mongoose = require('mongoose'), ExperimentSchema = mongoose.model('ExperimentSchema'); /** * List of Experiment schemas */ exports.list = function(req, res) { ExperimentSchema.find({}, function(err, schemas) { if (err) { res.json(500, {...
Add missingParam method to exception class.
<?php namespace Telegram\Bot\Exceptions; /** * Class CouldNotUploadInputFile. */ class CouldNotUploadInputFile extends TelegramSDKException { /** * @param $file * * @return CouldNotUploadInputFile */ public static function fileDoesNotExistOrNotReadable($file): CouldNotUploadInputFile ...
<?php namespace Telegram\Bot\Exceptions; /** * Class CouldNotUploadInputFile. */ class CouldNotUploadInputFile extends TelegramSDKException { /** * @param $file * * @return CouldNotUploadInputFile */ public static function fileDoesNotExistOrNotReadable($file): CouldNotUploadInputFile ...
Fix class BadFunctionCallException not found
<?php namespace Eris\Generator; use BadFunctionCallException; use Eris\Generator; use ReverseRegex\Lexer; use ReverseRegex\Random\SimpleRandom; use ReverseRegex\Parser; use ReverseRegex\Generator\Scope; /** * Note * and + modifiers cause an unbounded number of character to be generated (up to plus infinity) and as su...
<?php namespace Eris\Generator; use Eris\Generator; use ReverseRegex\Lexer; use ReverseRegex\Random\SimpleRandom; use ReverseRegex\Parser; use ReverseRegex\Generator\Scope; /** * Note * and + modifiers cause an unbounded number of character to be generated (up to plus infinity) and as such they are not supported. * ...
Make the window in the pyglet example larger.
# -*- coding: utf-8 -*- from __future__ import absolute_import import pyglet from pyglet import gl import imgui from imgui.integrations.pyglet import PygletRenderer def main(): window = pyglet.window.Window(width=1280, height=720, resizable=True) gl.glClearColor(1, 1, 1, 1) renderer = PygletRenderer(wi...
# -*- coding: utf-8 -*- from __future__ import absolute_import import pyglet from pyglet import gl import imgui from imgui.integrations.pyglet import PygletRenderer def main(): window = pyglet.window.Window(width=800, height=600, resizable=True) gl.glClearColor(1, 1, 1, 1) renderer = PygletRenderer(win...
CRM-4904: Refactor email body sync - Refactor migration
<?php namespace Oro\Bundle\EmailBundle\Migrations\Schema\v1_20; use Doctrine\DBAL\Schema\Schema; use Oro\Bundle\MigrationBundle\Migration\Migration; use Oro\Bundle\MigrationBundle\Migration\ParametrizedSqlMigrationQuery; use Oro\Bundle\MigrationBundle\Migration\QueryBag; use Oro\Bundle\MigrationBundle\Migration\SqlM...
<?php namespace Oro\Bundle\EmailBundle\Migrations\Schema\v1_20; use Doctrine\DBAL\Schema\Schema; use Oro\Bundle\MigrationBundle\Migration\Migration; use Oro\Bundle\MigrationBundle\Migration\QueryBag; use Oro\Bundle\MigrationBundle\Migration\SqlMigrationQuery; class OroEmailBundle implements Migration { /** ...
Add 'app' option as alias
#! /usr/bin/env node /** * Created by garusis on 31/01/17. */ import yargs from "yargs" const argv = yargs .usage("lb-migration <cmd> [args]") .command('migrate [--ds] [--models]', 'Migrate models in datasources', { d: { demand: false, alias: ["ds", "datasource"], ...
#! /usr/bin/env node /** * Created by garusis on 31/01/17. */ import yargs from "yargs" const argv = yargs .usage("lb-migration <cmd> [args]") .command('migrate [--ds] [--models]', 'Migrate models in datasources', { d: { demand: false, alias: ["ds", "datasource"], ...
Change error message in Property.
const Errors = use("core/errors"); class PropertyPrototype { constructor() { this._validators = new Set(); this._outputModifications = new Set(); } _addValidator(validateFunction) { this._validators.add(validateFunction); } _addOutputModification(outputSetter) { ...
const Errors = use("core/errors"); class PropertyPrototype { constructor() { this._validators = new Set(); this._outputModifications = new Set(); } _addValidator(validateFunction) { this._validators.add(validateFunction); } _addOutputModification(outputSetter) { ...
Use `self.stdout.write` instead of `print`
from __future__ import absolute_import import json from optparse import make_option from django.core.management.base import BaseCommand, CommandError from watchman.utils import get_checks class Command(BaseCommand): help = 'Runs the default django-watchman checks' option_list = BaseCommand.option_list + (...
from __future__ import absolute_import import json from optparse import make_option from django.core.management.base import BaseCommand, CommandError from watchman.utils import get_checks class Command(BaseCommand): help = 'Runs the default django-watchman checks' option_list = BaseCommand.option_list + (...
Use describe instead of describe.only
goog.provide('ol.test.coordinate'); describe('ol.coordinate', function() { describe('#closestOnSegment', function() { it('can handle points where the foot of the perpendicular is closest', function() { var point = [2, 5]; var segment = [[-5, 0], [10, 0]]; expect(ol.coordina...
goog.provide('ol.test.coordinate'); describe.only('ol.coordinate', function() { describe('#closestOnSegment', function() { it('can handle points where the foot of the perpendicular is closest', function() { var point = [2, 5]; var segment = [[-5, 0], [10, 0]]; expect(ol.coo...
Add `JSON_PARTIAL_OUTPUT_ON_ERROR` flag when encoding JSON responses in the exception handler This fixes the scenario when json_encode() would fail and the default PHP exception handler takes over and returns something else than JSON
<?php namespace Nord\Lumen\Core\App\Exception; use Illuminate\Http\Exception\HttpResponseException; use Illuminate\Http\JsonResponse; class ApiExceptionHandler { /** * @var bool */ private $debug; /** * ApiExceptionHandler constructor. * * @param bool $debug */ public ...
<?php namespace Nord\Lumen\Core\App\Exception; use Illuminate\Http\Exception\HttpResponseException; use Illuminate\Http\JsonResponse; class ApiExceptionHandler { /** * @var bool */ private $debug; /** * ApiExceptionHandler constructor. * * @param bool $debug */ public ...
Remove test for use_setuptools, as it fails when running under pytest because the installed version of setuptools is already present.
import sys import os import tempfile import unittest import shutil import copy CURDIR = os.path.abspath(os.path.dirname(__file__)) TOPDIR = os.path.split(CURDIR)[0] sys.path.insert(0, TOPDIR) from ez_setup import _python_cmd, _install import ez_setup class TestSetup(unittest.TestCase): def urlopen(self, url): ...
import sys import os import tempfile import unittest import shutil import copy CURDIR = os.path.abspath(os.path.dirname(__file__)) TOPDIR = os.path.split(CURDIR)[0] sys.path.insert(0, TOPDIR) from ez_setup import (use_setuptools, _python_cmd, _install) import ez_setup class TestSetup(unittest.TestCase): def url...
Change logInstructions to allow users to copy import codes
'use strict'; var yeoman = require('yeoman-generator'); var chalk = require('chalk'); var path = require('path'); module.exports = yeoman.Base.extend({ constructor: function () { yeoman.Base.apply(this, arguments); this.argument('name', {type: String, required: true}); }, initializing: { paths: func...
'use strict'; var yeoman = require('yeoman-generator'); var path = require('path'); module.exports = yeoman.Base.extend({ constructor: function () { yeoman.Base.apply(this, arguments); this.argument('name', {type: String, required: true}); }, initializing: { paths: function() { this.destinatio...