text
stringlengths
17
1.47k
positive
stringlengths
673
4.43k
negative
stringlengths
677
2.81k
Exclude node modules from webpack using dir name
var webpack = require('webpack') var path = require('path'); module.exports = function(config) { config.set({ basePath: '', frameworks: ['jasmine'], files: [ 'test/**/*.js' ], preprocessors: { // add webpack as preprocessor 'src/**/*.js': ['webpack', 'sourcemap'], 'test/*...
var webpack = require('webpack') module.exports = function(config) { config.set({ basePath: '', frameworks: ['jasmine'], files: [ 'test/**/*.js' ], preprocessors: { // add webpack as preprocessor 'src/**/*.js': ['webpack', 'sourcemap'], 'test/**/*.js': ['webpack', 'sourc...
Read More module: changes to filter logic Absence of a post indicates we are previewing content.
<?php class ReadMore extends Modules { public function __init() { # Replace comment codes before markup modules filters them. $this->setPriority("markup_post_text", 4); } public function markup_post_text($text, $post = null) { if (!is_string($text) or !pr...
<?php class ReadMore extends Modules { public function __init() { # Replace comment codes before markup modules filters them. $this->setPriority("markup_post_text", 4); } public function markup_post_text($text, $post = null) { if (!is_string($text) or !pr...
Delete data check in __construct()
<?php namespace ApiAi\Model; /** * Class Base * * @package ApiAi\Model */ class Base implements \JsonSerializable { /** * @var array */ private $data; /** * Base constructor. * * @param array $data */ public function __construct($data = []) { $this->data ...
<?php namespace ApiAi\Model; /** * Class Base * * @package ApiAi\Model */ class Base implements \JsonSerializable { /** * @var array */ private $data; /** * Base constructor. * * @param array $data */ public function __construct($data = []) { if (empty($d...
Fix cityInfo tab not loading data after user completes form
'use strict'; const express = require('express'); const router = express.Router(); const bodyParser = require('body-parser'); const request = require('request'); const models = require('../../db/models'); module.exports.getAll = (req, res) => { models.User.where({ email: req.user.email}).fetch() .then((result) =...
'use strict'; const express = require('express'); const router = express.Router(); const bodyParser = require('body-parser'); const request = require('request'); const models = require('../../db/models'); module.exports.getAll = (req, res) => { models.User.where({ email: req.user.email}).fetch() .then((result) =...
Change fov scaling to "Hor+".
#!/usr/bin/env python2 import math import sys from direct.showbase.ShowBase import ShowBase import panda3d.core as p3d import ecs from player import PlayerController class NodePathComponent(ecs.Component): __slots__ = [ "nodepath", ] def __init__(self, modelpath=None): if modelpath is no...
#!/usr/bin/env python2 import sys from direct.showbase.ShowBase import ShowBase import panda3d.core as p3d import ecs from player import PlayerController class NodePathComponent(ecs.Component): __slots__ = [ "nodepath", ] def __init__(self, modelpath=None): if modelpath is not None: ...
Update error handler test for php52
<?php class ClientTest extends PHPUnit_Framework_TestCase { protected $client; protected function setUp(){ // Mock the notify function $this->client = $this->getMockBuilder('Bugsnag_Client') ->setMethods(array('notify')) ->setConstructo...
<?php class ClientTest extends PHPUnit_Framework_TestCase { protected $client; protected function setUp(){ // Mock the notify function $this->client = $this->getMockBuilder('Bugsnag_Client') ->setMethods(array('notify')) ->setConstructo...
Update GLPI to 0.91 in unit tests
<?php require_once('commonfunction.php'); include_once (GLPI_ROOT . "/config/based_config.php"); include_once (GLPI_ROOT . "/inc/dbmysql.class.php"); include_once (GLPI_CONFIG_DIR . "/config_db.php"); class GLPIInstallTest extends PHPUnit_Framework_TestCase { /** * @test */ public function installDataba...
<?php require_once('commonfunction.php'); include_once (GLPI_ROOT . "/config/based_config.php"); include_once (GLPI_ROOT . "/inc/dbmysql.class.php"); include_once (GLPI_CONFIG_DIR . "/config_db.php"); class GLPIInstallTest extends PHPUnit_Framework_TestCase { /** * @test */ public function installDataba...
Fix broken code, comment out sun.awt.X11.XLayerProtocol
package dr.inference.model; import dr.xml.*; //import sun.awt.X11.XLayerProtocol; /** * @author Joseph Heled * Date: 4/09/2009 */ public class ValuesPoolParser extends dr.xml.AbstractXMLObjectParser { public static String VALUES_POOL = "valuesPool"; public static String VALUES = "values"; publ...
package dr.inference.model; import dr.xml.*; import sun.awt.X11.XLayerProtocol; /** * @author Joseph Heled * Date: 4/09/2009 */ public class ValuesPoolParser extends dr.xml.AbstractXMLObjectParser { public static String VALUES_POOL = "valuesPool"; public static String VALUES = "values"; public...
Correct header params on adapter
# coding: utf-8 from tapioca import ( TapiocaAdapter, generate_wrapper_from_adapter, JSONAdapterMixin) from requests.auth import HTTPBasicAuth from .resource_mapping import RESOURCE_MAPPING class HarvestClientAdapter(JSONAdapterMixin, TapiocaAdapter): resource_mapping = RESOURCE_MAPPING api_root = 'ht...
# coding: utf-8 from tapioca import ( TapiocaAdapter, generate_wrapper_from_adapter, JSONAdapterMixin) from requests.auth import HTTPBasicAuth from .resource_mapping import RESOURCE_MAPPING class HarvestClientAdapter(JSONAdapterMixin, TapiocaAdapter): resource_mapping = RESOURCE_MAPPING api_root = 'ht...
Set controller without __invoke method from invokable class
<?php /* * This file is part of the Symfony package. * * (c) Fabien Potencier <fabien@symfony.com> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Symfony\Bundle\FrameworkBundle\Routing; use Symfony\Component\Routing\L...
<?php /* * This file is part of the Symfony package. * * (c) Fabien Potencier <fabien@symfony.com> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Symfony\Bundle\FrameworkBundle\Routing; use Symfony\Component\Routing\L...
Support for value of None in MoneyField.compress. Leaving a MoneyField blank in the Django admin site caused an issue when attempting to save an exception was raised since Money was getting an argument list of None.
from __future__ import unicode_literals from warnings import warn from django.forms import MultiValueField, DecimalField, ChoiceField from moneyed.classes import Money from .widgets import MoneyWidget, CURRENCY_CHOICES __all__ = ('MoneyField',) class MoneyField(MultiValueField): def __init__(self, currency_wi...
from __future__ import unicode_literals from warnings import warn from django.forms import MultiValueField, DecimalField, ChoiceField from moneyed.classes import Money from .widgets import MoneyWidget, CURRENCY_CHOICES __all__ = ('MoneyField',) class MoneyField(MultiValueField): def __init__(self, currency_wi...
Implement destroy function for category destroy
@if ((int) count($categories) === 0) <div class="alert alert-info" role="alert"> <strong><span class="fa fa-info-circle"></span> Info:</strong> Er zijn geen categorieen gevonden voor de helpdesk in het systeem. </div> @else <table class="table table-condensed table-hover"> <thead> ...
@if ((int) count($categories) === 0) <div class="alert alert-info" role="alert"> <strong><span class="fa fa-info-circle"></span> Info:</strong> Er zijn geen categorieen gevonden voor de helpdesk in het systeem. </div> @else <table class="table table-condensed table-hover"> <thead> ...
Allow newer versions of pyinotify
#!/usr/bin/env python from setuptools import setup, find_packages setup( name = 'spotter', version = '1.7', url = "http://github.com/borntyping/spotter", author = "Sam Clements", author_email = "sam@borntyping.co.uk", description = "A comm...
#!/usr/bin/env python from setuptools import setup, find_packages setup( name = 'spotter', version = '1.7', url = "http://github.com/borntyping/spotter", author = "Sam Clements", author_email = "sam@borntyping.co.uk", description = "A comm...
Update LTS versions in test matrix
/* eslint-env node */ module.exports = { scenarios: [ { name: 'ember-lts-2.12', npm: { devDependencies: { 'ember-source': '~2.12.0' } } }, { name: 'ember-lts-2.16', npm: { devDependencies: { 'ember-source': '~2.16.0' } ...
/* eslint-env node */ module.exports = { scenarios: [ { name: 'ember-lts-2.8', bower: { dependencies: { 'ember': 'components/ember#lts-2-8' }, resolutions: { 'ember': 'lts-2-8' } }, npm: { devDependencies: { 'ember-sourc...
Update language for over view charts
'use strict'; module.exports = { $meta: 'English translation file', navigation: { overview: { $filter: 'role', district: 'District Performance', block: 'Block Performance', $default: 'Overview Performance' }, discrete: { $filte...
'use strict'; module.exports = { $meta: 'English translation file', navigation: { overview: { $filter: 'role', district: 'District Performance', block: 'Block Performance', $default: 'Overview Performance' }, discrete: { $filte...
Use heroku api by default
import React from 'react'; import { StyleSheet, Text, View, TextInput, Button } from 'react-native'; import Login from './components/Login/Login.js'; // TODO Use prod server in prod mode const server = 'https://satoshi-api.herokuapp.com' // const server = 'http://localhost:8080' export default class HomeScreen exten...
import React from 'react'; import { StyleSheet, Text, View, TextInput, Button } from 'react-native'; import Login from './components/Login/Login.js'; // TODO Use prod server in prod mode // const server = 'https://satoshi-api.herokuapp.com' const server = 'http://localhost:8080' export default class HomeScreen exten...
[TASK] Adjust test fixture to Doctrine.ORM 2.2.0 The proxy interface in Common is now used, the fixture needs to be adjusted. Change-Id: I0ed772ad4d04cf80679f7f726698c9278812b2d9 Related: #32608 Releases: 1.1 Original-Commit-Hash: c2c171d440e60457cbefc8e11ec83bc41b4fc7f9
<?php namespace TYPO3\FLOW3\Tests\Functional\Reflection\Fixtures; /* * * This script belongs to the FLOW3 framework. * * * * It is free software; y...
<?php namespace TYPO3\FLOW3\Tests\Functional\Reflection\Fixtures; /* * * This script belongs to the FLOW3 framework. * * * * It is free software; y...
Update the version of the config too.
package ro.nicuch.citizensbooks; import org.bukkit.configuration.file.YamlConfiguration; import org.bukkit.inventory.ItemStack; import java.util.HashMap; import java.util.Map; public class ConfigUpdater { public static boolean updateConfig(CitizensBooksPlugin plugin, int oldVersion) { if (oldVersion == ...
package ro.nicuch.citizensbooks; import org.bukkit.configuration.file.YamlConfiguration; import org.bukkit.inventory.ItemStack; import java.util.HashMap; import java.util.Map; public class ConfigUpdater { public static boolean updateConfig(CitizensBooksPlugin plugin, int oldVersion) { if (oldVersion == ...
Remove bluebird require from AdapterManager
var fs = require('fs'), Path = require('path'); /** * Represents an object capable of listing and loading adapters using defined * conventions. * * @constructor */ var Adapters = function() { this.basePath = Path.resolve(Path.join(__dirname, '..', 'adapters')); }; Adapters.prototype = { /** * G...
var fs = require('fs'), Path = require('path'), Promise = require('bluebird'); /** * Represents an object capable of listing and loading adapters using defined * conventions. * * @constructor */ var Adapters = function() { this.basePath = Path.resolve(Path.join(__dirname, '..', 'adapters')); }; Adapt...
Fix group on equality iterator type hints
<?php namespace Pinq\Iterators\Standard; use Pinq\Iterators\Common; /** * Implementation of the join iterator using the fetch method. * * @author Elliot Levin <elliot@aanet.com.au> */ class GroupJoinOnEqualityIterator extends GroupJoinIterator { use Common\JoinOnEqualityIterator; /** * @var Ord...
<?php namespace Pinq\Iterators\Standard; use Pinq\Iterators\Common; /** * Implementation of the join iterator using the fetch method. * * @author Elliot Levin <elliot@aanet.com.au> */ class GroupJoinOnEqualityIterator extends GroupJoinIterator { use Common\JoinOnEqualityIterator; /** * @var Ord...
Add user page favorites and uploads number indicator
import React, { Component, PropTypes } from 'react' import { Container, Segment, Menu, Header, Label } from 'semantic-ui-react' import { Link } from 'react-router' import moment from 'moment' const propTypes = { user: PropTypes.object } class UserPage extends Component { render() { const { user } = this.props...
import React, { Component, PropTypes } from 'react' import { Container, Segment, Menu, Header } from 'semantic-ui-react' import { Link } from 'react-router' import moment from 'moment' const propTypes = { user: PropTypes.object } class UserPage extends Component { render() { const { user } = this.props if...
Use the right case for the package name
#!/usr/bin/env python from distutils.core import setup, Command class TestDiscovery(Command): user_options = [] def initialize_options(self): pass def finalize_options(self): pass def run(self): import sys, subprocess errno = subprocess.call([ sys.execut...
#!/usr/bin/env python from distutils.core import setup, Command class TestDiscovery(Command): user_options = [] def initialize_options(self): pass def finalize_options(self): pass def run(self): import sys, subprocess errno = subprocess.call([ sys.execut...
Add Dependent Fixture Interface to fix fixture loading
<?php namespace Soflomo\Blog\Fixture; use Doctrine\Common\Persistence\ObjectManager; use Doctrine\Common\DataFixtures\AbstractFixture; use Doctrine\Common\DataFixtures\DependentFixtureInterface; use Faker; use Soflomo\Blog\Entity\Article; class ArticleData extends AbstractFixture implements DependentFixtureInterface...
<?php namespace Soflomo\Blog\Fixture; use Doctrine\Common\Persistence\ObjectManager; use Doctrine\Common\DataFixtures\AbstractFixture; use Faker; use Soflomo\Blog\Entity\Article; class ArticleData extends AbstractFixture { protected $n = 10; public function load(ObjectManager $manager) { $blog ...
Check we've got a result object before exiting the results loop.
/** * bit.ly access library code. */ Shortener = { displayName: 'Shortener', shorten: function() { var uri, callback, name; if (typeof arguments[0] == 'string') { uri = arguments[0]; callback = arguments[1]; } else { uri = windo...
/** * bit.ly access library code. */ Shortener = { displayName: 'Shortener', shorten: function() { var uri, callback, name; if (typeof arguments[0] == 'string') { uri = arguments[0]; callback = arguments[1]; } else { uri = windo...
Update bookmark interface to work with mercurial 3.0.2 --HG-- extra : transplant_source : Qn%AB4%08%F4%3D%60%0DDb%10%E1%9C%A2%82%00z%1D5
# Mimic the hggit extension. try: from hggit import * hggit_reposetup = reposetup except ImportError: # Allow this module to be imported without # hg-git installed, eg for setup.py pass __version__ = "0.1.4" def reposetup(ui, repo, **kwargs): """ Automatically adds Bitbucket->GitHub mir...
# Mimic the hggit extension. try: from hggit import * hggit_reposetup = reposetup except ImportError: # Allow this module to be imported without # hg-git installed, eg for setup.py pass __version__ = "0.1.4" def reposetup(ui, repo, **kwargs): """ Automatically adds Bitbucket->GitHub mir...
Make mono channel output activation more readable
from keras.layers import Convolution2D, Reshape, Lambda, Activation from eva.layers.masked_convolution2d import MaskedConvolution2D class OutChannels(object): def __init__(self, height, width, channels, masked=False, palette=256): self.height = height self.width = width self.channels = cha...
from keras.layers import Convolution2D, Reshape, Lambda, Activation from eva.layers.masked_convolution2d import MaskedConvolution2D class OutChannels(object): def __init__(self, height, width, channels, masked=False, palette=256): self.height = height self.width = width self.channels = cha...
[HeartBeat] Allow current frame modifictation by event
(function($, document, window) { "use strict" window.animationHeartBeat = function (steps) { var max = steps; var delay = 70; var current = 0; var interval; var beat; $(document).bind('animation.stop', function() { console.log('animation....
(function($, document, window) { "use strict" window.animationHeartBeat = function (steps) { var max = steps; var delay = 70; var current = 0; var interval; var beat; $(document).bind('animation.stop', function() { console.log('animation....
Fix broken default config file
<?php namespace Jigsaw\Jigsaw\Console; use Illuminate\Filesystem\Filesystem; use Symfony\Component\Console\Input\InputArgument; use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Input\InputOption; use Symfony\Component\Console\Output\OutputInterface; class InitCommand extends Command {...
<?php namespace Jigsaw\Jigsaw\Console; use Illuminate\Filesystem\Filesystem; use Symfony\Component\Console\Input\InputArgument; use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Input\InputOption; use Symfony\Component\Console\Output\OutputInterface; class InitCommand extends Command {...
Replace one last place where aioes was used
import elasticsearch import os.path from datetime import datetime from .utils import read_json_file from .settings import ELASTICSEARCH_ALIAS def create_new_index(elastic): print("Creating new index...") module_path = os.path.dirname(__file__) config_filename = os.path.join(module_path, 'configuration',...
import aioes import os.path from datetime import datetime from .utils import read_json_file from .settings import ELASTICSEARCH_ALIAS def create_new_index(elastic): print("Creating new index...") module_path = os.path.dirname(__file__) config_filename = os.path.join(module_path, 'configuration', 'index....
Make it so library doesn't spit out error, when trying to display 0
<?php namespace ByteUnits; class PowerScale { private $base; private $scale; private $precision; public function __construct($base, $scale, $precision) { $this->base = $base; $this->scale = $scale; $this->precision = $precision; } public function scaleToUnit($quan...
<?php namespace ByteUnits; class PowerScale { private $base; private $scale; private $precision; public function __construct($base, $scale, $precision) { $this->base = $base; $this->scale = $scale; $this->precision = $precision; } public function scaleToUnit($quan...
Simplify definition of jscs task
module.exports = function( grunt ) { "use strict"; grunt.initConfig({ bump: { options: { files: [ "package.json" ], // Commit commit: true, commitMessage: "Release v%VERSION%", commitFiles: [ "package.json" ], ...
module.exports = function( grunt ) { "use strict"; grunt.initConfig({ bump: { options: { files: [ "package.json" ], // Commit commit: true, commitMessage: "Release v%VERSION%", commitFiles: [ "package.json" ], ...
Add flushing for console logging
package io.airlift.log; import java.io.OutputStream; import java.io.OutputStreamWriter; import java.io.PrintWriter; import java.io.Writer; import java.util.concurrent.atomic.AtomicBoolean; import java.util.logging.Handler; import java.util.logging.LogRecord; import static java.nio.charset.StandardCharsets.UTF_8; fin...
package io.airlift.log; import java.io.OutputStream; import java.io.OutputStreamWriter; import java.io.Writer; import java.util.logging.Handler; import java.util.logging.LogRecord; import static java.nio.charset.StandardCharsets.UTF_8; import static java.util.logging.ErrorManager.CLOSE_FAILURE; import static java.uti...
Fix for erroneous service definition
<?php /* * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT * OWNER OR CONTRIBUTORS B...
<?php /* * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT * OWNER OR CONTRIBUTORS B...
Make default QueryFactory return data (fixes test)
from django.conf import settings from django.contrib.auth.models import User import factory from website.models import Db, Query class TagsFactory(factory.DjangoModelFactory): class Meta: abstract = True @factory.post_generation def tags(self, create, extracted): if create and extracted:...
from django.conf import settings from django.contrib.auth.models import User import factory from website.models import Db, Query class TagsFactory(factory.DjangoModelFactory): class Meta: abstract = True @factory.post_generation def tags(self, create, extracted): if create and extracted:...
Fix issue observed in jenkins errors (missing comma)
/* global UTILS */ 'use strict'; angular.module('alienUiApp').factory('appEnvMngrService', ['applicationEnvironmentServices', function(applicationEnvironmentServices) { return { init: function(applicationId) { if(this.applicationId !== null) { this.close(); } this.applicationId = appli...
/* global UTILS */ 'use strict'; angular.module('alienUiApp').factory('appEnvMngrService', ['applicationEnvironmentServices', function(applicationEnvironmentServices) { return { init: function(applicationId) { if(this.applicationId !== null) { this.close(); } this.applicationId = appli...
FIx Document provider not refetching
import { createAction } from 'redux-actions'; import { createThunkAction } from 'utils/redux'; import isEmpty from 'lodash/isEmpty'; export const fetchCountriesDocumentsInit = createAction( 'fetchCountriesDocumentsInit' ); export const fetchCountriesDocumentsReady = createAction( 'fetchCountriesDocumentsReady' ); ...
import { createAction } from 'redux-actions'; import { createThunkAction } from 'utils/redux'; import isEmpty from 'lodash/isEmpty'; export const fetchCountriesDocumentsInit = createAction( 'fetchCountriesDocumentsInit' ); export const fetchCountriesDocumentsReady = createAction( 'fetchCountriesDocumentsReady' ); ...
Add error logging level methods
<?php namespace LaravelDecouplr\Log; use Decouplr\Decouplr; use Illuminate\Log\Writer; abstract class LaravelLogDecouplr extends Decouplr { public function __construct(Writer $writer){ $this->decoupled = $writer; } public function useFiles() { return $this->delegate(__FU...
<?php namespace LaravelDecouplr\Log; use Decouplr\Decouplr; use Illuminate\Log\Writer; abstract class LaravelLogDecouplr extends Decouplr { public function __construct(Writer $writer){ $this->decoupled = $writer; } public function useFiles() { return $this->delegate(__FU...
Make the weather page use a named controller. We have to use named controllers rather than inline controllers because we want to be able to indicate to the client which controller to use to render the page. We can send the client a string to look up, but we can't reliably serialize the controller function and transmit...
var app = angular.module('simpleapp', ['ng', 'ngRoute']); app.controller( 'simpleController', function ($scope, $location, $http) { $scope.currentUrl = $location.absUrl(); } ); app.controller( 'weatherController', function (weatherData, $scope) { $scope.weather = weatherData; ...
var app = angular.module('simpleapp', ['ng', 'ngRoute']); app.controller( 'simpleController', function ($scope, $location, $http) { $scope.currentUrl = $location.absUrl(); } ); app.config( function ($routeProvider, $locationProvider) { $locationProvider.html5Mode(true); $route...
Remove unused and commented code
#!/usr/bin/env node var S=require('surku'); var fs=require('fs'); var surkuConfig={ maxMutations:20, minMutations:1, chunkSize:3000 }; var surku=new S(surkuConfig); function init(config){ surkuConfig.tempDirectory=config.tempDirectory; } function generateTestCase(getSample,callback){ var pre...
#!/usr/bin/env node var S=require('surku'); var fs=require('fs'); var path=require('path'); var surkuConfig={ maxMutations:20, minMutations:1, chunkSize:3000 }; var surku=new S(surkuConfig); function init(config){ surkuConfig.tempDirectory=config.tempDirectory; } function generateTestCase(getSample,...
Update mtgox api endpoint to use SSL
"""Bitccoin ticker module for ppbot. @package ppbot Displays the current bitcoin pricing from mtgox @syntax btc """ import requests import string import json from xml.dom.minidom import parseString from modules import * class Bitcoin(Module): def __init__(self, *args, **kwargs): """Constructor""" ...
"""Bitccoin ticker module for ppbot. @package ppbot Displays the current bitcoin pricing from mtgox @syntax btc """ import requests import string import json from xml.dom.minidom import parseString from modules import * class Bitcoin(Module): def __init__(self, *args, **kwargs): """Constructor""" ...
Feature: Remove deprecated reference + always cleanup the <style> block
<?php namespace Fedeisas\LaravelMailCssInliner; use TijsVerkoyen\CssToInlineStyles\CssToInlineStyles; class CssInlinerPlugin implements \Swift_Events_SendListener { /** * @param Swift_Events_SendEvent $evt */ public function beforeSendPerformed(\Swift_Events_SendEvent $evt) { $message =...
<?php namespace Fedeisas\LaravelMailCssInliner; use TijsVerkoyen\CssToInlineStyles\CssToInlineStyles; class CssInlinerPlugin implements \Swift_Events_SendListener { /** * @param Swift_Events_SendEvent $evt */ public function beforeSendPerformed(\Swift_Events_SendEvent $evt) { $message =...
Bump version to see if pip installs it
import multiprocessing from setuptools import setup, find_packages setup( name='sow-generator', version='0.1.1', description='Create a scope of work from templates and version controlled documentation.', long_description = open('README.rst', 'r').read() + open('CHANGELOG.rst', 'r').read() + open('AUTHO...
import multiprocessing from setuptools import setup, find_packages setup( name='sow-generator', version='0.1', description='Create a scope of work from templates and version controlled documentation.', long_description = open('README.rst', 'r').read() + open('CHANGELOG.rst', 'r').read() + open('AUTHORS...
Fix gulp task. Bundle should start after Transform is done.
var plumber = require("gulp-plumber"); var webpack = require("gulp-webpack"); var cssmin = require("gulp-minify-css"); var csscon = require("gulp-concat-css"); var jshint = require("gulp-jshint"); var watch = require("gulp-watch"); var react = require("gulp-react"); var gulp = require("gulp"); gulp.task("li...
var plumber = require("gulp-plumber"); var webpack = require("gulp-webpack"); var cssmin = require("gulp-minify-css"); var csscon = require("gulp-concat-css"); var jshint = require("gulp-jshint"); var watch = require("gulp-watch"); var react = require("gulp-react"); var gulp = require("gulp"); gulp.task("cs...
Use 'fields' instead of 'kwargs' to document intent.
# -*- coding: utf-8 -*- """ The Renderer class provides the infrastructure for generating template-based code. It's used by the .grammars module for parser generation. """ from __future__ import print_function, division, absolute_import, unicode_literals import itertools from .util import trim def render(item, **field...
# -*- coding: utf-8 -*- """ The Renderer class provides the infrastructure for generating template-based code. It's used by the .grammars module for parser generation. """ from __future__ import print_function, division, absolute_import, unicode_literals import itertools from .util import trim def render(item, **field...
Set defalut focus on first input element in search panel
angular.module('openspecimen') .directive('osRightDrawer', function(osRightDrawerSvc) { return { restrict: 'A', link: function(scope, element, attrs) { element.addClass('os-right-drawer'); element.removeAttr('os-right-drawer'); var header = element.find('div.os-head'); ...
angular.module('openspecimen') .directive('osRightDrawer', function(osRightDrawerSvc) { return { restrict: 'A', link: function(scope, element, attrs) { element.addClass('os-right-drawer'); element.removeAttr('os-right-drawer'); var header = element.find('div.os-head'); ...
Fix Generator verification in loop()
<?php declare(strict_types=1); namespace Funktions; use Exception; use Generator; /** * Return a value based on a test * * @param boolean $test * @param callable $truthy * @param callable $falsy * @return mixed */ function condition(bool $test, callable $truthy, callable $falsy) { if ($test) { re...
<?php declare(strict_types=1); namespace Funktions; use Exception; /** * Return a value based on a test * * @param boolean $test * @param callable $truthy * @param callable $falsy * @return mixed */ function condition(bool $test, callable $truthy, callable $falsy) { if ($test) { return call_user_...
Check in built Stateful mixin
define( ["ember","./machine","exports"], function(__dependency1__, __dependency2__, __exports__) { "use strict"; var Mixin = __dependency1__.Mixin; var computed = __dependency1__.computed; var Machine = __dependency2__["default"] || __dependency2__; __exports__["default"] = Mixin.create({...
define( ["ember","./machine","exports"], function(__dependency1__, __dependency2__, __exports__) { "use strict"; var Mixin = __dependency1__.Mixin; var computed = __dependency1__.computed; var Machine = __dependency2__["default"] || __dependency2__; __exports__["default"] = Mixin.create({ ...
Add 'Systems Administration' to the list of project classifiers
from setuptools import setup, find_packages from suponoff import __version__ as version if __name__ == '__main__': with open("README.rst") as f: long_description = f.read() setup( name="suponoff", version=version, author="Gambit Research", author_email="opensource@gambi...
from setuptools import setup, find_packages from suponoff import __version__ as version if __name__ == '__main__': with open("README.rst") as f: long_description = f.read() setup( name="suponoff", version=version, author="Gambit Research", author_email="opensource@gambi...
Use try_update_model in sign in handler instead of dict update.
""" """ from wheezy.core.collections import attrdict from wheezy.core.comp import u from wheezy.security import Principal from wheezy.web.authorization import authorize from shared.views import APIHandler from membership.validation import credential_validator class SignInHandler(APIHandler): def post(self): ...
""" """ from wheezy.core.collections import attrdict from wheezy.core.comp import u from wheezy.security import Principal from wheezy.web.authorization import authorize from shared.views import APIHandler from membership.validation import credential_validator class SignInHandler(APIHandler): def post(self): ...
Implement deleteAll as a variant of delete Will need to add tests for this entire thing later. Change-Id: Ib40fe1d4f126923ed1788417f144d0d45fd24e61
package org.wikimedia.wikipedia.data; import android.content.ContentProviderClient; import android.net.Uri; import android.os.RemoteException; abstract public class ContentPersister<T> { private final ContentProviderClient client; private final PersistanceHelper<T> persistanceHelper; public ContentPersis...
package org.wikimedia.wikipedia.data; import android.content.ContentProviderClient; import android.net.Uri; import android.os.RemoteException; abstract public class ContentPersister<T> { private final ContentProviderClient client; private final PersistanceHelper<T> persistanceHelper; public ContentPersis...
Fix duplicates in imported venues
var Event = require('../models/Event.js'); var Venue = require('../models/Venue.js'); exports.sync = function(events) { events.map(function(evt) { var eventquery = { 'title': evt.title, 'startAt': evt.startAt }; Event.findOne( eventquery, func...
var Event = require('../models/Event.js'); var Venue = require('../models/Venue.js'); exports.sync = function(events) { events.map(function(evt) { var eventquery = { 'title': evt.title, 'startAt': evt.startAt }; Event.findOne( eventquery, func...
Fix encoding (thanks to Yasushi Masuda)
# -*- coding: utf-8 -*- #$HeadURL$ #$LastChangedDate$ #$LastChangedRevision$ import sys from reportlab.platypus import PageBreak, Spacer from flowables import * import shlex from log import log def parseRaw (data): '''Parse and process a simple DSL to handle creation of flowables. Supported (can...
#$HeadURL$ #$LastChangedDate$ #$LastChangedRevision$ import sys from reportlab.platypus import PageBreak, Spacer from flowables import * import shlex from log import log def parseRaw (data): '''Parse and process a simple DSL to handle creation of flowables. Supported (can add others on request): ...
Change level and experience to regular integers.
module.exports = function(sequelize, DataTypes) { var User = sequelize.define('User', { username: { type: DataTypes.STRING, allowNull: false, unique: true }, password: { type: DataTypes.STRING, allowNull: false }, em...
module.exports = function(sequelize, DataTypes) { var User = sequelize.define('User', { username: { type: DataTypes.STRING, allowNull: false, unique: true }, password: { type: DataTypes.STRING, allowNull: false }, em...
Put React lifecycle hooks on the prototype
import React from 'react'; import ReactDOM from 'react-dom'; /** * @param {ReactClass} Target The component that defines `onOutsideEvent` handler. * @param {String[]} supportedEvents A list of valid DOM event names. Default: ['mousedown']. * @return {ReactClass} */ export default (Target, supportedEvents = ['mouse...
import React from 'react'; import ReactDOM from 'react-dom'; /** * @param {ReactClass} Target The component that defines `onOutsideEvent` handler. * @param {String[]} supportedEvents A list of valid DOM event names. Default: ['mousedown']. * @return {ReactClass} */ export default (Target, supportedEvents = ['mouse...
Allow service provider to run from console
<?php namespace Watson\Breadcrumbs; use Illuminate\Support\ServiceProvider as BaseServiceProvider; class ServiceProvider extends BaseServiceProvider { /** * Indicates if loading of the provider is deferred. * * @var bool */ protected $defer = true; /** * Register the service pro...
<?php namespace Watson\Breadcrumbs; use Illuminate\Support\ServiceProvider as BaseServiceProvider; class ServiceProvider extends BaseServiceProvider { /** * Indicates if loading of the provider is deferred. * * @var bool */ protected $defer = true; /** * Register the service pro...
Order similar artist results properly
from django.db.models import Q import echonest from artists.models import Artist from echonest.models import SimilarResponse from users.models import User from .models import (GeneralArtist, UserSimilarity, Similarity, update_similarities) def add_new_similarities(artist, force_update=False): ...
import echonest from artists.models import Artist from echonest.models import SimilarResponse from users.models import User from .models import (GeneralArtist, UserSimilarity, Similarity, update_similarities) def add_new_similarities(artist, force_update=False): similarities = [] response...
Use a non-locale aware output Otherwise, the alpha value will not be handled correctly i.e. in a German locale (this locale uses a comma instead of a dot).
<?php namespace OzdemirBurak\Iris\Traits; trait AlphaTrait { /** * @var double */ protected $alpha; /** * @param null $alpha * * @return $this|float */ public function alpha($alpha = null) { if ($alpha !== null) { $this->alpha = $alpha <= 1 ? $alp...
<?php namespace OzdemirBurak\Iris\Traits; trait AlphaTrait { /** * @var double */ protected $alpha; /** * @param null $alpha * * @return $this|float */ public function alpha($alpha = null) { if ($alpha !== null) { $this->alpha = $alpha <= 1 ? $alp...
Add rst long description for pypi
""" Copyright (c) 2010-2013, Anthony Garcia <anthony@lagg.me> Distributed under the ISC License (see LICENSE) """ from distutils.core import setup, Command from distutils.errors import DistutilsOptionError from unittest import TestLoader, TextTestRunner import steam class run_tests(Command): description = "Run th...
""" Copyright (c) 2010-2013, Anthony Garcia <anthony@lagg.me> Distributed under the ISC License (see LICENSE) """ from distutils.core import setup, Command from distutils.errors import DistutilsOptionError from unittest import TestLoader, TextTestRunner import steam class run_tests(Command): description = "Run th...
Include level, channel, and datetime in extra data sent to Rollbar.
<?php namespace Monolog\Handler; use RollbarNotifier; use Exception; /** * Sends errors to Rollbar * * @author Paul Statezny <paulstatezny@gmail.com> */ class RollbarHandler extends AbstractProcessingHandler { /** * Rollbar notifier * * @var RollbarNotifier */ protected $rollbarNotifi...
<?php namespace Monolog\Handler; use RollbarNotifier; use Exception; /** * Sends errors to Rollbar * * @author Paul Statezny <paulstatezny@gmail.com> */ class RollbarHandler extends AbstractProcessingHandler { /** * Rollbar notifier * * @var RollbarNotifier */ protected $rollbarNotifi...
Add the Windows compatibility for the processor counter
<?php namespace Liuggio\Fastest\Process; use Symfony\Component\Process\Process; /** * Number of processors seen by the OS and used for process scheduling. */ class ProcessorCounter { const PROC_DEFAULT_NUMBER = 4; const PROC_CPUINFO = '/proc/cpuinfo'; private static $count = null; private $procC...
<?php namespace Liuggio\Fastest\Process; /** * Number of processors seen by the OS and used for process scheduling. */ class ProcessorCounter { const PROC_DEFAULT_NUMBER = 4; const PROC_CPUINFO = '/proc/cpuinfo'; private static $count = null; private $procCPUInfo; public function __construct...
Make privacy checkbox on user form required via required attribute.
from django import forms from tower import ugettext_lazy as _lazy from flicks.base.util import country_choices from flicks.users.models import UserProfile class UserProfileForm(forms.ModelForm): # L10n: Used in a choice field where users can choose between receiving # L10n: HTML-based or Text-only newslette...
from django import forms from tower import ugettext_lazy as _lazy from flicks.base.util import country_choices from flicks.users.models import UserProfile class UserProfileForm(forms.ModelForm): # L10n: Used in a choice field where users can choose between receiving # L10n: HTML-based or Text-only newslette...
Add code in order to get the current user
<?php namespace AppBundle\Controller; use Symfony\Bundle\FrameworkBundle\Controller\Controller; use Symfony\Component\Config\Definition\Exception\Exception; use Symfony\Component\HttpFoundation\ParameterBag; use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpKernel\Exception\NotFoundHttpException...
<?php namespace AppBundle\Controller; use Symfony\Bundle\FrameworkBundle\Controller\Controller; use Symfony\Component\Config\Definition\Exception\Exception; use Symfony\Component\HttpFoundation\ParameterBag; use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpKernel\Exception\NotFoundHttpException...
Create return the created object from mongodb
const ModelState = require('../model-state'); class BaseData { constructor(db, ModelClass, validator) { this.db = db; this.validator = validator; this.collectionName = ModelClass.name.toLowerCase() + 's'; this.collection = db.collection(this.collectionName); } getAll(filter...
const ModelState = require('../model-state'); class BaseData { constructor(db, ModelClass, validator) { this.db = db; this.validator = validator; this.collectionName = ModelClass.name.toLowerCase() + 's'; this.collection = db.collection(this.collectionName); } getAll(filter...
Move urlWithExtension to the global common Remove from content common as it overwrites the global common defined by the user
const config = { common: { outputDir: 'public', styles: [], scripts: [], urlWithExtension: false, }, template: { common: { path: 'templates', // Path where the templates are }, pug: { pretty: true, }, }, file: { html: {}, json: {}, markdown: {}, yaml...
const config = { common: { outputDir: 'public', styles: [], scripts: [], }, template: { common: { path: 'templates', // Path where the templates are }, pug: { pretty: true, }, }, file: { html: {}, json: {}, markdown: {}, yaml: {}, }, asset: { act...
Stop stripping out the Server header from response from origins. Should overwrite this in a zuul filter if we don't want to use the Server header from origin, rather than removing it by default.
package com.netflix.zuul.util; import com.netflix.client.http.HttpResponse; import com.netflix.zuul.message.http.HttpRequestMessage; import org.junit.Assert; import org.junit.Test; import org.junit.runner.RunWith; import org.mockito.Mock; import org.mockito.runners.MockitoJUnitRunner; /** * User: michaels@netflix.co...
package com.netflix.zuul.util; import com.netflix.client.http.HttpResponse; import com.netflix.zuul.message.http.HttpRequestMessage; import org.junit.Assert; import org.junit.Test; import org.junit.runner.RunWith; import org.mockito.Mock; import org.mockito.runners.MockitoJUnitRunner; /** * User: michaels@netflix.co...
Add URLs to each searializer
from django.contrib.auth.models import User from .models import ContentItem, Profile, Comment, Hashtag, ContentHashTag, Like from rest_framework import serializers class UserSerializer(serializers.HyperlinkedModelSerializer): class Meta: model = User fields = ('id', 'url', 'username', 'email', 'la...
from django.contrib.auth.models import User from .models import ContentItem, Profile, Comment, Hashtag, ContentHashTag, Like from rest_framework import serializers class UserSerializer(serializers.HyperlinkedModelSerializer): class Meta: model = User fields = ('id', 'url', 'username', 'email', 'la...
Allow retrieval of external api credentials
#!/usr/bin/env python2.7 import os import json class OAEnv(object): @property def static_http_root(self): if self.envcfg['httpinfo']['secure'] is True: security = "https://" else: security = "http://" return "%s%s" % ( security, self.envcfg['httpinfo']['httproo...
#!/usr/bin/env python2.7 import os import json class OAEnv(object): @property def static_http_root(self): if self.envcfg['httpinfo']['secure'] is True: security = "https://" else: security = "http://" return "%s%s" % ( security, self.envcfg['httpinfo']['httproo...
Revert "Allow Ref in StringValue" This reverts commit a1957fb04118ce13f2cb37a52bc93718eed0ae41.
from . import AWSObject, AWSProperty, Ref from .validators import boolean class ParameterObjectAttribute(AWSProperty): props = { 'Key': (basestring, True), 'StringValue': (basestring, False), } class ParameterObject(AWSProperty): props = { 'Attributes': ([ParameterObjectAttribute...
from . import AWSObject, AWSProperty, Ref from .validators import boolean class ParameterObjectAttribute(AWSProperty): props = { 'Key': (basestring, True), 'StringValue': (basestring, False), } class ParameterObject(AWSProperty): props = { 'Attributes': ([ParameterObjectAttribute...
Drop back to state as return val If we store state on Algorithm then we're not thread-safe.
from __future__ import absolute_import from __future__ import division from __future__ import print_function from __future__ import unicode_literals from algorithm import Algorithm def main(): Server().main() class Server(object): def __init__(self, argv=None): self.argv = argv def get_algor...
from __future__ import absolute_import from __future__ import division from __future__ import print_function from __future__ import unicode_literals from algorithm import Algorithm def main(): Server().main() class Server(object): def __init__(self, argv=None): self.argv = argv def get_algor...
:ambulance: Remove ref to deleted file
/* @flow */ import React from 'react' import TogglolCalendar from './TogglolCalendar' import ApiKeyInput from './ApiKeyInput' import type { TimeEntryObject } from '../interfaces/togglol' import type { ProjectObject } from '../interfaces/togglol' type Props = { time_entries: Array<TimeEntryObject>, user_loade...
/* @flow */ import React from 'react' import classes from './Togglol.scss' import TogglolCalendar from './TogglolCalendar' import ApiKeyInput from './ApiKeyInput' import type { TimeEntryObject } from '../interfaces/togglol' import type { ProjectObject } from '../interfaces/togglol' type Props = { time_entries:...
Use classifiers to specify the license. Classifiers are a standard way of specifying a license, and make it easy for automated tools to properly detect the license of the package. The "license" field should only be used if the license has no corresponding Trove classifier.
#!/usr/bin/python import os import re from setuptools import setup from m2r import parse_from_file import restructuredtext_lint # Parser README.md into reStructuredText format rst_readme = parse_from_file('README.md') # Validate the README, checking for errors errors = restructuredtext_lint.lint(rst_readme) # Raise ...
#!/usr/bin/python import os import re from setuptools import setup from m2r import parse_from_file import restructuredtext_lint # Parser README.md into reStructuredText format rst_readme = parse_from_file('README.md') # Validate the README, checking for errors errors = restructuredtext_lint.lint(rst_readme) # Raise ...
Fix index as key anti pattern
import React from 'react'; import { BrowserRouter, Match, Miss } from 'react-router' import Header from './components/Header'; import CTA from './components/CTA'; import Footer from './components/Footer'; import routes from './config/routes'; import FourOhFour from './components/404'; const App = () => ( // <Browser...
import React from 'react'; import { BrowserRouter, Match, Miss } from 'react-router' import Header from './components/Header'; import CTA from './components/CTA'; import Footer from './components/Footer'; import routes from './config/routes'; import FourOhFour from './components/404'; const App = () => ( // <Browser...
Remove glide, she doesn't even go here
<?php namespace Northstar\Services; use DoSomething\Gateway\Common\RestApiClient; class Fastly extends RestApiClient { /** * Create a new Fastly API client. */ public function __construct() { $url = config('services.fastly.url'); $options = [ 'headers' => [ ...
<?php namespace Northstar\Services; use DoSomething\Gateway\Common\RestApiClient; class Fastly extends RestApiClient { /** * Create a new Fastly API client. */ public function __construct() { $url = config('services.fastly.url'); $options = [ 'headers' => [ ...
Make sure the middleware checks URIs case insensitive
<?php namespace A3020\Centry\Http\Middleware; use Concrete\Core\Application\ApplicationAwareInterface; use Concrete\Core\Application\ApplicationAwareTrait; use Concrete\Core\Http\Middleware\DelegateInterface; use Concrete\Core\Http\Middleware\MiddlewareInterface; use Illuminate\Config\Repository; use Symfony\Componen...
<?php namespace A3020\Centry\Http\Middleware; use Concrete\Core\Application\ApplicationAwareInterface; use Concrete\Core\Application\ApplicationAwareTrait; use Concrete\Core\Http\Middleware\DelegateInterface; use Concrete\Core\Http\Middleware\MiddlewareInterface; use Illuminate\Config\Repository; use Symfony\Componen...
Remove pointless `_cache` attribute on MemcacheLock class. If this was doing anything useful, I have no idea what it was.
import random import time from datetime import datetime from django.core.cache import cache class MemcacheLock(object): def __init__(self, identifier, unique_value): self.identifier = identifier self.unique_value = unique_value @classmethod def acquire(cls, identifier, wait=True, steal_a...
import random import time from datetime import datetime from django.core.cache import cache class MemcacheLock(object): def __init__(self, identifier, cache, unique_value): self.identifier = identifier self._cache = cache self.unique_value = unique_value @classmethod def acquire(...
Fix for function signature change in 0.4.0 in fetch_access_token
""" LswApi auth plugin for HTTPie. """ from json import loads, dumps from time import time from os import path from lswapi import __auth_token_url__, __token_store__, fetch_access_token from requests import post from httpie.plugins import AuthPlugin class LswApiAuth(object): def __init__(self, client_id, client_s...
""" LswApi auth plugin for HTTPie. """ from json import loads, dumps from time import time from os import path from lswapi import __auth_token_url__, __token_store__, fetch_access_token from requests import post from httpie.plugins import AuthPlugin class LswApiAuth(object): def __init__(self, client_id, client_s...
Set the role to button instead of tab
import 'accordion/src/accordion.js'; (function() { "use strict"; document.querySelectorAll('.accordion').forEach(function(item) { new Accordion(item, { onToggle: function(target){ // Only allow one accordion item open at time target.accordion.folds.forEach(f...
import 'accordion/src/accordion.js'; (function() { "use strict"; document.querySelectorAll('.accordion').forEach(function(item) { new Accordion(item, { onToggle: function(target){ // Only allow one accordion item open at time target.accordion.folds.forEach(f...
Fix for CI comment - this._super(); + this._super(...arguments);
import Ember from 'ember' import _ from 'lodash/lodash' export default Ember.Component.extend({ classNames: ['frost-pods'], classNameBindings: ['orientation'], orientation: 'vertical', podNames: Ember.computed('podStack.[]', function () { return _.dropRight(this.get('podStack').map(function (entry) { ...
import Ember from 'ember' import _ from 'lodash/lodash' export default Ember.Component.extend({ classNames: ['frost-pods'], classNameBindings: ['orientation'], orientation: 'vertical', podNames: Ember.computed('podStack.[]', function () { return _.dropRight(this.get('podStack').map(function (entry) { ...
Add method that returns Birth based on age
package sizebay.catalog.client.model; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import lombok.Data; import lombok.NoArgsConstructor; import lombok.experimental.Accessors; import java.io.Serializable; import java.math.BigDecimal; import java.time.ZoneId; import java.time.ZonedDateTime; import java....
package sizebay.catalog.client.model; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import lombok.Data; import lombok.NoArgsConstructor; import lombok.experimental.Accessors; import java.io.Serializable; import java.util.HashMap; import java.util.Map; @Data @Accessors(chain = true) @NoArgsConstructor...
Add one more event button
$(document).ready(function(){ var div = d3.select("body").append("div") .attr("class", "tooltip") .style("opacity", 0); var interactiveBrowse_humanAndEcosystems = d3.select("#interactiveBrowse_humanAndEcosystems"); var toxicity = interactiveBrowse_humanAndEcosystems.append("rect") ...
$(document).ready(function(){ var div = d3.select("body").append("div") .attr("class", "tooltip") .style("opacity", 0); var interactiveBrowse_humanAndEcosystems = d3.select("#interactiveBrowse_humanAndEcosystems"); var toxicity = interactiveBrowse_humanAndEcosystems.append("rect") ...
Add ActionBar title on QnaBuilder
package zero.zd.zquestionnaire; import android.content.Context; import android.content.Intent; import android.os.Bundle; import android.support.v7.app.ActionBar; import android.support.v7.app.AppCompatActivity; import android.view.Menu; import android.view.MenuItem; import android.view.View; import android.widget.Toas...
package zero.zd.zquestionnaire; import android.content.Context; import android.content.Intent; import android.os.Bundle; import android.support.v7.app.AppCompatActivity; import android.view.Menu; import android.view.MenuItem; import android.view.View; import android.widget.Toast; public class QnaBuilderActivity exten...
Update SdlArtwork test to have reusable equalTest
package com.smartdevicelink.managers.file; import com.smartdevicelink.AndroidTestCase2; import com.smartdevicelink.managers.file.filetypes.SdlArtwork; import com.smartdevicelink.managers.file.filetypes.SdlFile; import com.smartdevicelink.proxy.rpc.enums.StaticIconName; import com.smartdevicelink.test.Test; public cla...
package com.smartdevicelink.managers.file; import com.smartdevicelink.AndroidTestCase2; import com.smartdevicelink.managers.file.filetypes.SdlArtwork; import com.smartdevicelink.managers.file.filetypes.SdlFile; import com.smartdevicelink.proxy.rpc.enums.StaticIconName; import com.smartdevicelink.test.Test; public cla...
Remove extraneous OSC message listener in SoundTestController
'use strict'; angular.module('core').controller('SoundTestController', ['$scope', 'TrialData', function($scope, TrialData) { /* global io */ var socket = io(); // Send a message to Max to start the sound test socket.emit('sendOSCMessage', { oscType: 'message', address: '/eim/control/sou...
'use strict'; angular.module('core').controller('SoundTestController', ['$scope', 'TrialData', function($scope, TrialData) { /* global io */ var socket = io(); socket.on('oscMessageSent', function(data) { console.log('socket "oscMessageSent" event received with data: ' + data); }); socke...
Put weaker requirements on Archive.org service
# -*- coding: utf-8 -*- """ This module contains Service implementation of Archive.org. http://archive.org """ from . import Service, JSONMixin from six import text_type from tornado.httpclient import HTTPRequest ############################################################################## class ArchiveOrg(JSON...
# -*- coding: utf-8 -*- """ This module contains Service implementation of Archive.org. http://archive.org """ from . import Service, JSONMixin from six import text_type from tornado.httpclient import HTTPRequest ############################################################################## class ArchiveOrg(JSON...
Return a simple object when an entity is picked
angular.module('OpiferEntityPicker', ['ui.bootstrap.typeahead']) .directive('entityPicker', function() { var tpl = '<input type="text" ng-model="search" typeahead="object.name for object in getObject($viewValue)" typeahead-on-select="onSelect($item, $model, $label)" typeahead-loading="loadingL...
angular.module('OpiferEntityPicker', ['ui.bootstrap.typeahead']) .directive('entityPicker', function() { var tpl = '<input type="text" ng-model="search" typeahead="object.name for object in getObject($viewValue)" typeahead-on-select="onSelect($item, $model, $label)" typeahead-loading="loadingL...
Add assertions for error logging
(function () { 'use strict'; var reverseUrl, $route; var routeMock = {}; routeMock.routes = { '/testRoute1/': { controller: 'TestController1', originalPath: '/test-route-1/' }, '/testRoute1/:params/': { controller: 'TestController1', ...
(function () { 'use strict'; var reverseUrl, $route; var routeMock = {}; routeMock.routes = { '/testRoute1/': { controller: 'TestController1', originalPath: '/test-route-1/' }, '/testRoute1/:params/': { controller: 'TestController1', ...
Add tests for TCP flow interception
import pytest from mitmproxy.addons import intercept from mitmproxy import exceptions from mitmproxy.test import taddons from mitmproxy.test import tflow def test_simple(): r = intercept.Intercept() with taddons.context(r) as tctx: assert not r.filt tctx.configure(r, intercept="~q") a...
import pytest from mitmproxy.addons import intercept from mitmproxy import exceptions from mitmproxy.test import taddons from mitmproxy.test import tflow def test_simple(): r = intercept.Intercept() with taddons.context(r) as tctx: assert not r.filt tctx.configure(r, intercept="~q") a...
Handle response status and headers in default adapter
<?php namespace Hochstrasser\Wirecard; use Psr\Http\Message\RequestInterface; use GuzzleHttp\Psr7\Response; use GuzzleHttp\Psr7; abstract class Adapter { static function defaultAdapter() { return function (RequestInterface $request) { $headers = []; foreach ($request->getHead...
<?php namespace Hochstrasser\Wirecard; use Psr\Http\Message\RequestInterface; use GuzzleHttp\Psr7\Response; use GuzzleHttp\Psr7; abstract class Adapter { static function defaultAdapter() { return function (RequestInterface $request) { $headers = []; foreach ($request->getHead...
Add method to create a test container to interface I've simply forgot that...
<?php declare(strict_types=1); namespace Lcobucci\DependencyInjection; use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface; use Symfony\Component\DependencyInjection\Compiler\PassConfig; use Symfony\Component\DependencyInjection\ContainerInterface; /** * Definition of how the container builder ...
<?php declare(strict_types=1); namespace Lcobucci\DependencyInjection; use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface; use Symfony\Component\DependencyInjection\Compiler\PassConfig; use Symfony\Component\DependencyInjection\ContainerInterface; /** * Definition of how the container builder ...
Disable autocomplete for client_id and client_secret inputs on Wave credentials form
<?php /** * Form for Wave credentials. * * @license http://opensource.org/licenses/MIT The MIT License (MIT) */ namespace Wave\Form\Type; use Symfony\Component\Form\AbstractType; use Symfony\Component\Form\FormBuilderInterface; use Symfony\Component\Form\FormInterface; use Symfony\Component\Form\FormView; use S...
<?php /** * Form for Wave credentials. * * @license http://opensource.org/licenses/MIT The MIT License (MIT) */ namespace Wave\Form\Type; use Symfony\Component\Form\AbstractType; use Symfony\Component\Form\FormBuilderInterface; use Symfony\Component\Form\FormInterface; use Symfony\Component\Form\FormView; use S...
Fix PHP warning when submitting new conversation without any recipient
<?php namespace FireDIY\PrivateMessageBundle\Validator; use FireDIY\PrivateMessageBundle\Entity\Conversation; use Symfony\Component\Validator\Context\ExecutionContextInterface; /** * Class ConversationValidator * @package FireDIY\PrivateMessageBundle\Validator */ class ConversationValidator { const RECIPIENT_...
<?php namespace FireDIY\PrivateMessageBundle\Validator; use FireDIY\PrivateMessageBundle\Entity\Conversation; use Symfony\Component\Validator\Context\ExecutionContextInterface; /** * Class ConversationValidator * @package FireDIY\PrivateMessageBundle\Validator */ class ConversationValidator { const RECIPIENT_...
Add support of s3 path
""" This command will create and run survey jobs for each SRA run accession in the range from start_accession to end_accession. """ import boto3 import botocore import uuid from django.core.management.base import BaseCommand from data_refinery_foreman.surveyor import surveyor from data_refinery_common.logging import ...
""" This command will create and run survey jobs for each SRA run accession in the range from start_accession to end_accession. """ from django.core.management.base import BaseCommand from data_refinery_foreman.surveyor import surveyor from data_refinery_common.logging import get_and_configure_logger logger = get_an...
Fix navigator.languages not supported in IE and Safari
import ActionTypes from '../constants/ActionTypes'; import BaseStore from './BaseStore'; class LocaleStore extends BaseStore { constructor() { super(); this.subscribe(() => this._registerToActions.bind(this)); this._locale = 'en'; let locale = localStorage.getItem('locale'); ...
import ActionTypes from '../constants/ActionTypes'; import BaseStore from './BaseStore'; class LocaleStore extends BaseStore { constructor() { super(); this.subscribe(() => this._registerToActions.bind(this)); this._locale = 'en'; let locale = localStorage.getItem('locale'); ...
Fix image grouping in gallery view
from django.shortcuts import render from .models import Image from .forms import ImageForm from django.views.generic import CreateView, DeleteView, UpdateView, ListView, View from django.shortcuts import redirect, get_object_or_404 from django.http import HttpResponseRedirect, HttpResponse from django.contrib.auth.deco...
from django.shortcuts import render from .models import Image from .forms import ImageForm from django.views.generic import CreateView, DeleteView, UpdateView, ListView, View from django.shortcuts import redirect, get_object_or_404 from django.http import HttpResponseRedirect, HttpResponse from django.contrib.auth.deco...
feat: Modify script which split your region in smaller sample
#!/usr/bin/env python # -*- coding: utf-8 -*- import xml.etree.ElementTree as ET # Use cElementTree or lxml if too slow import os OSM_FILE = "san-francisco-bay_california.osm" # Replace this with your osm file SAMPLE_FILE = "sample_sfb.osm" k = 20 # Parameter: take every k-th top level element def get_element(osm...
#!/usr/bin/env python # -*- coding: utf-8 -*- import xml.etree.ElementTree as ET # Use cElementTree or lxml if too slow import os OSM_FILE = "san-francisco-bay_california.osm" # Replace this with your osm file SAMPLE_FILE = "sample_sfb.osm" k = 20 # Parameter: take every k-th top level element def get_element(osm...
Append lang mock to the end of file to not make source map being invalid.
var vfs = require('enb/lib/fs/async-fs'); module.exports = require('enb/lib/build-flow').create() .name('mock-lang-js.js') .target('target', '?.js') .useSourceFilename('source', '?.lang.js') .builder(function (source) { return vfs.read(source, 'utf8') .then(function (content) { ...
var vfs = require('enb/lib/fs/async-fs'); module.exports = require('enb/lib/build-flow').create() .name('mock-lang-js.js') .target('target', '?.js') .useSourceFilename('source', '?.lang.js') .builder(function (source) { return vfs.read(source, 'utf8') .then(function (content) { ...
Switch to using options, as with newer module definitions - Also allows easier extension of existing objects within the option set
define([ 'common/collections/single-timeseries' ], function (Collection) { return { requiresSvg: true, hasDatePicker: true, collectionClass: Collection, collectionOptions: function () { var options = {}; options.numeratorMatcher = new RegExp(this.model.get('numerator-matcher')), o...
define([ 'common/collections/single-timeseries' ], function (Collection) { return { requiresSvg: true, hasDatePicker: true, collectionClass: Collection, collectionOptions: function () { return { numeratorMatcher: new RegExp(this.model.get('numerator-matcher')), denominatorMatc...
Update license text and classifiers and README ext
############################################################################## # # Copyright Benji York and Contributors. # All Rights Reserved. # # This software is subject to the provisions of the Apache License, Version # 2.0. # # THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED # WARRANTIES ARE ...
############################################################################## # # Copyright Benji York and Contributors. # All Rights Reserved. # # This software is subject to the provisions of the Apache License, Version # 2.0. # # THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED # WARRANTIES ARE ...
Split the transformation to File's.
package org.jboss.loom.utils; import java.io.File; import java.io.IOException; import java.util.ArrayList; import java.util.Arrays; import java.util.List; import org.apache.tools.ant.DirectoryScanner; /** * Usage: * * <pre><code>files = new DirScanner("** /foo/*.bar").list( baseDir );</code></pre> * * @au...
package org.jboss.loom.utils; import java.io.File; import java.io.IOException; import java.util.ArrayList; import java.util.List; import org.apache.tools.ant.DirectoryScanner; /** * Usage: * * <pre><code>files = new DirScanner("** /foo/*.bar").list( baseDir );</code></pre> * * @author Ondrej Zizka, ozizka...
Fix minor issues in CollisionManager
"use strict"; function CollisionManager() { var objects = []; this.intersect = function(object1, object2) { var pos1 = object1.getLocation(); var pos2 = object2.getLocation(); return (((pos1.x >= pos2.x && pos1.x <= pos2.x + pos2.width) && (pos1.y >= pos2.y && pos1.y...
"use strict"; function CollisionManager() { var objects = []; this.intersect = function(object1, object2) { var pos1 = object1.getLocation(); var pos2 = object2.getLocation(); return (((pos1.x >= pos2.x && pos1.x <= pos2.x + pos2.width) && (pos1.y >= pos2.y && pos1.y...