text
stringlengths
16
4.96k
positive
stringlengths
321
2.24k
negative
stringlengths
310
2.21k
Load dist css file in example
// The Vue build version to load with the `import` command // (runtime-only or standalone) has been set in webpack.base.conf with an alias. import Vue from 'vue' import Router from 'vue-router' import App from './App' import Home from './Home' import Eagle from 'eagle.js' import 'eagle.js/dist/eagle.css' import slide...
// The Vue build version to load with the `import` command // (runtime-only or standalone) has been set in webpack.base.conf with an alias. import Vue from 'vue' import Router from 'vue-router' import App from './App' import Home from './Home' import Eagle from 'eagle.js' import slideshows from './slideshows/slidesho...
Add godoc string and debug flag parsing
// This is gotify, a lightweight Spotify player written in Go package main import ( "flag" "fmt" "github.com/adrien-f/gotify/config" sp "github.com/op/go-libspotify" ) func Ascii() { fmt.Println(" _ _ __") fmt.Println(" __ _ ___ | |_(_)/ _|_ _") fmt.Println(" / _` |/ _ \\| __| | |_| | | |") ...
package main import ( "fmt" "github.com/adrien-f/gotify/config" sp "github.com/op/go-libspotify" ) func Ascii() { fmt.Println(" _ _ __") fmt.Println(" __ _ ___ | |_(_)/ _|_ _") fmt.Println(" / _` |/ _ \\| __| | |_| | | |") fmt.Println("| (_| | (_) | |_| | _| |_| |") fmt.Println(" \\__, |\\...
FIX: Remove access key fields that are not required
<?php class AccessKeysSiteConfig extends DataObjectDecorator { function extraStatics() { return array( 'db' => array( 'SkipToMainContentAccessKey' => 'VarChar(1)' ) ); } public function updateCMSFields(FieldSet &$fields) { $tf...
<?php class AccessKeysSiteConfig extends DataObjectDecorator { function extraStatics() { return array( 'db' => array( 'SearchAccessKey' => 'VarChar(1)', 'SkipToMainContentAccessKey' => 'VarChar(1)', 'AccessibilityHelpAccessKey' => 'VarChar...
Disable OAuth header parsing for now.
<?php namespace Northstar\Http; use Illuminate\Foundation\Http\Kernel as HttpKernel; class Kernel extends HttpKernel { /** * The application's global HTTP middleware stack. * * @var array */ protected $middleware = [ \Illuminate\Foundation\Http\Middleware\CheckForMaintenanceMode::...
<?php namespace Northstar\Http; use Illuminate\Foundation\Http\Kernel as HttpKernel; class Kernel extends HttpKernel { /** * The application's global HTTP middleware stack. * * @var array */ protected $middleware = [ \Illuminate\Foundation\Http\Middleware\CheckForMaintenanceMode::...
III-2779: Fix exception about enums that can't be serialized, ensure native sapiVersion is serialized instead
<?php namespace CultuurNet\UDB3\SavedSearches\Command; use CultuurNet\UDB3\ValueObject\SapiVersion; use ValueObjects\StringLiteral\StringLiteral; abstract class SavedSearchCommand { /** * @var string */ protected $sapiVersion; /** * @var StringLiteral */ protected $userId; /...
<?php namespace CultuurNet\UDB3\SavedSearches\Command; use CultuurNet\UDB3\ValueObject\SapiVersion; use ValueObjects\StringLiteral\StringLiteral; abstract class SavedSearchCommand { /** * @var SapiVersion */ protected $sapiVersion; /** * @var StringLiteral */ protected $userId; ...
Install argparse when installing on Python 2.6
#/usr/bin/env python import os from setuptools import setup, find_packages from salad import VERSION ROOT_DIR = os.path.dirname(__file__) SOURCE_DIR = os.path.join(ROOT_DIR) requirements = ["argparse", "nose", "splinter", "zope.testbrowser", "lettuce>=0.2.10.1"] try: import argparse except ImportError: requirements.a...
#/usr/bin/env python import os from setuptools import setup, find_packages from salad import VERSION ROOT_DIR = os.path.dirname(__file__) SOURCE_DIR = os.path.join(ROOT_DIR) setup( name="salad", description="A nice mix of great BDD ingredients", author="Steven Skoczen", author_email="steven.skoczen@wk...
Change unit object format (server side)
var units = { datacenter: { unitStats: { name: 'SysAdmin', attack: 0, security: 25, power: 500, price: 2000 } }, personal_computer: { unitStats: { name: 'Zombie computer', attack: 10, secu...
var units = { datacenter: { unitName: 'adminsys', unitStats: { attack: 10, security: 50, power: 5 } }, personal_computer: { unitName: 'zombie_computer', unitStats: { attack: 50, security: 0, power...
Use named functions for better readability
angular .module('ngSharepoint') .provider('$sp', $spProvider); function $spProvider() { var siteUrl = ''; var connMode = 'JSOM'; var token = false; var autoload = true; var provider = { setSiteUrl: setSiteUrl, setConnectionMode: setConnectionMode, setAccessToken: setAccessToken, setAutoload: setAutoloa...
angular .module('ngSharepoint') .provider('$sp', function() { var siteUrl = ''; var connMode = 'JSOM'; //possible values: JSOM, REST var token = false; var autoload = true; return { setSiteUrl: function (newUrl) { siteUrl = newUrl; }, setConnectionMode: function(newConnMode) { //Only JSOM Supp...
ROO-1875: Improve file system management messages by using "Updated" instead of "Managed" verb
package org.springframework.roo.process.manager.internal; import java.io.File; import java.util.logging.Logger; import org.springframework.roo.file.undo.FilenameResolver; import org.springframework.roo.support.logging.HandlerUtils; import org.springframework.roo.support.util.Assert; public class ManagedMessageRender...
package org.springframework.roo.process.manager.internal; import java.io.File; import java.util.logging.Logger; import org.springframework.roo.file.undo.FilenameResolver; import org.springframework.roo.support.logging.HandlerUtils; import org.springframework.roo.support.util.Assert; public class ManagedMessageRender...
Change button link to point to Donorbox page
import React from 'react'; // import PropTypes from 'prop-types'; import Section from 'shared/components/section/section'; import LinkButton from 'shared/components/linkButton/linkButton'; import styles from './donate.css'; const Donate = (props) => { const { ...otherProps } = props; return ( <Section ti...
import React from 'react'; // import PropTypes from 'prop-types'; import Section from 'shared/components/section/section'; import LinkButton from 'shared/components/linkButton/linkButton'; import styles from './donate.css'; const Donate = (props) => { const { ...otherProps } = props; return ( <Section ti...
event-protocol: Make binary command executable and add hashbang I might have missed something, but I couldn't work out to run it (from another directory) anymore since it moved into the bin directory in 3dbafa2e4a327a4251038a97063b7de5e0da3f88
#!/usr/bin/env node const readline = require('readline') const validateEvent = require('../lib/validateEvent') const RED = '\033[0;31m' const NC = '\033[0m' const lines = readline.createInterface({ input: process.stdin }) let error = false lines.on('line', line => { if(error) return let event try { event = ...
const readline = require('readline') const validateEvent = require('../lib/validateEvent') const RED = '\033[0;31m' const NC = '\033[0m' const lines = readline.createInterface({ input: process.stdin }) let error = false lines.on('line', line => { if(error) return let event try { event = JSON.parse(line) ...
Change Entity Revision name separator from . to __
"use strict"; const Table = require('./table'); class Revision extends Table { constructor(engine, relationship, name='revision', alias=null) { super(engine, relationship.name + '__' + name, alias); this.id = name; this.relationship = relationship; return this; } schema() { let schema = sup...
"use strict"; const Table = require('./table'); class Revision extends Table { constructor(engine, relationship, name='revision', alias=null) { super(engine, relationship.name + '.' + name, alias); this.id = name; this.relationship = relationship; return this; } schema() { let schema = supe...
Correct a client test description even-numbered -> odd-numbered
package client import ( "github.com/summerwind/h2spec/config" "github.com/summerwind/h2spec/spec" "golang.org/x/net/http2" ) func StreamIdentifiers() *spec.ClientTestGroup { tg := NewTestGroup("5.1.1", "Stream Identifiers") // An endpoint that receives an unexpected stream identifier // MUST respond with a con...
package client import ( "github.com/summerwind/h2spec/config" "github.com/summerwind/h2spec/spec" "golang.org/x/net/http2" ) func StreamIdentifiers() *spec.ClientTestGroup { tg := NewTestGroup("5.1.1", "Stream Identifiers") // An endpoint that receives an unexpected stream identifier // MUST respond with a con...
Check expected type after JSON decode instead of checking what is not expected. This will also allow "true" and "false" as filenames instead of only "null".
<?php /** * ownCloud - ajax frontend * * @author Robin Appelman * @copyright 2010 Robin Appelman icewind1991@gmail.com * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE * License as published by the Free Software Foundation; either * ...
<?php /** * ownCloud - ajax frontend * * @author Robin Appelman * @copyright 2010 Robin Appelman icewind1991@gmail.com * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE * License as published by the Free Software Foundation; either * ...
Introduce ember-infinity as a service
export function initialize(application) { const inject = (property, what) => { application.inject('controller', property, what); application.inject('component', property, what); application.inject('route', property, what); }; inject('config', 'service:config'); inject('session', 'service:session')...
export function initialize(application) { const inject = (property, what) => { application.inject('controller', property, what); application.inject('component', property, what); application.inject('route', property, what); }; inject('config', 'service:config'); inject('session', 'service:session')...
Switch experiment to performing 1000 parallel requests
const io = require('socket.io'), winston = require('winston'); winston.remove(winston.transports.Console); winston.add(winston.transports.Console, {'timestamp': true}); const PORT = 3031; winston.info('Rupture real-time service starting'); winston.info('Listening on port ' + PORT); var socket = io.listen(PORT...
const io = require('socket.io'), winston = require('winston'); winston.remove(winston.transports.Console); winston.add(winston.transports.Console, {'timestamp': true}); const PORT = 3031; winston.info('Rupture real-time service starting'); winston.info('Listening on port ' + PORT); var socket = io.listen(PORT...
Handle error testcases in mock-server tests.
""" Tests for the mock-server itself. """ from utils import APIPath def test_testcase_difference(root_path): """Ensure that different testcases output different data.""" recipes = set() testcase_paths = ( APIPath(path, 'http://example.com') for path in root_path.path.iterdir() if path.is_...
""" Tests for the mock-server itself. """ from utils import APIPath def test_testcase_difference(root_path): """Ensure that different testcases output different data.""" recipes = set() testcase_paths = ( APIPath(path, 'http://example.com') for path in root_path.path.iterdir() if path.is_...
Add wrapper for async receive event handler
import asyncio import inspect import sys from rollbar.contrib.asgi import ASGIApp def run(coro): if sys.version_info >= (3, 7): return asyncio.run(coro) assert inspect.iscoroutine(coro) loop = asyncio.new_event_loop() asyncio.set_event_loop(loop) try: return loop.run_until_compl...
import asyncio import inspect import sys from rollbar.contrib.asgi import ASGIApp def run(coro): if sys.version_info >= (3, 7): return asyncio.run(coro) assert inspect.iscoroutine(coro) loop = asyncio.new_event_loop() asyncio.set_event_loop(loop) try: return loop.run_until_compl...
Simplify data object for authentication
package hummingbird import ( "encoding/json" "github.com/parnurzeal/gorequest" ) type API struct { endpoint string token string request *gorequest.SuperAgent } func (api *API) UserAuthenticate(username, email, password string) (errs []error, body string) { data := map[string]string{ "username": username...
package hummingbird import ( "encoding/json" "github.com/parnurzeal/gorequest" ) type API struct { endpoint string token string request *gorequest.SuperAgent } func (api *API) UserAuthenticate(username, email, password string) (errs []error, body string) { type UserAuthenticateData struct { Username st...
Fix Celery configuration for AppConfig in INSTALLED_APPS
# http://celery.readthedocs.org/en/latest/django/first-steps-with-django.html from __future__ import absolute_import import os from celery import Celery # Attempt to determine the project name from the directory containing this file PROJECT_NAME = os.path.basename(os.path.dirname(__file__)) # Set the default Django s...
# http://celery.readthedocs.org/en/latest/django/first-steps-with-django.html from __future__ import absolute_import import os from celery import Celery # Attempt to determine the project name from the directory containing this file PROJECT_NAME = os.path.basename(os.path.dirname(__file__)) # Set the default Django s...
feat: Add pagination options to listReferencedFiles
import { cozyFetchJSON } from './fetch' import { encodeQuery } from './utils' import { DOCTYPE_FILES } from './doctypes' function updateRelations (verb) { return function (cozy, doc, ids) { if (!doc) throw new Error('missing doc argument') if (!Array.isArray(ids)) ids = [ids] const refs = ids.map((id) =...
import {cozyFetchJSON} from './fetch' import { DOCTYPE_FILES } from './doctypes' function updateRelations (verb) { return function (cozy, doc, ids) { if (!doc) throw new Error('missing doc argument') if (!Array.isArray(ids)) ids = [ids] const refs = ids.map((id) => ({type: DOCTYPE_FILES, id})) retu...
Use FAIL rate-limit handler for tests Should avoid possible Thread.sleep() for tests execution.
package org.kohsuke.github; import org.junit.Assert; import org.junit.Before; import org.kohsuke.randname.RandomNameGenerator; import java.io.File; /** * @author Kohsuke Kawaguchi */ public abstract class AbstractGitHubApiTestBase extends Assert { protected GitHub gitHub; @Before public void setUp() ...
package org.kohsuke.github; import org.junit.Assert; import org.junit.Before; import org.kohsuke.randname.RandomNameGenerator; import java.io.File; /** * @author Kohsuke Kawaguchi */ public abstract class AbstractGitHubApiTestBase extends Assert { protected GitHub gitHub; @Before public void setUp() ...
Add the redacter display name to the redaction text
/* Copyright 2015, 2016 OpenMarket Ltd Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, sof...
/* Copyright 2015, 2016 OpenMarket Ltd Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, sof...
Implement /refresh endpoint for indetity provider
// Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. package com.yahoo.vespa.hosted.athenz.instanceproviderservice.instanceconfirmation; import com.google.inject.Inject; import com.yahoo.container.jaxrs.annotation.Component; import com.yahoo.log.LogLeve...
// Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. package com.yahoo.vespa.hosted.athenz.instanceproviderservice.instanceconfirmation; import com.google.inject.Inject; import com.yahoo.container.jaxrs.annotation.Component; import com.yahoo.log.LogLeve...
routes/flights/base: Reset "page" to 1 after leaving the route
import Ember from 'ember'; export default Ember.Route.extend({ ajax: Ember.inject.service(), queryParams: { page: { refreshModel: true }, column: { refreshModel: true }, order: { refreshModel: true }, }, model(params) { return this.get('ajax').request(this.getURL(params), { data: { ...
import Ember from 'ember'; export default Ember.Route.extend({ ajax: Ember.inject.service(), queryParams: { page: { refreshModel: true }, column: { refreshModel: true }, order: { refreshModel: true }, }, model(params) { return this.get('ajax').request(this.getURL(params), { data: { ...
Remove explicit requirement of JsonApiService JsonApiService is implicitly import before it is a service
/** * Module dependencies */ var util = require( 'util' ), actionUtil = require( './_util/actionUtil' ), pluralize = require('pluralize'); /** * Create Record * * post /:modelIdentity * * An API call to create and return a single model instance from the data adapter * using the specified criteria. * */ m...
/** * Module dependencies */ var util = require( 'util' ), actionUtil = require( './_util/actionUtil' ), pluralize = require('pluralize'); var JsonApiService = require('../services/JsonApiService'); /** * Create Record * * post /:modelIdentity * * An API call to create and return a single model instance fr...
Update error text to be more descriptive
package org.javarosa.xpath.expr; import org.javarosa.core.model.condition.EvaluationContext; import org.javarosa.core.model.instance.DataInstance; import org.javarosa.xpath.XPathNodeset; import org.javarosa.xpath.XPathTypeMismatchException; import org.javarosa.xpath.parser.XPathSyntaxException; public class XPathCoun...
package org.javarosa.xpath.expr; import org.javarosa.core.model.condition.EvaluationContext; import org.javarosa.core.model.instance.DataInstance; import org.javarosa.xpath.XPathNodeset; import org.javarosa.xpath.XPathTypeMismatchException; import org.javarosa.xpath.parser.XPathSyntaxException; public class XPathCoun...
TEST added core-js to loading libraries for test suite
module.exports = function(config) { config.set({ basePath: '', frameworks: ['jasmine'], files: [ 'node_modules/core-js/client/core.js', { pattern: 'test/**/*.js', watched: false } ], exclude: [], preprocessors: { 'test/**/*.js': ['webpack'] }, webpack: { module:...
module.exports = function(config) { config.set({ basePath: '', frameworks: ['jasmine'], files: [ { pattern: 'test/**/*.js', watched: false } ], exclude: [], preprocessors: { 'test/**/*.js': ['webpack'] }, webpack: { module: { loaders: [ { test: /\.js...
Use List instead of ArrayList as type
/* * This file is part of Bisq. * * Bisq is free software: you can redistribute it and/or modify it * under the terms of the GNU Affero General Public License as published by * the Free Software Foundation, either version 3 of the License, or (at * your option) any later version. * * Bisq is distributed in the ...
/* * This file is part of Bisq. * * Bisq is free software: you can redistribute it and/or modify it * under the terms of the GNU Affero General Public License as published by * the Free Software Foundation, either version 3 of the License, or (at * your option) any later version. * * Bisq is distributed in the ...
Include the position into the graph
from networkx import Graph def translate_df_to_graph(buses_df, lines_df, transformers_df=None): graph = Graph() buses = [] for bus_name, bus in buses_df.iterrows(): pos = (bus.x, bus.y) buses.append((bus_name, {'pos': pos})) # add nodes graph.add_nodes_from(buses) # add br...
from networkx import OrderedGraph def translate_df_to_graph(buses_df, lines_df, transformers_df=None): graph = OrderedGraph() buses = buses_df.index # add nodes graph.add_nodes_from(buses) # add branches branches = [] for line_name, line in lines_df.iterrows(): branches.append( ...
Use a dictionary for metrid ids. There are few unique ones (less than 1k), but many instances.
// Copyright 2020 Oath Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. package ai.vespa.metricsproxy.metric.model; import com.yahoo.yolean.concurrent.CopyOnWriteHashMap; import java.util.Map; import java.util.Objects; /** * @author gjoranv */ public class MetricId { p...
// Copyright 2020 Oath Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. package ai.vespa.metricsproxy.metric.model; import java.util.Objects; /** * @author gjoranv */ public class MetricId { public static final MetricId empty = toMetricId(""); public final String id...
Use periods on senteces in docs
var ContactView = require('../view/Contact'); /** * Creates a new Contact. * @constructor * @arg {Object} options - Object hash used to populate instance. * @arg {string} options.firstName - First name of the contact. * @arg {string} options.firstName - Last name of the contact. * @arg {string} options.tel - Tel...
var ContactView = require('../view/Contact'); /** * Creates a new Contact * @constructor * @arg {Object} options - Object hash used to populate instance * @arg {string} options.firstName - First name of the contact * @arg {string} options.firstName - Last name of the contact * @arg {string} options.tel - name o...
Fix incorrect namespace for test class
<?php namespace Moxio\CodeSniffer\MoxioSniffs\Sniffs\Tests\PHP; use Moxio\CodeSniffer\MoxioSniffs\Sniffs\PHP\DisallowUniqidWithoutMoreEntropySniff; use Moxio\CodeSniffer\MoxioSniffs\Sniffs\Tests\AbstractSniffTest; class DisallowUniqidWithoutMoreEntropySniffTest extends AbstractSniffTest { protected function getSn...
<?php namespace Moxio\Sniffs\Tests\PHP; use Moxio\CodeSniffer\MoxioSniffs\Sniffs\PHP\DisallowUniqidWithoutMoreEntropySniff; use Moxio\CodeSniffer\MoxioSniffs\Sniffs\Tests\AbstractSniffTest; class DisallowUniqidWithoutMoreEntropySniffTest extends AbstractSniffTest { protected function getSniffClass() { ...
Change client constants sandbox URL to https
<?php /** * CheckoutApi_Client_Constant * A final class that manage constant value for all CheckoutApi_Client_Client instance * @package CheckoutApi_Client * @category Api * @author Dhiraj Gangoosirdar <dhiraj.gangoosirdar@checkout.com> * @copyright 2014 Integration team (http://www.checkout.com) *...
<?php /** * CheckoutApi_Client_Constant * A final class that manage constant value for all CheckoutApi_Client_Client instance * @package CheckoutApi_Client * @category Api * @author Dhiraj Gangoosirdar <dhiraj.gangoosirdar@checkout.com> * @copyright 2014 Integration team (http://www.checkout.com) *...
Add `request` and `response` to context. Add `request` and `response` to context in the service. Closes #106.
var find = require('reactor/find'), serializer = require('./serializer'), url = require('url'); function say () { var all = [].slice.call(arguments), filtered = all.filter(function (argument) { return argument !== say }); console.log.apply(console, filtered); if (filtered.length != all.length) proc...
var find = require('reactor/find'), serializer = require('./serializer'), url = require('url'); function say () { var all = [].slice.call(arguments), filtered = all.filter(function (argument) { return argument !== say }); console.log.apply(console, filtered); if (filtered.length != all.length) proc...
Add git command to appAction category
'use strict'; var path = require('path'); var taskOpts = require('./lib/tasks.js'); module.exports = function(kbox) { var events = kbox.core.events; var engine = kbox.engine; kbox.ifApp(function(app) { // Grab the clients var Git = require('./lib/git.js'); var git = new Git(kbox, app); // Ev...
'use strict'; var path = require('path'); var taskOpts = require('./lib/tasks.js'); module.exports = function(kbox) { var events = kbox.core.events; var engine = kbox.engine; kbox.ifApp(function(app) { // Grab the clients var Git = require('./lib/git.js'); var git = new Git(kbox, app); // Ev...
Update class integration test to use new syntax and output assertion
from unittest.mock import patch import io from thinglang import run def test_class_integration(): with patch('sys.stdin', io.StringIO('yotam\n19\n5')): assert run(""" thing Person has text name has number age setup with name self.name = name does say_hello with repeat_count ...
from thinglang import run def test_class_integration(): assert run(""" thing Person has text name has number age created with name self.name = name self.age = 0 does grow_up self.age = self.age + 1 does say_hello with excitement_level Output.write("Hello from...
Modify subscription handler interface name
#!/usr/bin/env python2.5 ## ## @file contextOrientationTCs.py ## ## Copyright (C) 2008 Nokia. All rights reserved. ## ## ## ## ## Requires python2.5-gobject and python2.5-dbus ## ## Implements also some testing API: ## ## contextSrcPath="." sessionConfigPath="tests/python-test-library/stubs" ctxBusName = "org.freed...
#!/usr/bin/env python2.5 ## ## @file contextOrientationTCs.py ## ## Copyright (C) 2008 Nokia. All rights reserved. ## ## ## ## ## Requires python2.5-gobject and python2.5-dbus ## ## Implements also some testing API: ## ## contextSrcPath="." sessionConfigPath="tests/python-test-library/stubs" ctxBusName = "org.freed...
Add fail option to testing harness
package net.teamio.blockunit; /** * Created by oliver on 2017-07-03. */ public class TestingHarness { public void assertEquals(int a, int b) { if (a != b) { throw new TestAssertionException("AssertEquals: %d is not equal to %d", a, b); } } public void assertEquals(boolean a, boolean b) { if (a != b) { ...
package net.teamio.blockunit; /** * Created by oliver on 2017-07-03. */ public class TestingHarness { public void assertEquals(int a, int b) { if (a != b) { throw new TestAssertionException("AssertEquals: %d is not equal to %d", a, b); } } public void assertEquals(boolean a, boolean b) { if (a != b) { ...
Check for the existance of the settings file and report if its not there
""" MCServer Tools config loader """ import json import os.path from mcserver import MCServerError class CoreConfig(object): """ MCServer Tools configuration """ SETTINGS_FILE = 'mcserver.settings' def __init__(self, path): """ Load configuration from the given file path """ self.settings_file = os.p...
""" MCServer Tools config loader """ import json import os.path class CoreConfig(object): """ MCServer Tools configuration """ SETTINGS_FILE = 'mcserver.settings' def __init__(self, path): """ Load configuration from the given file path """ self.settings_file = os.path.join(path, self.SETTINGS_FILE) ...
Add linux in build options
module.exports = function (grunt) { grunt.initConfig({ nodewebkit: { options: { platforms: ['win', 'osx', 'linux'], buildDir: './build', version: '0.12.1' }, src: [ 'index.html', 'package.jso...
module.exports = function (grunt) { grunt.initConfig({ nodewebkit: { options: { platforms: ['win', 'osx'], buildDir: './build', version: '0.12.1' }, src: [ 'index.html', 'package.json', ...
Add comment for users delete route
import koaRouter from 'koa-router' import {create, remove} from './collection' const router = koaRouter() router.post('/', function* () { let login = this.request.body.login , password = this.request.body.password try { yield create(login, password) this.status = 201 this.type = 'json' this.b...
import koaRouter from 'koa-router' import {create, remove} from './collection' const router = koaRouter() router.post('/', function* () { let login = this.request.body.login , password = this.request.body.password try { yield create(login, password) this.status = 201 this.type = 'json' this.b...
Add in largest scale with high pb cutoff
import sys ''' Cleans an MS with a single channel given a mask and a model ''' vis = sys.argv[4] model = sys.argv[5] mask = sys.argv[6] out_root = vis[:-3] clean(vis=vis, imagename=out_root+'.clean', field='M33*', restfreq='1420.40575177MHz', mode='channel', width=1, nchan=1, start=1, cell='1.5ar...
import sys ''' Cleans an MS with a single channel given a mask and a model ''' vis = sys.argv[4] model = sys.argv[5] mask = sys.argv[6] out_root = vis[:-3] clean(vis=vis, imagename=out_root+'.clean', field='M33*', restfreq='1420.40575177MHz', mode='channel', width=1, nchan=1, start=1, cell='1.5ar...
Change array to object for data
/** * BaseCache it's a simple static cache * * @namespace Barba.BaseCache * @type {Object} */ var BaseCache = { /** * The array that keeps everything. * * @memberOf Barba.BaseCache * @type {Array} */ data: {}, /** * Helper to extend the object * * @memberOf Barba.BaseCache * @priv...
/** * BaseCache it's a simple static cache * * @namespace Barba.BaseCache * @type {Object} */ var BaseCache = { /** * The array that keeps everything. * * @memberOf Barba.BaseCache * @type {Array} */ data: [], /** * Helper to extend the object * * @memberOf Barba.BaseCache * @priv...
Add gevent 1.0 as a dependency
from setuptools import setup, find_packages import sys, os version = '0.1' setup(name='ouimeaux', version=version, description="Python API to Belkin WeMo devices", long_description="""\ """, classifiers=[], # Get strings from http://pypi.python.org/pypi?%3Aaction=list_classifiers keyword...
from setuptools import setup, find_packages import sys, os version = '0.1' setup(name='ouimeaux', version=version, description="Python API to Belkin WeMo devices", long_description="""\ """, classifiers=[], # Get strings from http://pypi.python.org/pypi?%3Aaction=list_classifiers keyword...
Update test_amp_is_canonical() with new naming.
<?php /** * Tests for amp.php. * * @package AMP */ /** * Tests for amp.php. */ class Test_AMP extends WP_UnitTestCase { /** * Tear down and clean up. */ public function tearDown() { parent::tearDown(); remove_theme_support( 'amp' ); } /** * Test amp_is_canonical(). * * @covers amp_is_canonica...
<?php /** * Tests for amp.php. * * @package AMP */ /** * Tests for amp.php. */ class Test_AMP extends WP_UnitTestCase { /** * Tear down and clean up. */ public function tearDown() { parent::tearDown(); remove_theme_support( 'amp' ); } /** * Test amp_is_canonical(). * * @covers amp_is_canonica...
Fix NPE for command with no arguments [jes: fixed whitespace and commit message] Signed-off-by: Johannes Schindelin <53fb8db7833fca1e1746dd8592f61048d350f64c@gmx.de>
package com.github.maven_nar; import java.util.ArrayList; import java.util.List; public class ProcessLibraryCommand { /** * The executable to run * * @parameter default-value="" */ private String executable; /** * The library type that this command is valid for * ...
package com.github.maven_nar; import java.util.ArrayList; import java.util.List; public class ProcessLibraryCommand { /** * The executable to run * * @parameter default-value="" */ private String executable; /** * The library type that this command is valid for * ...
Disable ExampleDecoder testing on go < 1.8 ... because it fails as the error message returned by stdlib changed with go1.8.
// The original error message returned by stdlib changed with go1.8. // We only test the latest release. // //+build go1.8 forcego1.8 package jsonptrerror_test import ( "fmt" "strings" "github.com/dolmen-go/jsonptrerror" ) func ExampleDecoder() { decoder := jsonptrerror.NewDecoder(strings.NewReader( `{"key": ...
package jsonptrerror_test import ( "fmt" "strings" "github.com/dolmen-go/jsonptrerror" ) func ExampleDecoder() { decoder := jsonptrerror.NewDecoder(strings.NewReader( `{"key": "x", "value": 5}`, )) var out struct { Key string `json:"key"` Value bool `json:"value"` } err := decoder.Decode(&out) fmt...
Simplify the use of `phutil_get_library_root` Summary: Currently, in order to retrieve the library root of the current phutil module, the following code is required: ```lang=php $library = phutil_get_current_library_name(); $root = phutil_get_library_root($library); ``` This can be simplified by allowing the use of ...
<?php function phutil_get_library_root($library = null) { if (!$library) { $library = phutil_get_current_library_name(); } $bootloader = PhutilBootloader::getInstance(); return $bootloader->getLibraryRoot($library); } function phutil_get_library_root_for_path($path) { foreach (Filesystem::walkToRoot($pa...
<?php function phutil_get_library_root($library) { $bootloader = PhutilBootloader::getInstance(); return $bootloader->getLibraryRoot($library); } function phutil_get_library_root_for_path($path) { foreach (Filesystem::walkToRoot($path) as $dir) { if (Filesystem::pathExists($dir.'/__phutil_library_init__.php...
Disable Express' view components (we use our own)
/** server The backbone of the server module. In development, this runs proxied through BrowserSync server. @param {Object} options Options passed on to "globals" @param {Function} next Called when server successfully initialized **/ var reorg = require("reorg"); module.exports = reorg(function(options,...
/** server The backbone of the server module. In development, this runs proxied through BrowserSync server. @param {Object} options Options passed on to "globals" @param {Function} next Called when server successfully initialized **/ var reorg = require("reorg"); module.exports = reorg(function(options,...
Fix defaults for Session config
<?php return [ /** * The driver to use to store the session (defaults to `file`) */ 'driver' => getenv('SESSION_DRIVER') ?: 'file', /** * The name of the cookie that is set in a visitors browser */ 'cookie' => getenv('SESSION_COOKIE') ?: 'lumberjack_session', /** * How lo...
<?php return [ /** * The driver to use to store the session (defaults to `file`) */ 'driver' => getenv('SESSION_DRIVER') ?? 'file', /** * The name of the cookie that is set in a visitors browser */ 'cookie' => getenv('SESSION_COOKIE') ?? 'lumberjack_session', /** * How lo...
Set a default api path
from __future__ import unicode_literals from django.conf import settings from django.conf.urls import include, url from rest_framework_bulk.routes import BulkRouter from rest_surveys.views import ( SurveyViewSet, SurveyResponseViewSet, ) # API # With trailing slash appended: router = BulkRouter() router.regis...
from __future__ import unicode_literals from django.conf import settings from django.conf.urls import include, url from rest_framework_bulk.routes import BulkRouter from rest_surveys.views import ( SurveyViewSet, SurveyResponseViewSet, ) # API # With trailing slash appended: router = BulkRouter() router.regis...
Fix missing public decls that were breaking tests
package com.xtremelabs.robolectric.shadows; import com.xtremelabs.robolectric.util.Implementation; import com.xtremelabs.robolectric.util.Implements; import android.media.AudioManager; @SuppressWarnings({"UnusedDeclaration"}) @Implements(AudioManager.class) public class ShadowAudioManager { private int streamMaxV...
package com.xtremelabs.robolectric.shadows; import com.xtremelabs.robolectric.util.Implementation; import com.xtremelabs.robolectric.util.Implements; import android.media.AudioManager; @SuppressWarnings({"UnusedDeclaration"}) @Implements(AudioManager.class) public class ShadowAudioManager { private int streamMaxV...
Store both username and displayName in server session
var passport = require('passport'), GitHubStrategy = require('passport-github').Strategy, config = require('./config'); passport.serializeUser(function(user, done) { var sessionUser = {username: user.username, displayName: user.displayName, avatar: user._json.avatar_url, github_id: user.id} done(null, ...
var passport = require('passport'), GitHubStrategy = require('passport-github').Strategy, config = require('./config'); passport.serializeUser(function(user, done) { var sessionUser = {name: user.displayName, avatar: user._json.avatar_url, github_id: user.id} done(null, sessionUser); }); passport.dese...
Update plugin to work with the new build-wepack hook signature.
import path from 'path'; export default () => () => (webpackConfig = {}) => { // Register extensions webpackConfig.resolve.extensions.push('.ts', '.tsx'); const jsLoader = webpackConfig.module.loaders.find(loader => loader.id === 'babel'); // Make sure ts and tsx files are processed by babel after be...
import path from 'path'; export default ({ previousValue: prevWebpackConfig }) => () => () => { const webpackConfig = { ...prevWebpackConfig }; // Register extensions webpackConfig.resolve.extensions.push('.ts', '.tsx'); // Make sure ts and tsx files are processed by babel after being the typescript ...
Add comment for test account
import config from 'config'; import { Router } from 'express'; const router = Router(); router.post('/student', (req, res) => { if (req.body.username === 'test' && req.body.password === 'test') { console.log('student logged in, account:', req.body.username); res.cookie(config.cookie_path.name, req.body.username, ...
import config from 'config'; import { Router } from 'express'; const router = Router(); router.post('/student', (req, res) => { if (req.body.username === 'test' && req.body.password === 'test') { console.log('student logged in, account:', req.body.username); res.cookie(config.cookie_path.name, req.body.username, ...
Use correct comparison operator for TEXTAREA in isEditorBlur
export default class FocusHandler { inputFocused = false; editorMouseDown = false; onEditorMouseDown = ():void => { this.editorFocused = true; } onInputMouseDown = ():void => { this.inputFocused = true; } isEditorBlur = (event): void => { if ( (event.target.tagName === 'INPUT' || even...
export default class FocusHandler { inputFocused = false; editorMouseDown = false; onEditorMouseDown = ():void => { this.editorFocused = true; } onInputMouseDown = ():void => { this.inputFocused = true; } isEditorBlur = (event): void => { if ( (event.target.tagName === 'INPUT' || even...
blueprints/route-test: Use `options.entity-name` for test description
'use strict'; const path = require('path'); const stringUtil = require('ember-cli-string-utils'); const useTestFrameworkDetector = require('../test-framework-detector'); module.exports = useTestFrameworkDetector({ description: 'Generates a route unit test.', availableOptions: [ { name: 'reset-namespace...
'use strict'; const testInfo = require('ember-cli-test-info'); const path = require('path'); const stringUtil = require('ember-cli-string-utils'); const useTestFrameworkDetector = require('../test-framework-detector'); module.exports = useTestFrameworkDetector({ description: 'Generates a route unit test.', avail...
Add authenticate.py to installed scripts
from setuptools import setup setup( name='bwapi', version='3.2.0', description='A software development kit for the Brandwatch API', url='https://github.com/BrandwatchLtd/api_sdk', author='Amy Barker, Jamie Lebovics, Paul Siegel and Jessica Bowden', author_email='amyb@brandwatch.com, paul@br...
from setuptools import setup setup( name='bwapi', version='3.2.0', description='A software development kit for the Brandwatch API', url='https://github.com/BrandwatchLtd/api_sdk', author='Amy Barker, Jamie Lebovics, Paul Siegel and Jessica Bowden', author_email='amyb@brandwatch.com, paul@br...
Fix des alertes sur des attributs inexistants
<?php namespace ETNA\FeatureContext; trait setUpScenarioDirectories { /** @Var string */ private $requests_path; /** @Var string */ private $results_path; /** * @BeforeScenario */ public function setUpScenarioDirectories($event) { if ($event instanceof \Behat\Behat\Event...
<?php namespace ETNA\FeatureContext; trait setUpScenarioDirectories { /** * @BeforeScenario */ public function setUpScenarioDirectories($event) { if ($event instanceof \Behat\Behat\Event\ScenarioEvent) { $this->results_path = realpath(dirname($event->getScenario()->getFile()...
Add dummy @TransactionAttribute on read method.
package jannotate.beans; import jannotate.domain.Annotation; import java.util.List; import javax.annotation.Resource; import javax.inject.Named; import javax.persistence.EntityManager; import javax.persistence.PersistenceContext; import javax.persistence.Transient; import javax.ejb.*; @Stateless public class Annota...
package jannotate.beans; import jannotate.domain.Annotation; import java.util.List; import javax.annotation.Resource; import javax.inject.Named; import javax.persistence.EntityManager; import javax.persistence.PersistenceContext; import javax.persistence.Transient; import javax.ejb.*; @Stateless public class Annota...
Correct local references when loading uncompiled source
/** * @fileoverview Bootstrapper for local development. * * This script can be used during development instead of the compiled firebase-simple-login.js. * It pulls in the raw source files, so no compilation step is required (though if you * change any dependencies, e.g. by adding goog.require statements, you'll ne...
/** * @fileoverview Bootstrapper for local development. * * This script can be used during development instead of the compiled firebase-simple-login.js. * It pulls in the raw source files, so no compilation step is required (though if you * change any dependencies, e.g. by adding goog.require statements, you'll ne...
Print stack only when env DEBUG is set
var Q = require('q'); var _ = require('lodash'); var http = require('http'); var send = require('send'); var path = require('path'); var Gaze = require('gaze').Gaze; function watch(dir) { var d = Q.defer(); dir = path.resolve(dir); var gaze = new Gaze("**/*.md", { cwd: dir }); gaze.once...
var Q = require('q'); var _ = require('lodash'); var http = require('http'); var send = require('send'); var path = require('path'); var Gaze = require('gaze').Gaze; function watch(dir) { var d = Q.defer(); dir = path.resolve(dir); var gaze = new Gaze("**/*.md", { cwd: dir }); gaze.once...
Make ports a slice for consistency with policy violations Signed-off-by: Kevin Kirsche <18695bc9b6a48cd25cda049e45c04495c905a059@gmail.com>
package nessusProcessor // PolicyViolationMatchCriteria holds what criteria should be checked when checking for a // policy violation. type PolicyViolationMatchCriteria struct { ExternallyAccessible bool IgnoreViolationWithCriteriaMatch bool PreviousViolationCheck bool CountIf ...
package nessusProcessor // PolicyViolationMatchCriteria holds what criteria should be checked when checking for a // policy violation. type PolicyViolationMatchCriteria struct { ExternallyAccessible bool IgnoreViolationWithCriteriaMatch bool PreviousViolationCheck bool CountIf ...
Add password confirmation to user seeds.
var db = require('../models/db'); db.User .build({ username: 'johndoe', email: 'johndoe@tessel.io', name: 'John Doe', password: 'password', passwordConfirmation: 'password' }) .confirmPassword() .digest() .genApiKey() .save() .success(function(user){ console.log('user =>' + user.u...
var db = require('../models/db'); db.User .build({ username: 'johndoe', email: 'johndoe@tessel.io', name: 'John Doe', password: 'password', }) .digest() .genApiKey() .save() .success(function(user){ console.log('user =>' + user.username + ' stored'); }) .error(function(err){ con...
Fix word count if the altered string ends up empty
function runLogEditorWordCount(){ var common = LogEditorCommon.getInstance(), previewDiv = $("div.mdd_editor_wrap textarea"); common.toolbar.append("<li id='geoachingUtilsWordCount'>Hallo<li/>"); previewDiv.on("input", function(e){ var currentText = $(e.currentTarget).val(), currentWordCount = countWords(cu...
function runLogEditorWordCount(){ var common = LogEditorCommon.getInstance(), previewDiv = $("div.mdd_editor_wrap textarea"); common.toolbar.append("<li id='geoachingUtilsWordCount'>Hallo<li/>"); previewDiv.on("input", function(e){ var currentText = $(e.currentTarget).val(), currentWordCount = countWords(cu...
Set 'darkest' as default tint
import React, { PureComponent } from 'react'; import Box from '../box'; import PropTypes from 'prop-types'; import cx from 'classnames'; import { COLORS, TINTS } from '../../constants'; import theme from './theme.css'; const factory = (baseType, type, defaultElement) => { class Text extends PureComponent { rende...
import React, { PureComponent } from 'react'; import Box from '../box'; import PropTypes from 'prop-types'; import cx from 'classnames'; import { COLORS, TINTS } from '../../constants'; import theme from './theme.css'; const factory = (baseType, type, defaultElement) => { class Text extends PureComponent { rende...
Use a recurrence's label as it's unique id.
<?php namespace Plummer\Calendar; class Calendar { protected $events; protected $recurrenceTypes; protected function __construct(\Iterator $events, $recurrenceTypes) { $this->events = $events; $this->addRecurrenceTypes($recurrenceTypes); } public static function make(\Iterator $events, $recurrenceTypes =...
<?php namespace Plummer\Calendar; class Calendar { protected $events; protected $recurrenceTypes; protected function __construct(\Iterator $events, $recurrenceTypes) { $this->events = $events; $this->addRecurrenceTypes($recurrenceTypes); } public static function make(\Iterator $events, $recurrenceTypes =...
Tweak wording in doc comments
<?php namespace Neos\Flow\Http; use Neos\Flow\Annotations as Flow; use Neos\Flow\Core\Bootstrap; use Psr\Http\Message\ServerRequestInterface; /** * Central authority to get hold of the active HTTP request. * When no active HTTP request can be determined (for example in CLI context) an exception will be thrown * *...
<?php namespace Neos\Flow\Http; use Neos\Flow\Annotations as Flow; use Neos\Flow\Core\Bootstrap; use Psr\Http\Message\ServerRequestInterface; /** * Central authority to get hold of the active HTTP request. * When no active HTTP request can be determined (for example in CLI context) an exception will be thrown * *...
Update control statement negation example
<?php // basic if - else if ($expr1) { // if body } elseif ($expr2) { // elseif body } else { // else body; } // if with a negation if (!$expr1) { // if body } // if with an operand if ($expr1 && $expr2) { // if body } else { // else body; } // if with long expression if ($expr1 && $exp...
<?php // basic if - else if ($expr1) { // if body } elseif ($expr2) { // elseif body } else { // else body; } // if with a negation if (! $expr1) { // if body } // if with an operand if ($expr1 && $expr2) { // if body } else { // else body; } // if with long expression if ($expr1 && $ex...
Make token creation a little easier to read
var assert = require('assert'); var connect = require('connect'); var csrf = require('csrf-lite'); var extend = require('obj-extend'); module.exports = function (options) { options = extend({ tokenKey: 'csrfToken', dataKey: 'body' }, options); return function connectCsrf (req, res, next) { // Grab t...
var assert = require('assert'); var connect = require('connect'); var csrf = require('csrf-lite'); var extend = require('obj-extend'); module.exports = function (options) { options = extend({ tokenKey: 'csrfToken', dataKey: 'body' }, options); return function connectCsrf (req, res, next) { // Grab t...
Fix header of Python file Now correctly points to the Python interpretor
#!/usr/bin/env python import socket, fcntl, sys #Lock to only allow one instance of this program to run pid_file = '/tmp/send.pid' fp = open(pid_file, 'w') try: fcntl.lockf(fp, fcntl.LOCK_EX | fcntl.LOCK_NB) except IOError: print 'An instance of this program is already running' sys.exit(0) import Adafruit_C...
#!/usr/bin/env/python import socket, fcntl, sys #Lock to only allow one instance of this program to run pid_file = '/tmp/send.pid' fp = open(pid_file, 'w') try: fcntl.lockf(fp, fcntl.LOCK_EX | fcntl.LOCK_NB) except IOError: print 'An instance of this program is already running' sys.exit(0) import Adafruit_C...
Update unit test to test for latest updates in the basic class template class.
<?php /* * This file is part of the Onema ClassyFile Package. * For the full copyright and license information, * please view the LICENSE file that was distributed * with this source code. */ namespace Onema\Test; use Onema\ClassyFile\Template\BasicClassTemplate; /** * BasicClassTemplateTest - Description. ...
<?php /* * This file is part of the Onema ClassyFile Package. * For the full copyright and license information, * please view the LICENSE file that was distributed * with this source code. */ namespace Onema\Test; use Onema\ClassyFile\Template\BasicClassTemplate; /** * BasicClassTemplateTest - Description. ...
Correct version for deploy to GAE
//Command to run test version: //goapp serve app.yaml //Command to deploy/update application: //goapp deploy -application golangnode0 -version 0 package main import ( "fmt" "net/http" ) func helloWorld(w http.ResponseWriter, r *http.Request) { fmt.Fprintf(w, "Hello World!") } func startPage(w http.ResponseWriter...
//Command to run test version: //goapp serve app.yaml //Command to deploy/update application: //goapp deploy -application golangnode0 -version 0 package main import ( "fmt" "net/http" ) func helloWorld(w http.ResponseWriter, r *http.Request) { fmt.Fprintf(w, "Hello World!") } func startPage(w http.ResponseWriter...
Use snake case for API's URL: generic_records instead of genericRecord and species_observation instead of speciesObservation.
from __future__ import absolute_import, unicode_literals, print_function, division from django.conf.urls import url from rest_framework import routers from main.api import views as main_views router = routers.DefaultRouter() router.register(r'projects?', main_views.ProjectViewSet, 'project') router.register(r'sites...
from __future__ import absolute_import, unicode_literals, print_function, division from django.conf.urls import url from rest_framework import routers from main.api import views as main_views router = routers.DefaultRouter() router.register(r'projects?', main_views.ProjectViewSet, 'project') router.register(r'sites...
Fix a couple of bugs. git-svn-id: ca8e9bb6f3f9b50a093b443c23951d3c25ca0913@45 369101cc-9a96-11dd-8e58-870c635edf7a
package com.thaiopensource.relaxng; import org.xml.sax.Locator; import com.thaiopensource.datatype.Datatype; class ValuePattern extends SimplePattern { String str; Datatype dt; ValuePattern(Datatype dt, String str, Locator locator) { super(combineHashCode(VALUE_HASH_CODE, str.hashCode()), locator); thi...
package com.thaiopensource.relaxng; import org.xml.sax.Locator; import com.thaiopensource.datatype.Datatype; class ValuePattern extends SimplePattern { String str; Datatype dt; ValuePattern(Datatype dt, String str, Locator locator) { super(combineHashCode(VALUE_HASH_CODE, str.hashCode()), locator); thi...
Remove JUnit 4 rule ExpectedException.none() (deprecated in version 4.13)
/* * (C) Copyright 2017 Boni Garcia (http://bonigarcia.github.io/) * * 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 require...
/* * (C) Copyright 2017 Boni Garcia (http://bonigarcia.github.io/) * * 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 require...
Add Type field to RecordMatchContext
/* Copyright 2016 The MITRE Corporation. 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 agre...
/* Copyright 2016 The MITRE Corporation. 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 agre...
Change let to var in sms route
"use strict"; const express = require('express'); const twilio = require('twilio'); const bodyParser = require('body-parser'); const app = express(); // Run server to listen on port 8000. const server = app.listen(8000, () => { console.log('listening on *:8000'); }); const io = require('socket.io')(server); app.u...
"use strict"; const express = require('express'); const twilio = require('twilio'); const bodyParser = require('body-parser'); const app = express(); // Run server to listen on port 8000. const server = app.listen(8000, () => { console.log('listening on *:8000'); }); const io = require('socket.io')(server); app.u...
Use relative URL for redirect in NewTerminalHandler
"""Tornado handlers for the terminal emulator.""" # Copyright (c) IPython Development Team. # Distributed under the terms of the Modified BSD License. from tornado import web import terminado from ..base.handlers import IPythonHandler class TerminalHandler(IPythonHandler): """Render the terminal interface.""" ...
"""Tornado handlers for the terminal emulator.""" # Copyright (c) IPython Development Team. # Distributed under the terms of the Modified BSD License. from tornado import web import terminado from ..base.handlers import IPythonHandler class TerminalHandler(IPythonHandler): """Render the terminal interface.""" ...
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...
Add additional assertion that the file we uploaded is correct We should pull back down the S3 bucket file and be sure it's the same, proving we used the boto3 API correctly. We should probably, at some point, also upload a _real_ zip file and not just a plaintext file.
import boto3 from os import path from lambda_uploader import uploader, config from moto import mock_s3 EX_CONFIG = path.normpath(path.join(path.dirname(__file__), '../test/configs')) @mock_s3 def test_s3_upload(): mock_bucket = 'mybucket' conn = boto3.resource('s3') conn.create...
import boto3 from os import path from lambda_uploader import uploader, config from moto import mock_s3 EX_CONFIG = path.normpath(path.join(path.dirname(__file__), '../test/configs')) @mock_s3 def test_s3_upload(): mock_bucket = 'mybucket' conn = boto3.resource('s3') conn.create...
Change Django field filter kwarg from name to field_name for Django 2 support
import django_filters from django_filters.filters import Lookup from apps.events.models import Event class ListFilter(django_filters.Filter): # https://github.com/carltongibson/django-filter/issues/137#issuecomment-37820702 def filter(self, qs, value): value_list = value.split(u',') return su...
import django_filters from django_filters.filters import Lookup from apps.events.models import Event class ListFilter(django_filters.Filter): # https://github.com/carltongibson/django-filter/issues/137#issuecomment-37820702 def filter(self, qs, value): value_list = value.split(u',') return su...
Add 3.7 to the trove classifiers
import setuptools from flatdict import __version__ setuptools.setup( name='flatdict', version=__version__, description=('Python module for interacting with nested dicts as a ' 'single level dict with delimited keys.'), long_description=open('README.rst').read(), author='Gavin M. R...
import setuptools from flatdict import __version__ setuptools.setup( name='flatdict', version=__version__, description=('Python module for interacting with nested dicts as a ' 'single level dict with delimited keys.'), long_description=open('README.rst').read(), author='Gavin M. R...
[BLD] Resolve RuntimeError: Invalid DISPLAY variable - tst
# -*- coding: utf-8 -*- """ Created on Mon Dec 30 02:37:25 2013 @author: Jan """ import unittest import pandas as pd from opengrid.library import plotting class PlotStyleTest(unittest.TestCase): def test_default(self): plt = plotting.plot_style() class CarpetTest(unittest.TestCase): def test_defau...
# -*- coding: utf-8 -*- """ Created on Mon Dec 30 02:37:25 2013 @author: Jan """ import unittest class PlotStyleTest(unittest.TestCase): def test_default(self): from opengrid.library.plotting import plot_style plt = plot_style() class CarpetTest(unittest.TestCase): def test_default(self): ...
Add get_project_author ability in project track repository
<?php /** * @license MIT * Full license text in LICENSE file */ namespace Eadrax\Core\Usecase\Project\Track; interface Repository { public function is_user_tracking_project($fan, $project); public function remove_project($fan, $project); public function if_fan_of($fan, $idol); public function remov...
<?php /** * @license MIT * Full license text in LICENSE file */ namespace Eadrax\Core\Usecase\Project\Track; interface Repository { public function is_user_tracking_project($fan, $project); public function remove_project($fan, $project); public function if_fan_of($fan, $idol); public function remov...
Set production databse to test database
# -*- coding: utf-8 -*- import os HERE = os.path.abspath(os.path.dirname(__file__)) PROJECT_ROOT = os.path.abspath(os.path.join(HERE, os.pardir)) class Config: SECRET_KEY = os.environ.get('SECRET_KEY', 'secret-key') SQLALCHEMY_TRACK_MODIFICATIONS = False SQLALCHEMY_DATABASE_URI = os.environ.get('DATABASE...
# -*- coding: utf-8 -*- import os HERE = os.path.abspath(os.path.dirname(__file__)) PROJECT_ROOT = os.path.abspath(os.path.join(HERE, os.pardir)) class Config: SECRET_KEY = os.environ.get('SECRET_KEY', 'secret-key') SQLALCHEMY_TRACK_MODIFICATIONS = False SQLALCHEMY_DATABASE_URI = os.environ.get('DATABASE...
Change user select to use public class fields
import React from 'react'; class UserSelect extends React.Component { defaultValue = 'unassigned'; state = { selectedUserId: this.defaultValue } handleUserChange = (evt) => { let prevUserId; const selectedUserId = evt.target.value; if (this.state.selectedUserId !== this.defaultValue) { ...
import React from 'react'; class UserSelect extends React.Component { constructor(props) { super(props); this.defaultValue = 'unassigned'; this.state = { selectedUserId: this.defaultValue }; this.handleUserChange = this.handleUserChange.bind(this); } handleUserChange(evt) { let ...
Add creation of a file to write to
var fs = require('fs'); var clicolour = require('cli-color'); var mkdirp = require('mkdirp'); var error = require('../../error/bsod.js'); var xml = require('xml'); var exec = require('child_process').exec; exports.buildLang = function buildLang(x, y, z) { console.log(clicolour.cyanBright("webOS ") + clicolour.yello...
var fs = require('fs'); var clicolour = require('cli-color'); var mkdirp = require('mkdirp'); var error = require('../../error/bsod.js'); var xml = require('xml'); exports.buildLang = function buildLang(x, y, z) { console.log(clicolour.cyanBright("webOS ") + clicolour.yellowBright("oobe ") + "Createing xml..."); ...
Remove deprication tag as it leads to compile errors
// Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. package com.yahoo.vespa.hosted.controller.api.integration.dns; import java.util.ArrayList; import java.util.List; import java.util.Optional; /** * A managed DNS service. * * @author mpolden */ pu...
// Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. package com.yahoo.vespa.hosted.controller.api.integration.dns; import java.util.ArrayList; import java.util.List; import java.util.Optional; /** * A managed DNS service. * * @author mpolden */ pu...
Fix passing argument to callback to be status code not a boolean
module.exports = function( options, callback ) { var option, spider, startTime = new Date(), duration = require( "duration" ), spawn = require( "child_process" ).spawn, args = [ "test", __dirname + "/lib/tests.js" ]; for ( option in options ) { if ( options.hasOwnProperty( option ) ) { args.push( "--" +...
module.exports = function( options, callback ) { var option, spider, startTime = new Date(), duration = require( "duration" ), spawn = require( "child_process" ).spawn, args = [ "test", __dirname + "/lib/tests.js" ]; for ( option in options ) { if ( options.hasOwnProperty( option ) ) { args.push( "--" +...
Enforce 20s timeout for all unit tests.
/** * Allow the test suite to run with other libs or jQuery's. */ jQuery.noConflict(); /** * QUnit hooks */ (function() { // jQuery-specific QUnit.reset var reset = QUnit.reset, ajaxSettings = jQuery.ajaxSettings; QUnit.reset = function() { reset.apply(this, arguments); jQuery.event.global = {}; jQuery...
jQuery.noConflict(); // Allow the test to run with other libs or jQuery's. // jQuery-specific QUnit.reset (function() { var reset = QUnit.reset, ajaxSettings = jQuery.ajaxSettings; QUnit.reset = function() { reset.apply(this, arguments); jQuery.event.global = {}; jQuery.ajaxSettings = jQuery.extend({}, ajax...
Update: Add process title & improve callback invocation
#!/usr/bin/env node 'use strict'; var Liftoff = require('liftoff'); var Hacker = new Liftoff({ localDeps: ['hacker'], configName: 'hackerfile', processTitle: 'hacker', cwdOpt: 'cwd', requireOpt: 'require' }).on('require', function (name, module) { if (name === 'coffee-script') { module.register(); }...
#!/usr/bin/env node 'use strict'; var Liftoff = require('liftoff'); var Hacker = new Liftoff({ localDeps: ['hacker'], configName: 'hackerfile', cwdOpt: 'cwd', requireOpt: 'require' }).on('require', function (name, module) { if (name === 'coffee-script') { module.register(); } }).on('requireFail', func...
Raise exception instead of returnning it
import requests import os import shutil client_id = '' # Imgur application Client ID, fill this in. directory_name = 'Imgur Albums\\' # Directory for the images to be stored def scrape(album_id): ''' (str) -> list of str Given an Imgur album ID, scrapes all the images within the album into a folder. Re...
import requests import os import shutil client_id = '' # Imgur application Client ID, fill this in. directory_name = 'Imgur Albums\\' # Directory for the images to be stored def scrape(album_id): ''' (str) -> list of str Given an Imgur album ID, scrapes all the images within the album into a folder. Re...
fix(sanketa): Fix surrogate pair split :sushi:
/* @flow */ /** * sanketa * * @param {number|string} rawChars - raw chars * @param {Object} [opts] - options * @param {boolean} [opts.r] - reverse flag * @param {number|string} [opts.s] - sepalater * @return {string} */ export default function sanketa(rawChars: (number|string), opts: Object = {}): string { co...
/* @flow */ /** * sanketa * * @param {number|string} rawChars - raw chars * @param {Object} [opts] - options * @param {boolean} [opts.r] - reverse flag * @param {number|string} [opts.s] - sepalater * @return {string} */ export default function sanketa(rawChars: (number|string), opts: Object = {}): string { co...
Add simplejson as installation requirement
""" Setup and installation for the package. """ try: from setuptools import setup except ImportError: from distutils.core import setup setup( name="three", version="0.1", author="Zach Williams", author_email="hey@zachwill.com", description="An easy-to-use wrapper for the Open311 API", ...
""" Setup and installation for the package. """ try: from setuptools import setup except ImportError: from distutils.core import setup setup( name="three", version="0.1", author="Zach Williams", author_email="hey@zachwill.com", description="An easy-to-use wrapper for the Open311 API", ...
Return empty menu when no group context available.
<?php namespace Bkstg\CoreBundle\Menu\Builder; use Bkstg\CoreBundle\Context\GroupContextProvider; use Bkstg\CoreBundle\Event\ProductionMenuCollectionEvent; use Knp\Menu\FactoryInterface; use Symfony\Component\EventDispatcher\EventDispatcherInterface; class ProductionMenuBuilder { private $factory; private $d...
<?php namespace Bkstg\CoreBundle\Menu\Builder; use Bkstg\CoreBundle\Context\GroupContextProvider; use Bkstg\CoreBundle\Event\ProductionMenuCollectionEvent; use Knp\Menu\FactoryInterface; use Symfony\Component\EventDispatcher\EventDispatcherInterface; class ProductionMenuBuilder { private $factory; private $d...
Fix import when using python3.3
# -*- coding: utf-8 -*- # vim: set ts=4 # Copyright 2013 Rémi Duraffort # This file is part of RandoAmisSecours. # # RandoAmisSecours is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as published by # the Free Software Foundation, either version 3 of...
# -*- coding: utf-8 -*- # vim: set ts=4 # Copyright 2013 Rémi Duraffort # This file is part of RandoAmisSecours. # # RandoAmisSecours is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as published by # the Free Software Foundation, either version 3 of...
Add window.getselection() mock to commentTree test Jsdom does not support window.getSelection(), which is used by the editor. So in any test fully mounting lego-editor to the dom, this needs to be mocked.
import React from 'react'; import { mount, shallow } from 'enzyme'; import CommentTree from '../CommentTree'; import comments from './fixtures/comments'; import { generateTreeStructure } from '../../../utils'; import { MemoryRouter } from 'react-router-dom'; describe('<CommentTree />', () => { beforeAll(() => { ...
import React from 'react'; import { mount, shallow } from 'enzyme'; import CommentTree from '../CommentTree'; import comments from './fixtures/comments'; import { generateTreeStructure } from '../../../utils'; import { MemoryRouter } from 'react-router-dom'; describe('<CommentTree />', () => { const tree = generate...
Use actual user avatar in passport mock
var User = require('./models').User; module.exports = { initialize: function(sessionUserObject) { return function(req, res, next) { var passport = this; User.findOne({username: 'Andrew'}, function(err, found){ found = found.toJSON(); found.avatar_url = found.avatar_url; ...
var User = require('./models').User; module.exports = { initialize: function(sessionUserObject) { return function(req, res, next) { var passport = this; User.findOne({username: 'Andrew'}, function(err, found){ found = found.toJSON(); found.avatar_url = 'https://avatars.gi...