text
stringlengths
17
1.47k
positive
stringlengths
673
4.43k
negative
stringlengths
677
2.81k
Add another property to the model.
var mongoose = require("mongoose"); var ArtworkSchema = new mongoose.Schema({ "P43_has_dimension": [ { "@type": String, "P90_has_value": String, "P91_has_unit": { "@id": String } } ], "P70i_is_documented_in": { "P3_has_...
var mongoose = require("mongoose"); var ArtworkSchema = new mongoose.Schema({ "P43_has_dimension": [ { "@type": String, "P90_has_value": String, "P91_has_unit": { "@id": String } } ], "P108i_was_produced_by": { "@type":...
Use mask 0xff for the joypad.
package eu.rekawek.coffeegb.controller; import eu.rekawek.coffeegb.AddressSpace; import eu.rekawek.coffeegb.cpu.InterruptManager; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import java.util.HashSet; import java.util.Set; public class Joypad implements AddressSpace { private static final Logger LOG...
package eu.rekawek.coffeegb.controller; import eu.rekawek.coffeegb.AddressSpace; import eu.rekawek.coffeegb.cpu.InterruptManager; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import java.util.HashSet; import java.util.Set; public class Joypad implements AddressSpace { private static final Logger LOG...
Add unit test to verify javacc dependency configuration
package ca.coglinc.gradle.plugins.javacc; import static org.junit.Assert.assertNotNull; import static org.junit.Assert.assertTrue; import org.gradle.api.Project; import org.gradle.api.Task; import org.gradle.api.artifacts.Configuration; import org.gradle.testfixtures.ProjectBuilder; import org.junit.Before; import or...
package ca.coglinc.gradle.plugins.javacc; import java.util.HashMap; import java.util.Map; import org.gradle.api.Project; import org.gradle.api.Task; import org.gradle.testfixtures.ProjectBuilder; import org.junit.Assert; import org.junit.Before; import org.junit.Test; public class JavaccPluginTest { private Proj...
Unify promiseThrottler. Add 'key' to options.
/* * Author: CM */ (function(global) { /** * @param {PromiseThrottled} fn * @param {Object|null} [options] * @param {Boolean} options.cancel Whether to cancel the previous promise if it is still running. * @returns {PromiseThrottled} */ function promiseThrottler(fn, options) { options = _.def...
/* * Author: CM */ (function(global) { /** * @callback PromiseThrottled * @param {...Object|String|Number} any number of optional params * @return {Promise} */ /** * @param {PromiseThrottled} fn * @param {Object|null} options * @param {Boolean} options.cancel Whether to cancel the previous...
Change soundcloud sync to happen every 20 minutes
import logging import newrelic.agent log = logging.getLogger(__name__) def send_saved_search_alerts(): from pmg import app from pmg.models import SavedSearch application = newrelic.agent.application() with newrelic.agent.BackgroundTask(application, name='send_saved_search_alerts', group='Task'): ...
import logging import newrelic.agent log = logging.getLogger(__name__) def send_saved_search_alerts(): from pmg import app from pmg.models import SavedSearch application = newrelic.agent.application() with newrelic.agent.BackgroundTask(application, name='send_saved_search_alerts', group='Task'): ...
Enable auto creating translation category
<?php namespace papalapa\yiistart\models; use papalapa\yiistart\modules\i18n\models\SourceMessage; use papalapa\yiistart\modules\i18n\models\SourceMessageCategories; use yii\i18n\MissingTranslationEvent; /** * Class TranslationEventHandler * @package papalapa\yiistart\models */ ...
<?php namespace papalapa\yiistart\models; use papalapa\yiistart\modules\i18n\models\SourceMessage; use papalapa\yiistart\modules\i18n\models\SourceMessageCategories; use yii\i18n\MissingTranslationEvent; /** * Class TranslationEventHandler * @package papalapa\yiistart\models */ ...
Use a real email in contactUs email from-field
Meteor.methods({ addContactUsMessage: function(message) { try { // synchronous (to the server) insert ContactUsMessages.insert({ name: message.name, email: message.email, zipcode: message.zipcode, text: message.text, createdAt: new Date(), authorId: Met...
Meteor.methods({ addContactUsMessage: function(message) { try { // synchronous (to the server) insert ContactUsMessages.insert({ name: message.name, email: message.email, zipcode: message.zipcode, text: message.text, createdAt: new Date(), authorId: Met...
Prepend base URL to assets
<!doctype html> <html> <head> <meta charset="utf-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <title>{{ $title }}</title> <meta name="description" content=""> <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, minimum-scale=1"> <meta name="theme-c...
<!doctype html> <html> <head> <meta charset="utf-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <title>{{ $title }}</title> <meta name="description" content=""> <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, minimum-scale=1"> <meta name="theme-c...
[logicmind] Allow more representations when parsing
from tokens.andd import And from tokens.expression import Expression from tokens.iff import Iff from tokens.nop import Not from tokens.orr import Or from tokens.then import Then from tokens.variable import Variable class TokenParser: """This parser only works with atomic expressions, so parenthesis are nee...
from tokens.andd import And from tokens.expression import Expression from tokens.iff import Iff from tokens.nop import Not from tokens.orr import Or from tokens.then import Then from tokens.variable import Variable class TokenParser: """This parser only works with atomic expressions, so parenthesis are nee...
Make sure events are working correctly on front page
define([ 'zepto', 'Underscore', 'Backbone', 'models/expenses', 'text!../../tpl/home.html' ], function ($, _, Backbone, Expenses, template) { var HomeView = Backbone.View.extend({ events:{ "click #get":"refresh", "click tr": "navigate_row" ...
define([ 'zepto', 'Underscore', 'Backbone', 'models/expenses', 'text!../../tpl/home.html' ], function ($, _, Backbone, Expenses, template) { var HomeView = Backbone.View.extend({ events:{ "click #get":"refresh" }, initialize: function...
Revert "rm for readd alter" This reverts commit 0a0a873bb6a66a9be52dfd3f13fc1f1d0d8af226.
<?php class Pagination extends Schema { function __construct($config){ parent::__construct($config); $max = isset($config['size'])? $config['size'] : 100; $this->_schema = array( "type"=> "object", "description"=> "Request a slice of the final data set.", ...
<?php class Pagination extends Schema { function __construct($config){ parent::__construct($config); $this->_schema = array( "type"=> "object", "description"=> "Request a slice of the final data set.", "properties"=> array( "limit"=> array( ...
Add 3.5 to PyPI info
# -*- coding: utf-8 -*- try: from setuptools import setup except ImportError: from distutils.core import setup with open('README.rst') as f: readme = f.read() setup( name='whatthepatch', version='0.0.3', description='A patch parsing library.', long_description=readme, author='Christo...
# -*- coding: utf-8 -*- try: from setuptools import setup except ImportError: from distutils.core import setup with open('README.rst') as f: readme = f.read() setup( name='whatthepatch', version='0.0.3', description='A patch parsing library.', long_description=readme, author='Christo...
Undo redundant embedded URI check. git-svn-id: 25f448894bd6eb0cddf10ded73b4f5a7ea3203f3@1782 48356398-32a2-884e-a903-53898d9a118a
<?php class HTMLPurifier_URIFilter_SecureMunge extends HTMLPurifier_URIFilter { public $name = 'SecureMunge'; public $post = true; private $target, $secretKey, $parser; public function prepare($config) { $this->target = $config->get('URI', 'SecureMunge'); $this->secretKey = $config->get...
<?php class HTMLPurifier_URIFilter_SecureMunge extends HTMLPurifier_URIFilter { public $name = 'SecureMunge'; public $post = true; private $target, $secretKey, $parser; public function prepare($config) { $this->target = $config->get('URI', 'SecureMunge'); $this->secretKey = $config->get...
Fix component defaults was shared
import pluck from './pluck'; import { ref, refs, noop, mixin, insertCss, emptyTemplate, computedAll, pureComputedAll } from '../util/'; const modulePolyfill = { constructor: noop, defaults: {}, template: emptyTemplate }; // Transform transiton component module to native com...
import pluck from './pluck'; import { ref, refs, noop, mixin, insertCss, emptyTemplate, computedAll, pureComputedAll } from '../util/'; const modulePolyfill = { constructor: noop, defaults: {}, template: emptyTemplate }; // Transform transiton component module to native com...
Fix errors in integration pkg
package com.raoulvdberge.refinedstorage.integration.forgeenergy; import net.minecraft.item.ItemStack; import net.minecraft.nbt.CompoundNBT; import net.minecraftforge.energy.EnergyStorage; public class ItemEnergyForge extends EnergyStorage { private static final String NBT_ENERGY = "Energy"; private ItemStack...
package com.raoulvdberge.refinedstorage.integration.forgeenergy; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraftforge.energy.EnergyStorage; public class ItemEnergyForge extends EnergyStorage { private static final String NBT_ENERGY = "Energy"; private ItemSt...
Fix update_permission command for legacy content types
import logging from django.conf import settings from django.utils.importlib import import_module from django.db.models import get_apps from django.contrib.auth.management import create_permissions from django.contrib.auth.models import Permission from django.contrib.contenttypes.models import ContentType from django.c...
import logging from django.conf import settings from django.utils.importlib import import_module from django.db.models import get_apps from django.contrib.auth.management import create_permissions from django.contrib.auth.models import Permission from django.contrib.contenttypes.models import ContentType from django.c...
Test the actual test result.
/* eslint-disable no-console, no-duplicate-imports, import/no-duplicates */ import _ from 'lodash'; import proxyquire from 'proxyquire'; import describe from '../src'; import { specStream } from '../src'; describe('RxT', (it) => { it('should run a simple passing and failing given/when/then test', test => test ...
/* eslint-disable no-console, no-duplicate-imports, import/no-duplicates */ import proxyquire from 'proxyquire'; import describe from '../src'; import { specStream } from '../src'; describe('RxT', (it) => { it('should run a simple passing and failing given/when/then test', test => test .given('givenWhenThe...
Stop processing when language is deselected.
import axios from 'axios'; import { CHANGE_LANGUAGE, FETCH_NODES, FILTER_CONTENT_KIND, FILTER_TOPIC, FILTER_VISIBIITY, } from './types'; const API_TRANSLATE_NOW = 'https://www.khanacademy.org/api/internal/translate_now?'; /** * Activated by the user. Triggers other actions, does nothing by itself...
import axios from 'axios'; import { CHANGE_LANGUAGE, FETCH_NODES, FILTER_CONTENT_KIND, FILTER_TOPIC, FILTER_VISIBIITY, } from './types'; const API_TRANSLATE_NOW = 'https://www.khanacademy.org/api/internal/translate_now?'; /** * Activated by the user. Triggers other actions, does nothing by itself...
Include config files in the pip install
#!/usr/bin/env python from setuptools import setup, find_packages from dreambeam import __version__ setup(name='dreamBeam', version=__version__, description='Measurement equation framework for radio interferometry.', author='Tobia D. Carozzi', author_email='tobia.carozzi@chalmers.se', pa...
#!/usr/bin/env python from setuptools import setup, find_packages from dreambeam import __version__ setup(name='dreamBeam', version=__version__, description='Measurement equation framework for radio interferometry.', author='Tobia D. Carozzi', author_email='tobia.carozzi@chalmers.se', pa...
Support to request null string
import ast def isEmpty(value): if value: return False else: return True def isNotEmpty(value): if not value: return False else: return True def stringToDict(param): if isNotEmpty(param) or param != '': return ast.literal_eval(param) def stringToDictLis...
import ast def isEmpty(value): if value: return False else: return True def isNotEmpty(value): if not value: return False else: return True def stringToDict(param): if isNotEmpty(param) or param != '': return ast.literal_eval(param) def stringToDictLis...
Check if build number exists (so we won't create a package with 'None' in it's name)
from glob import glob import imp import logging import os import subprocess import mock from setuptools import setup as _setup from vdt.versionplugin.wheel.shared import parse_version_extra_args from vdt.versionplugin.wheel.utils import WheelRunningDistribution logger = logging.getLogger(__name__) def build_packa...
from glob import glob import imp import logging import os import subprocess import mock from setuptools import setup as _setup from vdt.versionplugin.wheel.shared import parse_version_extra_args from vdt.versionplugin.wheel.utils import WheelRunningDistribution logger = logging.getLogger(__name__) def build_packa...
Stop closing the connection. Rely on the pool
var mssql = require("mssql"); var database = { query: function(connection, query, callback) { mssql.connect(connection, function(connectionError) { if(connectionError) { mssql.close(); callback(connectionError, []); } else { var request = new mssql.Request(); // Atta...
var mssql = require("mssql"); var database = { query: function(connection, query, callback) { mssql.connect(connection, function(connectionError) { if(connectionError) { mssql.close(); callback(connectionError, []); } else { var request = new mssql.Request(); // Atta...
Make twine check happy [ci skip]
"""colorise module setup script for distribution.""" from setuptools import setup import os def get_version(filename): with open(filename) as fh: for line in fh: if line.startswith('__version__'): return line.split('=')[-1].strip()[1:-1] setup( name='colorise', versi...
"""colorise module setup script for distribution.""" from setuptools import setup import os def get_version(filename): with open(filename) as fh: for line in fh: if line.startswith('__version__'): return line.split('=')[-1].strip()[1:-1] setup( name='colorise', versi...
Correct the usage of decorator.decorator Correct the usage of decorator.decorator as described in [1]. [1]http://pythonhosted.org/decorator/documentation.html#decorator-decorator Change-Id: Ia71b751f364e09541faecf6a43f252e0b856558e Closes-Bug: #1483464
# Copyright 2015 Huawei Technologies Co.,LTD. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed...
# Copyright 2015 Huawei Technologies Co.,LTD. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed...
Update package description to specify OpenGL 3.3+
from setuptools import setup setup( name="demosys-py", version="0.3.10", description="Modern OpenGL 3.3+ Framework inspired by Django", long_description=open('README.rst').read(), url="https://github.com/Contraz/demosys-py", author="Einar Forselv", author_email="eforselv@gmail.com", mai...
from setuptools import setup setup( name="demosys-py", version="0.3.10", description="Modern OpenGL 4.1+ Framework inspired by Django", long_description=open('README.rst').read(), url="https://github.com/Contraz/demosys-py", author="Einar Forselv", author_email="eforselv@gmail.com", mai...
Test multiple slashes in Path::combine
<?php namespace nochso\Omni\Test; use nochso\Omni\Path; class PathTest extends \PHPUnit_Framework_TestCase { public function combineProvider() { return [ ['', ['', '']], ['/', ['', '/']], ['/', ['/', '']], ['/a', ['/', 'a']], ['foo/bar', ['f...
<?php namespace nochso\Omni\Test; use nochso\Omni\Path; class PathTest extends \PHPUnit_Framework_TestCase { public function combineProvider() { return [ ['', ['', '']], ['/', ['', '/']], ['/', ['/', '']], ['/a', ['/', 'a']], ['foo/bar', ['f...
Fix name/value pairing for Google Font List
<?php /** * Gets a list of cgGroup objects. */ class cgGoogleFontListGetListProcessor extends modObjectGetListProcessor { public $languageTopics = array('clientconfig:default'); /** * {@inheritDoc} * @return mixed */ public function process() { $apiKey = $this->modx->getOption('cli...
<?php /** * Gets a list of cgGroup objects. */ class cgGoogleFontListGetListProcessor extends modObjectGetListProcessor { public $languageTopics = array('clientconfig:default'); /** * {@inheritDoc} * @return mixed */ public function process() { $apiKey = $this->modx->getOption('cli...
Fix certificate regenerating each startup
# Copyright (c) Jupyter Development Team. # Distributed under the terms of the Modified BSD License. from jupyter_core.paths import jupyter_data_dir import subprocess import os import os.path import errno import stat c = get_config() c.NotebookApp.ip = '*' c.NotebookApp.port = 8888 c.NotebookApp.open_browser = False ...
# Copyright (c) Jupyter Development Team. # Distributed under the terms of the Modified BSD License. from jupyter_core.paths import jupyter_data_dir import subprocess import os import errno import stat c = get_config() c.NotebookApp.ip = '*' c.NotebookApp.port = 8888 c.NotebookApp.open_browser = False # Generate a s...
Implement getName() in twig extension
<?php namespace IAkumaI\SphinxsearchBundle\Twig; use IAkumaI\SphinxsearchBundle\Search\Sphinxsearch; /** * Twig extension for Sphinxsearch bundle */ class SphinxsearchExtension extends \Twig_Extension { /** * @var Sphinxsearch */ protected $searchd; /** * Constructor * @param Sphi...
<?php namespace IAkumaI\SphinxsearchBundle\Twig; use IAkumaI\SphinxsearchBundle\Search\Sphinxsearch; /** * Twig extension for Sphinxsearch bundle */ class SphinxsearchExtension extends \Twig_Extension { /** * @var Sphinxsearch */ protected $searchd; /** * Constructor * @param Sphi...
Fix typo in demo gulp file
var gulp = require('gulp'), styleguide = require('./lib/styleguide'), source = 'lib/app/**/*.scss', outputPath = 'demo-output'; gulp.task('styleguide', ['static'], function() { return gulp.src(source) .pipe(styleguide({ title: 'SC5 Styleguide', server: true, rootPath: outputPath, ...
var gulp = require('gulp'), styleguide = require('./lib/styleguide'), source = 'lib/app/**/*.scss', ouputPath = 'demo-output'; gulp.task('styleguide', ['static'], function() { return gulp.src(source) .pipe(styleguide({ title: 'SC5 Styleguide', server: true, rootPath: ouputPath, ...
Fix a remaining reference to 'swingtime' in a comment
#!/usr/bin/env python import os import sys try: from setuptools import setup except ImportError: from distutils.core import setup if sys.argv[-1] == 'publish': os.system('python setup.py sdist upload') sys.exit(0) with open('README.rst', 'r') as f: long_description = f.read() # Dynamically calcu...
#!/usr/bin/env python import os import sys try: from setuptools import setup except ImportError: from distutils.core import setup if sys.argv[-1] == 'publish': os.system('python setup.py sdist upload') sys.exit(0) with open('README.rst', 'r') as f: long_description = f.read() # Dynamically calcu...
Tweak to migration in order to accomodate old names for data fields and allow for if data fields were not present
import json from django.contrib.auth.models import Group from django.core.management.base import BaseCommand from api_manager.models import GroupProfile, Organization class Command(BaseCommand): """ Migrates legacy organization data and user relationships from older Group model approach to newer concrete Org...
import json from django.contrib.auth.models import Group from django.core.management.base import BaseCommand from api_manager.models import GroupProfile, Organization class Command(BaseCommand): """ Migrates legacy organization data and user relationships from older Group model approach to newer concrete Org...
Use hdurl prop from NASA API response `hd` param appears to be obsolete, however there is an hdurl prop in the response
const { nasaApiKey } = require('./nasa-api-key'); exports.decorateConfig = (config) => { return Object.assign({}, config, { backgroundColor: 'transparent' });; } exports.decorateHyper = (Hyper, { React }) => { return class extends React.Component { constructor (props, context) { super(props, cont...
const { nasaApiKey } = require('./nasa-api-key'); exports.decorateConfig = (config) => { return Object.assign({}, config, { backgroundColor: 'transparent' });; } exports.decorateHyper = (Hyper, { React }) => { return class extends React.Component { constructor (props, context) { super(props, cont...
Add badge to Model Collector
<?php namespace Barryvdh\Debugbar\DataCollector; use DebugBar\DataCollector\DataCollector; use DebugBar\DataCollector\DataCollectorInterface; use DebugBar\DataCollector\Renderable; use Illuminate\Contracts\Events\Dispatcher; use Illuminate\Support\Str; /** * Collector for Models. */ class ModelsCollector extends D...
<?php namespace Barryvdh\Debugbar\DataCollector; use DebugBar\DataCollector\DataCollector; use DebugBar\DataCollector\DataCollectorInterface; use DebugBar\DataCollector\Renderable; use Illuminate\Contracts\Events\Dispatcher; use Illuminate\Support\Str; /** * Collector for Models. */ class ModelsCollector extends D...
Add new line to bottom of file
if (Meteor.isServer) { Meteor.methods({ // send user an email when they get a notifcation createNotification: function ( giblet, url, notificationKeys ) { Notifications.insert({ createdAt: new Date(), owner: giblet.owner, gibletID: giblet._id, keywords: notificationKeys, ...
if (Meteor.isServer) { Meteor.methods({ // send user an email when they get a notifcation createNotification: function ( giblet, url, notificationKeys ) { Notifications.insert({ createdAt: new Date(), owner: giblet.owner, gibletID: giblet._id, keywords: notificationKeys, ...
Remove unused class that caused the error
<?php /* * This file is part of the Doctrine\OrientDB package. * * (c) Alessandro Nadalin <alessandro.nadalin@gmail.com> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ /** * Class Updates * * @package Doctrine\OrientDB *...
<?php /* * This file is part of the Doctrine\OrientDB package. * * (c) Alessandro Nadalin <alessandro.nadalin@gmail.com> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ /** * Class Updates * * @package Doctrine\OrientDB *...
Make plain repl work again.
import sys import getopt from ctl import HavenCtl def print_version(): import pkg_resources # part of setuptools version = pkg_resources.require("havenctl")[0].version print(version) def print_usage(): print """ Usage: havenctl [-a <remote_address> | --address=<remote_address>] [-p <...
import sys import getopt from ctl import HavenCtl def print_version(): import pkg_resources # part of setuptools version = pkg_resources.require("havenctl")[0].version print(version) def print_usage(): print """ Usage: havenctl [-a <remote_address> | --address=<remote_address>] [-p <...
Support Django 1.7 in test runner.
#!/usr/bin/env python from os.path import dirname, abspath import sys import django from django.conf import settings if not settings.configured: settings_dict = dict( INSTALLED_APPS=( 'localeurl', 'localeurl.tests', 'django.contrib.sites', # for sitemap test ...
#!/usr/bin/env python from os.path import dirname, abspath import sys from django.conf import settings if not settings.configured: from django import VERSION settings_dict = dict( INSTALLED_APPS=( 'localeurl', 'localeurl.tests', 'django.contrib.sites', # for sitema...
Fix back links in intro
module.exports = { '/': { backLink: '/../priority_service_170315/filter/uncancelled', next: '/what-you-need' }, '/before-you-continue-overseas': { backLink: '/../priority_service_170315/overseas/uncancelled', next: '/what-you-need-overseas' }, '/what-you-need': { ...
module.exports = { '/': { backLink: '/../priority_service_170301/filter/uncancelled', next: '/what-you-need' }, '/before-you-continue-overseas': { backLink: '/../priority_service_170301/overseas/uncancelled', next: '/what-you-need-overseas' }, '/what-you-need': { ...
Update requests to fix security issue
from setuptools import setup, find_packages from pypandoc import convert def convert_markdown_to_rst(file): return convert(file, 'rst') setup(name='gitlabform', version='1.0.2', description='Easy configuration as code tool for GitLab using config in plain YAML', long_description=convert_mark...
from setuptools import setup, find_packages from pypandoc import convert def convert_markdown_to_rst(file): return convert(file, 'rst') setup(name='gitlabform', version='1.0.1', description='Easy configuration as code tool for GitLab using config in plain YAML', long_description=convert_mark...
Add useHistoryState-plugin to plugins. (not only create)
Ext.namespace('Kwc.List.Switch'); Kwc.List.Switch.Component = Ext.extend(Kwf.EyeCandy.List, { //transition: {}, showArrows: true, defaultState: 'normal', childSelector: '> div > .listSwitchItem', _init: function() { this.states = [ 'normal' ]; if (!this.plugi...
Ext.namespace('Kwc.List.Switch'); Kwc.List.Switch.Component = Ext.extend(Kwf.EyeCandy.List, { //transition: {}, showArrows: true, defaultState: 'normal', childSelector: '> div > .listSwitchItem', _init: function() { this.states = [ 'normal' ]; if (!this.plugi...
Use all of content in redirect from oauth callback
"""Main codrspace views""" from django.shortcuts import render, redirect from settings import GITHUB_CLIENT_ID import requests def index(request, slug=None, template_name="base.html"): return render(request, template_name) def edit(request, slug=None, template_name="edit.html"): """Edit Your Post""" r...
"""Main codrspace views""" from django.shortcuts import render, redirect from settings import GITHUB_CLIENT_ID import requests def index(request, slug=None, template_name="base.html"): return render(request, template_name) def edit(request, slug=None, template_name="edit.html"): """Edit Your Post""" r...
MongoDB: Fix pagination for last page
var utils = require('../../utils'); module.exports = function(mongoose) { /** * Paginates and executes a query */ mongoose.Query.prototype.paginate = function paginate(page, limit, callback) { // The number of pages to show page = parseInt(page, 10) || 1; limit = parseInt(limit, 10) || 20; ...
var utils = require('../../utils'); module.exports = function(mongoose) { /** * Paginates and executes a query */ mongoose.Query.prototype.paginate = function paginate(page, limit, callback) { // The number of pages to show page = parseInt(page, 10) || 1; limit = parseInt(limit, 10) || 20; ...
Update requirements. Add bat file
from distutils.core import setup setup( name='lcinvestor', version=open('lcinvestor/VERSION').read(), author='Jeremy Gillick', author_email='none@none.com', packages=['lcinvestor', 'lcinvestor.tests', 'lcinvestor.settings'], package_data={ 'lcinvestor': ['VERSION'], 'lcinvestor....
from distutils.core import setup setup( name='lcinvestor', version=open('lcinvestor/VERSION').read(), author='Jeremy Gillick', author_email='none@none.com', packages=['lcinvestor', 'lcinvestor.tests', 'lcinvestor.settings'], package_data={ 'lcinvestor': ['VERSION'], 'lcinvestor....
Clear undo buffer when terminal cleared.
import threading import wx from styled_text_ctrl import StyledTextCtrl class ThreadOutputCtrl(StyledTextCtrl): def __init__(self, parent, env, auto_scroll=False): StyledTextCtrl.__init__(self, parent, env) self.auto_scroll = auto_scroll self.__lock = threading.Lock() self.__queue ...
import threading import wx from styled_text_ctrl import StyledTextCtrl class ThreadOutputCtrl(StyledTextCtrl): def __init__(self, parent, env, auto_scroll=False): StyledTextCtrl.__init__(self, parent, env) self.auto_scroll = auto_scroll self.__lock = threading.Lock() self.__queue ...
Change an option for a grunt task
module.exports = function(grunt) { // Load tasks grunt.loadNpmTasks('grunt-nodemon'); grunt.loadNpmTasks('grunt-contrib-less'); grunt.loadNpmTasks('grunt-contrib-watch'); grunt.loadNpmTasks('grunt-concurrent'); grunt.loadNpmTasks('grunt-browserify'); grunt.initConfig({ less: { ...
module.exports = function(grunt) { // Load tasks grunt.loadNpmTasks('grunt-nodemon'); grunt.loadNpmTasks('grunt-contrib-less'); grunt.loadNpmTasks('grunt-contrib-watch'); grunt.loadNpmTasks('grunt-concurrent'); grunt.loadNpmTasks('grunt-browserify'); grunt.initConfig({ less: { ...
Use just "jsonDecode" instead of "decode"
<?php class CM_Clockwork_Storage_FileSystem extends CM_Clockwork_Storage_Abstract implements CM_Service_ManagerAwareInterface { use CM_Service_ManagerAwareTrait; protected function _load() { $data = []; $file = $this->_getStorageFile(); if ($file->exists()) { $values = CM_...
<?php class CM_Clockwork_Storage_FileSystem extends CM_Clockwork_Storage_Abstract implements CM_Service_ManagerAwareInterface { use CM_Service_ManagerAwareTrait; protected function _load() { $data = []; $file = $this->_getStorageFile(); if ($file->exists()) { $values = CM_...
Remove empty properties from object
import path from 'path'; import HtmlWebpackPlugin from 'webpack-html-plugin'; import webpack from 'webpack'; /** removes empty items from array */ const array = (target) => target.filter((item) => item); /** removes empty properties from object */ const object = (target) => Object.keys(target).filter((key) => target[...
import path from 'path'; import HtmlWebpackPlugin from 'webpack-html-plugin'; import webpack from 'webpack'; const array = (target) => target.filter((item) => item); export default ({dev, prod}) => ({ entry: array([ dev && 'react-hot-loader/patch', 'babel-polyfill', './src/', ]), o...
Add GitLab CI commit env variable
(function (logger, exec, Promise) { 'use strict'; module.exports = { getCommitId: function (commitId) { return new Promise(function (resolve, reject) { if (commitId) { logger.debug('Provided Commit Id: ' + commitId); return resolve(comm...
(function (logger, exec, Promise) { 'use strict'; module.exports = { getCommitId: function (commitId) { return new Promise(function (resolve, reject) { if (commitId) { logger.debug('Provided Commit Id: ' + commitId); return resolve(comm...
Fix interaction test: use newer interaction. - Does tvtag remove older interactions?
package com.uwetrottmann.getglue.services; import com.uwetrottmann.getglue.BaseTestCase; import com.uwetrottmann.getglue.entities.GetGlueInteraction; import com.uwetrottmann.getglue.entities.GetGlueInteractionResource; import java.util.List; import static org.fest.assertions.api.Assertions.assertThat; public class ...
package com.uwetrottmann.getglue.services; import com.uwetrottmann.getglue.BaseTestCase; import com.uwetrottmann.getglue.entities.GetGlueInteraction; import com.uwetrottmann.getglue.entities.GetGlueInteractionResource; import java.util.List; import static org.fest.assertions.api.Assertions.assertThat; public class ...
Call function when options is a function
'use strict'; (function (root, factory) { if (typeof define === 'function' && define.amd) { define([ 'marionette', 'underscore', 'bootstrapValidator' ], factory); } else if (typeof exports === 'object') { module.exports = factory( require(...
'use strict'; (function(root, factory) { if (typeof define === 'function' && define.amd) { define([ 'marionette', 'underscore', 'bootstrapValidator' ], factory); } else if (typeof exports === 'object') { module.exports = factory( require('...
Revert "Activity was imported twice" This reverts commit a0600929774c1e90c7dc43043ff87b5ea84213b4.
import android import android.activity from os import unlink from jnius import autoclass, cast from plyer.facades import Camera from plyer.platforms.android import activity Intent = autoclass('android.content.Intent') PythonActivity = autoclass('org.renpy.android.PythonActivity') MediaStore = autoclass('android.provi...
from os import unlink from jnius import autoclass, cast from plyer.facades import Camera from plyer.platforms.android import activity Intent = autoclass('android.content.Intent') PythonActivity = autoclass('org.renpy.android.PythonActivity') MediaStore = autoclass('android.provider.MediaStore') Uri = autoclass('androi...
Fix problem with image not updating.
'use strict'; /** * @file * Delivers a component representing one single category in the autocomplete * parent autocomplete component. */ import React from 'react'; import {isArray, includes} from 'lodash'; import AutoCompleteRow from './AutoCompleteRow.component'; var AutoCompleteCategory = React.createClass({ ...
'use strict'; /** * @file * Delivers a component representing one single category in the autocomplete * parent autocomplete component. */ import React from 'react'; import {isArray, includes} from 'lodash'; import AutoCompleteRow from './AutoCompleteRow.component'; var AutoCompleteCategory = React.createClass({ ...
BB-562: Add possibility to inject code into forms and view templates - CR fixes
<?php namespace Oro\Bundle\UIBundle\Event; use Symfony\Component\EventDispatcher\Event; use Symfony\Component\Form\FormView; use Twig_Environment; class BeforeListRenderEvent extends Event { /** * @var \Twig_Environment */ protected $environment; /** * @var array */ protected $d...
<?php namespace Oro\Bundle\UIBundle\Event; use Symfony\Component\EventDispatcher\Event; use Symfony\Component\Form\FormView; use Twig_Environment; class BeforeListRenderEvent extends Event { /** * @var \Twig_Environment */ protected $environment; /** * @var array */ protected $d...
Adjust to ts2dart change of filename handling.
var chalk = require('chalk'); var gutil = require('gulp-util'); var spawn = require('gulp-spawn'); var through = require('through2'); var ts2dart = require('ts2dart'); var which = require('which'); exports.transpile = function() { var hadErrors = false; return through.obj( function(file, enc, done) { ...
var chalk = require('chalk'); var gutil = require('gulp-util'); var spawn = require('gulp-spawn'); var through = require('through2'); var ts2dart = require('ts2dart'); var which = require('which'); exports.transpile = function() { var hadErrors = false; return through.obj( function(file, enc, done) { ...
Replace incorrect JS_MIMETYPES with CSS_MIMETYPES
from django.conf import settings from mediasync import CSS_MIMETYPES, JS_MIMETYPES import os from subprocess import Popen, PIPE def _yui_path(settings): if not hasattr(settings, 'MEDIASYNC'): return None path = settings.MEDIASYNC.get('YUI_COMPRESSOR_PATH', None) if path: path = os.path.real...
from django.conf import settings from mediasync import JS_MIMETYPES import os from subprocess import Popen, PIPE def _yui_path(settings): if not hasattr(settings, 'MEDIASYNC'): return None path = settings.MEDIASYNC.get('YUI_COMPRESSOR_PATH', None) if path: path = os.path.realpath(os.path.ex...
Use getResourceAsStream as getResource won't work
package com.github.atomfrede.jadenticon; import org.apache.commons.io.FileUtils; import org.apache.commons.io.IOUtils; import javax.script.Invocable; import javax.script.ScriptEngine; import javax.script.ScriptEngineManager; import javax.script.ScriptException; import java.io.File; import java.io.InputStream; public...
package com.github.atomfrede.jadenticon; import org.apache.commons.io.FileUtils; import javax.script.Invocable; import javax.script.ScriptEngine; import javax.script.ScriptEngineManager; import javax.script.ScriptException; import java.io.File; public class JdenticonWrapper { private Object jdenticon; priva...
Remove use of "unsure" from TrainingData type The "unsure" key isn't used anywhere else
import numpy import sys from typing import (Iterator, Tuple, Mapping, Union, Iterable, List, Any) if sys.version_info >= (3, 8): from typing import TypedDict, Protocol, Literal else: from ty...
import numpy import sys from typing import (Iterator, Tuple, Mapping, Union, Iterable, List, Any) if sys.version_info >= (3, 8): from typing import TypedDict, Protocol, Literal else: from ty...
Fix for os.path.join with model_id, was breaking on non-string model_id values.
import os import requests class LumidatumClient(object): def __init__(self, authentication_token, model_id=None, host_address='https://www.lumidatum.com'): self.authentication_token = authentication_token self.model_id = str(model_id) self.host_address = host_address def getRecommen...
import os import requests class LumidatumClient(object): def __init__(self, authentication_token, model_id=None, host_address='https://www.lumidatum.com'): self.authentication_token = authentication_token self.model_id = str(model_id) self.host_address = host_address def getRecommen...
Remove some thrash from library.
// ---------------------------- Imports. --------------------------------- const fs = require('fs'), cp = require('child_process'), request = require('request') // --------------------------- Main class. ------------------------------- class Pizdos { // Public. /** * Starts ...
// ---------------------------- Imports. --------------------------------- const fs = require('fs'), cp = require('child_process'), request = require('request') // --------------------------- Main class. ------------------------------- class Pizdos { // Public. /** * Starts ...
Define template path inside share callback
<?php namespace Apitude\Core\Template; use Apitude\Core\Provider\AbstractServiceProvider; use Apitude\Core\Utility\Arr; use Handlebars\Handlebars; use Handlebars\Loader\FilesystemLoader; use Silex\Application; class TemplateServiceProvider extends AbstractServiceProvider { public function register(Application $ap...
<?php namespace Apitude\Core\Template; use Apitude\Core\Provider\AbstractServiceProvider; use Apitude\Core\Utility\Arr; use Handlebars\Handlebars; use Handlebars\Loader\FilesystemLoader; use Silex\Application; class TemplateServiceProvider extends AbstractServiceProvider { public function register(Application $ap...
Make building_number and state optional
<?php use Illuminate\Database\Migrations\Migration; use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; class CreateAddressesTable extends Migration { public function up() { Schema::create('addresses', function (Blueprint $table) { $table->increments('id'); ...
<?php use Illuminate\Database\Migrations\Migration; use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; class CreateAddressesTable extends Migration { public function up() { Schema::create('addresses', function (Blueprint $table) { $table->increments('id'); ...
Add padding to the basket input.
import { Util } from "../../util.js"; export class BasketTemplate { static update(render, state, events) { const headerClasses = "fw6 bb b--black-20 tl pb1 pr1 bg-black-10"; const trClasses = "pv1 pr1 bb b--black-20"; const trClassesLink = `${trClasses} pointer dim`; /* eslint-disa...
import { Util } from "../../util.js"; export class BasketTemplate { static update(render, state, events) { const headerClasses = "fw6 bb b--black-20 tl pb1 pr1 bg-black-10"; const trClasses = "pv1 pr1 bb b--black-20"; const trClassesLink = `${trClasses} pointer dim`; /* eslint-disa...
Rename markdown_div to jquery variable with $
$(function () { var before_value = '', $markdown_div = $('#id_markdown'), $preview = $('.preview'), $html_div = $('#id_html'), $create_form = $('#create_html'), markdown_event, markdown_content = '', markdown_slides = []; $create_form.submit(function () {...
$(function () { var before_value = '', markdown_div = $('#id_markdown'), $preview = $('.preview'), $html_div = $('#id_html'), $create_form = $('#create_html'), markdown_event, markdown_content = '', markdown_slides = []; $create_form.submit(function () { ...
Support Django < 1.5 with a simplified version of `get_url()`
from django.core.management import call_command try: from django.shortcuts import resolve_url except ImportError: import warnings warnings.warn("URL path supported only in get_url() with Django < 1.5") resolve_url = lambda to, *args, **kwargs: to from behave_django.testcase import BehaveDjangoTestCase ...
from django.core.management import call_command from django.shortcuts import resolve_url from behave_django.testcase import BehaveDjangoTestCase def before_scenario(context, scenario): # This is probably a hacky method of setting up the test case # outside of a test runner. Suggestions are welcome. :) c...
Fix resolved file paths and exclude node_modules Since I’m no longer using beartime-core, nothing in node_modules/ needs to be compiled.
var path = require('path') var webpack = require('webpack') module.exports = { entry: './src/index.js', output: { path: path.resolve(__dirname, './dist'), publicPath: '/dist/', filename: 'build.js' }, resolveLoader: { root: path.join(__dirname, 'node_modules'), }, module: { loaders: [ ...
var path = require('path') var webpack = require('webpack') module.exports = { entry: './src/index.js', output: { path: path.resolve(__dirname, './dist'), publicPath: '/', filename: 'build.js' }, resolveLoader: { root: path.join(__dirname, 'node_modules'), }, module: { loaders: [ ...
CAMEL-14671: Make PropertiesFunction part of the PropertiesComponent SPI
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may ...
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may ...
Replace slashes with backslash in namespace Fixes #70.
<?php namespace Studio\Parts\Composer; use Studio\Filesystem\Directory; use Studio\Parts\AbstractPart; class Part extends AbstractPart { public function setupPackage($composer, Directory $target) { // Ask for package name $composer->name = $this->input->ask( 'Please name this pack...
<?php namespace Studio\Parts\Composer; use Studio\Filesystem\Directory; use Studio\Parts\AbstractPart; class Part extends AbstractPart { public function setupPackage($composer, Directory $target) { // Ask for package name $composer->name = $this->input->ask( 'Please name this pack...
Add a couple more cursor helpers
<?php namespace League\CLImate\Util; class Cursor { /** * Move the cursor up in the terminal x number of lines. * * @param int $lines * * @return string */ public function up($lines = 1) { return "\e[{$lines}A"; } /** * Move the cursor down in the termin...
<?php namespace League\CLImate\Util; class Cursor { /** * Move the cursor up in the terminal x number of lines. * * @param int $lines * * @return string */ public function up($lines = 1) { return "\e[{$lines}A"; } /** * Move the cursor left in the termin...
Split Protocol class in Protocol and ProtocolElement
''' Created on 11 jan. 2013 @author: sander ''' from abc import abstractmethod, ABCMeta class ProtocolElement(object): __metaclass__ = ABCMeta @abstractmethod def __init__(self): ''' Constructor ''' def __repr__(self): # This works as long as we accept all properties...
''' Created on 11 jan. 2013 @author: sander ''' from abc import abstractmethod, ABCMeta class Protocol(object): __metaclass__ = ABCMeta header_type = None @abstractmethod def __init__(self, next_header=None, payload=''): ''' Constructor ''' self.next_header = next_he...
Add debug code to list how many object entities there are for each type, along with number of fields
var ObjectEditor = { Data: { Units: require('../WEdata/data/Units.json'), Items: require('../WEdata/data/Items.json'), Destructables: require('../WEdata/data/Destructables.json') }, Fields: { Units: require('../WEdata/fields/UnitMetaData.json'), Items: require('../W...
var ObjectEditor = { Data: { Units: require('../WEdata/data/Units.json'), Items: require('../WEdata/data/Items.json'), Destructables: require('../WEdata/data/Destructables.json') }, Fields: { Units: require('../WEdata/fields/UnitMetaData.json'), Items: require('../W...
Maintain current protocol, hostname and port when navigating
/*global window, document, Faye */ /*jslint vars: true, indent: 2 */ (function () { 'use strict'; var begin = function (beginControlling, beginMirroring) { var faye = new Faye.Client('/faye'); if (window.location.hostname.indexOf('mirror') === 0) { beginMirroring(faye); } else { beginCont...
/*global window, document, Faye */ /*jslint vars: true, indent: 2 */ (function () { 'use strict'; var begin = function (beginControlling, beginMirroring) { var faye = new Faye.Client('/faye'); if (window.location.hostname.indexOf('mirror') === 0) { beginMirroring(faye); } else { beginCont...
Add exit command to the help text
/* * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distribut...
/* * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distribut...
Improve error message when prophet.yml not found.
<?php /** * * * @author Sam Schmidt * @date 2015-04-22 * @company Linus Shops */ namespace LinusShops\Prophet; use LinusShops\Prophet\Exceptions\InvalidConfigException; use Symfony\Component\Yaml\Parser; class Config { private $modules; public function __construct($parsedConfi...
<?php /** * * * @author Sam Schmidt * @date 2015-04-22 * @company Linus Shops */ namespace LinusShops\Prophet; use LinusShops\Prophet\Exceptions\InvalidConfigException; use Symfony\Component\Yaml\Parser; class Config { private $modules; public function __construct($parsedConfi...
Change assertIn to assert_ for python 2.6 support
import unittest import fiona from shapely.geometry import Point import geopandas as gpd from geopandas.geocode import geocode, _prepare_geocode_result class TestGeocode(unittest.TestCase): def test_prepare_result(self): # Calls _prepare_result with sample results from the geocoder call # loop ...
import unittest import fiona from shapely.geometry import Point import geopandas as gpd from geopandas.geocode import geocode, _prepare_geocode_result class TestGeocode(unittest.TestCase): def test_prepare_result(self): # Calls _prepare_result with sample results from the geocoder call # loop ...
Add files on the command line, cleanup
// Copyright 2013 SteelSeries ApS. All rights reserved. // No license is given for the use of this source code. // This package impliments a basic LISP interpretor for embedding in a go program for scripting. // This file provides a repl package main import ( "bufio" "flag" "fmt" "github.com/steelseri...
// Copyright 2013 SteelSeries ApS. All rights reserved. // No license is given for the use of this source code. // This package impliments a basic LISP interpretor for embedding in a go program for scripting. // This file provides a repl package main import ( "bufio" "fmt" "github.com/steelseries/golisp" ...
Fix affiliated institutions multiplying at every render
import Ember from 'ember'; import loadAll from 'ember-osf/utils/load-relationship'; export default Ember.Component.extend({ users: Ember.A(), bibliographicUsers: Ember.A(), institutions: Ember.A(), getAuthors: function() { // Cannot be called until node has loaded! const node = this.get...
import Ember from 'ember'; import loadAll from 'ember-osf/utils/load-relationship'; export default Ember.Component.extend({ users: Ember.A(), bibliographicUsers: Ember.A(), institutions: Ember.A(), getAuthors: function() { // Cannot be called until node has loaded! const node = this.get...
Make methods names more representative
var cdb = require('cartodb.js'); var RowsView = require('./rows_view'); var ChooseGeometryView = require('./choose_geometry_view'); var ViewFactory = require('../../view_factory'); /** * View for the georeference types that requires the two-steps flow. * First select columns values, and then the geometry type to use...
var cdb = require('cartodb.js'); var RowsView = require('./rows_view'); var ChooseGeometryView = require('./choose_geometry_view'); var ViewFactory = require('../../view_factory'); /** * View for the georeference types that requires the two-steps flow. * First select columns values, and then the geometry type to use...
Update invalid URI to correctly throw exception
/* * $Id: AltRepTest.java [23-Apr-2004] * * Copyright (c) 2004, Ben Fortuna All rights reserved. */ package net.fortuna.ical4j.model.parameter; import java.net.URI; import java.net.URISyntaxException; import net.fortuna.ical4j.model.Parameter; import net.fortuna.ical4j.model.ParameterFactoryImpl; import junit.fr...
/* * $Id: AltRepTest.java [23-Apr-2004] * * Copyright (c) 2004, Ben Fortuna All rights reserved. */ package net.fortuna.ical4j.model.parameter; import java.net.URI; import java.net.URISyntaxException; import net.fortuna.ical4j.model.Parameter; import net.fortuna.ical4j.model.ParameterFactoryImpl; import junit.fr...
Add test for no HTTP_AUTHORIZATION header at all
from utils.testcase import EndpointTestCase from rest_framework import status from rest_framework.test import APIClient from django.utils.translation import ugettext_lazy as _ import sure class TestUtils(EndpointTestCase): def test_fail_authentication(self): client = APIClient() client.credentia...
from utils.testcase import EndpointTestCase from rest_framework import status from rest_framework.test import APIClient from django.utils.translation import ugettext_lazy as _ import sure class TestUtils(EndpointTestCase): def test_fail_authentication(self): client = APIClient() client.credentia...
Fix transparent issue of search input
module.exports = { inputStyle: { "backgroundColor": "white", "border": `1px solid transparent`, "borderRadius": `1px`, "boxShadow": `0 2px 6px rgba(0, 0, 0, 0.3)`, "boxSizing": `border-box`, "MozBoxSizing": `border-box`, "fontSize": `14px`, "height": `...
module.exports = { inputStyle: { "border": `1px solid transparent`, "borderRadius": `1px`, "boxShadow": `0 2px 6px rgba(0, 0, 0, 0.3)`, "boxSizing": `border-box`, "MozBoxSizing": `border-box`, "fontSize": `14px`, "height": `32px`, "marginTop": `27px`, ...
Replace pre-commit test patch decorators with setUp/tearDown patching.
import unittest from mock import Mock, patch from captainhook import pre_commit class TestMain(unittest.TestCase): def setUp(self): self.get_files_patch = patch('captainhook.pre_commit.get_files') get_files = self.get_files_patch.start() get_files.return_value = ['file_one'] se...
import unittest from mock import Mock, patch from captainhook import pre_commit class TestMain(unittest.TestCase): @patch('captainhook.pre_commit.get_files') @patch('captainhook.pre_commit.HookConfig') @patch('captainhook.pre_commit.checks') def test_calling_run_without_args(self, checks, HookConfi...
Fix Trove classifiers to allow PyPI upload
from distutils.core import setup from pexpect import __version__ setup (name='pexpect', version=__version__, py_modules=['pxssh', 'fdpexpect', 'FSM', 'screen', 'ANSI'], packages=['pexpect'], description='Pexpect allows easy control of interactive console applications.', author='Noah Spurrier; Thom...
from distutils.core import setup from pexpect import __version__ setup (name='pexpect', version=__version__, py_modules=['pxssh', 'fdpexpect', 'FSM', 'screen', 'ANSI'], packages=['pexpect'], description='Pexpect allows easy control of interactive console applications.', author='Noah Spurrier; Thom...
Validate language input for settings page
<?php namespace App\Http\Controllers; use Illuminate\Http\Request; use Auth; use Image; use Storage; class SettingsController extends Controller { public function index() { $user = Auth::user(); return view('settings', [ 'languages' => config('app.locales'), 'tags' => $u...
<?php namespace App\Http\Controllers; use Illuminate\Http\Request; use Auth; use Image; use Storage; class SettingsController extends Controller { public function index() { $user = Auth::user(); return view('settings', [ 'languages' => config('app.locales'), 'tags' => $u...
Fix direct assignment to the forward side of a many-to-many
from django.db import migrations PERM_INITIAL = {'wsparcie': ('can_add_record', 'can_change_own_record', 'can_view', 'can_view_all' ), 'obserwator': ( 'can_vie...
from django.db import migrations PERM_INITIAL = {'wsparcie': ('can_add_record', 'can_change_own_record', 'can_view', 'can_view_all' ), 'obserwator': ( 'can_vie...
Fix extra output in tests
<?php namespace Rocketeer\Abstracts\Strategies; use Mockery\MockInterface; use Rocketeer\TestCases\RocketeerTestCase; class AbstractStrategyTest extends RocketeerTestCase { public function testCanCheckForManifestWithoutServer() { $this->app['path.base'] = realpath(__DIR__.'/../../..'); $this->...
<?php namespace Rocketeer\Abstracts\Strategies; use Mockery\MockInterface; use Rocketeer\TestCases\RocketeerTestCase; class AbstractStrategyTest extends RocketeerTestCase { public function testCanCheckForManifestWithoutServer() { $this->app['path.base'] = realpath(__DIR__.'/../../..'); $this->...
Use Object.entries instead of Object.keys
import * as path from 'path'; import {fs} from 'node-promise-es6'; import * as fse from 'fs-extra-promise-es6'; export default class { constructor(basePath) { this.basePath = path.resolve(basePath); } async create() { await fse.mkdirs(this.basePath); } path(...components) { return path.resolve(...
import * as path from 'path'; import {fs} from 'node-promise-es6'; import * as fse from 'fs-extra-promise-es6'; export default class { constructor(basePath) { this.basePath = path.resolve(basePath); } async create() { await fse.mkdirs(this.basePath); } path(...components) { return path.resolve(...
Declare variables in bezzier.js for loops
define(['../math.js', '../../app/directives/graph_sketcher/GraphUtils.js'], function(m, graphUtils) { return { numOfPts: 100, lineStyle: function(pts) { let n = pts.length - 1; let comb = []; let r; for (let r = 0; r <= n; r += 1) { /...
define(['../math.js', '../../app/directives/graph_sketcher/GraphUtils.js'], function(m, graphUtils) { return { numOfPts: 100, lineStyle: function(pts) { let n = pts.length - 1; let comb = []; let r; for (r = 0; r <= n; r += 1) { // fr...
Add the wasm-unsafe-eval keyword for CSP
<?php /* * This file is part of the Nelmio SecurityBundle. * * (c) Nelmio <hello@nelm.io> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Nelmio\SecurityBundle\ContentSecurityPolicy; class ContentSecurityPolicyParser {...
<?php /* * This file is part of the Nelmio SecurityBundle. * * (c) Nelmio <hello@nelm.io> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Nelmio\SecurityBundle\ContentSecurityPolicy; class ContentSecurityPolicyParser {...
Create unit watcher grunt task
/*jshint camelcase:false */ module.exports = function (grunt) { // Load all grunt tasks require('load-grunt-tasks')(grunt); // Project configuration. grunt.initConfig({ release: { options: { bump: true, //default: true file: 'package.json', //default: package.json add: true, ...
/*jshint camelcase:false */ module.exports = function (grunt) { // Load all grunt tasks require('load-grunt-tasks')(grunt); // Project configuration. grunt.initConfig({ release: { options: { bump: true, //default: true file: 'package.json', //default: package.json add: true, ...
Allow to do app->make with parameters to pass to the constructor of guzzle client
<?php namespace GuzzleHttp\Subscriber\Log\Support; use DebugBar\DataCollector\ExceptionsCollector; use DebugBar\DebugBar; use GuzzleHttp\Client; use GuzzleHttp\Subscriber\Log\LogSubscriber; use GuzzleHttp\Subscriber\Log\DebugbarSubscriber; use Psr\Log\LoggerInterface; use Illuminate\Support\ServiceProvider as BaseServ...
<?php namespace GuzzleHttp\Subscriber\Log\Support; use DebugBar\DataCollector\ExceptionsCollector; use DebugBar\DebugBar; use GuzzleHttp\Client; use GuzzleHttp\Subscriber\Log\LogSubscriber; use GuzzleHttp\Subscriber\Log\DebugbarSubscriber; use Psr\Log\LoggerInterface; use Illuminate\Support\ServiceProvider as BaseServ...
Fix: Remove visibility check, use the hide category functionality instead
<div class="panel panel-default qanda-panel"> <div class="panel-heading"> <?php echo $group; ?> </div> <div class="list-group"> <?php foreach($categories as $category) { ?> <a href="<?php echo $category['link']; ?>" class="list-group-item"> <b class="list-group-it...
<div class="panel panel-default qanda-panel"> <div class="panel-heading"> <?php echo $group; ?> </div> <div class="list-group"> <?php foreach($categories as $category) { ?> <?php if($category['space']->visibility > 0) { ?> <a href="<?php echo $category['link']; ?>" cl...
Make press-tip work on hover
import Tooltip from 'tooltip.js'; import './press-tip.scss'; export function PressTip() { 'ngInject'; return { restrict: 'A', link($scope, $element, $attrs) { let tooltip = null; let timer = null; function showTip() { if (!tooltip) { let title = $attrs.pressTip; ...
import Tooltip from 'tooltip.js'; import './press-tip.scss'; export function PressTip() { 'ngInject'; return { restrict: 'A', link($scope, $element, $attrs) { let tooltip = null; function showTip() { if (!tooltip) { let title = $attrs.pressTip; if ($attrs.pressTipT...
Return $this after adding a tag
<?php namespace SlmMail\Mail\Message\Provider; use SlmMail\Mail\Message\ProvidesOptions; use SlmMail\Mail\Message\ProvidesTags; use Zend\Mail\Message; class Mailgun extends Message { use ProvidesOptions; const TAG_LIMIT = 3; /** * @var array */ protected $tags = array(); /** * G...
<?php namespace SlmMail\Mail\Message\Provider; use SlmMail\Mail\Message\ProvidesOptions; use SlmMail\Mail\Message\ProvidesTags; use Zend\Mail\Message; class Mailgun extends Message { use ProvidesOptions; const TAG_LIMIT = 3; /** * @var array */ protected $tags = array(); /** * G...
Add space before each elseif opening parenthesis.
<?php namespace Sil\PhpEnv; class Env { /** * Retrieve the value of the specified environment variable, translating * values of 'true', 'false', and 'null' to their actual non-string values. * * PHP's built-in "getenv()" function returns a string (or false, if the * environment variable i...
<?php namespace Sil\PhpEnv; class Env { /** * Retrieve the value of the specified environment variable, translating * values of 'true', 'false', and 'null' to their actual non-string values. * * PHP's built-in "getenv()" function returns a string (or false, if the * environment variable i...
Check for null input; there is no input on page load
import Component from '@ember/component'; import { empty, or } from '@ember/object/computed'; export default Component.extend({ emptyName: empty('api_token.name'), disableCreate: or('api_token.isSaving', 'emptyName'), serverError: null, didInsertElement() { let input = this.element.querySelector('input');...
import Component from '@ember/component'; import { empty, or } from '@ember/object/computed'; export default Component.extend({ emptyName: empty('api_token.name'), disableCreate: or('api_token.isSaving', 'emptyName'), serverError: null, didInsertElement() { let input = this.element.querySelector('input');...
Change case of type hint.
<?php namespace Math\Functions; /** * Arithmetic of functions. These functions return functions themselves. */ class Arithmetic { /** * Adds any number of single variable (callback) functions {f(x)}. Returns * the sum as a callback function. * * @param callable ... $args Two or more single-v...
<?php namespace Math\Functions; /** * Arithmetic of functions. These functions return functions themselves. */ class Arithmetic { /** * Adds any number of single variable (callback) functions {f(x)}. Returns * the sum as a callback function. * * @param callable ... $args Two or more single-v...
Allow YQL module to be embedded in a loop
# pipeyql.py # import urllib import urllib2 from xml.etree import cElementTree as ElementTree from pipe2py import util def pipe_yql(context, _INPUT, conf, **kwargs): """This source issues YQL queries. Keyword arguments: context -- pipeline context _INPUT -- not used conf: yqlquery ...
# pipeyql.py # import urllib import urllib2 from xml.etree import cElementTree as ElementTree from pipe2py import util def pipe_yql(context, _INPUT, conf, **kwargs): """This source issues YQL queries. Keyword arguments: context -- pipeline context _INPUT -- not used conf: yqlquery ...
Update support for passing in filenames. This shit is gross
from imhotep.tools import Tool from collections import defaultdict import json import os import logging log = logging.getLogger(__name__) class FoodCritic(Tool): def invoke(self, dirname, filenames=set(), config_file=None): retval = defaultdict(lambda: defaul...
from imhotep.tools import Tool from collections import defaultdict import json import os import logging log = logging.getLogger(__name__) class FoodCritic(Tool): def invoke(self, dirname, filenames=set(), config_file=None, file_list=None): retv...
Use idx as key for similar player avatars
import React from 'react'; import PlayerAvatar from './PlayerAvatar.js' import '../style/components/SimilarPlayersCard.css'; export default function SimilarPlayersCard(props) { const similarPlayersList = [ { 'firstName': props.firstName0, 'lastName': props.lastName0, 'img': props.img0, '...
import React from 'react'; import PlayerAvatar from './PlayerAvatar.js' import '../style/components/SimilarPlayersCard.css'; export default function SimilarPlayersCard(props) { const similarPlayersList = [ { 'firstName': props.firstName0, 'lastName': props.lastName0, 'img': props.img0, '...