text
stringlengths
17
1.47k
positive
stringlengths
673
4.43k
negative
stringlengths
677
2.81k
Make use of the filter (syntactic sugar) for
angular.module('cheatsheet') .service('csfUserSettings', [ '$meteorSubscribe', '$meteorObject', '$q', '$timeout', '$rootScope', function($meteorSubscribe, $meteorObject, $q, $timeout, $rootScope) { var me = this; var deferred = $q.defer(); var userSettings = { ...
angular.module('cheatsheet') .service('csfUserSettings', [ '$meteorSubscribe', '$meteorObject', '$q', '$timeout', '$rootScope', function($meteorSubscribe, $meteorObject, $q, $timeout, $rootScope) { var me = this; var deferred = $q.defer(); var userSettings = { ...
Add colors to peer graph
package nl.tudelft.ti2306.blockchain; import java.io.File; import java.io.FileNotFoundException; import java.io.PrintWriter; import nl.tudelft.ti2306.blockchain.datastructure.PeerGraph; public class PeerGraphToViz implements Runnable { private PeerGraph graph; private String output; public PeerGraphToV...
package nl.tudelft.ti2306.blockchain; import java.io.File; import java.io.FileNotFoundException; import java.io.PrintWriter; import nl.tudelft.ti2306.blockchain.datastructure.PeerGraph; public class PeerGraphToViz implements Runnable { private PeerGraph graph; private String output; public PeerGraphToV...
Exclude ids from filter search
/** * Client class that talks to bugzilla */ const BZ_DOMAIN = "https://bugzilla.mozilla.org"; const REST_BUG = "/rest/bug"; export default { getBugs: function(bugIds) { if (!Array.isArray(bugIds)) { bugIds = [bugIds]; } let url = BZ_DOMAIN + REST_BUG + "?id=" + bugIds.join(","); return thi...
/** * Client class that talks to bugzilla */ const BZ_DOMAIN = "https://bugzilla.mozilla.org"; const REST_BUG = "/rest/bug"; export default { getBugs: function(bugIds) { if (!Array.isArray(bugIds)) { bugIds = [bugIds]; } let url = BZ_DOMAIN + REST_BUG + "?id=" + bugIds.join(","); return thi...
Fix bug when modifying the startFrame of a layer Two events were sent to the server at once, which triggered a double simultaneous write of layers.json. This mostly resulted in the endFrame update overwriting the startFrame update, and sometimes even an extra `]` at the end of the file for some mysterious reason.
'use strict'; angular.module('nin') .controller('BottomCtrl', function ($scope, $interval, socket) { var linesContainer = null; $scope.onBottomScroll = function(event) { linesContainer = event.target; $scope.bottomScrollOffset = event.target.scrollLeft; }; $scope.musicLayerClick = func...
'use strict'; angular.module('nin') .controller('BottomCtrl', function ($scope, $interval, socket) { var linesContainer = null; $scope.onBottomScroll = function(event) { linesContainer = event.target; $scope.bottomScrollOffset = event.target.scrollLeft; }; $scope.musicLayerClick = func...
Add active class to current breadcrumb
<?php namespace Coreplex\Crumbs\Renderers; use Coreplex\Crumbs\Contracts\Renderer as Contract; use Coreplex\Crumbs\Contracts\Container; class Basic implements Contract { /** * Render the breadcrumbs from the container * * @return string */ public function render(Container $container) ...
<?php namespace Coreplex\Crumbs\Renderers; use Coreplex\Crumbs\Contracts\Renderer as Contract; use Coreplex\Crumbs\Contracts\Container; class Basic implements Contract { /** * Render the breadcrumbs from the container * * @return string */ public function render(Container $container) ...
Increase python compatibility version and bump to v1.2.0
#!/usr/bin/env python # -*- coding: utf-8 -*- try: from setuptools import setup except ImportError: from distutils.core import setup long_description = """ Django URL routing system DRYed. """ requirements = [ 'django>=1.9', 'six', ] test_requirements = [ 'mock', 'coveralls' ] setup( ...
#!/usr/bin/env python # -*- coding: utf-8 -*- try: from setuptools import setup except ImportError: from distutils.core import setup long_description = """ Django URL routing system DRYed. """ requirements = [ 'django>=1.8', 'six', ] test_requirements = [ 'mock', 'coveralls' ] setup( ...
Remove --ip=* from ipcontroller command
""" IPython.parallel utilities. """ import os import subprocess import time import uuid class LocalCluster(object): """ Start an IPython.parallel cluster on localhost. Parameters ---------- n_engines : int Number of engines to initialize. """ def __init__(self, n_engines): ...
""" IPython.parallel utilities. """ import os import subprocess import time import uuid class LocalCluster(object): """ Start an IPython.parallel cluster on localhost. Parameters ---------- n_engines : int Number of engines to initialize. """ def __init__(self, n_engines): ...
Fix relative animation of list values
from kivy.animation import Animation class RelativeAnimation(Animation): """Class that extends the Kivy Animation base class to add relative animation property target values that are calculated when the animation starts.""" def _initialize(self, widget): """Initializes the animation and calculat...
from kivy.animation import Animation class RelativeAnimation(Animation): """Class that extends the Kivy Animation base class to add relative animation property target values that are calculated when the animation starts.""" def _initialize(self, widget): """Initializes the animation and calculat...
Fix tests on Python 2
# -*- coding: utf-8; -*- import re from jenkins_autojobs import main def test_filter_jobs(): class Job: def __init__(self, name): self.name = name class jenkins: @staticmethod def view_jobs(x): return { 'v1': [Job('scratch-one'), Job('scratch-...
# -*- coding: utf-8; -*- import re from jenkins_autojobs import main def test_filter_jobs(): class Job: def __init__(self, name): self.name = name class jenkins: pass names = ['feature-one', 'feature-two', 'release-one', 'release-two'] jenkins.jobs = [Job(i) for i in na...
Add $query to log output on caught graphql request errors
<?php namespace Rogue\Services; use Illuminate\Support\Facades\Log; use Softonic\GraphQL\ClientBuilder; class GraphQL { /** * Build a new GraphQL client. */ public function __construct() { $this->client = ClientBuilder::build(config('services.graphql.url')); } /** * Run a ...
<?php namespace Rogue\Services; use Illuminate\Support\Facades\Log; use Softonic\GraphQL\ClientBuilder; class GraphQL { /** * Build a new GraphQL client. */ public function __construct() { $this->client = ClientBuilder::build(config('services.graphql.url')); } /** * Run a ...
Add a default date format
<?php $db_core = require(__DIR__ . '/db_core.php'); $db_bank = require(__DIR__ . '/db_bank.php'); $db_openerp = require(__DIR__ . '/db_openerp.php'); Yii::setAlias('@base', dirname(dirname(__DIR__))); return [ 'vendorPath' => dirname(dirname(__DIR__)) . '/vendor', 'extensions' => require(__DIR__ . '/../../vend...
<?php $db_core = require(__DIR__ . '/db_core.php'); $db_bank = require(__DIR__ . '/db_bank.php'); $db_openerp = require(__DIR__ . '/db_openerp.php'); Yii::setAlias('@base', dirname(dirname(__DIR__))); return [ 'vendorPath' => dirname(dirname(__DIR__)) . '/vendor', 'extensions' => require(__DIR__ . '/../../vend...
Use normal link for download Or the frontend will shortcut and not find it
// @flow import { List, ListItem } from "material-ui/List"; import Subheader from "material-ui/Subheader"; import * as React from "react"; import { createFragmentContainer, graphql } from "react-relay"; import GroupscoreListGroupscore from "./__generated__/GroupscoreList_groupscore.graphql"; type Props = { groupsc...
// @flow import Link from "found/lib/Link"; import { List, ListItem } from "material-ui/List"; import Subheader from "material-ui/Subheader"; import * as React from "react"; import { createFragmentContainer, graphql } from "react-relay"; import GroupscoreListGroupscore from "./__generated__/GroupscoreList_groupscore....
Add BitBar metadata, working app
#!/usr/bin/env /usr/local/bin/node const bitbar = require('bitbar'); const request = require('superagent'); const moment = require('moment'); var busStop = 18610; var busAPIKey = 'TEST'; var busAPI = `http://api.pugetsound.onebusaway.org/api/where/arrivals-and-departures-for-stop/1_${busStop}.json?key=${busAPIKey}`; ...
#!/usr/bin/env /usr/local/bin/node const bitbar = require('bitbar'); const request = require('superagent'); const moment = require('moment'); var busStop = 18610; var busAPIKey = 'TEST'; var busAPI = `http://api.pugetsound.onebusaway.org/api/where/arrivals-and-departures-for-stop/1_${busStop}.json?key=${busAPIKey}`; ...
Support facets in the url that don't exist yet For example, the page first loads with a domain=Vivaldi facet in the URL. But there is no such domain, because domains are not loaded for another .1 second. So the facet is in the URL but not the search bar. With this fix, when domains are loaded and the facet JSON is upd...
angular.module('MagicSearch', ['ui.bootstrap']) .directive('magicOverrides', function() { return { restrict: 'A', controller: function($scope) { // showMenu and hideMenu depend on foundation's dropdown. They need // to be modified to work with another ...
angular.module('MagicSearch', ['ui.bootstrap']) .directive('magicOverrides', function() { return { restrict: 'A', controller: function($scope) { // showMenu and hideMenu depend on foundation's dropdown. They need // to be modified to work with another ...
Rename create_dirs method to makedirs in line with os.path method
# -*- coding: utf-8 -*- """ file: model_files.py Graph model classes for working with files """ import os import logging from lie_graph.graph_mixin import NodeEdgeToolsBaseClass class FilePath(NodeEdgeToolsBaseClass): @property def exists(self): path = self.get() if path: ret...
# -*- coding: utf-8 -*- """ file: model_files.py Graph model classes for working with files """ import os import logging from lie_graph.graph_mixin import NodeEdgeToolsBaseClass class FilePath(NodeEdgeToolsBaseClass): @property def exists(self): path = self.get() if path: ret...
Remove old data retrieval, replace error condition
(function(env) { env.ddg_spice_meta_cpan = function(api_result) { "use strict"; if ( !api_result || api_result.hits.hits.length < 1 ) { return DDH.failed('meta_cpan'); } Spice.add({ id: "meta_cpan", name: "Software", data: { ...
(function(env) { env.ddg_spice_meta_cpan = function(api_result) { "use strict"; if (!(api_result && api_result.author && api_result.version)) { return Spice.failed('meta_cpan'); } var script = $('[src*="/js/spice/meta_cpan/"]')[0], source = $(script).attr("sr...
Move token handling from tag function to CSSAssetTagNode
from __future__ import absolute_import from django.template import Node, Library, TemplateSyntaxError from gears.assets import build_asset from ..settings import environment, GEARS_URL, GEARS_DEBUG register = Library() class CSSAssetTagNode(Node): template = u'<link rel="stylesheet" href="%s%%s">' % GEARS_URL ...
from __future__ import absolute_import from django.template import Node, Library, TemplateSyntaxError from gears.assets import build_asset from ..settings import environment, GEARS_URL, GEARS_DEBUG register = Library() class CSSAssetTagNode(Node): template = u'<link rel="stylesheet" href="%s%%s">' % GEARS_URL ...
Make wand plugin cleanup after itself. If you disabled the wand plugin, the currently outlined element would stay outlined. This change fixes that.
/** * Allows users to see what screen readers would see. */ let $ = require("jquery"); let Plugin = require("../base"); require("./style.less"); class A11yTextWand extends Plugin { getTitle() { return "Screen Reader Wand"; } getDescription() { return "Hover over elements to view them a...
/** * Allows users to see what screen readers would see. */ let $ = require("jquery"); let Plugin = require("../base"); require("./style.less"); class A11yTextWand extends Plugin { getTitle() { return "Screen Reader Wand"; } getDescription() { return "Hover over elements to view them a...
Remove custom icon and name, this should be set from slack webhook configuration page
<?php namespace MathieuImbert\Slack\Logger; class SlackRequest { private $webhookUrl; /** * SlackRequest constructor. * @param string $webhookUrl */ public function __construct($webhookUrl) { $this->webhookUrl = $webhookUrl; } public function post($text) { ...
<?php namespace MathieuImbert\Slack\Logger; class SlackRequest { private $webhookUrl; /** * SlackRequest constructor. * @param string $webhookUrl */ public function __construct($webhookUrl) { $this->webhookUrl = $webhookUrl; } public function post($text) { ...
Rename method name (stop -> pause)
/*global MusicPlayer, Vue */ (function (global, undefined) { 'use strict'; document.addEventListener('DOMContentLoaded', function () { var musicPlayer = new MusicPlayer(); var hasSource = false; var isPlay = false; new Vue({ el: '#app', data: { ...
/*global MusicPlayer, Vue */ (function (global, undefined) { 'use strict'; document.addEventListener('DOMContentLoaded', function () { var musicPlayer = new MusicPlayer(); var hasSource = false; var isPlay = false; new Vue({ el: '#app', data: { ...
Change accoring to PR comments. moving code inside if block
<?php namespace Omise\Payment\Block\Checkout\Onepage\Success; class PaynowAdditionalInformation extends \Magento\Framework\View\Element\Template { /** * @var \Magento\Checkout\Model\Session */ protected $_checkoutSession; /** * @param \Magento\Framework\View\Element\Template\Context $contex...
<?php namespace Omise\Payment\Block\Checkout\Onepage\Success; class PaynowAdditionalInformation extends \Magento\Framework\View\Element\Template { /** * @var \Magento\Checkout\Model\Session */ protected $_checkoutSession; /** * @param \Magento\Framework\View\Element\Template\Context $contex...
Increment version for multichannel splitting
__doc__ = """ Manipulate audio with an simple and easy high level interface. See the README file for details, usage info, and a list of gotchas. """ from setuptools import setup setup( name='pydub', version='0.19.0', author='James Robert', author_email='jiaaro@gmail.com', description='Manipulate ...
__doc__ = """ Manipulate audio with an simple and easy high level interface. See the README file for details, usage info, and a list of gotchas. """ from setuptools import setup setup( name='pydub', version='0.18.0', author='James Robert', author_email='jiaaro@gmail.com', description='Manipulate ...
Change installation path for nipap-passwd This really is a "admin tool" and so we put it in /usr/sbin instead! Fixes #196
#!/usr/bin/env python from distutils.core import setup import nipap long_desc = open('README.rst').read() short_desc = long_desc.split('\n')[0].split(' - ')[1].strip() setup( name = 'nipap', version = nipap.__version__, description = short_desc, long_description = long_desc, author = nipap.__aut...
#!/usr/bin/env python from distutils.core import setup import nipap long_desc = open('README.rst').read() short_desc = long_desc.split('\n')[0].split(' - ')[1].strip() setup( name = 'nipap', version = nipap.__version__, description = short_desc, long_description = long_desc, author = nipap.__aut...
Fix problem with missing semicolon The minified source was dealing with it, we need to deal with it only for the non-minified variant.
import { terser } from 'rollup-plugin-terser' import filesize from 'rollup-plugin-filesize' import license from 'rollup-plugin-license' export default [ { input: 'src/js.cookie.mjs', output: [ // config for <script type="module"> { dir: 'dist', entryFileNames: '[name].mjs', ...
import { terser } from 'rollup-plugin-terser' import filesize from 'rollup-plugin-filesize' import license from 'rollup-plugin-license' export default [ { input: 'src/js.cookie.mjs', output: [ // config for <script type="module"> { dir: 'dist', entryFileNames: '[name].mjs', ...
Add user agent so we don't get bounced by sites requiring it (e.g. SoundCloud)
'use strict'; var request = require( 'request' ), cheerio = require( 'cheerio' ), urlChecker = { bot : false, setup : function( bot ){ var _this = this, channel; _this.bot = bot; for( channel in _this.bot.opt.channels ){ if( _t...
'use strict'; var request = require( 'request' ), cheerio = require( 'cheerio' ), urlChecker = { bot : false, setup : function( bot ){ var _this = this, channel; _this.bot = bot; for( channel in _this.bot.opt.channels ){ if( _t...
Allow negative values, only mask -9999
import numpy def import_climate_data(filepath, monthnr): ncols = 720 nrows = 360 digits = 5 with open(filepath, 'r') as filein: lines = filein.readlines() line_n = 0 grid_size = 0.50 xmin = 0.25 xmax = 360.25 ymin = -89.75 ymax = 90.25 ...
import numpy def import_climate_data(filepath, monthnr): ncols = 720 nrows = 360 digits = 5 with open(filepath, 'r') as filein: lines = filein.readlines() line_n = 0 grid_size = 0.50 xmin = 0.25 xmax = 360.25 ymin = -89.75 ymax = 90.25 ...
[BJA-271] Add synchronized keyword to prevent concurrency issues in lazy parsing
package org.bouncycastle.asn1; import java.io.IOException; import java.util.Enumeration; public class LazyDERSequence extends DERSequence { private byte[] encoded; private boolean parsed = false; private int size = -1; LazyDERSequence( byte[] encoded) throws IOException { ...
package org.bouncycastle.asn1; import java.io.IOException; import java.util.Enumeration; public class LazyDERSequence extends DERSequence { private byte[] encoded; private boolean parsed = false; private int size = -1; LazyDERSequence( byte[] encoded) throws IOException { ...
Cache: Add initial implementation of the bulk updates
import copy import vim from taskwiki.task import VimwikiTask class TaskCache(object): """ A cache that holds all the tasks in the given file and prevents multiple redundant taskwarrior calls. """ def __init__(self, tw): self.uuid_cache = dict() self.cache = dict() self.tw...
import copy import vim from taskwiki.task import VimwikiTask class TaskCache(object): """ A cache that holds all the tasks in the given file and prevents multiple redundant taskwarrior calls. """ def __init__(self, tw): self.uuid_cache = dict() self.cache = dict() self.tw...
ENH: Add test that fails *if* 'all' is not working
from nose.tools import assert_in, assert_equal from bluesky.run_engine import RunEngine from bluesky.examples import * from nose.tools import raises RE = None def setup(): global RE RE = RunEngine() def exception_raiser(doc): raise Exception("Hey look it's an exception that better not kill the " ...
from nose.tools import assert_in, assert_equal from bluesky.run_engine import RunEngine from bluesky.examples import * RE = None def setup(): global RE RE = RunEngine() def test_main_thread_callback_exceptions(): def callbacker(doc): raise Exception("Hey look it's an exception that better not ...
Throw RuntimeException is scandir returns false.
<?php /** * Utility class that works with deleting files and directories. */ class DeleteUtils { /** * Delete all files and directories within the root directory. * * @param String The absolute path to the root directory. */ public static function rm_dir($path) { f...
<?php /** * Utility class that works with deleting files and directories. */ class DeleteUtils { /** * Delete all files and directories within the root directory. * * @param String The absolute path to the root directory. */ public static function rm_dir($path) { f...
Drop data on server relaunch
/** * Default model configuration * (sails.config.models) * * Unless you override them, the following properties will be included * in each of your models. * * For more info on Sails models, see: * http://sailsjs.org/#!/documentation/concepts/ORM */ module.exports.models = { /******************************...
/** * Default model configuration * (sails.config.models) * * Unless you override them, the following properties will be included * in each of your models. * * For more info on Sails models, see: * http://sailsjs.org/#!/documentation/concepts/ORM */ module.exports.models = { /******************************...
Add reset on rotation support in log processor.
import re import snmpy class log_processor(snmpy.plugin): def create(self): for k, v in sorted(self.conf['objects'].items()): extra = { 'count': re.compile(v['count']), 'reset': re.compile(v['reset']) if 'reset' in v else None, 'start': int(v['...
import re import snmpy class log_processor(snmpy.plugin): def create(self): for k, v in sorted(self.conf['objects'].items()): extra = { 'count': re.compile(v['count']), 'reset': re.compile(v['reset']) if 'reset' in v else None, 'start': int(v['sta...
Initialize doctrine models when storage is doctrine
<?php namespace Tbbc\MoneyBundle\DependencyInjection\Compiler; use Doctrine\Bundle\DoctrineBundle\DependencyInjection\Compiler\DoctrineOrmMappingsPass; use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface; use Symfony\Component\DependencyInjection\ContainerBuilder; use Symfony\Component\DependencyI...
<?php namespace Tbbc\MoneyBundle\DependencyInjection\Compiler; use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface; use Symfony\Component\DependencyInjection\ContainerBuilder; use Symfony\Component\DependencyInjection\Definition; use Symfony\Component\DependencyInjection\Reference; /** * Class S...
Change wording to use response
import requests, json from resources.urls import FACEBOOK_MESSAGES_POST_URL class HttpClient(): """ Client which excutes the call to facebook's messenger api """ def submit_request(self, path, method, payload, completion): assert len(path) > 0 path = self.get_api_url(pa...
import requests, json from resources.urls import FACEBOOK_MESSAGES_POST_URL class HttpClient(): """ Client which excutes the call to facebook's messenger api """ def submit_request(self, path, method, payload, completion): assert len(path) > 0 path = self.get_api_url(pa...
Support no context with tLog
<?php /** * @license MIT * @copyright 2017 Tim Gunter */ namespace Kaecyra\AppCommon\Log\Tagged; /** * Tagged log trait * * @author Tim Gunter <tim@vanillaforums.com> * @package app-common */ trait TaggedLogTrait { /** * Log tag * @var string|Callable */ protected $logTag = null; ...
<?php /** * @license MIT * @copyright 2017 Tim Gunter */ namespace Kaecyra\AppCommon\Log\Tagged; /** * Tagged log trait * * @author Tim Gunter <tim@vanillaforums.com> * @package app-common */ trait TaggedLogTrait { /** * Log tag * @var string|Callable */ protected $logTag = null; ...
Add initialProgress property to make start from the given value
var React = require('react-native'); var { Animated, Easing, StyleSheet, View } = React; var styles = StyleSheet.create({ background: { backgroundColor: '#bbbbbb', height: 5, overflow: 'hidden' }, fill: { backgroundColor: '#3b5998', height: 5 } }); var ProgressBar = React.createCl...
var React = require('react-native'); var { Animated, Easing, StyleSheet, View } = React; var styles = StyleSheet.create({ background: { backgroundColor: '#bbbbbb', height: 5, overflow: 'hidden' }, fill: { backgroundColor: '#3b5998', height: 5 } }); var ProgressBar = React.createCl...
Convert FlowToolsLog to a class
# flowtools_wrapper.py # Copyright 2014 Bo Bayles (bbayles@gmail.com) # See http://github.com/bbayles/py3flowtools for documentation and license from __future__ import division, print_function, unicode_literals import io import os import sys from .flow_line import FlowLine if sys.version_info.major < 3: import ...
# flowtools_wrapper.py # Copyright 2014 Bo Bayles (bbayles@gmail.com) # See http://github.com/bbayles/py3flowtools for documentation and license from __future__ import division, print_function, unicode_literals import io import os import sys from .flow_line import FlowLine if sys.version_info.major < 3: import ...
Remove reset method for database class
<?php /* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. */ namespace acd; /** * Description of database * * @author Acidvertigo */ class Database { /** @var object|null **/ ...
<?php /* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. */ namespace acd; /** * Description of database * * @author Acidvertigo */ class Database { /** @var object|null **/ ...
Remove reference to deprecated TicketDB class
<?php ini_set('display_errors', 1); error_reporting(E_ALL); require_once('class.TicketAdminPage.php'); $page = new TicketAdminPage('Burning Flipside - Tickets'); $page->add_js(JS_DATATABLE, false); $page->add_css(CSS_DATATABLE); $page->add_js_from_src('js/sold_tickets.js'); $page->body .= ' <div class="row"> ...
<?php ini_set('display_errors', 1); error_reporting(E_ALL); require_once('class.TicketAdminPage.php'); require_once('class.FlipsideTicketDB.php'); $page = new TicketAdminPage('Burning Flipside - Tickets'); $page->add_js(JS_DATATABLE); $page->add_css(CSS_DATATABLE); $page->add_js_from_src('js/sold_tickets.js'); $page-...
Attach prefix path resolver at end of chain of aggregate resolver
<?php /** * Zend Framework (http://framework.zend.com/) * * @link http://github.com/zendframework/zf2 for the canonical source repository * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ namespace ...
<?php /** * Zend Framework (http://framework.zend.com/) * * @link http://github.com/zendframework/zf2 for the canonical source repository * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ namespace ...
Fix for fatal error with renamned DispatchesCommands trait
<?php namespace Laravel\Lumen\Routing; use Illuminate\Http\Request; abstract class Controller { use DispatchesJobs, ValidatesRequests; /** * The middleware defined on the controller. * * @var array */ protected $middleware = []; /** * Define a middleware on the controller. ...
<?php namespace Laravel\Lumen\Routing; use Illuminate\Http\Request; abstract class Controller { use DispatchesCommands, ValidatesRequests; /** * The middleware defined on the controller. * * @var array */ protected $middleware = []; /** * Define a middleware on the controlle...
Replace .bind with @bind decorator
import { h, Component } from 'preact' import { bind } from './util' export default class extends Component { constructor() { super() this.state.show = false } linkState(key) { return e => this.setState({ [key]: e.target.value }) } @bind toggleShow() { this.setState({ show: !...
import { h, Component } from 'preact' export default class extends Component { constructor() { super() this.state.show = false } linkState(key) { return e => this.setState({ [key]: e.target.value }) } toggleShow() { this.setState({ show: !this.state.show }) } clearStat...
[Fields] Fix du min et du max
<?php namespace Gregwar\DSD\Fields; /** * Nombre * * @author Grégoire Passault <g.passault@gmail.com> */ class NumberField extends Field { /** * Valeur minimum */ private $min = null; /** * Valeur maximum */ private $max = null; public function __construct() { ...
<?php namespace Gregwar\DSD\Fields; /** * Nombre * * @author Grégoire Passault <g.passault@gmail.com> */ class NumberField extends Field { /** * Valeur minimum */ private $min = null; /** * Valeur maximum */ private $max = null; public function __construct() { ...
Fix a typo bug referencing headers
const responseFromObject = (mockResponse, response) => { // statusCode if (mockResponse.statusCode) { response.statusCode = mockResponse.statusCode } // statusMessage if (mockResponse.statusMessage) { response.statusMessage = mockResponse.statusMessage } // headers if (mo...
const responseFromObject = (mockResponse, response) => { // statusCode if (mockResponse.statusCode) { response.statusCode = mockResponse.statusCode } // statusMessage if (mockResponse.statusMessage) { response.statusMessage = mockResponse.statusMessage } // headers if (mo...
Replace \Criteria with \ModelCriteria, as in the pagination subscriber
<?php namespace Knp\Component\Pager\Event\Subscriber\Sortable; use Symfony\Component\EventDispatcher\EventSubscriberInterface; use Knp\Component\Pager\Event\ItemsEvent; class PropelQuerySubscriber implements EventSubscriberInterface { public function items(ItemsEvent $event) { $query = $event->target...
<?php namespace Knp\Component\Pager\Event\Subscriber\Sortable; use Symfony\Component\EventDispatcher\EventSubscriberInterface; use Knp\Component\Pager\Event\ItemsEvent; class PropelQuerySubscriber implements EventSubscriberInterface { public function items(ItemsEvent $event) { $query = $event->target...
Update troposphere & awacs to latest releases
import os from setuptools import setup, find_packages import glob VERSION = "0.6.3" src_dir = os.path.dirname(__file__) install_requires = [ "troposphere>=1.8.0", "boto3>=1.3.1", "botocore>=1.4.38", "PyYAML>=3.11", "awacs>=0.6.0", "colorama==0.3.7", ] tests_require = [ "nose>=1.0", "...
import os from setuptools import setup, find_packages import glob VERSION = "0.6.3" src_dir = os.path.dirname(__file__) install_requires = [ "troposphere>=1.2.2", "boto3>=1.3.1", "botocore>=1.4.38", "PyYAML>=3.11", "awacs>=0.5.3", "colorama==0.3.7", ] tests_require = [ "nose>=1.0", "...
Set timeout of five minutes
'use strict'; const mocha = require('mocha'); const BaseWorker = require('./BaseWorker'); const EventsBus = require('../libs/EventsBus'); const Util = require('../libs/Util'); class MochaWorker extends BaseWorker { constructor(scenario) { super(scenario); this._mocha = new mocha(); } setu...
'use strict'; const mocha = require('mocha'); const BaseWorker = require('./BaseWorker'); const EventsBus = require('../libs/EventsBus'); const Util = require('../libs/Util'); class MochaWorker extends BaseWorker { constructor(scenario) { super(scenario); this._mocha = new mocha(); } setu...
Add conflict to dyncss to ensure correct less rendering
<?php /*************************************************************** * Extension Manager/Repository config file for ext "bootstrap_package". ***************************************************************/ $EM_CONF[$_EXTKEY] = array ( 'title' => 'Bootstrap Package', 'description' => 'Boostrap Package deli...
<?php /*************************************************************** * Extension Manager/Repository config file for ext "bootstrap_package". ***************************************************************/ $EM_CONF[$_EXTKEY] = array ( 'title' => 'Bootstrap Package', 'description' => 'Boostrap Package deli...
Add description of LetBindings and LetBinding, which were missing from document
/** * Abstract Syntax Tree. * * <pre> * Group ::= Abbreviation* Definition* * * Definition ::= Test | FourPhaseTest | Table * * Test ::= Assertion* * * Assertion ::= Proposition* Fixture * * Proposition ::= QuotedExpr Predicate * * Predicate ::= IsPredicate | IsNotPredicate | ThrowsPre...
/** * Abstract Syntax Tree. * * <pre> * Group ::= Abbreviation* Definition* * * Definition ::= Test | FourPhaseTest | Table * * Test ::= Assertion* * * Assertion ::= Proposition* Fixture * * Proposition ::= QuotedExpr Predicate * * Predicate ::= IsPredicate | IsNotPredicate | ThrowsPre...
Disable and run and help commands; don't read settings.
import argparse, os, sys from .. import log from .. project.importer import import_symbol from .. project.preset_library import PresetLibrary __all__ = ['main'] COMMANDS = ('all_pixel', 'devices', 'demo', 'run') # 'set', 'show') MODULES = {c: import_symbol('.' + c, 'bibliopixel.main') for c in COMMANDS} PRESET_LIBRA...
import argparse, os, sys from .. import log from .. project.importer import import_symbol from .. project.preset_library import PresetLibrary __all__ = ['main'] COMMANDS = ('all_pixel', 'devices', 'demo', 'run', 'set', 'show') MODULES = {c: import_symbol('.' + c, 'bibliopixel.main') for c in COMMANDS} PRESET_LIBRARY_...
Remove python 3 syntax for python 2 compatibility
from django.contrib.auth.models import AnonymousUser from django.db.models.base import ModelBase from django.test import TestCase from rest_framework.test import APIRequestFactory, force_authenticate from . import factories class AbstractModelTestCase(TestCase): """ Base class for tests of model mixins. To use, ...
from django.contrib.auth.models import AnonymousUser from django.db.models.base import ModelBase from django.test import TestCase from rest_framework.test import APIRequestFactory, force_authenticate from . import factories class AbstractModelTestCase(TestCase): """ Base class for tests of model mixins. To use, ...
Delete margin-right class from nav
import React, { Component } from 'react' import { Link, IndexLink } from 'react-router' export class Nav extends Component { constructor(props) { super(props) } render() { return ( <nav className="navbar navbar-default"> <div className="container-fluid"> <div className="collapse ...
import React, { Component } from 'react' import { Link, IndexLink } from 'react-router' export class Nav extends Component { constructor(props) { super(props) } render() { return ( <nav className="navbar navbar-default"> <div className="container-fluid"> <div className="collapse ...
Add route to own profile
var winston = require('winston'); var path = require('path'); global.APP_NAME = "proxtop"; global.PROXER_BASE_URL = "https://proxer.me"; global.INDEX_LOCATION = __dirname + "../../index.html"; global.PROXER_PATHS = { ROOT: '/', LOGIN: '/component/user/?task=user.login', WATCHLIST: '/ucp?s=reminder', OW...
var winston = require('winston'); var path = require('path'); global.APP_NAME = "proxtop"; global.PROXER_BASE_URL = "https://proxer.me"; global.INDEX_LOCATION = __dirname + "../../index.html"; global.PROXER_PATHS = { ROOT: '/', LOGIN: '/component/user/?task=user.login', WATCHLIST: '/ucp?s=reminder' }; try ...
Split up the tests for AuthorizationToken
from django.test import TestCase from django.contrib.auth.models import User from doac.models import AuthorizationToken, Client, RefreshToken, Scope class TestAuthorizationTokenModel(TestCase): def setUp(self): self.oclient = Client(name="Test Client", access_host="http://localhost/") self.oclien...
from django.test import TestCase from django.contrib.auth.models import User from doac.models import AuthorizationToken, Client, RefreshToken, Scope class TestAuthorizationTokenModel(TestCase): def setUp(self): self.oclient = Client(name="Test Client", access_host="http://localhost/") self.oclien...
Use absolute path for config file so it works with apps like Hazel
from os import path from ConfigParser import ConfigParser import requests import sys def reverse_lookup(lat, lon): if(lat is None or lon is None): return None config_file = '%s/config.ini' % path.dirname(path.dirname(path.abspath(__file__))) if not path.exists(config_file): return None ...
from os import path from ConfigParser import ConfigParser import requests import sys def reverse_lookup(lat, lon): if(lat is None or lon is None): return None if not path.exists('./config.ini'): return None config = ConfigParser() config.read('./config.ini') if('MapQuest' ...
Check for parent filterable fields as well as local filterable fields
from rest_framework import serializers as ser from api.base.serializers import JSONAPISerializer, LinksField, Link class UserSerializer(JSONAPISerializer): filterable_fields = frozenset([ 'fullname', 'given_name', 'middle_name', 'family_name', 'id' ]) id = ser.Char...
from rest_framework import serializers as ser from api.base.serializers import JSONAPISerializer, LinksField, Link class UserSerializer(JSONAPISerializer): filterable_fields = frozenset([ 'fullname', 'given_name', 'middle_name', 'family_name', 'id' ]) id = ser.Char...
Add TODOs on how to expose non-playable tracks
from __future__ import unicode_literals from mopidy import models import spotify def to_track(sp_track): if not sp_track.is_loaded: return # TODO Return placeholder "[loading]" track? if sp_track.error != spotify.ErrorType.OK: return # TODO Return placeholder "[error]" track? if sp_t...
from __future__ import unicode_literals from mopidy import models import spotify def to_track(sp_track): if not sp_track.is_loaded: return if sp_track.error != spotify.ErrorType.OK: return if sp_track.availability != spotify.TrackAvailability.AVAILABLE: return # TODO artis...
Use cluster length of 3
import random __metaclass__ = type class Generator: def __init__(self, data): if isinstance(data, str): data = data.split('\n') self.clusters = [] for item in data: if item.find(' ') < 0: item += ' ' name, info = item.split(' ', 2) ...
import random __metaclass__ = type class Generator: def __init__(self, data): if isinstance(data, str): data = data.split('\n') self.clusters = [] for item in data: if item.find(' ') < 0: item += ' ' name, info = item.split(' ', 2) ...
Check if App is running in console :bug:
<?php namespace JarydKrish\ErrorLogger; use App; use Backend; use BackendAuth; use Illuminate\Foundation\AliasLoader; use System\Classes\PluginBase; /** * ErrorLogger Plugin Information File */ class Plugin extends PluginBase { /** * Returns information about this plugin. * * @return array *...
<?php namespace JarydKrish\ErrorLogger; use App; use Backend; use BackendAuth; use Illuminate\Foundation\AliasLoader; use System\Classes\PluginBase; /** * ErrorLogger Plugin Information File */ class Plugin extends PluginBase { /** * Returns information about this plugin. * * @return array *...
Improve printing of signature and version
#!/usr/bin/env python # # Copyright (c) 2017 Ralf Horstmann <ralf@ackstorm.de> # # Permission to use, copy, modify, and distribute this software for any # purpose with or without fee is hereby granted, provided that the above # copyright notice and this permission notice appear in all copies. # # THE SOFTWARE IS PRO...
#!/usr/bin/env python # # Copyright (c) 2017 Ralf Horstmann <ralf@ackstorm.de> # # Permission to use, copy, modify, and distribute this software for any # purpose with or without fee is hereby granted, provided that the above # copyright notice and this permission notice appear in all copies. # # THE SOFTWARE IS PRO...
Fix navbar outside html tags
@extends('main') @section('head') <style> .row { margin-top: 5%; } #meme { display: block; margin-left: auto; margin-right: auto; } #progress { margin-top: 1%; } </style> @endsect...
@extends('main') @section('head') <style> .row { margin-top: 5%; } #meme { display: block; margin-left: auto; margin-right: auto; } #progress { margin-top: 1%; } </style> @endsect...
Fix padding error in sample app view data
<?php class ViewData { /** * @var int $time */ private $time; /** * @var float $distance */ private $distance; const SPEED_PRECISION = 2; public function __construct() { $this->time = $_POST['time']; $this->distance = $_POST['distance']; } /**...
<?php class ViewData { /** * @var int $time */ private $time; /** * @var float $distance */ private $distance; const SPEED_PRECISION = 2; public function __construct() { $this->time = $_POST['time']; $this->distance = $_POST['distance']; } /**...
Fix a bug launching a posix executable
# coding: utf-8 from __future__ import unicode_literals, division, absolute_import, print_function import sys import os import subprocess def launch_executable(executable, args, cwd, env=None): """ Launches an executable with optional arguments :param executable: A unicode string of an executabl...
# coding: utf-8 from __future__ import unicode_literals, division, absolute_import, print_function import sys import os import subprocess def launch_executable(executable, args, cwd, env=None): """ Launches an executable with optional arguments :param executable: A unicode string of an executabl...
Correct which to not through... ...this was the whole point of it.
var spawn = require('child_process').spawn; var _which = require('which'); function which (prog) { try { return _which.sync(prog); } catch (err) { if (err.message === 'not found: ' + prog) { return null; } else { throw err; } } } module.exports.trans...
var spawn = require('child_process').spawn; var which = require('which'); module.exports.transformer = childProcTransformer; module.exports.transform = childProcTransform; function childProcTransformer(prog, transformer) { var cmd = which.sync(prog); if (!cmd) return noopTransformer; return subTransformer...
Add link to club name
<h1>打卡紀錄</h1> <ul class="list-group"> @forelse($records as $record) <li class="list-group-item"> <div> <h4>{{ link_to_route('clubs.show', $record->club->name, $record->club) }} {!! $record->club->clubType->tag ?? '' !!} @if(!$record->club->...
<h1>打卡紀錄</h1> <ul class="list-group"> @forelse($records as $record) <li class="list-group-item"> <div> <h4>{{ $record->club->name }} {!! $record->club->clubType->tag ?? '' !!} @if(!$record->club->is_counted) <span cl...
Revert "Make tick thicker to facilitate hovering" This reverts commit a90e6f1f92888e0904bd50d67993ab23ccec1a38.
'use strict'; // Service for the spec config. // We keep this separate so that changes are kept even if the spec changes. angular.module('vlui') .factory('Config', function() { var Config = {}; Config.data = {}; Config.config = {}; Config.getConfig = function() { return {}; }; Config...
'use strict'; // Service for the spec config. // We keep this separate so that changes are kept even if the spec changes. angular.module('vlui') .factory('Config', function() { var Config = {}; Config.data = {}; Config.config = {}; Config.getConfig = function() { return {}; }; Config...
Increase sleep value to 2s
<?php namespace RabbitMQBundle\Tests\Controller; use AppBundle\Entity\Post; use Symfony\Bundle\FrameworkBundle\Test\WebTestCase; use Symfony\Component\HttpFoundation\Response; class RabbitMQControllerTest extends WebTestCase { protected $entityManager; public function __construct() { self::bootK...
<?php namespace RabbitMQBundle\Tests\Controller; use AppBundle\Entity\Post; use Symfony\Bundle\FrameworkBundle\Test\WebTestCase; use Symfony\Component\HttpFoundation\Response; class RabbitMQControllerTest extends WebTestCase { protected $entityManager; public function __construct() { self::bootK...
Use dict comprehension instead of dict([...])
'Accounts' from __future__ import unicode_literals from .... import ProResource, RelatedResourceMixin import six import sys class Account(RelatedResourceMixin, ProResource): 'Abstraction of Accounts resource in duedil v3 pro api' attribute_names = [ 'uri', 'date', 'type' ] acc...
'Accounts' from __future__ import unicode_literals from .... import ProResource, RelatedResourceMixin import six import sys class Account(RelatedResourceMixin, ProResource): 'Abstraction of Accounts resource in duedil v3 pro api' attribute_names = [ 'uri', 'date', 'type' ] acc...
Allow custom endpoint in persona.verifier.
<?php namespace Mozilla\Persona\Provider\Laravel; use Auth; use Illuminate\Auth\Guard; use Illuminate\Support\ServiceProvider; use Mozilla\Persona\Identity; use Mozilla\Persona\Verifier; use Request; class PersonaServiceProvider extends ServiceProvider { /** * Indicates if loading of the provider is deferred...
<?php namespace Mozilla\Persona\Provider\Laravel; use Auth; use Illuminate\Auth\Guard; use Illuminate\Support\ServiceProvider; use Mozilla\Persona\Identity; use Mozilla\Persona\Verifier; use Request; class PersonaServiceProvider extends ServiceProvider { /** * Indicates if loading of the provider is deferred...
Add argparse as a dependency
import os from setuptools import setup import mando with open(os.path.join(os.path.dirname(__file__), 'README.rst')) as fobj: readme = fobj.read() setup(name='mando', version=mando.__version__, author='Michele Lacchia', author_email='michelelacchia@gmail.com', url='https://mando.readthedo...
import os from setuptools import setup import mando with open(os.path.join(os.path.dirname(__file__), 'README.rst')) as fobj: readme = fobj.read() setup(name='mando', version=mando.__version__, author='Michele Lacchia', author_email='michelelacchia@gmail.com', url='https://mando.readthedo...
Remove back authorization for snippets
package org.crunchytorch.coddy.snippet.api; import org.crunchytorch.coddy.snippet.elasticsearch.entity.SnippetEntity; import org.crunchytorch.coddy.snippet.service.SnippetService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; import javax.ws.rs.*; impo...
package org.crunchytorch.coddy.snippet.api; import org.crunchytorch.coddy.snippet.elasticsearch.entity.SnippetEntity; import org.crunchytorch.coddy.snippet.service.SnippetService; import org.crunchytorch.coddy.user.filter.AuthorizationFilter; import org.springframework.beans.factory.annotation.Autowired; import org.sp...
Allow signal handlers to be disabled to run in subthread
import time from twisted.internet import reactor from .http_protocol import HTTPFactory class Server(object): def __init__(self, channel_layer, host="127.0.0.1", port=8000, signal_handlers=True): self.channel_layer = channel_layer self.host = host self.port = port self.signal_han...
import time from twisted.internet import reactor from .http_protocol import HTTPFactory class Server(object): def __init__(self, channel_layer, host="127.0.0.1", port=8000): self.channel_layer = channel_layer self.host = host self.port = port def run(self): self.factory = HT...
Add learning test for sinon sandbox.
define( [ 'chai', 'sinon', 'jquery' ], function(chai, undefined, undefined) { var assert = chai.assert; // Assertions var assertCleanXHR = function() { assert.isNotFunction( XMLHttpRequest.restore, 'XMLHttpRequest lacks method `restore`.' ); }; ...
define( [ 'chai', 'sinon', 'jquery' ], function(chai, undefined, undefined) { var assert = chai.assert; describe('sinon', function() { it('should be an object', function() { assert.isObject(sinon, 'Check sinon object.'); }); describe('fakeServer', function() ...
FIX only pass S52 test
from expects import expect, equal from primestg.report import Report with description('Report S52 example'): with before.all: self.data_filename = 'spec/data/MRTR000000822522_0_S52_1_20200929001048' self.report = {} with open(self.data_filename) as data_file: self.report = Re...
from expects import expect, equal from primestg.report import Report with fdescription('Report S52 example'): with before.all: self.data_filename = 'spec/data/MRTR000000822522_0_S52_1_20200929001048' self.report = {} with open(self.data_filename) as data_file: self.report = R...
Add tests for login oauth links
# coding: utf-8 from findaconf import app, db from findaconf.tests.config import set_app, unset_app from unittest import TestCase class TestSiteRoutes(TestCase): def setUp(self): self.app = set_app(app, db) def tearDown(self): unset_app(db) # test routes from blueprint/site.py def ...
# coding: utf-8 from findaconf import app, db from findaconf.tests.config import set_app, unset_app from unittest import TestCase class TestSiteRoutes(TestCase): def setUp(self): self.app = set_app(app, db) def tearDown(self): unset_app(db) # test routes from blueprint/site.py def ...
Replace bind with fat arrow syntax
import request from 'superagent'; import { Promise } from 'bluebird'; import { isValidToken } from './jwt'; export default class TokenClient { constructor(config) { this.user = config.user; this.password = config.password; this.routes = config.routes; this.token = config.token; } getValidToken()...
import request from 'superagent'; import { Promise } from 'bluebird'; import { isValidToken } from './jwt'; export default class TokenClient { constructor(config) { this.user = config.user; this.password = config.password; this.routes = config.routes; this.token = config.token; } getValidToken()...
Remove leading whitespace in constructor arg
<?php namespace Avalanche\Bundle\ImagineBundle\Imagine\Filter; use Avalanche\Bundle\ImagineBundle\Imagine\Filter\Loader\LoaderInterface; use Imagine\Exception\InvalidArgumentException; use Imagine\Filter\FilterInterface; use Symfony\Component\DependencyInjection\ContainerInterface; class FilterManager { private...
<?php namespace Avalanche\Bundle\ImagineBundle\Imagine\Filter; use Avalanche\Bundle\ImagineBundle\Imagine\Filter\Loader\LoaderInterface; use Imagine\Exception\InvalidArgumentException; use Imagine\Filter\FilterInterface; use Symfony\Component\DependencyInjection\ContainerInterface; class FilterManager { private...
Convert to flags=value for future compatibility
import re from mitmproxy import exceptions from mitmproxy import filt class Replace: def __init__(self): self.lst = [] def configure(self, options, updated): """ .replacements is a list of tuples (fpat, rex, s): fpatt: a string specifying a filter pattern. ...
import re from mitmproxy import exceptions from mitmproxy import filt class Replace: def __init__(self): self.lst = [] def configure(self, options, updated): """ .replacements is a list of tuples (fpat, rex, s): fpatt: a string specifying a filter pattern. ...
Remove whitespace before and after link text
<?php declare (strict_types = 1); namespace GrottoPress\Jentil\Utilities\ThemeMods; use GrottoPress\Jentil\Jentil; class Colophon extends AbstractThemeMod { /** * @var ThemeMods */ private $themeMods; public function __construct(ThemeMods $theme_mods) { $this->themeMods = $theme_mo...
<?php declare (strict_types = 1); namespace GrottoPress\Jentil\Utilities\ThemeMods; use GrottoPress\Jentil\Jentil; class Colophon extends AbstractThemeMod { /** * @var ThemeMods */ private $themeMods; public function __construct(ThemeMods $theme_mods) { $this->themeMods = $theme_mo...
Add req.files to params object
'use strict'; var passport = require('passport'), nconf = require('nconf'), utils = require('../lib/utils'), geboSchema = require('../schemata/gebo'), agentSchema = require('../schemata/agent'), extend = require('extend'), q = require('q'); module.exports = function(email) { // Turn the e...
'use strict'; var passport = require('passport'), nconf = require('nconf'), utils = require('../lib/utils'), geboSchema = require('../schemata/gebo'), agentSchema = require('../schemata/agent'), q = require('q'); module.exports = function(email) { // Turn the email into a mongo-friend databas...
Remove prop mapper from auth wrapper
import React, { Component } from 'react' import PropTypes from 'prop-types' import hoistStatics from 'hoist-non-react-statics' import isEmpty from 'lodash.isempty' const defaults = { AuthenticatingComponent: () => null, // dont render anything while authenticating FailureComponent: undefined, wrapperDisplayName:...
import React, { Component } from 'react' import PropTypes from 'prop-types' import hoistStatics from 'hoist-non-react-statics' import isEmpty from 'lodash.isempty' const defaults = { AuthenticatingComponent: () => null, // dont render anything while authenticating FailureComponent: undefined, wrapperDisplayName:...
Make phantom reporter a plain old object
/* globals window,alert,jasmine */ 'use strict'; (function () { var sendMessage = function sendMessage () { var args = [].slice.call(arguments); /* eslint-disable */ if (window._phantom) { alert(JSON.stringify(args)); } /* eslint-enable *...
/* globals window,alert,jasmine */ 'use strict'; (function () { var sendMessage = function sendMessage () { var args = [].slice.call(arguments); /* eslint-disable */ if (window._phantom) { alert(JSON.stringify(args)); } /* eslint-enable *...
Add log level to configuration
/* eslint key-spacing:0 spaced-comment:0 */ const path = require('path'); const ip = require('ip'); const projectBase = path.resolve(__dirname, '..'); /************************************************ /* Default configuration *************************************************/ module.exports = { env : process.env.NO...
/* eslint key-spacing:0 spaced-comment:0 */ const path = require('path'); const ip = require('ip'); const projectBase = path.resolve(__dirname, '..'); /************************************************ /* Default configuration *************************************************/ module.exports = { env : process.env.NO...
Change google storage endpoint to us https
import React, {Component, PropTypes} from 'react'; import {Akkad, Scene, shapes, cameras, lights, systems} from "akkad"; const googleStorageEndpoint = `https://storage.googleapis.com/akkad-assets-1/`; const {ArcRotateCamera} = cameras; const {HemisphericLight} = lights; const {Mesh, Position, Rotate} = systems; clas...
import React, {Component, PropTypes} from 'react'; import {Akkad, Scene, shapes, cameras, lights, systems} from "akkad"; const googleStorageEndpoint = `http://storage.googleapis.com/akkad-assets-1/`; const {ArcRotateCamera} = cameras; const {HemisphericLight} = lights; const {Mesh, Position, Rotate} = systems; class...
Revert "tests: Use exports syntax directly" This reverts commit 5c2697713268ad03612e93d1c0b285a9b7f9986e.
import sinon from 'sinon'; import config from '../config.default.json'; import DataStoreHolder from '../lib/data-store-holder'; import getGithubClient from './_github-client'; const getIssue = (content = 'lorem ipsum') => { //TODO should use an actual issue instance instead with a no-op github client. const la...
import sinon from 'sinon'; import config from '../config.default.json'; import DataStoreHolder from '../lib/data-store-holder'; export { getGithubClient } from './_github-client'; const getIssue = (content = 'lorem ipsum') => { //TODO should use an actual issue instance instead with a no-op github client. cons...
Use self for php 5.3
<?php namespace Mockery\Generator; class DefinedTargetClass { private $rfc; public function __construct(\ReflectionClass $rfc) { $this->rfc = $rfc; } public static function factory($name) { return new self(new \ReflectionClass($name)); } public function getName() ...
<?php namespace Mockery\Generator; class DefinedTargetClass { private $rfc; public function __construct(\ReflectionClass $rfc) { $this->rfc = $rfc; } public static function factory($name) { return new static(new \ReflectionClass($name)); } public function getName() ...
Use fat arrow syntax for callbacks.
{ angular.module('marvelousnote.notesForm') .controller('NotesFormController', NotesFormController); NotesFormController.$inject = ['$state', 'Flash', 'NotesService']; function NotesFormController($state, Flash, NotesService) { const vm = this; vm.note = NotesService.find($state.params.noteId); vm....
{ angular.module('marvelousnote.notesForm') .controller('NotesFormController', NotesFormController); NotesFormController.$inject = ['$state', 'Flash', 'NotesService']; function NotesFormController($state, Flash, NotesService) { const vm = this; vm.note = NotesService.find($state.params.noteId); ...
Update openfisca-core requirement from <32.0,>=27.0 to >=27.0,<33.0 Updates the requirements on [openfisca-core](https://github.com/openfisca/openfisca-core) to permit the latest version. - [Release notes](https://github.com/openfisca/openfisca-core/releases) - [Changelog](https://github.com/openfisca/openfisca-core/b...
# -*- coding: utf-8 -*- from setuptools import setup, find_packages setup( name = "OpenFisca-Country-Template", version = "3.9.4", author = "OpenFisca Team", author_email = "contact@openfisca.org", classifiers=[ "Development Status :: 5 - Production/Stable", "License :: OSI Approve...
# -*- coding: utf-8 -*- from setuptools import setup, find_packages setup( name = "OpenFisca-Country-Template", version = "3.9.4", author = "OpenFisca Team", author_email = "contact@openfisca.org", classifiers=[ "Development Status :: 5 - Production/Stable", "License :: OSI Approve...
Return empty string if result output is disabled
import jinja2 import six import os from st2actions.runners.pythonrunner import Action from st2client.client import Client class FormatResultAction(Action): def __init__(self, config): super(FormatResultAction, self).__init__(config) api_url = os.environ.get('ST2_ACTION_API_URL', None) tok...
import jinja2 import six import os from st2actions.runners.pythonrunner import Action from st2client.client import Client class FormatResultAction(Action): def __init__(self, config): super(FormatResultAction, self).__init__(config) api_url = os.environ.get('ST2_ACTION_API_URL', None) tok...
Fix importError for Yaafe and Aubio
# -*- coding: utf-8 -*- from __future__ import absolute_import from . import api from . import core from . import decoder from . import analyzer from . import grapher from . import encoder __version__ = '0.5.5' __all__ = ['api', 'core', 'decoder', 'analyzer', 'grapher', 'encoder'] def _discover_modules(): impo...
# -*- coding: utf-8 -*- from __future__ import absolute_import from . import api from . import core from . import decoder from . import analyzer from . import grapher from . import encoder __version__ = '0.5.5' __all__ = ['api', 'core', 'decoder', 'analyzer', 'grapher', 'encoder'] def _discover_modules(): impo...
Fix problem in as_json and as_jsonp
import json from functools import wraps from django.http import HttpResponse from django.shortcuts import render_to_response from django.template import RequestContext def as_json(func): def decorator(request, *ar, **kw): output = func(request, *ar, **kw) return HttpResponse(json.dumps(output), '...
import json from functools import wraps from django.http import HttpResponse from django.shortcuts import render_to_response from django.template import RequestContext def as_json(func): def decorator(request, *ar, **kw): output = func(request, *ar, **kw) if not isinstance(output, dict): ...
Update the Japanese example test
# Japanese Language Test from seleniumbase.translate.japanese import セレニウムテストケース # noqa class 私のテストクラス(セレニウムテストケース): def test_例1(self): self.を開く("https://ja.wikipedia.org/wiki/") self.テキストを確認する("ウィキペディア") self.要素を確認する('[title*="ウィキペディアへようこそ"]') self.JS入力('input[name="search"]', "ア...
# Japanese Language Test from seleniumbase.translate.japanese import セレニウムテストケース # noqa class 私のテストクラス(セレニウムテストケース): def test_例1(self): self.を開く("https://ja.wikipedia.org/wiki/") self.テキストを確認する("ウィキペディア") self.要素を確認する('[title*="メインページに移動する"]') self.JS入力('input[name="search"]', "アニ...
Revert back Admin controller user ACL to ON
<?php namespace Devlabs\SportifyBundle\Controller; use Symfony\Bundle\FrameworkBundle\Controller\Controller; use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route; use Devlabs\SportifyBundle\Entity\Tournament; class AdminController extends Controller { /** * @Route("/admin", name="admin_index") */...
<?php namespace Devlabs\SportifyBundle\Controller; use Symfony\Bundle\FrameworkBundle\Controller\Controller; use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route; use Devlabs\SportifyBundle\Entity\Tournament; class AdminController extends Controller { /** * @Route("/admin", name="admin_index") */...
Fix up a couple of minor issues
# -*- coding: utf-8 -*- """Implementation of pep257 integration with Flake8. pep257 docstrings convention needs error code and class parser for be included as module into flake8 """ import io import pep8 import pep257 __version__ = '0.2.2' class pep257Checker(object): """Flake8 needs a class to check python fi...
# -*- coding: utf-8 -*- """pep257 docstrings convention needs error code and class parser for be included as module into flake8 """ import io import pep8 import pep257 __version__ = '0.2.2' class pep257Checker(object): """flake8 needs a class to check python file.""" name = 'pep257' version = __versio...
Stop propagating click to parents
/* global define */ define([ 'jquery', 'views/reply-form-view' ], function ($, ReplyFormView) { 'use strict'; var ReplyableView = { renderReplyBox: function (event) { event.preventDefault(); event.stopPropagation(); this.clickedReplyButton = $(event.currentTarget); if (!this.$(thi...
/* global define */ define([ 'jquery', 'views/reply-form-view' ], function ($, ReplyFormView) { 'use strict'; var ReplyableView = { renderReplyBox: function (event) { event.preventDefault(); this.clickedReplyButton = $(event.currentTarget); if (!this.$(this.replyForm).length) { ...
Include contrib.sites when running tests; needed for sitemaps in Django >= 1.2.
#!/usr/bin/env python from os.path import dirname, abspath import sys from django.conf import settings if not settings.configured: from django import VERSION settings_dict = dict( INSTALLED_APPS=( 'localeurl', 'django.contrib.sites', # for sitemap test ), R...
#!/usr/bin/env python from os.path import dirname, abspath import sys from django.conf import settings if not settings.configured: from django import VERSION settings_dict = dict( INSTALLED_APPS=( 'localeurl', ), ROOT_URLCONF='localeurl.tests.test_urls', ) ...
Change deprecated options_list to add_arguments
from django.core.management.base import BaseCommand from recommends.tasks import recommends_precompute from datetime import datetime import dateutil.relativedelta import warnings class Command(BaseCommand): help = 'Calculate recommendations and similarities based on ratings' def add_arguments(self, parser)...
from django.core.management.base import BaseCommand from recommends.tasks import recommends_precompute from datetime import datetime import dateutil.relativedelta from optparse import make_option import warnings class Command(BaseCommand): help = 'Calculate recommendations and similarities based on ratings' ...
Print all scsslint errors before existing.
var path = require('path'); var eslint = require('gulp-eslint'); var merge = require('lodash/object/merge'); var shelljs = require('shelljs'); function scssLintExists() { return shelljs.which('scss-lint'); } module.exports = function(gulp, options) { var scssLintPath = path.resolve(__dirname, 'scss-lint.yml'); ...
var path = require('path'); var eslint = require('gulp-eslint'); var merge = require('lodash/object/merge'); var shelljs = require('shelljs'); function failLintBuild() { process.exit(1); } function scssLintExists() { return shelljs.which('scss-lint'); } module.exports = function(gulp, options) { var scssLintP...
Revert to puppeteer (keeping chromium install for dependencies)
// Karma configuration file, see link for more information // https://karma-runner.github.io/0.13/config/configuration-file.html process.env.CHROME_BIN = require('puppeteer').executablePath() module.exports = function (config) { config.set({ basePath: '', frameworks: ['jasmine', '@angular/cli'], plugins:...
// Karma configuration file, see link for more information // https://karma-runner.github.io/0.13/config/configuration-file.html process.env.CHROME_BIN = require('puppeteer').executablePath() module.exports = function (config) { config.set({ basePath: '', frameworks: ['jasmine', '@angular/cli'], plugins:...
Change test case user info
import datetime import tmdbsimple as tmdb from django.contrib.auth.models import User from django.test import TestCase from .models import Movie class MovieTestCase(TestCase): def setUp(self): User.objects.create(username="movie_test_case", password="pass", email="movie@test_case.tld", ...
import datetime from django.contrib.auth.models import User from django.test import TestCase import tmdbsimple as tmdb from .models import Movie class MovieTestCase(TestCase): def setUp(self): User.objects.create(username="test_user", password="pass", email="test@user.tld", first_name="Test", ...