text
stringlengths
17
1.47k
positive
stringlengths
673
4.43k
negative
stringlengths
677
2.81k
Fix cross domain request (CORS) issue
$(document).ready(function() { //$.get('http://127.0.0.1:8000/output.csv', function (data) { $.get('output.csv', function (data) { Highcharts.setOptions({ global: { useUTC: true }, colors: ['#2222ff', '#ff2222'] }); $('#container').high...
$(document).ready(function() { //$.get('http://127.0.0.1:8000/output.csv', function (data) { //$.get('https://github.com/kenyot/weight_log/blob/gh-pages/output.csv', function (data) { $.get('output.csv', function (data) { Highcharts.setOptions({ global: { useUTC: true ...
Change metadata type to map
package com.github.macrodata.skyprint.section; import lombok.Setter; import lombok.ToString; import javax.xml.transform.stream.StreamSource; import java.util.List; import java.util.Map; import java.util.stream.Stream; import static com.github.macrodata.skyprint.section.SectionHelper.*; @ToString public class RootSe...
package com.github.macrodata.skyprint.section; import lombok.Setter; import lombok.ToString; import java.util.List; import static com.github.macrodata.skyprint.section.SectionHelper.*; @ToString public class RootSection extends Section { @Setter private MetadataSection metadata; @Setter private St...
Fix process_voting_round to reflect contract model
# pylint: disable=W0613 from django.dispatch import receiver from django.db.models.signals import post_save from voting import constants from source.models import Source from voting.models import VotingRound from source import constants as source_constants from contracts.models import Contract @receiver(signal=post_...
# pylint: disable=W0613 from django.dispatch import receiver from django.db.models.signals import post_save from voting import constants from source.models import Source from voting.models import VotingRound from source import constants as source_constants from contracts.models import Contract @receiver(signal=post_...
Add todo comment about work to be completed
/* * Copyright 2014 Timothy Brooks * * 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 i...
/* * Copyright 2014 Timothy Brooks * * 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 i...
Support using a module as a call back if it has an function attribute by the same name.
import traceback import types class NurlyResult(): def __init__(self, code='200 OK', head=None, body=''): self.head = {} if type(head) != dict else head self.body = body self.code = code class NurlyStatus(): ST_IDLE = 0 ST_BUSY = 1 ST_STOP = 2 ST_MAP = { ST_IDLE: ...
import traceback class NurlyResult(): def __init__(self, code='200 OK', head=None, body=''): self.head = {} if type(head) != dict else head self.body = body self.code = code class NurlyStatus(): ST_IDLE = 0 ST_BUSY = 1 ST_STOP = 2 ST_MAP = { ST_IDLE: 'IDLE', ...
Add input's name for future usage
import React from 'react'; import styles from 'stylesheets/components/common/typography'; class Kugel extends React.Component { constructor(props) { super(props); this.state = { radius: 0, volumen: 0 }; this.handleChange = this.handleChange.bind(this); } handleChange(event) { co...
import React from 'react'; import styles from 'stylesheets/components/common/typography'; class Kugel extends React.Component { constructor(props) { super(props); this.state = { radius: 0, volumen: 0 }; this.handleChange = this.handleChange.bind(this); } handleChange(event) { co...
Fix embed=body to query string for eventstore in mono
var debug = require('debug')('geteventstore:getevents'), req = require('request-promise'), assert = require('assert'), url = require('url'), q = require('q'); var baseErr = 'Get Events - '; module.exports = function(config) { var buildUrl = function(stream, startPosition, length, direction) { ...
var debug = require('debug')('geteventstore:getevents'), req = require('request-promise'), assert = require('assert'), url = require('url'), q = require('q'); var baseErr = 'Get Events - '; module.exports = function(config) { var buildUrl = function(stream, startPosition, length, direction) { ...
Use a private I/O thread pool for failure detector
/* * 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...
Change over to local email server in production
from local_settings import * DEBUG = False ALLOWED_HOSTS = ['uchicagohvz.org'] ADMINS = ( ('Administrator', 'admin@uchicagohvz.org'), ) SERVER_EMAIL = 'noreply@uchicagohvz.org' # Database DATABASES = { 'default': { 'ENGINE': 'django.db.backends.postgresql_psycopg2', # Add 'postgresql_psycopg2', 'pos...
from local_settings import * DEBUG = False ALLOWED_HOSTS = ['uchicagohvz.org'] ADMINS = ( ('Administrator', 'admin@uchicagohvz.org'), ) SERVER_EMAIL = 'noreply@uchicagohvz.org' # Database DATABASES = { 'default': { 'ENGINE': 'django.db.backends.postgresql_psycopg2', # Add 'postgresql_psycopg2', 'pos...
Remove 3.5 for now. It's not added to PyPI yet.
#!/usr/bin/env python from setuptools import setup, find_packages from setuputils import find_version, read setup( name='astor', version=find_version('astor/__init__.py'), description='Read/rewrite/write Python ASTs', long_description=read('README.rst'), author='Patrick Maupin', author_email...
#!/usr/bin/env python from setuptools import setup, find_packages from setuputils import find_version, read setup( name='astor', version=find_version('astor/__init__.py'), description='Read/rewrite/write Python ASTs', long_description=read('README.rst'), author='Patrick Maupin', author_email...
Fix another bug which caused sorting not to work with new combined api results
var request = require('request'); var _und = require('underscore'); /* Get orders listing. */ exports.list = function(req, res){ var results = { orders: [], bitStampOrders: [], btceOrders: [] }; request('https://www.bitstamp.net/api/transactions/', function(error, response, body){ ...
var request = require('request'); var _und = require('underscore'); /* Get orders listing. */ exports.list = function(req, res){ var results = { orders: [], bitStampOrders: [], btceOrders: [] }; request('https://www.bitstamp.net/api/transactions/', function(error, response, body){ ...
Add test for invalid email
import unittest from flask import json from api import db from api.BucketListAPI import app from instance.config import application_config class AuthenticationTestCase(unittest.TestCase): def setUp(self): app.config.from_object(application_config['TestingEnv']) self.client = app.test_client() ...
import unittest from flask import json from api import db from api.BucketListAPI import app from instance.config import application_config class AuthenticationTestCase(unittest.TestCase): def setUp(self): app.config.from_object(application_config['TestingEnv']) self.client = app.test_client() ...
Remove auto branch name in commit
'use strict'; var exec = require('child_process').exec; var throwErr = require('../utils/throw-err'); function fastPush(commitMessage) { exec('git --version', function(error) { if(error) { throwErr('You don\'t have git installed'); } else { exec('git rev-parse --abbrev-ref HEAD', function(err, c...
'use strict'; var exec = require('child_process').exec; var throwErr = require('../utils/throw-err'); function fastPush(commitMessage) { exec('git --version', function(error) { if(error) { throwErr('You don\'t have git installed'); } else { exec('git rev-parse --abbrev-ref HEAD', function(err, c...
Fix for AJAX cache bug in IE
# -*- coding: utf-8 -*- from django.http import HttpResponse from updateable import settings class UpdateableMiddleware(object): def process_request(self, request): updateable = bool(request.GET.get(settings.UPDATEABLE_GET_VARIABLE)) hashvals = {} if updateable: ids = request...
# -*- coding: utf-8 -*- from django.http import HttpResponse from updateable import settings class UpdateableMiddleware(object): def process_request(self, request): updateable = bool(request.GET.get(settings.UPDATEABLE_GET_VARIABLE)) hashvals = {} if updateable: ids = request...
Add error handling to random move.
var otherPlayers = require('../../../src/command_util.js').CommandUtil.otherPlayerInRoom; exports.listeners = { playerEnter: chooseRandomExit }; function chooseRandomExit(room, rooms, player, players, npc) { return function(room, rooms, player, players, npc) { if (isCoinFlip()) { var exits = room.getExi...
var otherPlayers = require('../../../src/command_util.js').CommandUtil.otherPlayerInRoom; exports.listeners = { playerEnter: chooseRandomExit }; //FIXME: Occasionally causes crash because of undefined. function chooseRandomExit(room, rooms, player, players, npc) { return function(room, rooms, player, players, npc...
Add checks for invalid sources.
import matchbox from './lib/matcher'; import transactionFormatters from './lib/formatters/transactions'; import emailFormatters from './lib/formatters/emails'; import fs from 'fs'; import concat from 'concat-stream'; import os from 'os'; import emailSources from './lib/email-sources'; const match = function(msg, cb) {...
import matchbox from './lib/matcher'; import transactionFormatters from './lib/formatters/transactions'; import emailFormatters from './lib/formatters/emails'; import fs from 'fs'; import concat from 'concat-stream'; import os from 'os'; import emailSources from './lib/email-sources'; const match = function(msg, cb) {...
Make tests runnable in WebStorm.
(function() { /*global __karma__,require*/ "use strict"; var included = ''; var excluded = ''; var webglValidation = false; var release = false; if(__karma__.config.args){ included = __karma__.config.args[0]; excluded = __karma__.config.args[1]; webglValidation = __...
(function() { /*global __karma__,require*/ "use strict"; var included = __karma__.config.args[0]; var excluded = __karma__.config.args[1]; var webglValidation = __karma__.config.args[2]; var release = __karma__.config.args[3]; var toRequire = ['Cesium']; if (release) { require...
Update regex to match underscore and be case insensitive;
"use strict"; ;(function ( root, name, definition ) { /* * Exports */ if ( typeof define === 'function' && define.amd ) { define( [], definition ); } else if ( typeof module === 'object' && module.exports ) { module.exports = definition(); } else { root[ name ...
"use strict"; ;(function ( root, name, definition ) { /* * Exports */ if ( typeof define === 'function' && define.amd ) { define( [], definition ); } else if ( typeof module === 'object' && module.exports ) { module.exports = definition(); } else { root[ name ...
Use auth.credentials.user for policy checks
const Boom = require('boom'); exports.register = function (server, options, next) { if (!options) options = {}; const policies = options.policies || []; // General check function check = async(user, action, target) => { if (!user || !action) return false; try { // Resolve ...
const Boom = require('boom'); exports.register = function (server, options, next) { if (!options) options = {}; const policies = options.policies || []; // General check function check = async(user, action, target) => { if (!user || !action) return false; try { // Resolve ...
Modify an error handling when a command not specified for Which
""" .. codeauthor:: Tsuyoshi Hombashi <tsuyoshi.hombashi@gmail.com> """ import errno import shutil from typing import Optional from .error import CommandError class Which: @property def command(self): return self.__command def __init__(self, command: str) -> None: if not command: ...
""" .. codeauthor:: Tsuyoshi Hombashi <tsuyoshi.hombashi@gmail.com> """ import errno import shutil from typing import Optional from .error import CommandError class Which: @property def command(self): return self.__command def __init__(self, command: str) -> None: if not command: ...
Remove static import in this test.
package com.kickstarter.libs.utils; import com.kickstarter.factories.CategoryFactory; import com.kickstarter.factories.LocationFactory; import com.kickstarter.libs.RefTag; import com.kickstarter.services.DiscoveryParams; import junit.framework.TestCase; public class DiscoveryParamsUtilsTest extends TestCase { pub...
package com.kickstarter.libs.utils; import com.kickstarter.factories.CategoryFactory; import com.kickstarter.factories.LocationFactory; import com.kickstarter.libs.RefTag; import com.kickstarter.services.DiscoveryParams; import junit.framework.TestCase; import static com.kickstarter.libs.utils.DiscoveryParamsUtils.r...
Add redirect middleware to heroku configs
import os import urllib.parse from gamecraft.settings_heroku_base import * DEBUG = False TEMPLATE_DEBUG = False INSTALLED_APPS = INSTALLED_APPS + ( 'raven.contrib.django.raven_compat', ) redis_parse_result = urllib.parse.urlparse(os.environ['REDISCLOUD_URL']) CACHES = { 'default': { 'BACKEND': 'redi...
import os import urllib.parse from gamecraft.settings_heroku_base import * DEBUG = False TEMPLATE_DEBUG = False INSTALLED_APPS = INSTALLED_APPS + ( 'raven.contrib.django.raven_compat', ) redis_parse_result = urllib.parse.urlparse(os.environ['REDISCLOUD_URL']) CACHES = { 'default': { 'BACKEND': 'redi...
Remove a redundant if and fix a syntax error
import ircbotframe import sys class Handler: def __init__(self, host, port=6667, name="MediaWiki", description="MediaWiki recent changes bot", channels=[]): self.channels = channels self.bot = ircbotframe.ircBot(host, port, name, description) self.bot.bind("376", self.endMOTD) self....
import ircbotframe import sys class Handler: def __init__(self, host, port=6667, name="MediaWiki", description="MediaWiki recent changes bot", channels=[]): self.channels = channels self.bot = ircbotframe.ircBot(host, port, name, description) self.bot.bind("376", self.endMOTD) self....
Make CMS default interface language install correctly. We could have a situation where: * Language == Interface languages (so SameInterfaceLanguages is true) * Default language != Default Interface language. This wasn't possible anymore. This changes makes sure the 'sameInterfaceLanguages' check does not enforce the ...
<?php namespace ForkCMS\Bundle\InstallerBundle\Form\Handler; use Symfony\Component\Form\Form; use Symfony\Component\HttpFoundation\Request; /** * Validates and saves the data from the languages form * * @author Wouter Sioen <wouter.sioen@wijs.be> */ class LanguagesHandler { public function process(Form $form...
<?php namespace ForkCMS\Bundle\InstallerBundle\Form\Handler; use Symfony\Component\Form\Form; use Symfony\Component\HttpFoundation\Request; /** * Validates and saves the data from the languages form * * @author Wouter Sioen <wouter.sioen@wijs.be> */ class LanguagesHandler { public function process(Form $form...
Fix loading schedule from file
package linenux.control; import java.nio.file.Paths; import javafx.beans.property.ObjectProperty; import javafx.beans.property.SimpleObjectProperty; import linenux.command.result.CommandResult; import linenux.model.Schedule; import linenux.storage.XmlScheduleStorage; /** * Controls data flow for the entire applicat...
package linenux.control; import java.nio.file.Paths; import javafx.beans.property.ObjectProperty; import javafx.beans.property.SimpleObjectProperty; import linenux.command.result.CommandResult; import linenux.model.Schedule; import linenux.storage.XmlScheduleStorage; /** * Controls data flow for the entire applicat...
Fix validation error in Firefox
import React, { PropTypes, Component } from 'react'; import shouldPureComponentUpdate from 'react-pure-render/function'; import Label from 'binary-components/lib/Label'; import NumericInput from 'binary-components/lib/NumericInput'; // const basises = ['payout', 'stake']; const payouts = [1, 2, 5, 10, 20, 50, 100, 200...
import React, { PropTypes, Component } from 'react'; import shouldPureComponentUpdate from 'react-pure-render/function'; import Label from 'binary-components/lib/Label'; import NumericInput from 'binary-components/lib/NumericInput'; // const basises = ['payout', 'stake']; const payouts = [1, 2, 5, 10, 20, 50, 100, 200...
Fix display of code block language where none is given.
<?php namespace FluxBB\Markdown\Node; use FluxBB\Markdown\Common\Collection; use FluxBB\Markdown\Common\Text; class CodeBlock extends Node implements NodeAcceptorInterface { /** * @var Collection */ protected $lines; /** * @var string */ protected $language; public functio...
<?php namespace FluxBB\Markdown\Node; use FluxBB\Markdown\Common\Collection; use FluxBB\Markdown\Common\Text; class CodeBlock extends Node implements NodeAcceptorInterface { /** * @var Collection */ protected $lines; /** * @var string */ protected $language; public functio...
Change class Baro to use timedelta_to_string, some fixes
from datetime import datetime import utils class Baro: """This class contains info about the Void Trader and is initialized with data in JSON format """ def __init__(self, data): self.config = data['Config'] self.start = datetime.fromtimestamp(data['Activation'...
from datetime import datetime class Baro: """This class represents a Baro item and is initialized with data in JSON format """ def __init__(self, data): self.config = data['Config'] self.start = datetime.fromtimestamp(data['Activation']['sec']) self.end...
Fix UserCommentForm(), which got broken in the previous commit.
from django.utils.translation import ugettext as _ from django.utils.safestring import mark_safe from django.contrib.auth.models import User try: from django import newforms as forms except ImportError: from django import forms from blango.models import Comment # This violates the DRY principe, but it's the ...
from django.utils.translation import ugettext as _ from django.utils.safestring import mark_safe from django.contrib.auth.models import User try: from django import newforms as forms except ImportError: from django import forms from blango.models import Comment # This violates the DRY principe, but it's the ...
Read the file content, if it is not read when the request is multipart then the client get an error
""" @author: Ferdinand E. Silva @email: ferdinandsilva@ferdinandsilva.com @website: http://ferdinandsilva.com """ import os from django.utils import simplejson as json class qqFileUploader(object): def __init__(self, allowedExtensions=None, sizeLimit=1024): self.allowedExtensions = allowedExtensions or [...
""" @author: Ferdinand E. Silva @email: ferdinandsilva@ferdinandsilva.com @website: http://ferdinandsilva.com """ import os from django.utils import simplejson as json class qqFileUploader(object): def __init__(self, allowedExtensions=None, sizeLimit=1024): self.allowedExtensions = allowedExtensions or [...
Build fails if lint fails
/*global desc, task, jake, fail, complete */ (function() { "use strict"; desc("Build and test"); task("default", ["lint"]); desc("Lint everything"); task("lint", [], function() { var lint = require("./build/lint/lint_runner.js"); var files = new jake.FileList(); files.incl...
/*global desc, task, jake, fail, complete */ (function() { "use strict"; desc("Build and test"); task("default", ["lint"]); desc("Lint everything"); task("lint", [], function() { var lint = require("./build/lint/lint_runner.js"); var files = new jake.FileList(); files.incl...
Fix for Python 3.4 extension compilation. An extra extension compilation option introduced in Python 3.4 collided with -std=c99; added -Wno-declaration-after-statement negates this.
#!/usr/bin/env python # -*- coding: utf-8 -*- from distutils.core import setup from distutils.core import Extension #from Cython.Distutils import build_ext import numpy from numpy.distutils.system_info import get_info mpfit_sources = [ 'mpyfit/mpyfit.c', 'mpyfit/cmpfit/mpfit.c', ] # Avoid some numpy warnings,...
#!/usr/bin/env python # -*- coding: utf-8 -*- from distutils.core import setup from distutils.extension import Extension #from Cython.Distutils import build_ext import numpy from numpy.distutils.system_info import get_info mpfit_sources = [ 'mpyfit/mpyfit.c', 'mpyfit/cmpfit/mpfit.c', ] # Avoid some numpy warn...
Remove dependency on FirebaseNotification Contract
<?php namespace DouglasResende\FCM\Channels; use DouglasResende\FCM\Messages\FirebaseMessage; use Illuminate\Contracts\Config\Repository as Config; use GuzzleHttp\Client; use Illuminate\Notifications\Notification; /** * Class FirebaseChannel * @package DouglasResende\FCM\Channels */ class FirebaseChannel { /*...
<?php namespace DouglasResende\FCM\Channels; use DouglasResende\FCM\Messages\FirebaseMessage; use Illuminate\Contracts\Config\Repository as Config; use GuzzleHttp\Client; use DouglasResende\FCM\Contracts\FirebaseNotification as Notification; /** * Class FirebaseChannel * @package DouglasResende\FCM\Channels */ cl...
Remove shift that was supposed to remove the callback only when it existed Signed-off-by: Henrique Vicente <d390f26e2f50ad5716a9c69c58de1f5df9730e3b@gmail.com>
/* * grunt-cli-config * https://github.com/henvic/grunt-cli-config * * Copyright (c) 2014 Henrique Vicente * Licensed under the MIT license. */ 'use strict'; module.exports = function exports(grunt) { function parseBooleanParam(option) { return { key: option, value: grunt.opt...
/* * grunt-cli-config * https://github.com/henvic/grunt-cli-config * * Copyright (c) 2014 Henrique Vicente * Licensed under the MIT license. */ 'use strict'; module.exports = function exports(grunt) { function parseBooleanParam(option) { return { key: option, value: grunt.opt...
fix(linter): Fix Arrow function should not return assignment
'use strict'; const cheerio = require('cheerio'); const http = require('http'); const querystring = require('querystring'); const getZip = data => { return new Promise((resolve, reject) => { const qs = querystring.stringify({ calle: data.address, numero: data.number, comuna: data.commune }...
'use strict'; const cheerio = require('cheerio'); const http = require('http'); const querystring = require('querystring'); const getZip = data => { return new Promise((resolve, reject) => { const qs = querystring.stringify({ calle: data.address, numero: data.number, comuna: data.commune }...
Correct error in theme:: layout path
<?php namespace Anomaly\SelectFieldType\Handler; use Anomaly\SelectFieldType\SelectFieldType; use Anomaly\Streams\Platform\Addon\Theme\ThemeCollection; use Illuminate\Config\Repository; use Illuminate\Filesystem\Filesystem; /** * Class Layouts * * @link http://anomaly.is/streams-platform * @author ...
<?php namespace Anomaly\SelectFieldType\Handler; use Anomaly\SelectFieldType\SelectFieldType; use Anomaly\Streams\Platform\Addon\Theme\ThemeCollection; use Illuminate\Config\Repository; use Illuminate\Filesystem\Filesystem; /** * Class Layouts * * @link http://anomaly.is/streams-platform * @author ...
Allow to dd in cli
<?php /* +------------------------------------------------------------------------+ | dd | +------------------------------------------------------------------------+ | Copyright (c) 2016 Phalcon Team (https://www.phalconphp.com) | +-----...
<?php /* +------------------------------------------------------------------------+ | dd | +------------------------------------------------------------------------+ | Copyright (c) 2016 Phalcon Team (https://www.phalconphp.com) | +-----...
Correct implementation of joinParams() helper
export default { /** * Naive polyfill for Object.assign() * Why I did it? Because even modular lodash adds too much code in final build * @param {Object} target * @return {Object} */ assign(target) { for (let i = 1; i < arguments.length; i++) { let obj = Object(argum...
export default { /** * Naive polyfill for Object.assign() * Why I did it? Because even modular lodash adds too much code in final build * @param {Object} target * @return {Object} */ assign(target) { for (let i = 1; i < arguments.length; i++) { let obj = Object(argum...
Add user to error messages
package org.signaut.jetty.deploy.providers.couchdb; import java.io.IOException; import java.io.Writer; import javax.servlet.http.HttpServletRequest; import org.eclipse.jetty.server.handler.ErrorHandler; /** * Display the error as a json object * */ class JsonErrorHandler extends ErrorHandler { @Override ...
package org.signaut.jetty.deploy.providers.couchdb; import java.io.IOException; import java.io.Writer; import javax.servlet.http.HttpServletRequest; import org.eclipse.jetty.server.handler.ErrorHandler; /** * Display the error as a json object * */ class JsonErrorHandler extends ErrorHandler { @Override ...
Rename is_connected method to connected
import uuid class BaseTransport(object): """Base transport class.""" REQUEST_ID_KEY = 'requestId' REQUEST_ACTION_KEY = 'action' def __init__(self, data_format_class, data_format_options, handler_class, handler_options, name): self._data_format = data_format_class(**data_form...
import uuid class BaseTransport(object): """Base transport class.""" REQUEST_ID_KEY = 'requestId' REQUEST_ACTION_KEY = 'action' def __init__(self, data_format_class, data_format_options, handler_class, handler_options, name): self._data_format = data_format_class(**data_form...
Set type option to nodebuffer if in node environment.
var write = require('./write'), geojson = require('./geojson'), prj = require('./prj'), JSZip = require('jszip'); module.exports = function(gj, options) { var zip = new JSZip(), layers = zip.folder(options && options.folder ? options.folder : 'layers'); [geojson.point(gj), geojson.line(gj...
var write = require('./write'), geojson = require('./geojson'), prj = require('./prj'), JSZip = require('jszip'); module.exports = function(gj, options) { var zip = new JSZip(), layers = zip.folder(options && options.folder ? options.folder : 'layers'); [geojson.point(gj), geojson.lin...
Add _isMounted check for setState
// @flow import React, { Component } from 'react'; import { connect } from 'react-redux'; import { autocomplete } from 'app/actions/SearchActions'; import { debounce } from 'lodash'; type Props = { filter: Array<string> }; function withAutocomplete(WrappedComponent: any) { return class extends Component { st...
// @flow import React, { Component } from 'react'; import { connect } from 'react-redux'; import { autocomplete } from 'app/actions/SearchActions'; import { debounce } from 'lodash'; type Props = { filter: Array<string> }; function withAutocomplete(WrappedComponent: any) { return class extends Component { st...
Fix dot reporter not resetting the current line length
<?php namespace pho\Reporter; use pho\Console\Console; use pho\Suite\Suite; use pho\Runnable\Spec; class DotReporter extends AbstractReporter implements ReporterInterface { private static $maxPerLine = 60; private $lineLength; /** * Creates a SpecReporter object, used to render a nested view of te...
<?php namespace pho\Reporter; use pho\Console\Console; use pho\Suite\Suite; use pho\Runnable\Spec; class DotReporter extends AbstractReporter implements ReporterInterface { private static $maxPerLine = 60; private $lineLength; /** * Creates a SpecReporter object, used to render a nested view of te...
CRM-4654: Modify standard step to skip extended merge field
<?php namespace Oro\Bundle\EntityMergeBundle\Model\Step; use Symfony\Component\EventDispatcher\EventDispatcherInterface; use Oro\Bundle\EntityMergeBundle\Data\EntityData; use Oro\Bundle\EntityMergeBundle\Event\FieldDataEvent; use Oro\Bundle\EntityMergeBundle\MergeEvents; use Oro\Bundle\EntityMergeBundle\Model\Strate...
<?php namespace Oro\Bundle\EntityMergeBundle\Model\Step; use Symfony\Component\EventDispatcher\EventDispatcherInterface; use Oro\Bundle\EntityMergeBundle\Data\EntityData; use Oro\Bundle\EntityMergeBundle\Event\FieldDataEvent; use Oro\Bundle\EntityMergeBundle\MergeEvents; use Oro\Bundle\EntityMergeBundle\Model\Strate...
Reformat posts in seed data
import moment from 'moment'; import { Posts } from '../../api/collections'; const seedPosts = () => { const post = Posts.findOne(); if (!post) { for (let i = 0; i < 50; i++) { Posts.insert({ userId: 'QBgyG7MsqswQmvm7J', username: 'evancorl', createdAt: moment().utc().toDate(), ...
import moment from 'moment'; import { Posts } from '../../api/collections'; const seedPosts = () => { const postCount = Posts.find().count(); if (postCount === 0) { for (let i = 0; i < 50; i++) { Posts.insert({ createdAt: moment().utc().toDate(), userId: 'QBgyG7MsqswQmvm7J', mes...
Fix doc string injection of deprecated wrapper
import warnings import functools __all__ = ['deprecated'] class deprecated(object): """Decorator to mark deprecated functions with warning. Adapted from <http://wiki.python.org/moin/PythonDecoratorLibrary>. Parameters ---------- alt_func : str If given, tell user what function to use i...
import warnings import functools __all__ = ['deprecated'] class deprecated(object): """Decorator to mark deprecated functions with warning. Adapted from <http://wiki.python.org/moin/PythonDecoratorLibrary>. Parameters ---------- alt_func : str If given, tell user what function to use i...
Fix import now that this is renamed.
import sys from django.conf import settings from django.core.management.base import BaseCommand from comrade import cronjobs import logging logger = logging.getLogger('comrade.cron') class Command(BaseCommand): help = 'Run a script, often a cronjob' args = '[name args...]' def handle(self, *args, **opts...
import sys from django.conf import settings from django.core.management.base import BaseCommand import cronjobs import commonware.log log = commonware.log.getLogger('comrade.cron') class Command(BaseCommand): help = 'Run a script, often a cronjob' args = '[name args...]' def handle(self, *args, **opts):...
Reformat tests to use spaces not tabs
/* * Copyright 2017 MovingBlocks * * 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 t...
/* * Copyright 2017 MovingBlocks * * 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 t...
Make test output show natural sw.
package cz.crcs.ectester.reader.output; import cz.crcs.ectester.common.util.CardUtil; import cz.crcs.ectester.reader.response.Response; import java.io.PrintStream; /** * @author Jan Jancar johny@neuromancer.sk */ public class ResponseWriter { private PrintStream output; public ResponseWriter(PrintStream o...
package cz.crcs.ectester.reader.output; import cz.crcs.ectester.common.util.CardUtil; import cz.crcs.ectester.reader.response.Response; import java.io.PrintStream; /** * @author Jan Jancar johny@neuromancer.sk */ public class ResponseWriter { private PrintStream output; public ResponseWriter(PrintStream o...
Fix undeclared variable error and prevent event default
(function (){ var GOVUKDATEFIELDS = function (){ var $allDateGroupInstances = $(".form-date"), init = function (){ $allDateGroupInstances.each(function (){ var $currentGroup = $(this); var $inputs = $currentGroup.find('input'); var $todayButton = $currentGroup.find('a...
(function (){ var GOVUKDATEFIELDS = function (){ var $allDateGroupInstances = $(".form-date"), init = function (){ $allDateGroupInstances.each(function (){ var $currentGroup = $(this); var $inputs = $currentGroup.find('input'); var $todayButton = $currentGroup.find('a...
Create test case for default currency
<?php namespace Flagbit\Bundle\CurrencyBundle\Tests; use Flagbit\Bundle\CurrencyBundle\DependencyInjection\Configuration; use Symfony\Component\Config\Definition\Processor; class ConfigurationTest extends \PHPUnit_Framework_TestCase { protected function process($config) { $processor = new Processor()...
<?php namespace Flagbit\Bundle\CurrencyBundle\Tests; use Flagbit\Bundle\CurrencyBundle\DependencyInjection\Configuration; use Symfony\Component\Config\Definition\Processor; class ConfigurationTest extends \PHPUnit_Framework_TestCase { protected function process($config) { $processor = new Processor()...
Improve classifiers, version and url
import os from setuptools import setup, find_packages with open(os.path.join(os.path.dirname(__file__), 'README.rst')) as readme: README = readme.read() # allow setup.py to be run from any path os.chdir(os.path.normpath(os.path.join(os.path.abspath(__file__), os.pardir))) setup( name='django-onmydesk', v...
import os from setuptools import setup, find_packages with open(os.path.join(os.path.dirname(__file__), 'README.rst')) as readme: README = readme.read() # allow setup.py to be run from any path os.chdir(os.path.normpath(os.path.join(os.path.abspath(__file__), os.pardir))) setup( name='django-onmydesk', v...
Join two lines in one
# encoding: utf-8 import json def json_filter(value): return json.dumps(value) def count_filter(value): if value is None: return "" count = float(value) base = 1000 prefixes = [ ('K'), ('M'), ('G'), ('T'), ('P'), ('E'), ('Z'), ...
# encoding: utf-8 import json def json_filter(value): return json.dumps(value) def count_filter(value): if value is None: return "" count = float(value) base = 1000 prefixes = [ ('K'), ('M'), ('G'), ('T'), ('P'), ('E'), ('Z'), ...
Return correct value, remove unused props
import React, { Component, PropTypes } from 'react'; import DayPicker from 'react-day-picker'; import moment from 'moment'; import s from './DatePicker.css'; const weekdaysShort = ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun']; const weekdaysLong = [ 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday'...
import React, { Component, PropTypes } from 'react'; import DayPicker from 'react-day-picker'; import moment from 'moment'; import s from './DatePicker.css'; const weekdaysShort = ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun']; const weekdaysLong = [ 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday'...
Fix bug in sentiment calculation Signed-off-by: Itai Koren <7a3f8a9ea5df78694ad87e4c8117b31e1b103a24@gmail.com>
// Include The 'require.async' Module require("require.async")(require); /** * Tokenizes an input string. * * @param {String} Input * * @return {Array} */ function tokenize (input) { return input .replace(/[^a-zA-Z ]+/g, "") .replace("/ {2,}/", " ") .toLowerCase() ...
// Include The 'require.async' Module require("require.async")(require); /** * Tokenizes an input string. * * @param {String} Input * * @return {Array} */ function tokenize (input) { return input .replace(/[^a-zA-Z ]+/g, "") .replace("/ {2,}/", " ") .toLowerCase() ...
Refactor episode details JavaScript functions.
var Cloudy = { isEpisodePage: function() { return $("#audioplayer").length == 1; }, getEpisodeDetails: function() { var episodeTitle = $(".titlestack .title").text(); var showTitle = $(".titlestack .caption2").text(); return { show_title: showTitle, e...
var Cloudy = { isEpisodePage: function() { return $("#audioplayer").length == 1; }, sendEpisodeToCloudy: function() { var episodeTitle = $(".titlestack .title").text(); var showTitle = $(".titlestack .caption2").text(); var details = { "show_title": showTitle, ...
:bug: Fix Punchcard JS and images compilation
const gulp = require('gulp'); const config = require('config'); const runner = require('punchcard-runner'); const concat = require('gulp-concat'); const uglify = require('gulp-uglify'); const imagemin = require('gulp-imagemin'); const path = require('path'); const options = runner.config({ application: { library...
const gulp = require('gulp'); const config = require('config'); const runner = require('punchcard-runner'); const options = runner.config({ application: { library: { src: [ 'lib', 'config', 'content-types', 'input-plugins' ], } }, tasks: { nodemon: { ...
Fix bug wrong pageId in showAction
<?php namespace Akhann\StaticPageBundle\Controller; use Symfony\Bundle\FrameworkBundle\Controller\Controller; abstract class DefaultController extends Controller { abstract public function getIndexTemplate(); abstract public function getShowTemplateNamespace(); public function indexAction() { ...
<?php namespace Akhann\StaticPageBundle\Controller; use Symfony\Bundle\FrameworkBundle\Controller\Controller; abstract class DefaultController extends Controller { abstract public function getIndexTemplate(); abstract public function getShowTemplateNamespace(); public function indexAction() { ...
Prepare for making alpha release
from setuptools import setup, find_packages import sys, os here = os.path.abspath(os.path.dirname(__file__)) try: README = open(os.path.join(here, 'README.rst')).read() except IOError: README = '' version = "0.0.1a" setup(name='backlash', version=version, description="Standalone WebOb port of the...
from setuptools import setup, find_packages import sys, os here = os.path.abspath(os.path.dirname(__file__)) try: README = open(os.path.join(here, 'README.rst')).read() except IOError: README = '' version = "0.0.1" setup(name='backlash', version=version, description="standalone version of the Wer...
Hide source input from create dialog
import React from 'react'; import { injectIntl } from 'react-intl'; import Button from '@material-ui/core/Button'; import Dialog from '@material-ui/core/Dialog'; import DialogActions from '@material-ui/core/DialogActions'; import DialogContent from '@material-ui/core/DialogContent'; import DialogTitle from '@material-u...
import React from 'react'; import { injectIntl } from 'react-intl'; import Button from '@material-ui/core/Button'; import Dialog from '@material-ui/core/Dialog'; import DialogActions from '@material-ui/core/DialogActions'; import DialogContent from '@material-ui/core/DialogContent'; import DialogTitle from '@material-u...
Add HeaderArea into HeaderRow storybook subcomponents
import React from 'react'; import HeaderRow, { HeaderArea } from '@ichef/gypcrete/src/HeaderRow'; import Button from '@ichef/gypcrete/src/Button'; import TextLabel from '@ichef/gypcrete/src/TextLabel'; import TextEllipsis from '@ichef/gypcrete/src/TextEllipsis'; import DebugBox from 'utils/DebugBox'; export default ...
import React from 'react'; import HeaderRow from '@ichef/gypcrete/src/HeaderRow'; import Button from '@ichef/gypcrete/src/Button'; import TextLabel from '@ichef/gypcrete/src/TextLabel'; import TextEllipsis from '@ichef/gypcrete/src/TextEllipsis'; import DebugBox from 'utils/DebugBox'; export default { title: '@i...
Tag version 0.1, ready for upload to PyPI.
import os from setuptools import setup README = open(os.path.join(os.path.dirname(__file__), 'README.rst')).read() # LICENSE = open(os.path.join(os.path.dirname(__file__), 'LICENSE.txt')).read() # allow setup.py to be run from any path os.chdir(os.path.normpath(os.path.join(os.path.abspath(__file__), os.pardir))) se...
import os from setuptools import setup README = open(os.path.join(os.path.dirname(__file__), 'README.rst')).read() # LICENSE = open(os.path.join(os.path.dirname(__file__), 'LICENSE.txt')).read() # allow setup.py to be run from any path os.chdir(os.path.normpath(os.path.join(os.path.abspath(__file__), os.pardir))) se...
Change to using threading.Lock instead of threading.Condition, and check lock state before trying to release it during the finally block
# coding=utf-8 import logging import threading import traceback class Handler(object): """ Handlers process metrics that are collected by Collectors. """ def __init__(self, config=None): """ Create a new instance of the Handler class """ # Initialize Log self.l...
# coding=utf-8 import logging import threading import traceback class Handler(object): """ Handlers process metrics that are collected by Collectors. """ def __init__(self, config=None): """ Create a new instance of the Handler class """ # Initialize Log self.l...
Change dictionary name to avoid collision; fix dict.values() call
from __future__ import unicode_literals class Graph(object): """A class for a simple graph data structure.""" def __init__(self): self.graph = {} def __repr__(self): return repr(self.graph) def nodes(self): """Return a list of all nodes in the graph.""" return [node f...
from __future__ import unicode_literals class Graph(object): """A class for a simple graph data structure.""" def __init__(self): self.nodes = {} def __repr__(self): pass def nodes(self): """Return a list of all nodes in the graph.""" return [node for node in self.nod...
Modify filter to show new computational sample templates.
class MCWorkflowProcessTemplatesComponentController { /*@ngInit*/ constructor(templates) { this.templates = templates.get(); this.templateTypes = [ { title: 'CREATE SAMPLES', cssClass: 'mc-create-samples-color', icon: 'fa-cubes', ...
class MCWorkflowProcessTemplatesComponentController { /*@ngInit*/ constructor(templates) { this.templates = templates.get(); this.templateTypes = [ { title: 'CREATE SAMPLES', cssClass: 'mc-create-samples-color', icon: 'fa-cubes', ...
Remove new JS syntax usage Add support for Node.js 4.x
/*eslint-env node*/ const _ = require('lodash'); const ERROR_SEVERITY = 2; function logIssue(issue) { const attributes = _.chain(_.toPairs(issue)) .map((pair) => ({ key: pair[0], value: pair[1], })) .filter((pair) => pair.key !== 'message') ...
/*eslint-env node*/ const _ = require('lodash'); const ERROR_SEVERITY = 2; function logIssue(issue) { const attributes = _.chain(_.toPairs(issue)) .filter(([ key, ]) => key !== 'message') .filter(([ , value, ]) => value !== undefined) .map((...
Address Python lint issue in unrelated file
# ===--- compiler_stage.py -----------------------------------------------===# # # This source file is part of the Swift.org open source project # # Copyright (c) 2014 - 2021 Apple Inc. and the Swift project authors # Licensed under Apache License v2.0 with Runtime Library Exception # # See https:#swift.org/LICENSE.txt...
# ===--- compiler_stage.py -----------------------------------------------===# # # This source file is part of the Swift.org open source project # # Copyright (c) 2014 - 2021 Apple Inc. and the Swift project authors # Licensed under Apache License v2.0 with Runtime Library Exception # # See https:#swift.org/LICENSE.txt...
Fix to ensure we dont leave any open file handles laying around
/* * Copyright 2012-2014 inBloom, Inc. and its affiliates. * * 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 appli...
/* * Copyright 2012-2014 inBloom, Inc. and its affiliates. * * 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 appli...
Fix errors reported by php-cs-fixer
<?php /** * Zend Framework (http://framework.zend.com/) * * @link http://github.com/zendframework/zf2 for the canonical source repository * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ namespace ...
<?php /** * Zend Framework (http://framework.zend.com/) * * @link http://github.com/zendframework/zf2 for the canonical source repository * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ namespace ...
Fix a stupid bug in get_people_from_memberships The rebinding of the function's election_data parameter was breaking the listing of candidates for a post.
from django.core.urlresolvers import reverse from django.conf import settings from django.http import HttpResponseRedirect from slugify import slugify from ..election_specific import AREA_POST_DATA from ..models import ( PopItPerson, membership_covers_date ) def get_redirect_to_post(election, post_data): sho...
from django.core.urlresolvers import reverse from django.conf import settings from django.http import HttpResponseRedirect from slugify import slugify from ..election_specific import AREA_POST_DATA from ..models import ( PopItPerson, membership_covers_date ) def get_redirect_to_post(election, post_data): sho...
Use the media id as notification id
package io.smartlogic.smartchat; import android.app.IntentService; import android.app.NotificationManager; import android.app.PendingIntent; import android.content.Context; import android.content.Intent; import android.os.Bundle; import android.support.v4.app.NotificationCompat; import android.support.v4.app.TaskStack...
package io.smartlogic.smartchat; import android.app.IntentService; import android.app.NotificationManager; import android.app.PendingIntent; import android.content.Context; import android.content.Intent; import android.os.Bundle; import android.support.v4.app.NotificationCompat; import android.support.v4.app.TaskStack...
QS-1486: Enable hidden metadata option on other people´s profile
import PropTypes from 'prop-types'; import React, { Component } from 'react'; import ProfileData from './ProfileData' export default class OtherProfileDataList extends Component { static propTypes = { profileWithMetadata: PropTypes.array.isRequired, metadata : PropTypes.object.isRequired...
import PropTypes from 'prop-types'; import React, { Component } from 'react'; import ProfileData from './ProfileData' export default class OtherProfileDataList extends Component { static propTypes = { profileWithMetadata: PropTypes.array.isRequired, metadata : PropTypes.object.isRequired...
Add test for index to cells
from support import lib,ffi from qcgc_test import QCGCTest class FitAllocatorTest(QCGCTest): def test_macro_consistency(self): self.assertEqual(2**lib.QCGC_LARGE_FREE_LIST_FIRST_EXP, lib.qcgc_small_free_lists + 1) last_exp = lib.QCGC_LARGE_FREE_LIST_FIRST_EXP + lib.qcgc_large_free_lists - 1 ...
from support import lib,ffi from qcgc_test import QCGCTest class FitAllocatorTest(QCGCTest): def test_macro_consistency(self): self.assertEqual(2**lib.QCGC_LARGE_FREE_LIST_FIRST_EXP, lib.qcgc_small_free_lists + 1) last_exp = lib.QCGC_LARGE_FREE_LIST_FIRST_EXP + lib.qcgc_large_free_lists - 1 ...
BB-4080: Add CLI command to perform product reindex - cr fixes
<?php namespace Oro\Bundle\SearchBundle\Engine; interface IndexerInterface { /** * Save one of several entities to search index * * @param object|array $entity * @param array $context * * @return bool */ public function save($entity, array $context = []); /** ...
<?php namespace Oro\Bundle\SearchBundle\Engine; interface IndexerInterface { /** * Save one of several entities to search index * * @param object|array $entity * @param array $context * * @return bool */ public function save($entity, $context = []); /** * De...
Add navbar prop to router.
const styles = require('../Style/style.js') import React, { Component } from 'react' import { Navigator } from 'react-native' import HomeMap from './HomeMap' import ParkingDetails from './ParkingDetails' export default class Router extends Component { constructor(props) { super(props) this.state = {} th...
const styles = require('../Style/style.js') import React, { Component } from 'react' import { Navigator } from 'react-native' import HomeMap from './HomeMap' import ParkingDetails from './ParkingDetails' export default class Router extends Component { constructor(props) { super(props) this.state = {} th...
Remove const expression to attain php 5.5 support
<?php namespace Asvae\ApiTester\Http\Controllers; use DateTime; use Illuminate\Routing\Controller; class AssetsController extends Controller { public function index($file = '') { // Permit only safe characters in filename. if (! preg_match('%^([a-z_\-\.]+?)$%', $file)) { abort(404...
<?php namespace Asvae\ApiTester\Http\Controllers; use DateTime; use Illuminate\Routing\Controller; class AssetsController extends Controller { const SECONDS_IN_YEAR = 60*60*24*365; public function index($file = '') { // Permit only safe characters in filename. if (! preg_match('%^([a-z_\...
Use readline() instead of next() to detect changes. tilequeue/queue/file.py -`readline()` will pick up new lines appended to the file, whereas `next()` will not since the iterator will just hit `StopIteration` and stop generating new lines. Use `readline()` instead, then, since it might be desirable to append some...
from tilequeue.tile import serialize_coord, deserialize_coord, CoordMessage import threading class OutputFileQueue(object): def __init__(self, fp): self.fp = fp self.lock = threading.RLock() def enqueue(self, coord): with self.lock: payload = serialize_coord(coord) ...
from tilequeue.tile import serialize_coord, deserialize_coord, CoordMessage import threading class OutputFileQueue(object): def __init__(self, fp): self.fp = fp self.lock = threading.RLock() def enqueue(self, coord): with self.lock: payload = serialize_coord(coord) ...
Make last_jobid available for compatibility.
package io.digdag.standards.operator.gcp; import com.google.api.services.bigquery.model.Job; import com.google.api.services.bigquery.model.JobConfiguration; import io.digdag.client.config.Config; import io.digdag.client.config.ConfigFactory; import io.digdag.client.config.ConfigKey; import io.digdag.spi.OperatorContex...
package io.digdag.standards.operator.gcp; import com.google.api.services.bigquery.model.Job; import com.google.api.services.bigquery.model.JobConfiguration; import io.digdag.client.config.Config; import io.digdag.client.config.ConfigFactory; import io.digdag.client.config.ConfigKey; import io.digdag.spi.OperatorContex...
Use dirname instead of realpath
<?php declare(strict_types=1); namespace WoohooLabs\Zen\Examples; use WoohooLabs\Zen\Config\AbstractCompilerConfig; use WoohooLabs\Zen\Config\Autoload\AutoloadConfig; use WoohooLabs\Zen\Config\Autoload\AutoloadConfigInterface; use WoohooLabs\Zen\Config\FileBasedDefinition\FileBasedDefinitionConfig; use WoohooLabs\Zen...
<?php declare(strict_types=1); namespace WoohooLabs\Zen\Examples; use WoohooLabs\Zen\Config\AbstractCompilerConfig; use WoohooLabs\Zen\Config\Autoload\AutoloadConfig; use WoohooLabs\Zen\Config\Autoload\AutoloadConfigInterface; use WoohooLabs\Zen\Config\FileBasedDefinition\FileBasedDefinitionConfig; use WoohooLabs\Zen...
Use a non-routeable address for this URL. We do not anticipate ever sending any traffic to this since this is the in-memory-only implementation.
# Copyright Least Authority Enterprises. # See LICENSE for details. """ An in-memory implementation of the Kubernetes client interface. """ from zope.interface import implementer from twisted.python.url import URL from twisted.web.resource import Resource from treq.testing import RequestTraversalAgent from . impo...
# Copyright Least Authority Enterprises. # See LICENSE for details. """ An in-memory implementation of the Kubernetes client interface. """ from zope.interface import implementer from twisted.python.url import URL from twisted.web.resource import Resource from treq.testing import RequestTraversalAgent from . impo...
Fix for esquire.untli() not working with linked list nodes
'use strict' /* * Assumes exclusive ownership of each removal */ function until(onRemove, removals) { onRemove.listenOnce(function() { removals.forEach(function(removal) { if(typeof removal === 'function') removal() else removal.remove() })...
'use strict' /* * Assumes exclusive ownership of each removal */ function until(onRemove, removals) { onRemove.listenOnce(function() { removals.forEach(function(removal) { removal() }) }) } function bind_until(func) { var clear var result = function func_with_until() { ...
Add test to get an object out back as an object
var Assert = require('assert'); var CacheAllTheThings = require('../'); describe('CacheAllTheThings', function() { it('When asked to boot a Redis instance, it should do so', function() { var inst = new CacheAllTheThings('redis'); Assert(inst.name, 'RedisCache'); }); describe('Redis', functio...
var Assert = require('assert'); var CacheAllTheThings = require('../'); describe('CacheAllTheThings', function() { it('When asked to boot a Redis instance, it should do so', function() { var inst = new CacheAllTheThings('redis'); Assert(inst.name, 'RedisCache'); }); describe('Redis', functio...
Use Laminas Doctrine Hydrator instead of DoctrineModule Hydrator
<?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...
Add support for proper relative files Until now it only worked if the file.base matched the main sass file's folder.
'use strict'; var path = require('path'); var fs = require('fs'); var through = require('through2'); var glob = require('glob'); module.exports = function() { var process = function(filename) { var replaceString = ''; if (fs.statSync(filename).isDirectory()) { // Ignore directories ...
'use strict'; var path = require('path'); var fs = require('fs'); var through = require('through2'); var glob = require('glob'); module.exports = function() { var process = function(filename) { var replaceString = ''; if (fs.statSync(filename).isDirectory()) { // Ignore directories ...
Integrate `UserChangeForm` so we get nice password fields.
from django.conf import settings from django.contrib import admin from django.contrib.auth.forms import UserChangeForm from django_polymorphic_auth.models import User from django_polymorphic_auth.usertypes.email.models import EmailUser from django_polymorphic_auth.usertypes.username.models import UsernameUser from poly...
from django.conf import settings from django.contrib import admin from django_polymorphic_auth.models import User from django_polymorphic_auth.usertypes.email.models import EmailUser from django_polymorphic_auth.usertypes.username.models import UsernameUser from polymorphic.admin import \ PolymorphicParentModelAdmi...
Fix a bug in OutputFileQueue.close(). tilequeue/queue/file.py -01a8fcb made `OutputFileQueue.read()` use `readline()` instead of `next()`, but didn't update `OutputFileQueue.close()`, which uses a list comprehension to grab the rest of the file. Since `.read()` no longer uses the iteration protocol, `.close()` wil...
from tilequeue.tile import serialize_coord, deserialize_coord, CoordMessage import threading class OutputFileQueue(object): def __init__(self, fp): self.fp = fp self.lock = threading.RLock() def enqueue(self, coord): with self.lock: payload = serialize_coord(coord) ...
from tilequeue.tile import serialize_coord, deserialize_coord, CoordMessage import threading class OutputFileQueue(object): def __init__(self, fp): self.fp = fp self.lock = threading.RLock() def enqueue(self, coord): with self.lock: payload = serialize_coord(coord) ...
Fix path to config file Get Can't locate path: </home/vagrant/Code/herbax.dev/vendor/wuifdesign/laravel-seo/src/config/wuifdesign-seo.php> when doing php artisan vendor:publish ... Config file name is seo.php not wuifdesign-seo.php
<?php namespace WuifDesign\SEO; use \Illuminate\Support\ServiceProvider as IlluminateServiceProvider; class ServiceProvider extends IlluminateServiceProvider { /** * Register the service provider. * * @return void */ public function register() { $this->mergeConfigFrom( ...
<?php namespace WuifDesign\SEO; use \Illuminate\Support\ServiceProvider as IlluminateServiceProvider; class ServiceProvider extends IlluminateServiceProvider { /** * Register the service provider. * * @return void */ public function register() { $this->mergeConfigFrom( ...
Set long description content type to markdown
#!/usr/bin/env python # -*- coding: utf-8 -*- from __future__ import absolute_import from __future__ import division from __future__ import print_function from __future__ import unicode_literals from setuptools import setup, find_packages import os def read_file(filename): """Read a file into a string""" path...
#!/usr/bin/env python # -*- coding: utf-8 -*- from __future__ import absolute_import from __future__ import division from __future__ import print_function from __future__ import unicode_literals from setuptools import setup, find_packages import os def read_file(filename): """Read a file into a string""" path...
Reduce warning time to 5s
import logging import time from functools import wraps from . import compat compat.patch() # monkey-patch time.perf_counter log = logging.getLogger('amqpy') def synchronized(lock_name): """Decorator for automatically acquiring and releasing lock for method call This decorator accesses the `lock_name` :cl...
import logging import time from functools import wraps from . import compat compat.patch() # monkey-patch time.perf_counter log = logging.getLogger('amqpy') def synchronized(lock_name): """Decorator for automatically acquiring and releasing lock for method call This decorator accesses the `lock_name` :cl...
Allow user to put in access token
$(function(){ var messages = []; function process(data) { if(data.data.length) { messages = messages.concat(data.data); } if(data.paging && data.paging.next) { console.log('Getting next page'); return $.getJSON(data.paging.next).then(process); } } $('.submit-id').click(funct...
$(function(){ var messages = []; var token = 'CAACEdEose0cBAPsc5EojEPsnGCVpG05fBKSV1N2WrZAJJ8ngZB55cAkWQA82ZBSaGbiOUOcI9rpRxMxT5kAjGmhhSSieTjtXFEuMYYOEtVIrFYC9ZCkuSSdT5P45ZBBvuniyPGZCZCFPDxkZBFhiRr0BRKje0ZBG7ylmeiJ10ImU8k3mpY5DdoPNT5yZCc6qZBF5jUZD'; function process(data) { if(data.data.length) { mess...
Use resolver to resolve the table name
var resolver = require('../resolver'); function select(database, options, callback) { var results = []; database.command('select', options, function(error, data) { if (error) { callback(error); } else { var columnNames = []; var i, j; for (j = 0; j < data[0][1].length; j++) { ...
function select(database, options, callback) { var results = []; database.command('select', options, function(error, data) { if (error) { callback(error); } else { var columnNames = []; var i, j; for (j = 0; j < data[0][1].length; j++) { columnNames[j] = data[0][1][j][0]; ...
Configure webpack so that `eval` is not used in the development mode Using eval is not allowed by the CSP of newer Nextcloud versions.
/** * ownCloud - Music app * * This file is licensed under the Affero General Public License version 3 or * later. See the COPYING file. * * @author Pauli Järvinen <pauli.jarvinen@gmail.com> * @copyright 2020 Pauli Järvinen * */ const path = require('path'); const MiniCssExtractPlugin = require('mini-css-extr...
/** * ownCloud - Music app * * This file is licensed under the Affero General Public License version 3 or * later. See the COPYING file. * * @author Pauli Järvinen <pauli.jarvinen@gmail.com> * @copyright 2020 Pauli Järvinen * */ const path = require('path'); const MiniCssExtractPlugin = require('mini-css-extr...
Set Python as default language.
<?php namespace App\Units\Home\Http\Controllers; use App\Domains\Graphics\FrameworkRadar; use App\Domains\Graphics\LanguagesIndex; use App\Domains\Graphics\LearningCurve; use App\Domains\Graphics\LearningCurveAll; use App\Domains\Graphics\Trend; use Codecasts\Support\Http\Controller; /** * Class GraphicsController....
<?php namespace App\Units\Home\Http\Controllers; use App\Domains\Graphics\FrameworkRadar; use App\Domains\Graphics\LanguagesIndex; use App\Domains\Graphics\LearningCurve; use App\Domains\Graphics\LearningCurveAll; use App\Domains\Graphics\Trend; use Codecasts\Support\Http\Controller; /** * Class GraphicsController....
Use binary scores to represent sentiment in map
package udacity.storm.tools; import java.util.Properties; import edu.stanford.nlp.ling.CoreAnnotations; import edu.stanford.nlp.neural.rnn.RNNCoreAnnotations; import edu.stanford.nlp.pipeline.Annotation; import edu.stanford.nlp.pipeline.StanfordCoreNLP; import edu.stanford.nlp.sentiment.SentimentCoreAnnotations; impo...
package udacity.storm.tools; import java.util.Properties; import edu.stanford.nlp.ling.CoreAnnotations; import edu.stanford.nlp.neural.rnn.RNNCoreAnnotations; import edu.stanford.nlp.pipeline.Annotation; import edu.stanford.nlp.pipeline.StanfordCoreNLP; import edu.stanford.nlp.sentiment.SentimentCoreAnnotations; impo...
Increment to minor version 1.1.0
import os import setuptools def readme(): if os.path.isfile('README.md'): try: import requests r = requests.post( url='http://c.docverter.com/convert', data={'from': 'markdown', 'to': 'rst'}, files={'input_files[]': open('README.md', ...
import os import setuptools def readme(): if os.path.isfile('README.md'): try: import requests r = requests.post( url='http://c.docverter.com/convert', data={'from': 'markdown', 'to': 'rst'}, files={'input_files[]': open('README.md', ...
Change version number to 0.1.x
/** * Configuration for kort application */ Ext.define('Denkmap.util.Config', { singleton: true, config: { /** * @cfg {String} version Current version number of application **/ version: '0.1.{BUILD_NR}', leafletMap: { zoom: 15, getTileLayerUr...
/** * Configuration for kort application */ Ext.define('Denkmap.util.Config', { singleton: true, config: { /** * @cfg {String} version Current version number of application **/ version: '0.0.{BUILD_NR}', leafletMap: { zoom: 15, getTileLayerUr...
Fix compilation of macro example
var nodes = require('./nodes').nodes, _ = require('underscore'); var macros = {}; var macroexpand = function(ast, env, opts) { var compileNodeWithEnv = require('./compile').compileNodeWithEnv; return _.map(ast, function(n) { var replacement = n.accept({ visitMacro: function() { ...
var nodes = require('./nodes').nodes, _ = require('underscore'); var macros = {}; var macroexpand = function(ast, env, opts) { var compileNodeWithEnv = require('./compile').compileNodeWithEnv; return _.map(ast, function(n) { var replacement = n.accept({ visitMacro: function() { ...
Remove php7.1 iterable type hint from test
<?php use PHPUnit\Framework\TestCase; use Garp\Functional as f; /** * @package Garp\Functional * @author Harmen Janssen <harmen@grrr.nl> * @license https://github.com/grrr-amsterdam/garp-functional/blob/master/LICENSE.md BSD-3-Clause */ class IsAssocTest extends TestCase { /** * @dataProvider arrayPr...
<?php use PHPUnit\Framework\TestCase; use Garp\Functional as f; /** * @package Garp\Functional * @author Harmen Janssen <harmen@grrr.nl> * @license https://github.com/grrr-amsterdam/garp-functional/blob/master/LICENSE.md BSD-3-Clause */ class IsAssocTest extends TestCase { /** * @dataProvider arrayPr...
Print all jslint errors before exiting.
var path = require('path'); var eslint = require('gulp-eslint'); var merge = require('lodash/object/merge'); var shelljs = require('shelljs'); function failLintBuild() { process.exit(1); } function scssLintExists() { return shelljs.which('scss-lint'); } module.exports = function(gulp, options) { var scssLintP...
var path = require('path'); var eslint = require('gulp-eslint'); var merge = require('lodash/object/merge'); var shelljs = require('shelljs'); function failLintBuild() { process.exit(1); } function scssLintExists() { return shelljs.which('scss-lint'); } module.exports = function(gulp, options) { var scssLintP...
Change a way of generating session ids
<?php namespace Perfumer\Component\Session; use Perfumer\Helper\Text; use Stash\Pool as Cache; class Core { /** * @var \Stash\Pool */ protected $cache; protected $items = []; protected $lifetime = 3600; public function __construct(Cache $cache, array $options = []) ...
<?php namespace Perfumer\Component\Session; use Stash\Pool as Cache; class Core { /** * @var \Stash\Pool */ protected $cache; protected $items = []; protected $lifetime = 3600; public function __construct(Cache $cache, array $options = []) { $this->cach...