text
stringlengths
16
4.96k
positive
stringlengths
321
2.24k
negative
stringlengths
310
2.21k
Add all the J* colormaps
import numpy as np import Image import scipy.io as sio def makeImage(cmap, fname): cmarr = (cmap*255).astype(np.uint8) im = Image.fromarray(cmarr[np.newaxis]) im.save(fname) def cmList(additional): cmaps = {} values = np.linspace(0, 1, 256) from matplotlib import cm, colors for cmname in d...
import numpy as np import Image def makeImage(cmap, fname): cmarr = (cmap*255).astype(np.uint8) im = Image.fromarray(cmarr[np.newaxis]) im.save(fname) def cmList(additional): cmaps = {} values = np.linspace(0, 1, 256) from matplotlib import cm, colors for cmname in dir(cm): cmap = ...
Handle error in case img service is down.
var middleware = require('../middleware'); var Router = require('express').Router(); var request = require('superagent'); const IMG_URL = process.env.IMG_URL || 'http://localhost:9003'; Router.route('/version/api') .get(middleware.authenticate('user', 'guest')) .get(function(req, res) { var ...
var middleware = require('../middleware'); var Router = require('express').Router(); var request = require('superagent'); const IMG_URL = process.env.IMG_URL || 'http://localhost:9003'; Router.route('/version/api') .get(middleware.authenticate('user', 'guest')) .get(function(req, res) { var ...
Add onClick event to space placeLabel
import React, { PropTypes } from 'react'; import DestinationListingCard from '../DestinationListingCard/DestinationListingCard'; import Link from '../../Link/Link'; import css from './SpaceListingCard.css'; const SpaceListingCard = (props) => { const { placeLabel, placeHref, location, size, onP...
import React, { PropTypes } from 'react'; import DestinationListingCard from '../DestinationListingCard/DestinationListingCard'; import Link from '../../Link/Link'; import css from './SpaceListingCard.css'; const SpaceListingCard = (props) => { const { placeLabel, placeHref, location, size, ......
Add full post to amp_skip_post filter
<?php function amp_get_permalink( $post_id ) { if ( '' != get_option( 'permalink_structure' ) ) { $amp_url = trailingslashit( get_permalink( $post_id ) ) . user_trailingslashit( AMP_QUERY_VAR, 'single_amp' ); } else { $amp_url = add_query_arg( AMP_QUERY_VAR, absint( $post_id ), home_url() ); } return apply_fi...
<?php function amp_get_permalink( $post_id ) { if ( '' != get_option( 'permalink_structure' ) ) { $amp_url = trailingslashit( get_permalink( $post_id ) ) . user_trailingslashit( AMP_QUERY_VAR, 'single_amp' ); } else { $amp_url = add_query_arg( AMP_QUERY_VAR, absint( $post_id ), home_url() ); } return apply_fi...
Disable debug mode (so there are no messages written to the javascript console)
jQuery(document).ready(function($){ $('notices_primary').infinitescroll({ debug: false, infiniteScroll : false, nextSelector : 'body#public li.nav_next a,'+ 'body#all li.nav_next a,'+ 'body#showstream li.nav_next a,'+ 'body#replies li.n...
jQuery(document).ready(function($){ $('notices_primary').infinitescroll({ debug: true, infiniteScroll : false, nextSelector : 'body#public li.nav_next a,'+ 'body#all li.nav_next a,'+ 'body#showstream li.nav_next a,'+ 'body#replies li.na...
Include cmt in installed packages.
from setuptools import setup, find_packages import versioneer def read_requirements(): import os path = os.path.dirname(os.path.abspath(__file__)) requirements_file = os.path.join(path, "requirements.txt") try: with open(requirements_file, "r") as req_fp: requires = req_fp.read()...
from setuptools import setup, find_packages import versioneer def read_requirements(): import os path = os.path.dirname(os.path.abspath(__file__)) requirements_file = os.path.join(path, 'requirements.txt') try: with open(requirements_file, 'r') as req_fp: requires = req_fp.read(...
Fix bug introduced in merge
/* * Copyright 2015 Caleb Brose, Chris Fogerty, Rob Sheehy, Zach Taylor, Nick Miller * * 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...
/* * Copyright 2015 Caleb Brose, Chris Fogerty, Rob Sheehy, Zach Taylor, Nick Miller * * 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...
Add starting position to the list of visited locations
x = y = direction = 0 moves = open('input.txt', 'r').readline().strip().split(', ') visited = set((0, 0)) for move in moves: if move[0] == 'L': if direction == 0: direction = 3 else: direction -= 1 elif move[0] == 'R': if direction == 3: direction = 0 else: direction += 1 dist = int(''.join(mov...
x = y = direction = 0 moves = open('input.txt', 'r').readline().strip().split(', ') visited = set() for move in moves: if move[0] == 'L': if direction == 0: direction = 3 else: direction -= 1 elif move[0] == 'R': if direction == 3: direction = 0 else: direction += 1 dist = int(''.join(move[1:])...
Add site footer to each documentation generator
var _ = require('lodash') var fs = require('fs') var gzip = require('gzip-size') var filesize = require('filesize') var cssstats = require('cssstats') var module = require('tachyons-letter-spacing/package.json') var moduleCss = fs.readFileSync('node_modules/tachyons-letter-spacing/tachyons-letter-spacing.min.css', 'ut...
var _ = require('lodash') var fs = require('fs') var gzip = require('gzip-size') var filesize = require('filesize') var cssstats = require('cssstats') var module = require('tachyons-letter-spacing/package.json') var moduleCss = fs.readFileSync('node_modules/tachyons-letter-spacing/tachyons-letter-spacing.min.css', 'ut...
Use array_reduce() to generate pipeline of callbacks.
<?php namespace estvoyage\statsd; use estvoyage\statsd\world as statsd ; class packet implements statsd\packet { private $metrics ; function __construct() { $this->metrics = []; } function writeOn(statsd\connection $connection, callable $callback) { $callback = function($connection) use ($callback) {...
<?php namespace estvoyage\statsd; use estvoyage\statsd\world as statsd ; class packet implements statsd\packet { private $metrics ; function __construct() { $this->metrics = []; } function writeOn(statsd\connection $connection, callable $callback) { $callback = function($connection) use ($callback) {...
Use set to compare list of values
# -*- coding: utf-8 -*- import pytest from junction.feedback import service from .. import factories pytestmark = pytest.mark.django_db def test_get_feedback_questions_without_conference(): result = service.get_feedback_questions(conference_id=23) assert result == {} def test_get_feedback_questions_with...
# -*- coding: utf-8 -*- import pytest from junction.feedback import service from .. import factories pytestmark = pytest.mark.django_db def test_get_feedback_questions_without_conference(): result = service.get_feedback_questions(conference_id=23) assert result == {} def test_get_feedback_questions_with...
Update text/Welcome.php to match changes in html version The html version of mailer view Welcome.php was updated. This change makes similar changes in the text version.
<?php /* * This file is part of the Dektrium project. * * (c) Dektrium project <http://github.com/dektrium> * * For the full copyright and license information, please view the LICENSE.md * file that was distributed with this source code. */ /** * @var dektrium\user\models\User */ ?> <?= Yii::t('user', 'Hello...
<?php /* * This file is part of the Dektrium project. * * (c) Dektrium project <http://github.com/dektrium> * * For the full copyright and license information, please view the LICENSE.md * file that was distributed with this source code. */ /** * @var dektrium\user\models\User */ ?> <?= Yii::t('user', 'Hello...
Formatting: Replace double quotes with single quotes
(function() { 'use strict'; angular.module('angular.jsgrid', []) .directive('ngJsgrid', function() { return { restrict: 'A', replace: false, transclude: false, scope: { config: '=ngJsgrid' }, ...
(function() { "use strict"; angular.module("angular.jsgrid", []) .directive("ngJsgrid", function() { return { restrict: "A", replace: false, transclude: false, scope: { config: "=ngJsgrid" }, ...
Add Constant for Loging request (used with startActivityForResult)
package com.simplenote.android; public class Constants { /** Name of stored preferences */ public static final String PREFS_NAME = "SimpleNotePrefs"; /** Logging tag prefix */ public static final String TAG = "SimpleNote:"; // Message Codes public static final int MESSAGE_UPDATE_NOTE = 12398; // Activity for r...
package com.simplenote.android; public class Constants { /** Name of stored preferences */ public static final String PREFS_NAME = "SimpleNotePrefs"; /** Logging tag prefix */ public static final String TAG = "SimpleNote:"; // Message Codes public static final int MESSAGE_UPDATE_NOTE = 12398; // API Base URL...
Fix Flyway dev console link
package io.quarkus.flyway.devconsole; import static io.quarkus.deployment.annotations.ExecutionTime.RUNTIME_INIT; import io.quarkus.deployment.IsDevelopment; import io.quarkus.deployment.annotations.BuildStep; import io.quarkus.deployment.annotations.Record; import io.quarkus.devconsole.spi.DevConsoleRouteBuildItem; ...
package io.quarkus.flyway.devconsole; import static io.quarkus.deployment.annotations.ExecutionTime.RUNTIME_INIT; import io.quarkus.deployment.IsDevelopment; import io.quarkus.deployment.annotations.BuildStep; import io.quarkus.deployment.annotations.Record; import io.quarkus.devconsole.spi.DevConsoleRouteBuildItem; ...
Fix unit test fixtures files
import shutil import os from django.core.files.storage import default_storage from django.test import TestCase class SampleFilesTestCase(TestCase): fixtures = ['sample'] @classmethod def setUpClass(cls): default_storage.location = 'media' # force using source media folder to avoid real data erasi...
import shutil import os from django.core.files.storage import default_storage from django.test import TestCase class SampleFilesTestCase(TestCase): fixtures = ['sample'] @classmethod def setUpClass(cls): default_storage.location = 'media' # force using source media folder to avoid real data erasi...
Fix error / keyboard side effect because of problem between the chair and the keyboard
/* * Copyright (C)2015 D. Plaindoux. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published * by the Free Software Foundation; either version 2, or (at your option) any * later version. * * This program is distributed i...
/* * Copyright (C)2015 D. Plaindoux. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published * by the Free Software Foundation; either version 2, or (at your option) any * later version. * * This program is distributed i...
Fix import of common module
#!/usr/bin/env python def main(): import argparse from ranwinconf.common import generate_host_config parser = argparse.ArgumentParser() parser.add_argument('host', type=str, help="Name or IP of the host to get configuration from") parser.add_argument('--output', type=str, nargs='?', default='<stdo...
#!/usr/bin/env python def main(): import argparse from ranwinconf.common import generate_host_config parser = argparse.ArgumentParser() parser.add_argument('host', type=str, help="Name or IP of the host to get configuration from") parser.add_argument('--output', type=str, nargs='?', default='<stdo...
Change cloudify-plugin-common version back to 3.2a6
######### # Copyright (c) 2014 GigaSpaces Technologies Ltd. All rights reserved # # 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...
######### # Copyright (c) 2014 GigaSpaces Technologies Ltd. All rights reserved # # 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...
Fix group by for mysql 5.7
<?php namespace Mja\Mail\Controllers; use BackendMenu; use Backend\Classes\Controller; use Mja\Mail\Models\Email; use Mja\Mail\Models\EmailOpens; /** * Back-end Controller */ class Mail extends Controller { public $hide_hints = false; public $implement = [ 'Backend.Behaviors.FormController', ...
<?php namespace Mja\Mail\Controllers; use BackendMenu; use Backend\Classes\Controller; use Mja\Mail\Models\Email; use Mja\Mail\Models\EmailOpens; /** * Back-end Controller */ class Mail extends Controller { public $hide_hints = false; public $implement = [ 'Backend.Behaviors.FormController', ...
Add no-trailing-spaces rule to eslint. Change-Id: I00d938706613b041b2896f40f70edf71c3f943d1
module.exports = { extends: ['eslint:recommended', 'google'], env: { es6: true, node: true, mocha: true, }, parserOptions: { ecmaVersion: 2018, sourceType: 'script', }, rules: { 'indent': [ 'error', 2, {'MemberExpression': 2}, ], 'max-len': ['error', 80, { i...
module.exports = { extends: ['eslint:recommended', 'google'], env: { es6: true, node: true, mocha: true, }, parserOptions: { ecmaVersion: 2018, sourceType: 'script', }, rules: { 'indent': [ 'error', 2, {'MemberExpression': 2}, ], 'max-len': ['error', 80, { i...
Correct controller for person look up (for type ahead). It returns the full list of objects matching the person
/* * To change this template, choose Tools | Templates * and open the template in the editor. */ package uk.org.rbc1b.roms.controller.person; import java.util.List; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; import org.springframework.transaction...
/* * To change this template, choose Tools | Templates * and open the template in the editor. */ package uk.org.rbc1b.roms.controller.person; import java.util.List; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; import org.springframework.transaction...
Fix name attribute in impuestos locales
<?php namespace CfdiUtils\Elements\ImpLocal10; use CfdiUtils\Elements\Common\AbstractElement; class ImpuestosLocales extends AbstractElement { public function addRetencionLocal(array $attributes = []): RetencionesLocales { $retencion = new RetencionesLocales($attributes); $this->addChild($rete...
<?php namespace CfdiUtils\Elements\ImpLocal10; use CfdiUtils\Elements\Common\AbstractElement; class ImpuestosLocales extends AbstractElement { public function addRetencionLocal(array $attributes = []): RetencionesLocales { $retencion = new RetencionesLocales($attributes); $this->addChild($rete...
Add method to launch a Runnable in a new thread
package org.jtheque.utils; import org.slf4j.LoggerFactory; import java.util.concurrent.ExecutorService; import java.util.concurrent.Executors; /* * Copyright JTheque (Baptiste Wicht) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the Lice...
package org.jtheque.utils; import org.slf4j.LoggerFactory; /* * Copyright JTheque (Baptiste Wicht) * * 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/...
Add code for collisions (untested)
import { translate, rand, vLog, objToArr, getR, massToRadius, filterClose, vectorToString } from './VectorHelpers'; import { GRAVITY, PLANET_SPRING } from './Constants'; const getGravityAccel = (vR, mass) => { const rMag2 = vR.lengthSq(); const rNorm = vR.normalize(); return rNorm.multiplyScalar(GRAVITY * mass...
import { translate, rand, vLog, objToArr, getR, massToRadius, filterClose, vectorToString } from './VectorHelpers'; import { GRAVITY, PLANET_SPRING } from './Constants'; const getGravityAccel = (vR, mass) => { const rMag2 = vR.lengthSq(); const rNorm = vR.normalize(); const accel = rNorm.multiplyScalar(GRAVITY...
Remove password from editable fields
<div class="wrapper"> <div class="content profile-content"> <div id="body"> <div id="add-video"> <p class="logo">Edit profile</p> <form method="post" enctype="multipart/form-data"> <div class="form-group"> <label for="title">Username</label> <input type="text" class="form-control" na...
<div class="wrapper"> <div class="content profile-content"> <div id="body"> <div id="add-video"> <p class="logo">Edit profile</p> <form method="post" enctype="multipart/form-data"> <div class="form-group"> <label for="title">Username</label> <input type="text" class="form-control" na...
Correct support for ngl NPM commands
'use strict'; const spawn = require('child_process').spawn; module.exports = function (rootDir, type) { const args = Array.from(arguments).slice(2); const cmd = /^win/.test(process.platform) ? 'npm.cmd' : 'npm'; spawn(cmd, ['run'].concat(getNpmCommand(type, args)), { stdio: 'inherit' }); }; const getNpm...
'use strict'; const spawn = require('child_process').spawn; module.exports = function (rootDir, type) { const args = Array.from(arguments).slice(2); spawn('npm', ['run'].concat(getNpmCommand(type, args)), { stdio: 'inherit' }); }; const getNpmCommand = (command, args) => { switch (command) { cas...
Add missing file level doc-block
<?php /** * Zend Framework (http://framework.zend.com/) * * @link http://github.com/zendframework/zf2 for the canonical source repository * @copyright Copyright (c) 2005-2013 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ namespace ...
<?php namespace Zend\Config; use Zend\ServiceManager\AbstractPluginManager; class WriterPluginManager extends AbstractPluginManager { protected $invokableClasses = array( 'php' => 'Zend\Config\Writer\PhpArray', 'ini' => 'Zend\Config\Writer\Ini', 'json' => 'Zend\Config\Writer\Json', ...
Add more responsiveness for user without organizations
var description = d3.select("#text") .html("<b>Title: </b><br/><b>Number: </b><br/><b>Body: </b><br/><b>ID: </b><br/><b>Assignee: </b><br/><b>Milestone: </b><br/><b>Repo: </b>"); $.getJSON("orgs.json") .done(function (data, textStatus, jqXHR) { var orgs = data; render(orgs); }) .fail(); var render ...
var description = d3.select("#text") .html("<b>Title: </b><br/><b>Number: </b><br/><b>Body: </b><br/><b>ID: </b><br/><b>Assignee: </b><br/><b>Milestone: </b><br/><b>Repo: </b>"); $.getJSON("orgs.json") .done(function (data, textStatus, jqXHR) { var orgs = data; render(orgs); }) .fail(); var render ...
Change version for next release
# # markdown/__version__.py # # version_info should conform to PEP 386 # (major, minor, micro, alpha/beta/rc/final, #) # (1, 1, 2, 'alpha', 0) => "1.1.2.dev" # (1, 2, 0, 'beta', 2) => "1.2b2" version_info = (2, 6, 0, 'zds', 8) def _get_version(): " Returns a PEP 386-compliant version number from version_info. " ...
# # markdown/__version__.py # # version_info should conform to PEP 386 # (major, minor, micro, alpha/beta/rc/final, #) # (1, 1, 2, 'alpha', 0) => "1.1.2.dev" # (1, 2, 0, 'beta', 2) => "1.2b2" version_info = (2, 6, 0, 'zds', 7) def _get_version(): " Returns a PEP 386-compliant version number from version_info. " ...
Install this the right way
'use strict'; // Declare app level module which depends on filters, and services var app = angular.module( 'myApp', [ 'ngRoute', 'myApp.controllers', 'myApp.filters', 'myApp.services', 'myApp.directives', // 3rd party dependencies 'btford.socket-io', 'fully-loaded' ] ); app.config( ...
'use strict'; // Declare app level module which depends on filters, and services var app = angular.module( 'myApp', [ 'ngRoute', 'myApp.controllers', 'myApp.filters', 'myApp.services', 'myApp.directives', // 3rd party dependencies 'btford.socket-io' ] ); app.config( function ( $routePro...
Fix unchanged function name for gitPull
/* @method gitPull Takes a flightplan instance and transport @param remote {Object} Flightplan transport instance @param webRoot {string} path to run git pull on the remote server e.g. /var/www/project */ var gitPull = function (remote, webRoot) { // git pull remote.with('cd ' + webRoot, function() { ...
/* @method gitPull Takes a flightplan instance and transport @param remote {Object} Flightplan transport instance @param webRoot {string} path to run git pull on the remote server e.g. /var/www/project */ var gitPull = function (remote, webRoot) { // git pull remote.with('cd ' + webRoot, function() { ...
Add method to get admin users.
module.exports = function(r) { 'use strict'; return { allByProject: allByProject, adminUsers: adminUsers, }; function allByProject() { return r.table('access').run().then(function(allAccess) { let byProject = {}; allAccess.forEach(function(a) { ...
module.exports = function(r) { 'use strict'; return { allByProject: allByProject }; function allByProject() { return r.table('access').run().then(function(allAccess) { let byProject = {}; allAccess.forEach(function(a) { if (!(a.project_id in byPr...
Make map property of ol.MapEvent exportable
goog.provide('ol.MapEvent'); goog.provide('ol.MapEventType'); goog.require('goog.events.Event'); /** * @enum {string} */ ol.MapEventType = { /** * Triggered after a map frame is rendered. * @event ol.MapEvent#postrender * @todo api */ POSTRENDER: 'postrender', /** * Triggered after the map is ...
goog.provide('ol.MapEvent'); goog.provide('ol.MapEventType'); goog.require('goog.events.Event'); /** * @enum {string} */ ol.MapEventType = { /** * Triggered after a map frame is rendered. * @event ol.MapEvent#postrender * @todo api */ POSTRENDER: 'postrender', /** * Triggered after the map is ...
Update up to changes in event-emitter package
'use strict'; var noop = require('es5-ext/function/noop') , assign = require('es5-ext/object/assign') , memoize = require('memoizee') , ee = require('event-emitter') , eePipe = require('event-emitter/pipe') , deferred = require('deferred') , isPromise = deferred.isPromise; module.exports =...
'use strict'; var noop = require('es5-ext/function/noop') , assign = require('es5-ext/object/assign') , memoize = require('memoizee') , ee = require('event-emitter') , eePipe = require('event-emitter/lib/pipe') , deferred = require('deferred') , isPromise = deferred.isPromise; module.expor...
Add test change for release
#!/usr/bin/env node const inquirer = require('inquirer') const Listr = require('listr') const steps = [{ type: 'input', name: 'userName', message: 'Whats your name?' }] const tasks = [{ title: 'Preparing', task: (context, task) => new Promise((resolve, reject) => { setTimeout(() => resolve(), 1000) }...
#!/usr/bin/env node const inquirer = require('inquirer') const Listr = require('listr') const steps = [{ type: 'input', name: 'userName', message: 'Whats your name?' }] const tasks = [{ title: 'Preparing', task: (context, task) => new Promise((resolve, reject) => { setTimeout(() => resolve(), 1000) }...
Add python 3.9 to trove classifiers
from setuptools import find_packages, setup with open("README.rst") as readme_file: readme = readme_file.read() setup( name="homebrew", version="0.2.1", description="Homebrew wrapper", long_description=readme, author="Iwan in 't Groen", author_email="iwanintgroen@gmail.com", url="https...
from setuptools import find_packages, setup with open("README.rst") as readme_file: readme = readme_file.read() setup( name="homebrew", version="0.2.1", description="Homebrew wrapper", long_description=readme, author="Iwan in 't Groen", author_email="iwanintgroen@gmail.com", url="https...
Add party and state to tooltip
$(document).ready(function() { var $body = $('body'); var className = 'dial-congress'; var senateData; var scan = function() { $.each(senateData, function(i, senator) { var firstLast = senator.firstName + '\\s+' + senator.lastName; var lastFirst = senator.lastName + ',\\s*' + senator.firstName;...
$(document).ready(function() { var $body = $('body'); var className = 'dial-congress'; var senateData; var scan = function() { $.each(senateData, function(i, senator) { var firstLast = senator.firstName + '\\s+' + senator.lastName; var lastFirst = senator.lastName + ',\\s*' + senator.firstName;...
Fix incorrect call to logging module
from __future__ import print_function import time import sys import socket import logging def wait_ssh_ready(host, tries=40, delay=3, port=22): # Wait until the SSH is actually up s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) print('Waiting for SSH at %s to be ready to connect' % host, end='') ...
from __future__ import print_function import time import sys import socket import logging def wait_ssh_ready(host, tries=40, delay=3, port=22): # Wait until the SSH is actually up s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) logging.info('Waiting for SSH at %s to be ready to connect' % host, end...
Add one more test and it fails
defaultConf = { height: 100, width: 300, fingerprintLength: 20 }; describe("The constructor is supposed a proper Captcha object", function() { it('Constructor Captcha exists', function(){ expect(Captcha).toBeDefined(); }); var captcha = new Captcha(); it("Captcha object is not null"...
defaultConf = { height: 100, width: 300, fingerprintLength: 20 }; describe("The constructor is supposed a proper Captcha object", function() { it('Constructor Captcha exists', function(){ expect(Captcha).toBeDefined(); }); var captcha = new Captcha(); it("Captcha object is not null"...
Raise timetout because of race conditions.
/**************************************************************************** * Copyright (C) 2019 ecsec GmbH. * All rights reserved. * Contact: ecsec GmbH (info@ecsec.de) * * This file is part of the Open eCard App. * * GNU General Public License Usage * This file may be used under the terms of the GNU General...
/**************************************************************************** * Copyright (C) 2019 ecsec GmbH. * All rights reserved. * Contact: ecsec GmbH (info@ecsec.de) * * This file is part of the Open eCard App. * * GNU General Public License Usage * This file may be used under the terms of the GNU General...
Fix "No tests were run" After including this packing in our ember app's package.json, was seeing: ``` 1..0 # tests 0 # pass 0 # fail 0 # ok No tests were run, please check whether any errors occurred in the page ``` Config in `ember-cli-build.js`: ``` sassLint: { disableTestGenerator: true } ``...
/* jshint node: true */ 'use strict'; var SassLinter = require('broccoli-sass-lint'); var mergeTrees = require('broccoli-merge-trees'); module.exports = { name: 'ember-cli-sass-lint', included: function(app) { if (!app.isTestingSassLintAddon) { this._super.included(app); } this.app = app; ...
/* jshint node: true */ 'use strict'; var SassLinter = require('broccoli-sass-lint'); var mergeTrees = require('broccoli-merge-trees'); module.exports = { name: 'ember-cli-sass-lint', included: function(app) { if (!app.isTestingSassLintAddon) { this._super.included(app); } this.app = app; ...
Return null from resolveuser since it seems to confuse bluebird
'use strict'; import models from '../../models'; import { GENERIC } from '../../utils/errorTypes.js'; let User = models.User; export default function resolveUser(req, res, next) { let jwtUserId = req.user.id; User.findById(jwtUserId) .then(function (loggedInUser) { if (!loggedInUse...
'use strict'; import models from '../../models'; import { GENERIC } from '../../utils/errorTypes.js'; let User = models.User; export default function resolveUser(req, res, next) { let jwtUserId = req.user.id; User.findById(jwtUserId) .then(function (loggedInUser) { if (!loggedInUse...
Update test to take advantage of new 'server ready' hooks, and stop server when test is done.
require('./common'); var path = require("path"); var file = "numbers"; var default_host_path = path.join(fixturesDir,"default-host"); var fullname = path.join(default_host_path, file); var fileText = require('fs').readFileSync(fullname); var settings = { "port": PORT, "default_host" : { "root": pat...
require('./common'); var path = require("path"); var file = "numbers"; var default_host_path = path.join(fixturesDir,"default-host"); var fullname = path.join(default_host_path, file); var fileText = require('fs').readFileSync(fullname); var settings = { "port": PORT, "default_host" : { "root": pat...
Fix typo in version number
<?php Class extension_markdown_typography extends Extension { /** * @see http://symphony-cms.com/learn/api/2.2/toolkit/extension/#about */ public function about() { return array( 'name' => 'Text Formatter: Markdown Typography', 'version' => '1.1.1', 'release-date' => '2011-12-22', ...
<?php Class extension_markdown_typography extends Extension { /** * @see http://symphony-cms.com/learn/api/2.2/toolkit/extension/#about */ public function about() { return array( 'name' => 'Text Formatter: Markdown Typography', 'version' => '1.1,1', 'release-date' => '2011-12-22', ...
Add module sourceType in options to babylon.
import fs from "fs"; import {parse} from "babylon"; import CodeGenerator from "../CodeGenerator"; import processTokens from "../process-tokens"; function parseText(text) { let ast = parse(text, { preserveParens: true, sourceType: "module", plugins: ["*"] }); let tokens = ast.token...
import fs from "fs"; import {parse} from "babylon"; import CodeGenerator from "../CodeGenerator"; import processTokens from "../process-tokens"; function parseText(text) { let ast = parse(text, { preserveParens: true, plugins: ["*"] }); let tokens = ast.tokens; let semicolons = ast.to...
Remove location lookup console statements
import CanvasClass from './CanvasClass'; import TextOverlay from './TextOverlay'; import mapboxgl from 'mapbox-gl'; /** * Location Lookup class - Binds Google places to text box and binds google places to map */ export default class LocationLookup { constructor(textOverlay, mapBox) { this.textOverla...
import CanvasClass from './CanvasClass'; import TextOverlay from './TextOverlay'; import mapboxgl from 'mapbox-gl'; /** * Location Lookup class - Binds Google places to text box and binds google places to map */ export default class LocationLookup { constructor(textOverlay, mapBox) { this.textOverla...
Remove hack from position angle test
from skyfield.api import Angle, Topos, load, load_file from skyfield.trigonometry import position_angle_of def test_position_angle(): a = Angle(degrees=0), Angle(degrees=0) b = Angle(degrees=1), Angle(degrees=1) assert str(position_angle_of(a, b)) == '315deg 00\' 15.7"' def test_position_angle_against_nas...
from skyfield.api import Angle, Topos, load, load_file from skyfield.trigonometry import position_angle_of def test_position_angle(): a = Angle(degrees=0), Angle(degrees=0) b = Angle(degrees=1), Angle(degrees=1) assert str(position_angle_of(a, b)) == '315deg 00\' 15.7"' def test_position_angle_against_nas...
Remove old express listen line that causes a server error.
module.exports = function(app) { var mongoose = require('mongoose'); // require mongoose (for mongodb integration var fs = require('fs'); // necessary to read from files fs.readFile(".dbconfig", 'utf8', function(err,data){ if (err) { console.log(err); } else { var dbAccess = JSON.pa...
module.exports = function(app) { var mongoose = require('mongoose'); // require mongoose (for mongodb integration var fs = require('fs'); // necessary to read from files fs.readFile(".dbconfig", 'utf8', function(err,data){ if (err) { console.log(err); } else { var dbAccess = JSON.pa...
Add matchMedia to the global scope
require("@babel/register")({ extensions: [".ts", ".js", ".tsx", ".jsx"], }) require("coffeescript/register") require("@babel/polyfill") require("raf/polyfill") require("should") require("./src/lib/jade_hook") // FIXME: Do we need this? // NOTE: Once we do AOT compilation we probably want to re-enable this on the se...
require("@babel/register")({ extensions: [".ts", ".js", ".tsx", ".jsx"], }) require("coffeescript/register") require("@babel/polyfill") require("raf/polyfill") require("should") require("./src/lib/jade_hook") // FIXME: Do we need this? // NOTE: Once we do AOT compilation we probably want to re-enable this on the se...
Modify from ion_auth to sentinel
<?php defined('BASEPATH') OR exit('No direct script access allowed'); use Library\Auth\Auth; class Login extends CI_Controller { public function __construct() { parent::__construct(); } public function index() { $this->form_validation->set_rules('email', 'Email', 'trim|valid_emai...
<?php defined('BASEPATH') OR exit('No direct script access allowed'); use Library\Auth\Auth; class Login extends CI_Controller { public function __construct() { parent::__construct(); } public function index() { $this->form_validation->set_rules('email', 'Email', 'trim|valid_emai...
Use more gunicorn threads when pooling database connector isn't available. When using postgres with meinheld, the best you can do so far (as far as I know) is up the number of threads.
import subprocess import sys import setup_util import os from os.path import expanduser home = expanduser("~") def start(args): setup_util.replace_text("django/hello/hello/settings.py", "HOST': '.*'", "HOST': '" + args.database_host + "'") setup_util.replace_text("django/hello/hello/settings.py", "\/home\/ubuntu"...
import subprocess import sys import setup_util import os from os.path import expanduser home = expanduser("~") def start(args): setup_util.replace_text("django/hello/hello/settings.py", "HOST': '.*'", "HOST': '" + args.database_host + "'") setup_util.replace_text("django/hello/hello/settings.py", "\/home\/ubuntu"...
Fix: Use process.env.NODE to find node executable
const fs = require('fs'); const path = require('path'); const exec = require('child_process').exec; // this is from the env of npm, not node const nodePath = process.env.NODE; const version = process.versions.v8; const tmpfile = path.join(__dirname, version+'.flags.json'); if (!fs.existsSync(tmpfile)) { exec(nodePa...
const fs = require('fs'); const path = require('path'); const exec = require('child_process').exec; const nodepath = process.env._; const version = process.versions.v8; const tmpfile = path.join(__dirname, version+'.flags.json'); if (!fs.existsSync(tmpfile)) { exec(nodepath+' --v8-options', function (execErr, resul...
Use next public path for polyfill loader
import { getOptions, stringifyRequest } from 'loader-utils' module.exports = function (content, sourceMap) { this.cacheable() const options = getOptions(this) const { buildId, modules } = options this.callback(null, ` // Webpack Polyfill Injector function main() {${modules.map(module => `\n require(${st...
import { getOptions, stringifyRequest } from 'loader-utils' module.exports = function (content, sourceMap) { this.cacheable() const options = getOptions(this) const { buildId, modules } = options this.callback(null, ` // Webpack Polyfill Injector function main() {${modules.map(module => `\n require(${st...
Call function to return url
const { renameCompanyList } = require('../repos') const urls = require('../../../lib/urls') // istanbul ignore next: Covered by functional tests async function handleEditCompanyList (req, res, next) { const { token } = req.session const { name, id } = req.body try { await renameCompanyList(token, name, id) ...
const { renameCompanyList } = require('../repos') const urls = require('../../../lib/urls') // istanbul ignore next: Covered by functional tests async function handleEditCompanyList (req, res, next) { const { token } = req.session const { name, id } = req.body try { await renameCompanyList(token, name, id) ...
Save and restore workbench state. git-svn-id: 9146c88ff6d39b48099bf954d15d68f687b3fa69@4697 28e8926c-6b08-0410-baaa-805c5e19b8d6
package org.objectweb.proactive.ic2d; import org.eclipse.ui.IWorkbenchPreferenceConstants; import org.eclipse.ui.PlatformUI; import org.eclipse.ui.application.IWorkbenchConfigurer; import org.eclipse.ui.application.IWorkbenchWindowConfigurer; import org.eclipse.ui.application.WorkbenchAdvisor; import org.eclipse.ui.ap...
package org.objectweb.proactive.ic2d; import org.eclipse.ui.IWorkbenchPreferenceConstants; import org.eclipse.ui.PlatformUI; import org.eclipse.ui.application.IWorkbenchConfigurer; import org.eclipse.ui.application.IWorkbenchWindowConfigurer; import org.eclipse.ui.application.WorkbenchAdvisor; import org.eclipse.ui.ap...
Fix an NPE with Velocity regions
package in.twizmwaz.cardinal.module.modules.appliedRegion.type; import in.twizmwaz.cardinal.module.modules.appliedRegion.AppliedRegion; import in.twizmwaz.cardinal.module.modules.filter.FilterModule; import in.twizmwaz.cardinal.module.modules.filter.FilterState; import in.twizmwaz.cardinal.module.modules.regions.Regio...
package in.twizmwaz.cardinal.module.modules.appliedRegion.type; import in.twizmwaz.cardinal.module.modules.appliedRegion.AppliedRegion; import in.twizmwaz.cardinal.module.modules.filter.FilterModule; import in.twizmwaz.cardinal.module.modules.filter.FilterState; import in.twizmwaz.cardinal.module.modules.regions.Regio...
Make Role migration's name field nullable
<?php use Illuminate\Database\Migrations\Migration; use Illuminate\Database\Schema\Blueprint; class CreateRolesTable extends Migration { /** * Run the migrations. * * @return void */ public function up() { Schema::connection('tenant')->create('roles', function (Blueprint $table...
<?php use Illuminate\Database\Migrations\Migration; use Illuminate\Database\Schema\Blueprint; class CreateRolesTable extends Migration { /** * Run the migrations. * * @return void */ public function up() { Schema::connection('tenant')->create('roles', function (Blueprint $table...
Disable globalShortcut spec on Windows CI
const {globalShortcut} = require('electron').remote const assert = require('assert') const isCI = require('electron').remote.getGlobal('isCi') describe('globalShortcut module', () => { if (isCI && process.platform === 'win32') { return } beforeEach(() => { globalShortcut.unregisterAll() }) it('can...
const {globalShortcut} = require('electron').remote const assert = require('assert') describe('globalShortcut module', () => { beforeEach(() => { globalShortcut.unregisterAll() }) it('can register and unregister accelerators', () => { const accelerator = 'CommandOrControl+A+B+C' assert.equal(global...
Remove explicit type argument since java defines declares it itself
package de.dotwee.rgb.canteen.model.helper; import android.content.Context; import android.widget.ArrayAdapter; import java.util.List; /** * Created by lukas on 19.11.2016. */ public class SpinnerHelper { private static final String TAG = SpinnerHelper.class.getSimpleName(); public static ArrayAdapter<Str...
package de.dotwee.rgb.canteen.model.helper; import android.content.Context; import android.widget.ArrayAdapter; import java.util.List; /** * Created by lukas on 19.11.2016. */ public class SpinnerHelper { private static final String TAG = SpinnerHelper.class.getSimpleName(); public static ArrayAdapter<Str...
Fix wrong table preferrence for role_user
<?php use Illuminate\Database\Migrations\Migration; use Illuminate\Database\Schema\Blueprint; class CreateRoleUserTable extends Migration { /** * Run the migrations. * * @return void */ public function up() { Schema::create('role_user', function (Blueprint $table) { ...
<?php use Illuminate\Database\Migrations\Migration; use Illuminate\Database\Schema\Blueprint; class CreateRoleUserTable extends Migration { /** * Run the migrations. * * @return void */ public function up() { Schema::create('role_user', function (Blueprint $table) { ...
Fix extension for babel/react loaders.
var path = require('path'); var webpack = require('webpack'); module.exports = { entry: [ 'webpack-dev-server/client?http://localhost:3000', 'webpack/hot/only-dev-server', './src/index' ], devtool: 'eval-source-map', output: { path: __dirname, filename: 'bundle.js', publicPath: '/static...
var path = require('path'); var webpack = require('webpack'); module.exports = { entry: [ 'webpack-dev-server/client?http://localhost:3000', 'webpack/hot/only-dev-server', './src/index' ], devtool: 'eval-source-map', output: { path: __dirname, filename: 'bundle.js', publicPath: '/static...
Change Help Scout beacon to show subject field
/* eslint-disable */ export default function initHsBeacon() { !function (e, o, n) { window.HSCW = o, window.HS = n, n.beacon = n.beacon || {}; var t = n.beacon; t.userConfig = {}, t.readyQueue = [], t.config = function (e) { this.userConfig = e; }, t.ready = function (e) { this.readyQueue.push(e); }, o.config = { doc...
/* eslint-disable */ export default function initHsBeacon() { !function (e, o, n) { window.HSCW = o, window.HS = n, n.beacon = n.beacon || {}; var t = n.beacon; t.userConfig = {}, t.readyQueue = [], t.config = function (e) { this.userConfig = e; }, t.ready = function (e) { this.readyQueue.push(e); }, o.config = { doc...
Set up new classifiers. Now production ready.
#!/usr/bin/env python # -*- coding: utf-8 -*- from setuptools import setup, find_packages setup( name = "django-jinja", version = "0.13", description = "Jinja2 templating language integrated in Django.", long_description = "", keywords = "django, jinja2", author = "Andrey Antukh", author_e...
#!/usr/bin/env python # -*- coding: utf-8 -*- from setuptools import setup, find_packages setup( name = 'django-jinja', version = "0.13", description = "Jinja2 templating language integrated in Django.", long_description = "", keywords = 'django, jinja2', author = 'Andrey Antukh', author_e...
[BUGFIX] Fix bug and refactor 2 step remove.
<?php namespace Deployer; use SourceBroker\DeployerExtended\Utility\FileUtility; task('file:rm2steps:1', function () { $removeRecursiveAtomicItems = get('file_remove2steps_items'); $random = get('random'); // Set active_path so the task can be used before or after "symlink" task or standalone. $activ...
<?php namespace Deployer; use SourceBroker\DeployerExtended\Utility\FileUtility; task('file:rm2steps:1', function () { $removeRecursiveAtomicItems = get('file_remove2steps_items'); $random = get('random'); // Set active_path so the task can be used before or after "symlink" task or standalone. $activ...
Put Raleigh-Durham on the map (literally)
$(document).ready(function(){ $(".us_map").mapael({ map : { name : "usa_states", cssClass : "map", tooltip : { cssClass : "mapTooltip" //class name of the tooltip container }, defaultArea : { attrs : { fill : "#282828", stroke: "#9a9a9a", }, attrsHover : { fill : "#d8a...
$(document).ready(function(){ $(".us_map").mapael({ map : { name : "usa_states", cssClass : "map", tooltip : { cssClass : "mapTooltip" //class name of the tooltip container }, defaultArea : { attrs : { fill : "#282828", stroke: "#9a9a9a", }, attrsHover : { fill : "#d8a...
Make sure our body part test actually proves we're using the right encoding
package com.vtence.molecule; import org.junit.Test; import java.io.IOException; import static com.vtence.molecule.helpers.Charsets.UTF_16; import static com.vtence.molecule.helpers.Charsets.UTF_8; import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.Matchers.equalTo; public class BodyPart...
package com.vtence.molecule; import org.junit.Test; import java.io.IOException; import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.Matchers.equalTo; public class BodyPartTest { @Test public void decodesTextContentAccordingToContentTypeCharset() throws IOException { Stri...
Fix endless loop in server
import upload from './upload'; import express from 'express'; import logger from 'winston'; const app = express(); export default app; app.set('port', process.env.PORT || 3000); logger.remove(logger.transports.Console); logger.add(logger.transports.Console, {'timestamp':true,}); app.use((req, res, next) => { res...
import upload from './upload'; import express from 'express'; import logger from 'winston'; const app = express(); export default app; app.set('port', process.env.PORT || 3000); logger.remove(logger.transports.Console); logger.add(logger.transports.Console, {'timestamp':true,}); app.use((req, res, next) => { // e...
Fix typo in method name. This method does not appear to be used within the gxui codebase.
// Copyright 2015 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package gl import ( "fmt" "github.com/go-gl/gl/v3.2-core/gl" ) type DrawMode int const ( POINTS DrawMode = gl.POINTS LINE_STRIP DrawMode = g...
// Copyright 2015 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package gl import ( "fmt" "github.com/go-gl/gl/v3.2-core/gl" ) type DrawMode int const ( POINTS DrawMode = gl.POINTS LINE_STRIP DrawMode = g...
Use date-format function for file-name
import os from datetime import datetime from time import time class Result: def __init__(self, directory): date = datetime.fromtimestamp(time()) self.file = File(directory, date.strftime('%Y-%m-%d_%H-%M-%S')) class File: def __init__(self, directory, name): if not os.path.exists(dire...
import os from datetime import datetime from time import time class Result: def __init__(self, directory): date = datetime.fromtimestamp(time()) name = '%d-%d-%d_%d-%d-%d' % ( date.year, date.month, date.day, date.hour, date.minute, ...
Allow to override include dir of xproto
import os import re keysym_re = re.compile(r"^#define\s+(XF86)?XK_(\w+)\s+(\S+)") class Keysyms(object): __slots__ = ('name_to_code', 'code_to_name', '__dict__') def __init__(self): self.name_to_code = {} self.code_to_name = {} def add_from_file(self, filename): with open(filena...
import re keysym_re = re.compile(r"^#define\s+(XF86)?XK_(\w+)\s+(\S+)") class Keysyms(object): __slots__ = ('name_to_code', 'code_to_name', '__dict__') def __init__(self): self.name_to_code = {} self.code_to_name = {} def add_from_file(self, filename): with open(filename, 'rt') ...
Remove redundant handle call in TrustedProxies middleware
<?php namespace App\Http\Middleware; use Cache; use Closure; use Illuminate\Http\Request; use Fideloper\Proxy\TrustProxies as Middleware; class TrustProxies extends Middleware { /** * The trusted proxies for this application. * * @var array */ protected $proxies = []; /** * The ...
<?php namespace App\Http\Middleware; use Cache; use Closure; use Illuminate\Http\Request; use Fideloper\Proxy\TrustProxies as Middleware; class TrustProxies extends Middleware { /** * The trusted proxies for this application. * * @var array */ protected $proxies = []; /** * The ...
Fix compile error due to class rename.
/* * Copyright 2013 the original author or authors. * * 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 applica...
/* * Copyright 2013 the original author or authors. * * 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 applica...
Append port 80 when a port is not provided
(function() { var __WS_send = WebSocket.prototype.send; window.__WS_send = WebSocket.prototype.send; WebSocket.prototype.send = function(data) { console.log(this.url); try { var ip = /((?:[0-9]{1,3}(?:\.|\-)){1,3}[0-9]{1,3})/.exec(this.url); var port = /\:[0-9]{1,5}/....
(function() { var __WS_send = WebSocket.prototype.send; window.__WS_send = WebSocket.prototype.send; WebSocket.prototype.send = function(data) { console.log(this.url); try { var re = /((?:[0-9]{1,3}(?:\.|\-)){1,3}[0-9]{1,3})(?:.*?)?(\:[0-9]{1,5})/; var match = re.exec...
Increment version number to 0.2.13 Merged Moritz's new process modules.
__version__ = '0.2.13' # This list defines all the modules that will be loaded if a user invokes # from climLab import * # totally out of date! #__all__ = ["constants", "thermo", "orbital_table", # "long_orbital_table", "insolation", "ebm", # "column", "convadj"] #from climlab import radiatio...
__version__ = '0.2.12' # This list defines all the modules that will be loaded if a user invokes # from climLab import * # totally out of date! #__all__ = ["constants", "thermo", "orbital_table", # "long_orbital_table", "insolation", "ebm", # "column", "convadj"] #from climlab import radiatio...
Fix potential NPE in the Capabilities
package com.infinityraider.infinitylib.capability; import net.minecraft.util.Direction; import net.minecraft.util.ResourceLocation; import net.minecraftforge.common.capabilities.Capability; import net.minecraftforge.common.capabilities.ICapabilityProvider; import net.minecraftforge.common.util.LazyOptional; import ja...
package com.infinityraider.infinitylib.capability; import net.minecraft.util.Direction; import net.minecraft.util.ResourceLocation; import net.minecraftforge.common.capabilities.Capability; import net.minecraftforge.common.capabilities.ICapabilityProvider; import net.minecraftforge.common.util.LazyOptional; import ja...
Quit gracefully after detecting a syntax error
<?php declare(strict_types=1); namespace Mihaeu\PhpDependencies\Analyser; use Mihaeu\PhpDependencies\OS\PhpFile; use Mihaeu\PhpDependencies\OS\PhpFileSet; use PhpParser\Error; use PhpParser\Parser as BaseParser; class Parser { /** @var BaseParser */ private $parser; /** * @param $parser */ ...
<?php declare(strict_types=1); namespace Mihaeu\PhpDependencies\Analyser; use Mihaeu\PhpDependencies\OS\PhpFile; use Mihaeu\PhpDependencies\OS\PhpFileSet; use PhpParser\Parser as BaseParser; class Parser { /** @var BaseParser */ private $parser; /** * @param $parser */ public function __c...
GF-5039: Add a call for changed method in create time Enyo-DCO-1.1-Signed-off-by: David Um <david.um@lge.com>
/** _moon.Button_ is an <a href="#enyo.Button">enyo.Button</a> with Moonstone styling applied. The color of the button may be customized by specifying a background color. For more information, see the documentation on <a href='https://github.com/enyojs/enyo/wiki/Buttons'>Buttons</a> in the Enyo Developer Guide. ...
/** _moon.Button_ is an <a href="#enyo.Button">enyo.Button</a> with Moonstone styling applied. The color of the button may be customized by specifying a background color. For more information, see the documentation on <a href='https://github.com/enyojs/enyo/wiki/Buttons'>Buttons</a> in the Enyo Developer Guide. ...
Tweak logging to add space and colon between type and msg
var Logger = function (config) { this.config = config; this.backend = this.config.backend || 'stdout' this.level = this.config.level || "LOG_INFO" if (this.backend == 'stdout') { this.util = require('util'); } else { if (this.backend == 'syslog') { this.util = require('node-syslog'); th...
var Logger = function (config) { this.config = config; this.backend = this.config.backend || 'stdout' this.level = this.config.level || "LOG_INFO" if (this.backend == 'stdout') { this.util = require('util'); } else { if (this.backend == 'syslog') { this.util = require('node-syslog'); th...
Make colored terminal output the default log formatter.
# This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0/. from marionette import BaseMarionetteOptions from greenlight import tests class ReleaseTestParser(BaseMarionetteOptio...
# This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0/. from marionette import BaseMarionetteOptions from greenlight import tests class ReleaseTestParser(BaseMarionetteOptio...
tests/route-addon: Use alternative blueprint test helpers
'use strict'; var blueprintHelpers = require('ember-cli-blueprint-test-helpers/helpers'); var setupTestHooks = blueprintHelpers.setupTestHooks; var emberNew = blueprintHelpers.emberNew; var emberGenerateDestroy = blueprintHelpers.emberGenerateDestroy; var chai = require('ember-cli-blueprint-test-helpers/chai'); var e...
'use strict'; var setupTestHooks = require('ember-cli-blueprint-test-helpers/lib/helpers/setup'); var BlueprintHelpers = require('ember-cli-blueprint-test-helpers/lib/helpers/blueprint-helper'); var generateAndDestroy = BlueprintHelpers.generateAndDestroy; describe('Acceptance: ember generate and destroy route-...
Convert iterated Python objects to JS.
// JSPyIterableObject.java /** * Copyright (C) 2008 10gen Inc. * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License, version 3, * as published by the Free Software Foundation. * * This program is distributed in the ho...
// JSPyIterableObject.java /** * Copyright (C) 2008 10gen Inc. * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License, version 3, * as published by the Free Software Foundation. * * This program is distributed in the ho...
Fix long-standing bug in aws.stringSetToPointers Instead of N pointers, we were returning N null pointers, followed by the real thing. It's not clear why we didn't trip on this until now, maybe there is a new server-side check for empty subnetID strings.
/* Copyright 2014 The Kubernetes Authors All rights reserved. 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 ag...
/* Copyright 2014 The Kubernetes Authors All rights reserved. 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 ag...
Use cartodb_id as FID column in gpkg
var ogr = require('./../ogr'); function GeoPackageFormat() {} GeoPackageFormat.prototype = new ogr('gpkg'); GeoPackageFormat.prototype._contentType = "application/x-sqlite3; charset=utf-8"; GeoPackageFormat.prototype._fileExtension = "gpkg"; // As of GDAL 1.10.1 SRID detection is bogus, so we use // our own method. ...
var ogr = require('./../ogr'); function GeoPackageFormat() {} GeoPackageFormat.prototype = new ogr('gpkg'); GeoPackageFormat.prototype._contentType = "application/x-sqlite3; charset=utf-8"; GeoPackageFormat.prototype._fileExtension = "gpkg"; // As of GDAL 1.10.1 SRID detection is bogus, so we use // our own method. ...
Make route to /game/:id/edit link to EditGame
import React from 'react' import { Router, Route, hashHistory } from 'react-router' import App from './App' import Home from './Home' import Overview from './Overview' import MatchReportContainer from './containers/MatchReportContainer' import NewGameContainer from './containers/NewGameContainer' import EditGameContai...
import React from 'react' import { Router, Route, hashHistory } from 'react-router' import App from './App' import Home from './Home' import Overview from './Overview' import MatchReportContainer from './containers/MatchReportContainer' import NewGameContainer from './containers/NewGameContainer' import ScoreGameConta...
Fix time formatting for queue items
import _ from 'lodash'; export function formatDuration(duration) { var sec_num = parseInt(duration, 10); var hours = Math.floor(sec_num / 3600); var minutes = Math.floor((sec_num - (hours * 3600)) / 60); var seconds = sec_num - (hours * 3600) - (minutes * 60); if (hours < 10) {hours = '0'+hours;} if...
import _ from 'lodash'; export function formatDuration(duration) { var sec_num = parseInt(duration, 10); var hours = Math.floor(sec_num / 3600); var minutes = Math.floor((sec_num - (hours * 3600)) / 60); var seconds = sec_num - (hours * 3600) - (minutes * 60); if (hours < 10) {hours = "0"+hours;} if...
Change example to conform to API
package main import ( "github.com/sean-duffy/xlsx" "strconv" ) func main() { c := []xlsx.Column{ xlsx.Column{Name: "Col1", Width: 10}, xlsx.Column{Name: "Col2", Width: 10}, } sh := xlsx.NewSheetWithColumns(c) sh.Title = "MySheet" for i := 0; i < 10; i++ { r := sh.NewRow() r.Cells[0] = xlsx.Cell{ ...
package main import ( "github.com/sean-duffy/xlsx" "strconv" ) func main() { c := []xlsx.Column{ xlsx.Column{Name: "Col1", Width: 10}, xlsx.Column{Name: "Col2", Width: 10}, } sh := xlsx.NewSheetWithColumns(c, "MySheet") for i := 0; i < 10; i++ { r := sh.NewRow() r.Cells[0] = xlsx.Cell{ Type: xl...
Fix incorrect arg to omit
import fetchResource from './helpers/fetchResource'; import omit from './helpers/omit'; import parseUrl from './helpers/parseUrl'; const DEFAULTS = { method: 'GET' }; export default function createResourceAction( options, sendType, successType, errorType ) { let rawUrl, urlCompiler; if (typeof options === 's...
import fetchResource from './helpers/fetchResource'; import omit from './helpers/omit'; import parseUrl from './helpers/parseUrl'; const DEFAULTS = { method: 'GET' }; export default function createResourceAction( options, sendType, successType, errorType ) { let rawUrl, urlCompiler; if (typeof options === 's...
Allow elements within SVG to overflow
function chart(selection) { // Merging the various user params vars.user_vars = vistk.utils.merge(vars.user_vars, vars._user_vars); // Merging with current charts parameters set by the user in the HTML file vars = vistk.utils.merge(vars, vars.user_vars); // Create the top level element conainin...
function chart(selection) { // Merging the various user params vars.user_vars = vistk.utils.merge(vars.user_vars, vars._user_vars); // Merging with current charts parameters set by the user in the HTML file vars = vistk.utils.merge(vars, vars.user_vars); // Create the top level element conainin...
Include required echo service in package
from setuptools import setup, find_packages VERSION = '3.0.1' setup( name='django-node', version=VERSION, packages=find_packages(exclude=('tests', 'example',)), package_data={ 'django_node': [ 'node_server.js', 'services/echo.js', 'package.json', ], ...
from setuptools import setup, find_packages VERSION = '3.0.1' setup( name='django-node', version=VERSION, packages=find_packages(exclude=('tests', 'example',)), package_data={ 'django_node': [ 'node_server.js', 'package.json', ], }, install_requires=[ ...
Hide 'other' activity on ui.
'use strict'; (function(isNode, isAngular) { var activities = [ {name: 'bike', textOver: 'Велосипед'}, {name: 'running', textOver: 'Бег'}, {name: 'workout', textOver: 'Workout'}, {name: 'hiking', textOver: 'Туризм'}, {name: 'photo', textOver: 'Фото'}, {name: 'en', textOver: 'Языки'}, {na...
'use strict'; (function(isNode, isAngular) { var activities = [ {name: 'bike', textOver: 'Велосипед'}, {name: 'running', textOver: 'Бег'}, {name: 'workout', textOver: 'Workout'}, {name: 'hiking', textOver: 'Туризм'}, {name: 'photo', textOver: 'Фото'}, {name: 'en', textOver: 'Языки'}, {na...
Remove button and cover fields from default config
<?php return [ // Class you want to use to represent sections 'sectionClass' => \StartupPalace\Maki\Section::class, // Class you want to use to represent field values 'fieldValueClass' => \StartupPalace\Maki\FieldValue::class, // Path to Maki's templates (from `resources/views`) 'templatePath' ...
<?php return [ // Class you want to use to represent sections 'sectionClass' => \StartupPalace\Maki\Section::class, // Class you want to use to represent field values 'fieldValueClass' => \StartupPalace\Maki\FieldValue::class, // Path to Maki's templates (from `resources/views`) 'templatePath' ...
Add validation details to the Admin interface
from django.contrib import admin from reddit.models import RedditAccount from reddit.forms import RedditAccountForm from datetime import date class RedditAccountAdmin(admin.ModelAdmin): list_display = ('username', 'user', 'date_created', 'link_karma', 'comment_karma', 'last_update', 'validated', 'is_valid') s...
from django.contrib import admin from reddit.models import RedditAccount from reddit.forms import RedditAccountForm from datetime import date class RedditAccountAdmin(admin.ModelAdmin): list_display = ('username', 'user', 'date_created', 'link_karma', 'comment_karma', 'last_update', 'is_valid') search_fields ...
Make parent server more robust
#!/usr/bin/env python import os import select import json import serf def server(): """A server for serf commands. Commands are a string object that are passed to serf. """ os.mkfifo('/serfnode/parent') pipe = os.fdopen( os.open('/serfnode/parent', os.O_RDONLY | os.O_NONBLOCK), 'r', 0)...
#!/usr/bin/env python import os import select import serf def server(): """A server for serf commands. Commands are a string object that are passed to serf. """ os.mkfifo('/serfnode/parent') pipe = os.fdopen( os.open('/serfnode/parent', os.O_RDONLY | os.O_NONBLOCK), 'r', 0) # open ...
Initialize post list when showing post list page
$(document).on('pageshow', '#post-list', function() { initPostList(); }); function initPostList() { var api_uri = 'http://amateras.wsd.kutc.kansai-u.ac.jp/~otsuka/michishiki_api_server/select.py?order_by=created_at&order=descend'; $.getJSON(api_uri, function(json) { for (var i = 0; i < json.length; i++) {...
$(function() { var api_uri = 'http://amateras.wsd.kutc.kansai-u.ac.jp/~otsuka/michishiki_api_server/select.py?order_by=created_at&order=descend'; $.getJSON(api_uri, function(json) { for (var i = 0; i < json.length; i++) { var $li = createListItem(json[i].title, json[i].comment, json[i].posted_by); $(...
Handle Google Analytics code initializing in a module
(function loadGapi() { var head = document.getElementsByTagName('head')[0]; var script = document.createElement('script'); script.type = 'text/javascript'; script.src = "https://apis.google.com/js/client.js?onload=initgapi"; head.appendChild(script); })(); window._gaq = window._gaq || []; var _gaq = window....
(function loadGapi() { var head = document.getElementsByTagName('head')[0]; var script = document.createElement('script'); script.type = 'text/javascript'; script.src = "https://apis.google.com/js/client.js?onload=initgapi"; head.appendChild(script); })(); var _gaq = _gaq || []; _gaq.push(['_setAccount', 'U...
Fix up some styling on user show page.
@extends('layout.master') @section('main_content') <h3> {{ $user['first_name'] }}</h3> <a href="{{ url('users/' . $user['_id'] . '/edit') }}"> Edit User <span class="glyphicon glyphicon-pencil"></span></a> @if ($aurora_user) Admin: {{ $aurora_user->hasRole('admin') ? '✓' : 'x' }} @if (!$aurora_user->hasRole('admi...
@extends('layout.master') @section('main_content') <a href="{{ url('users/' . $user['_id'] . '/edit') }}"> Edit User <span class="glyphicon glyphicon-pencil"></span></a> @if ($aurora_user) Admin: {{ $aurora_user->hasRole('admin') ? '✓' : 'x' }} @if (!$aurora_user->hasRole('admin')) {{ Form::open(['route' => ...
Use debug log for logging.
const crypto = require('crypto'); /** * memHandler - In memory upload handler * @param {object} options * @param {string} fieldname * @param {string} filename */ module.exports = function(options, fieldname, filename) { let buffers = []; let fileSize = 0; // eslint-disable-line let hash = crypto.createHash(...
const crypto = require('crypto'); /** * memHandler - In memory upload handler * @param {object} options * @param {string} fieldname * @param {string} filename */ module.exports = function(options, fieldname, filename) { let buffers = []; let fileSize = 0; // eslint-disable-line let hash = crypto.createHash(...
Increase max length of petition answer text
import settings from 'settings'; export default [ { element: 'input', name: 'petitionId', hidden: true, html: { type: 'hidden' } }, { element: 'input', name: 'token', hidden: true, html: { type: 'hidden' } }, { element: 'textarea', name: 'answer.tex...
import settings from 'settings'; export default [ { element: 'input', name: 'petitionId', hidden: true, html: { type: 'hidden' } }, { element: 'input', name: 'token', hidden: true, html: { type: 'hidden' } }, { element: 'textarea', name: 'answer.tex...
Rename Connection transmit function to process for use in IPFGraph
# -*- coding: utf-8 -*- import ioport class Connection(object): """ Connection class for IPFBlock Connection binding OPort and IPort of some IPFBlocks """ def __init__(self, oport, iport): # Check port compatibility and free of input port if ioport.compatible(oport, iport) ...
# -*- coding: utf-8 -*- import ioport class Connection(object): """ Connection class for IPFBlock Connection binding OPort and IPort of some IPFBlocks """ def __init__(self, oport, iport): # Check port compatibility and free of input port if ioport.compatible(oport, iport) ...