Dataset Viewer
Auto-converted to Parquet Duplicate
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...
End of preview. Expand in Data Studio
README.md exists but content is empty.
Downloads last month
28