text
stringlengths
16
4.96k
positive
stringlengths
321
2.24k
negative
stringlengths
310
2.21k
Add test forecast.io API call
import juliet_module from pygame import Rect from time import time import forecastio class weather_module(juliet_module.module): mod_name = "weather_module" __last_update = time() __api = None __forecast = None def __init__(self, _id, _keyfile): print("Initializing Weather Module") ...
import juliet_module from pygame import Rect from time import time from os import getcwd class weather_module(juliet_module.module): mod_name = "weather_module" __last_update = time() __api = None def __init__(self, _id, _keyfile): print("Initializing Weather Module") self.mod_id = _...
Add sample output in comments.
/* Detect object's properties being used */ // Object to be spied, can be Modernizr library for example var user = { name: 'Maciej', surname: 'Smolinski', fullName: 'Maciej Smolinski' }; // Spy Function function spyProperties (debugNamespace, objectReference) { Object.keys(objectReference).forEach(function (pr...
/* Detect object's properties being used */ // Object to be spied, can be Modernizr library for example var user = { name: 'Maciej', surname: 'Smolinski', fullName: 'Maciej Smolinski' }; // Spy Function function spyProperties (debugNamespace, objectReference) { Object.keys(objectReference).forEach(function (pr...
Make marker visible on android
// @flow import * as React from 'react'; import { Icon, StyleSheet } from '@kiwicom/react-native-app-shared'; import Color from '../Color'; type Props = {| size?: number, |}; const createStyles = (size: number) => StyleSheet.create({ icon: { ios: { position: 'absolute', left: -size / 2...
// @flow import * as React from 'react'; import { StyleSheet } from 'react-native'; import { Icon } from '@kiwicom/react-native-app-shared'; import Color from '../Color'; type Props = {| size?: number, |}; const createStyles = (size: number) => StyleSheet.create({ icon: { position: 'absolute', l...
Change the REST API so adding a flow is using path "/add/json" instead of "/add/{flow}/json", because now we use POST mechanism to add a flow.
package net.floodlightcontroller.flowcache.web; import net.floodlightcontroller.restserver.RestletRoutable; import org.restlet.Context; import org.restlet.Restlet; import org.restlet.routing.Router; public class FlowWebRoutable implements RestletRoutable { /** * Create the Restlet router and bind to the pro...
package net.floodlightcontroller.flowcache.web; import net.floodlightcontroller.restserver.RestletRoutable; import org.restlet.Context; import org.restlet.Restlet; import org.restlet.routing.Router; public class FlowWebRoutable implements RestletRoutable { /** * Create the Restlet router and bind to the pro...
Add some nose.tools to testing imports.
"""The testing directory contains a small set of imaging files to be used for doctests only. More thorough tests and example data will be stored in a nipy-data-suite to be created later and downloaded separately. Examples -------- >>> from neuroimaging.testing import funcfile >>> from neuroimaging.core.image import ...
"""The testing directory contains a small set of imaging files to be used for doctests only. More thorough tests and example data will be stored in a nipy-data-suite to be created later and downloaded separately. Examples -------- >>> from neuroimaging.testing import funcfile >>> from neuroimaging.core.image import ...
Clean up item price updating (1/2 runtime!)
const mongo = require('../../helpers/mongo.js') const api = require('../../helpers/api.js') const async = require('gw2e-async-promises') const transformPrices = require('./_transformPrices.js') const config = require('../../config/application.js') async function itemPrices (job, done) { job.log(`Starting job`) le...
const mongo = require('../../helpers/mongo.js') const api = require('../../helpers/api.js') const async = require('gw2e-async-promises') const transformPrices = require('./_transformPrices.js') async function itemPrices (job, done) { job.log(`Starting job`) let prices = await api().commerce().prices().all() let...
Fix class name according to filename.
<?php namespace Pingpong\Whoops; use Illuminate\Support\ServiceProvider; class WhoopsServiceProvider extends ServiceProvider { /** * Indicates if loading of the provider is deferred. * * @var boolean */ protected $defer = false; /** * Register the service provider. */ p...
<?php namespace Pingpong\Whoops; use Illuminate\Support\ServiceProvider; class ServiceProvider extends ServiceProvider { /** * Indicates if loading of the provider is deferred. * * @var boolean */ protected $defer = false; /** * Register the service provider. */ public ...
Write in terms of test operation
/* * Copyright 2015 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 2015 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...
Add distanceBetween function, event listener for 'faceLocation' on Tomato
const util = require('util'); const EventEmitter = require('events'); function Tomato(context, center, direction, speed) { EventEmitter.call(this); this.context = context; this.center = center || { x: center.x, y: center.y }; this.size = 10; this.direction = direction || 0; this.speed = speed || 3; } util...
const util = require('util'); const EventEmitter = require('events'); function Tomato(context, center, direction, speed) { EventEmitter.call(this); this.context = context; this.center = center || { x: center.x, y: center.y }; this.size = 10; this.direction = direction || 0; this.speed = speed || 3; } util...
Remove sparkline from spec (not needed anymore)
module.exports = function(config) { config.set({ basePath: '', frameworks: ['mocha', 'chai-jquery', 'jquery-2.1.0', 'chai', 'sinon-chai', 'fixture'], files: [ 'public/javascripts/vendor/d3.v3.min.js', 'public/javascripts/vendor/raphael-min.js', 'public/javascripts/vendor/morris.min.js', ...
module.exports = function(config) { config.set({ basePath: '', frameworks: ['mocha', 'chai-jquery', 'jquery-2.1.0', 'chai', 'sinon-chai', 'fixture'], files: [ 'public/javascripts/vendor/d3.v3.min.js', 'public/javascripts/vendor/raphael-min.js', 'public/javascripts/vendor/morris.min.js', ...
Add 1-hour expiry to requests_cache (formerly 5 minutes).
""" Top-level Flask application for HXL Proxy David Megginson January 2015 License: Public Domain Documentation: http://hxlstandard.org """ import os import requests_cache from flask import Flask, g, request from flask_cache import Cache import werkzeug.datastructures # Main application object app = Flask(__name__...
""" Top-level Flask application for HXL Proxy David Megginson January 2015 License: Public Domain Documentation: http://hxlstandard.org """ import os import requests_cache from flask import Flask, g, request from flask_cache import Cache import werkzeug.datastructures # Main application object app = Flask(__name__...
Adjust elements' height for window size
/* global $ */ 'use strict'; angular.module('memoApp') .controller('MemoEditCtrl', function ($scope, $routeParams, memoService) { $('.nav li').removeClass('active'); $('#nav-memos').addClass('active'); function resize() { var height = (window.innerHeight - $('#md_area').offset().top - 100) + 'px'...
/* global $ */ 'use strict'; angular.module('memoApp') .controller('MemoEditCtrl', function ($scope, $routeParams, memoService) { $('.nav li').removeClass('active'); $('#nav-memos').addClass('active'); var height = (window.innerHeight - $('#md_area').offset().top - 100) + 'px'; // console.log(heigh...
Make comments collection load only when loading a post
Router.configure({ layoutTemplate: 'layout', loadingTemplate: 'loading', notFoundTemplate: 'notFound', waitOn: function() { return Meteor.subscribe('posts'); } }); Router.route('/', { name: 'postsList'}); Router.route('/posts/:_id', { name: 'postPage', waitOn: function() { return Meteor.subscri...
Router.configure({ layoutTemplate: 'layout', loadingTemplate: 'loading', notFoundTemplate: 'notFound', waitOn: function() { return [Meteor.subscribe('posts'), Meteor.subscribe('comments')]; } }); Router.route('/', { name: 'postsList'}); Router.route('/posts/:_id', { name: 'postPage', data: function(...
Fix Turkish abbreviation for "minutes" In Turkish, the abbreviation of "dakika" (minute) is "dk".
(function (factory) { if (typeof define === 'function' && define.amd) { define(['jquery'], factory); } else if (typeof module === 'object' && typeof module.exports === 'object') { factory(require('jquery')); } else { factory(jQuery); } }(function (jQuery) { // Turkish shortened jQuery.timeago.se...
(function (factory) { if (typeof define === 'function' && define.amd) { define(['jquery'], factory); } else if (typeof module === 'object' && typeof module.exports === 'object') { factory(require('jquery')); } else { factory(jQuery); } }(function (jQuery) { // Turkish shortened jQuery.timeago.se...
Make $METEOR_NPM_REBUILD_FLAGS override default flags.
// Command-line arguments passed to npm when rebuilding binary packages. var args = [ "rebuild", // The --no-bin-links flag tells npm not to create symlinks in the // node_modules/.bin/ directory when rebuilding packages, which helps // avoid problems like https://github.com/meteor/meteor/issues/7401. "--no-...
// Command-line arguments passed to npm when rebuilding binary packages. var args = [ "rebuild", // The --no-bin-links flag tells npm not to create symlinks in the // node_modules/.bin/ directory when rebuilding packages, which helps // avoid problems like https://github.com/meteor/meteor/issues/7401. "--no-...
Update pubkey servlet to s/signers/keyring
# -*- coding: utf-8 -*- # Copyright 2014 matrix.org # # 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 o...
# -*- coding: utf-8 -*- # Copyright 2014 matrix.org # # 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 o...
refactor: Change location of regex compilation
import re url_re = re.compile("(?:\s|^)<(https?://[\w./?+&+%$!#=\-_]+)>(?:\s|$)") purge_re = re.compile("(purge) (\d+)") list_re = re.compile("list") def extract_url(message): """ Returns the first url in a message. If there aren't any returns None """ answer = url_re.search(message) if answer is...
import re url_re = re.compile("(?:\s|^)<(https?://[\w./?+&+%$!#=\-_]+)>(?:\s|$)") def extract_url(message): """ Returns the first url in a message. If there aren't any returns None """ answer = url_re.search(message) if answer is not None: answer = answer.group(1).strip() return ans...
Replace tabs with spaces, use parens to get rid of backslashes
from yacron import config def test_mergedicts(): assert dict(config.mergedicts({"a": 1}, {"b": 2})) == {"a": 1, "b": 2} def test_mergedicts_nested(): assert (dict(config.mergedicts( {"a": {'x': 1, 'y': 2, 'z': 3}}, {'a': {'y': 10}, "b": 2} )) == {"a": {'x': 1, 'y': 10, 'z': 3}, "b": 2}) ...
from yacron import config def test_mergedicts(): assert dict(config.mergedicts({"a": 1}, {"b": 2})) == {"a": 1, "b": 2} def test_mergedicts_nested(): assert dict(config.mergedicts( {"a": {'x': 1, 'y': 2, 'z': 3}}, {'a': {'y': 10}, "b": 2})) == \ {"a": {'x': 1, 'y': 10, 'z': 3}, "b": 2} def test_merg...
provider/common: Add more rationale to the doc comments for EnvFullName and MachineFullName.
// Copyright 2014 Canonical Ltd. // Licensed under the AGPLv3, see LICENCE file for details. package common import ( "fmt" "github.com/juju/names" "github.com/juju/juju/environs" ) // EnvFullName returns a string based on the provided environment // that is suitable for identifying the env on a provider. The re...
// Copyright 2014 Canonical Ltd. // Licensed under the AGPLv3, see LICENCE file for details. package common import ( "fmt" "github.com/juju/names" "github.com/juju/juju/environs" ) // EnvFullName returns a string based on the provided environment // that is suitable for identifying the env on a provider. func E...
Fix command line usage options
"""Calculate the number of Pomodori available within a time period. Usage: get-pomodori [--from=<time>] [--break=<minutes>] [--long-break=<minutes>] <end-time> get-pomodori (-h | --help | --version) Options: --version show program's version number and exit. -h, --help show t...
"""Calculate the number of Pomodori available within a time period. Usage: get-pomodori [--from=<time>] [--break=<minutes>] [--long-break=<minutes>] <end-time> get-pomodori (-h | --help | --version) Options: --version show program's version number and exit. -h, --help show t...
Make example work with refactored code.
require.paths.unshift('../lib') var inflect = require('inflect'); var options = { type: 'client', jid: 'user@example.com', password: 'secret', host: 'example.com', port: 5222 }; var connection = inflect.createConnection(options); connection.use(inflect.logger()); connection.use(inflect.serviceDiscovery([ { ...
require.paths.unshift('../lib') var xmpp = require('node-xmpp'); var inflect = require('inflect'); var options = { type: 'client', jid: 'user@example.com', password: 'secret', host: 'example.com', port: 5222 }; var connection = inflect.createConnection(options); connection.use(inflect.logger); connection.us...
Downgrade de version bump to a minor one
from setuptools import setup REPO_URL = 'http://github.com/datasciencebr/serenata-toolbox' setup( author='Serenata de Amor', author_email='op.serenatadeamor@gmail.com', classifiers=[ 'Development Status :: 4 - Beta', 'Intended Audience :: Science/Research', 'License :: OSI Approve...
from setuptools import setup REPO_URL = 'http://github.com/datasciencebr/serenata-toolbox' setup( author='Serenata de Amor', author_email='op.serenatadeamor@gmail.com', classifiers=[ 'Development Status :: 4 - Beta', 'Intended Audience :: Science/Research', 'License :: OSI Approve...
Add helper for container “created”-status checking
var exec = require('child_process').exec, _ = require('lodash') module.exports.asyncIterate = function(array, callback, done) { function iterate(idx) { var current = array[idx] if (current) { callback(current, function() { iterate(idx+1) }, function(err) { done(err) }) ...
var exec = require('child_process').exec, _ = require('lodash') module.exports.asyncIterate = function(array, callback, done) { function iterate(idx) { var current = array[idx] if (current) { callback(current, function() { iterate(idx+1) }, function(err) { done(err) }) ...
Test apply on a non-existing method
<?php use Jade\Compiler; class StatementsBugCompiler extends Compiler { public function __construct() { $this->createStatements(); } } class ApplyBugCompiler extends Compiler { public function __construct() { $this->apply('foo', array()); } } class JadeCompilerExceptionsTest exte...
<?php use Jade\Compiler; class BugCompiler extends Compiler { public function __construct() { $this->createStatements(); } } class JadeCompilerExceptionsTest extends PHPUnit_Framework_TestCase { /** * @expectedException Exception */ public function testHandleEmptyCode() { ...
Create object MenuItem that wraps functions to create a call stack
class MenuItem(object): def __init__(self, func=None): if func: self.function = func # Wrapper for child.function() that creates a call stack def run(self, ret=None): self.function() if ret: ret() class Menu(MenuItem): def __init__(self, dialog, items, title): self.d = ...
class Menu(object): def __init__(self, dialog, items, title, caller = None): self.d = dialog self.caller = caller self.entries = [] self.dispatch_table = {} tag = 1 self.title = title for entry, func in items: self.entries.append(tuple([str(tag)...
Fix the map file name git-svn-id: 3b6cb4556d214d66df54bca2662d7ef408f367bf@1330 46e82423-29d8-e211-989e-002590a4cdd4
<? # $Id: graphclick.php,v 1.1.2.2 2002-04-20 04:55:50 dan Exp $ # $cache_dir = "/tmp/"; if (!isset($id)) $id=0; $map = file($cache_dir."FreshPorts.graph".$id.".map"); if (count($map) == 0) { die("GRAPH: invalid id"); } foreach ($map as $m) { list($y,$p) = split(":",$m); $map_y[] = $y; $map_p[] = $p; } $i = ...
<? # $Id: graphclick.php,v 1.1.2.1 2002-04-19 20:26:05 dan Exp $ # $cache_dir = "/tmp/"; if (!isset($id)) $id=0; $map = file($cache_dir."graph".$id.".map"); if (count($map) == 0) { die("GRAPH: invalid id"); } foreach ($map as $m) { list($y,$p) = split(":",$m); $map_y[] = $y; $map_p[] = $p; } $i = 0; while ($...
Create a new variable in the php-proxy and set to the default proxyParam value
<?php // Set this to true if you want to be able to load images from a url that doesn't // end in an image file extension. E.g. through another proxy of kinds. define('ALLOW_NO_EXT', false); $proxyParam = 'camanProxyUrl'; if (!$_GET[$proxyParam]) { exit; } // Grab the URL $url = trim(urldecode($_GET[$proxyParam]))...
<?php // Set this to true if you want to be able to load images from a url that doesn't // end in an image file extension. E.g. through another proxy of kinds. define('ALLOW_NO_EXT', false); if (!$_GET['url']) { exit; } // Grab the URL $url = trim(urldecode($_GET['url'])); $urlinfo = parse_url($url, PHP_URL_PATH);...
Fix platform status url of webkit
'use strict'; const assert = require('assert'); const url = require('url'); /** * @param engine {string} * @param id {string} * @returns {string} */ function getPlatformStatusId(engine, id) { return engine + '-' + encodeURIComponent(id); } const PLATFORM_STATUS_URL_MAP = new Map([ ['chromium', 'https://...
'use strict'; const assert = require('assert'); const url = require('url'); /** * @param engine {string} * @param id {string} * @returns {string} */ function getPlatformStatusId(engine, id) { return engine + '-' + encodeURIComponent(id); } const PLATFORM_STATUS_URL_MAP = new Map([ ['chromium', 'https://...
Enable animations in bridgeless mode on iOS Reviewed By: ejanzer Differential Revision: D21465166 fbshipit-source-id: b34e8e97330b897e20d9a4b05dba1826df569e16
/** * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * * @flow * @format */ 'use strict'; import Platform from '../../Utilities/Platform'; import typeof AnimatedFlatList from './comp...
/** * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * * @flow * @format */ 'use strict'; import Platform from '../../Utilities/Platform'; import typeof AnimatedFlatList from './comp...
Add branch and state check on CD server.
// Continuous delivery server const { spawn } = require('child_process') const { resolve } = require('path') const { createServer } = require('http') const { urlencoded } = require('body-parser') const hostname = '127.0.0.1' const port = 80 const server = createServer((req, res) => { const { headers, method, url } =...
// Continuous delivery server const { spawn } = require('child_process') const { resolve } = require('path') const { createServer } = require('http') const { urlencoded } = require('body-parser') const hostname = '127.0.0.1' const port = 80 const server = createServer((req, res) => { const { headers, method, url } =...
Implement proposed changes + add `== null` check
import store from '../../store'; export default (key, params = null) => { if (!store.getters['localisation/isInitialised']) { return key; } let translation = store.getters['localisation/__'](key); if (typeof translation === 'undefined' || translation == null) { translation = key; ...
import store from '../../store'; const __ = store.getters[ 'localisation/__' ]; export default function (key, params) { if (!store.getters[ 'localisation/isInitialised' ]) { return key; } let translation = __(key); if (typeof translation === 'undefined' && store.state.localisation.ke...
Increment version to 0.4.0 for release
from setuptools import setup version = "0.4.0" setup( name="arxiv", version=version, packages=["arxiv"], # dependencies install_requires=[ 'feedparser', 'requests', 'pytest-runner', ], tests_require=[ "pytest", ], # metadata for upload to PyPI a...
from setuptools import setup version = "0.3.1" setup( name="arxiv", version=version, packages=["arxiv"], # dependencies install_requires=[ 'feedparser', 'requests', 'pytest-runner', ], tests_require=[ "pytest", ], # metadata for upload to PyPI a...
Add Audience group job failed type: AUDIENCE_GROUP_AUDIENCE_INSUFFICIENT
/* * Copyright 2020 LINE Corporation * * LINE Corporation licenses this file to you 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 re...
/* * Copyright 2020 LINE Corporation * * LINE Corporation licenses this file to you 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 re...
Enhance the dotted name lookup functionality.
# -*- coding: utf-8 -*- import os import pkgutil from mako.lookup import TemplateLookup from mako.template import Template class DottedTemplateLookup(TemplateLookup): def __init__(self, pkg): self.dfltpkg = pkg def adjust_uri(self, uri, relto): return uri def get_template(self, name):...
# -*- coding: utf-8 -*- import os import pkgutil from mako.lookup import TemplateLookup from mako.template import Template class DottedTemplateLookup(TemplateLookup): def __init__(self, pkg): self.dfltpkg = pkg def adjust_uri(self, uri, relto): return uri def get_template(self, name):...
feat: Add actions for add expense form
import Ember from 'ember'; // import $ from 'jquery'; export default Ember.Component.extend({ expense: { sum: null, category: '', name: '' }, currency: '£', expenseCategories: [ 'Charity', 'Clothing', 'Education', 'Events', 'Food', 'Gifts', 'Healthcare', 'Household',...
import Ember from 'ember'; import $ from 'jquery'; export default Ember.Component.extend({ expense: { sum: null, category: '', name: '' }, currency: '£', expenseCategories: [ 'Charity', 'Clothing', 'Education', 'Events', 'Food', 'Gifts', 'Healthcare', 'Household', ...
Add version flag to usage info Closes #8
#!/usr/bin/env node var readJson = require('read-package-json'); var minimist = require('minimist'); var path = require('path'); var url = require('url'); var shields = require('../'); var argv = minimist(process.argv.slice(2), { alias: { v: 'version' } }); if (argv.version) { console.log(require('../pack...
#!/usr/bin/env node var readJson = require('read-package-json'); var minimist = require('minimist'); var path = require('path'); var url = require('url'); var shields = require('../'); var argv = minimist(process.argv.slice(2), { alias: { v: 'version' } }); if (argv.version) { console.log(require('../pack...
Update script to remove empty line
const fs = require('fs'); const components = process.argv.slice(2); const componentDefaultContent = componentName => `import React, { Component, PropTypes, } from 'react'; class ${componentName} extends Component { render() { return ( <div></div> ); } } export default ${componentName}; `; cons...
#!/usr/bin/env node const fs = require('fs'); const components = process.argv.slice(2); const componentDefaultContent = componentName => ` import React, { Component, PropTypes, } from 'react'; class ${componentName} extends Component { render() { return ( <div></div> ); } } export default ${co...
Clear config on configVersion change: A v7 test failed when we restore the full config object. Try restoring only the two fields that get changed. [#1702476450](https://www.pivotaltracker.com/story/show/170247645) Authored-by: Eric Promislow <6c389fa4d719bbeec88fea52ca3b2497804923ad@suse.com>
package isolated import ( helpers "code.cloudfoundry.org/cli/integration/helpers" "code.cloudfoundry.org/cli/util/configv3" . "github.com/onsi/ginkgo" . "github.com/onsi/gomega" ) var _ = Describe("Config", func() { Describe("Version Management", func() { var oldTarget string var oldVersion int BeforeEach...
package isolated import ( helpers "code.cloudfoundry.org/cli/integration/helpers" "code.cloudfoundry.org/cli/util/configv3" . "github.com/onsi/ginkgo" . "github.com/onsi/gomega" ) var _ = Describe("Config", func() { Describe("Version Management", func() { var oldConfig *configv3.Config BeforeEach(func() { ...
Revert "Revert "Added nickname and punct, removed parens"" This reverts commit ab4e279a6866d432cd1f58a07879e219360b4911.
import random ateball = [ "It is certain.", "It is decidedly so.", "Without a doubt.", "Yes, definitely.", "You may rely on it.", "As I see it, yes.", "Most likely.", "Outlook good.", "Yes.", "Signs point to yes.", "Reply hazy, try...
import random ateball = [ "It is certain", "It is decidedly so", "Without a doubt", "Yes definitely", "You may rely on it", "As I see it yes", "Most likely", "Outlook good", "Yes", "Signs point to yes", "Reply hazy try again", ...
Add a fake prices endpoint
"use strict"; var express = require("express"); module.exports = function () { var app = express(); // Allow all domains to request data (see CORS for more details) app.use(function (req, res, next) { res.set("Access-Control-Allow-Origin", "*"); next(); }); // fake handler for the books endpoin...
"use strict"; var express = require("express"); module.exports = function () { var app = express(); // Allow all domains to request data (see CORS for more details) app.use(function (req, res, next) { res.set("Access-Control-Allow-Origin", "*"); next(); }); // fake handler for the books endpoin...
Revert "small refactor: use _.once only for watch" This reverts commit 6de0d1f1cc11374b412bf26103ab5c29afbeee0a.
'use strict'; const _ = require('lodash/fp'); const webpack = require('webpack'); const wpConfig = require('../../config/webpack.config.specs'); const {watchMode} = require('../utils'); module.exports = (gulp, plugins) => { gulp.task('bundle:specs', done => { plugins.util.log('Bundling specs with Webpack'); ...
'use strict'; const _ = require('lodash/fp'); const webpack = require('webpack'); const wpConfig = require('../../config/webpack.config.specs'); const {watchMode} = require('../utils'); module.exports = (gulp, plugins) => { gulp.task('bundle:specs', done => { plugins.util.log('Bundling specs with Webpack'); ...
Hide loading icon for unauthorized Fixes #44
// Ensure namespace housing exists var housing = housing || {}; /** * housing.app * * This is the entry point for the housing selection application. * This function sets up elements on the page for the housing library * functions in housing.js so that changes can be made to the page * template HTML without inter...
// Ensure namespace housing exists var housing = housing || {}; /** * housing.app * * This is the entry point for the housing selection application. * This function sets up elements on the page for the housing library * functions in housing.js so that changes can be made to the page * template HTML without inter...
Update new recs view and controller 2
craftEd.controller('RecsController', ['$scope', '$http', '$location', function($scope, $http, $location){ var config = { headers: { 'content-type': 'application/json' } }; var tokens = { headers: { "access-token": window.sessionStorage.token, "token-type": "Bearer", "client":...
craftEd.controller('RecsController', ['$scope', '$http', '$location', function($scope, $http, $location){ var config = { headers: { 'content-type': 'application/json' } }; var tokens = { headers: { "access-token": window.sessionStorage.token, "token-type": "Bearer", "client":...
Print error if the composition file cannot be found
package eu.netide.core.management.cli; import eu.netide.core.api.IBackendManager; import eu.netide.core.management.ManagementHandler; import org.apache.karaf.shell.commands.Argument; import org.apache.karaf.shell.commands.Command; import org.apache.karaf.shell.console.OsgiCommandSupport; import java.nio.file.Files; i...
package eu.netide.core.management.cli; import eu.netide.core.api.IBackendManager; import eu.netide.core.management.ManagementHandler; import org.apache.karaf.shell.commands.Argument; import org.apache.karaf.shell.commands.Command; import org.apache.karaf.shell.console.OsgiCommandSupport; import java.nio.file.Files; i...
Fix fetch api when returning non-JSON
export default class HttpApi { constructor (prefix = '') { this.prefix = prefix this.opts = { credentials: 'same-origin', headers: new Headers({ 'Content-Type': 'application/json', }) } return this.callApi } callApi = (method, url, opts = {}) => { opts = Object.assi...
export default class HttpApi { constructor (prefix = '') { this.prefix = prefix this.opts = { credentials: 'same-origin', headers: new Headers({ 'Content-Type': 'application/json', }) } return this.callApi } callApi = (method, url, opts = {}) => { opts = Object.assi...
Remove extraneous quote in asserter dockstring
from pprint import pformat def assert_calls_equal(expected, actual): """ Check whether the given mock object (or mock method) calls are equal and return a nicely formatted message. """ if not expected == actual: raise_calls_differ_error(expected, actual) def raise_calls_differ_error(expe...
from pprint import pformat def assert_calls_equal(expected, actual): """ Check whether the given mock object (or mock method) calls are equal and return a nicely formatted message. """ if not expected == actual: raise_calls_differ_error(expected, actual) def raise_calls_differ_error(expe...
Save selected theme in localStorage
'use strict'; var $themeIcons = null; var $themeLink = null; var storage = (function () { var key = 'theme'; return { load: function () { return window.localStorage[key]; }, save: function (name) { window.localStorage[key] = name; } }; }()); var loadTheme = function (theme) { $...
'use strict'; var themeIcons = null; var themeLink = null; var loadTheme = function (src) { themeLink.href = src; }; var putIcon = (function () { var newIcon = function () { var div = document.createElement('div'); div.className = 'icon'; themeIcons.appendChild(div); return div; }; return ...
Set collected css classes on set operators
var RoundNode = require("./RoundNode"); module.exports = (function () { var radius = 40; var o = function (graph) { RoundNode.apply(this, arguments); var that = this, superHoverHighlightingFunction = that.setHoverHighlighting, superPostDrawActions = that.postDrawActions; this.radius(radius); this....
var RoundNode = require("./RoundNode"); module.exports = (function () { var radius = 40; var o = function (graph) { RoundNode.apply(this, arguments); var that = this, superHoverHighlightingFunction = that.setHoverHighlighting, superPostDrawActions = that.postDrawActions; this.radius(radius); this....
Disable INFO messages and down when running test suite
#!/usr/bin/env python # -*- coding: utf-8 -*- import os import sys import nose import logging logging.disable(logging.INFO) # Disable debug logging when running the test suite. def start(argv=None): sys.exitfunc = lambda: sys.stderr.write('Shutting down...\n') if argv is None: argv = [ ...
#!/usr/bin/env python # -*- coding: utf-8 -*- import os import sys import nose import logging logging.disable(logging.DEBUG) # Disable debug logging when running the test suite. def start(argv=None): sys.exitfunc = lambda: sys.stderr.write('Shutting down...\n') if argv is None: argv = [ ...
Fix the issue that xip.io can not be set in catalog
import Component from '@ember/component'; import { next } from '@ember/runloop'; import { get, set, observer } from '@ember/object' import layout from './template'; import { inject as service } from '@ember/service'; import C from 'shared/utils/constants'; export default Component.extend({ settings: service(), la...
import Component from '@ember/component'; import { get, set, observer } from '@ember/object' import layout from './template'; import { inject as service } from '@ember/service'; import C from 'shared/utils/constants'; export default Component.extend({ settings: service(), layout, value: '', mode: 'automatic'...
Add route recursive for open all level trad
'use strict' /** * @ngdoc overview * @name serinaApp * @description * # serinaApp * * Main module of the application. */ angular .module('serinaApp', [ 'ngAnimate', 'ngCookies', 'ngResource', 'ngRoute', 'ngSanitize', 'ngMaterial' ]) .config(function ($routeProvider) { $routePro...
'use strict' /** * @ngdoc overview * @name serinaApp * @description * # serinaApp * * Main module of the application. */ angular .module('serinaApp', [ 'ngAnimate', 'ngCookies', 'ngResource', 'ngRoute', 'ngSanitize', 'ngMaterial' ]) .config(function ($routeProvider) { $routePro...
Move User/Group/Company management to plugin-id
package org.ligoj.app.resource.message; import org.ligoj.app.api.NodeVo; import org.ligoj.app.api.SimpleUser; import org.ligoj.app.model.Message; import org.ligoj.app.plugin.id.resource.ContainerWithScopeVo; import org.ligoj.app.resource.project.ProjectLightVo; import lombok.Getter; import lombok.Setter; /** * A me...
package org.ligoj.app.resource.message; import org.ligoj.app.api.NodeVo; import org.ligoj.app.api.SimpleUser; import org.ligoj.app.model.Message; import org.ligoj.app.plugin.id.resource.ContainerWithTypeVo; import org.ligoj.app.resource.project.ProjectLightVo; import lombok.Getter; import lombok.Setter; /** * A mes...
Use file path to find catalog.xml file
package au.gov.ga.geodesy.support.spring; import java.io.FileNotFoundException; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.util.ResourceUtils; import au.gov.ga.geodesy.domain.model.SynchronousEventPublisher; import au.go...
package au.gov.ga.geodesy.support.spring; import java.io.FileNotFoundException; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.util.ResourceUtils; import au.gov.ga.geodesy.domain.model.SynchronousEventPublisher; import au.go...
Change name separator of the endpoint (can't use pipe duh).
var semver = require('semver'); var createError = require('./createError'); function decompose(endpoint) { var regExp = /^(?:([\w\-]|(?:[\w\.\-]+[\w\-])?)=)?([^\|#]+)(?:#(.*))?$/; var matches = endpoint.match(regExp); if (!matches) { throw createError('Invalid endpoint: "' + endpoint + '"', 'EINVE...
var semver = require('semver'); var createError = require('./createError'); function decompose(endpoint) { var regExp = /^(?:([\w\-]|(?:[\w\.\-]+[\w\-])?)\|)?([^\|#]+)(?:#(.*))?$/; var matches = endpoint.match(regExp); if (!matches) { throw createError('Invalid endpoint: "' + endpoint + '"', 'EINV...
Clean up pulling README.rst and CHANGELOG.rst into the long_description
#!/usr/bin/env python import twelve import twelve.adapters import twelve.services try: from setuptools import setup except ImportError: from distutils.core import setup setup( name="twelve", version=twelve.__version__, description="12factor inspired settings for a variety of backing services arche...
#!/usr/bin/env python import twelve import twelve.adapters import twelve.services try: from setuptools import setup except ImportError: from distutils.core import setup setup( name="twelve", version=twelve.__version__, description="12factor inspired settings for a variety of backing services arche...
examples: Add missing uppy.socket call to S3 example
const uppy = require('uppy-server') const app = require('express')() app.use(require('cors')()) app.use(require('body-parser').json()) const options = { providerOptions: { s3: { getKey: (req, filename) => `whatever/${Math.random().toString(32).slice(2)}/${filename}`, key: process.env.UPPYSER...
const uppy = require('uppy-server') const app = require('express')() app.use(require('cors')()) app.use(require('body-parser').json()) app.use(uppy.app({ providerOptions: { s3: { getKey: (req, filename) => `whatever/${Math.random().toString(32).slice(2)}/${filename}`, key: process.env.UPPYSE...
Add missing id fields in readings and events Signed-off-by: Federico Claramonte <9aaaa8bfe6a7a51765b462c528e1446dcf049286@caviumnetworks.com>
// // Copyright (c) 2017 Mainflux // // SPDX-License-Identifier: Apache-2.0 // package export // Message - Encapsulating / wrapper message object that contains Event // to be exported and the client export registration details type Message struct { Registration Registration Evt Event } // Event - packet o...
// // Copyright (c) 2017 Mainflux // // SPDX-License-Identifier: Apache-2.0 // package export // Message - Encapsulating / wrapper message object that contains Event // to be exported and the client export registration details type Message struct { Registration Registration Evt Event } // Event - packet o...
Fix on teeny tiny little typo... Also remember to write commit messages in the present tense.
people = 30 cars = 40 buses = 55 if cars > people: print "We should take the cars." elif cars < people: print "We should not take the cars." else: print "We can't decide." if buses > cars: print "That's too many buses." elif buses < cars: print "Maybe we could take the buses." else: print "We...
people = 30 cars = 40 buses = 55 if cars > people: print "We should take the cars." elif cars < people: print "We should not take the cars." else: print "We can't decide." if buses > cars: print "That's too many buses." elif buses < cars: print "Maybe we could take the buses." else: print "We...
Store the player keys in the preserved games
from persistent_dict import * class PreservedGame(): def __init__(self, game): self.rules = game.rules # .clone? self.player = [None, game.player[1].key(), game.player[2].key()] self.move_history = game.move_history[:] def game_name(self): return "Freddo" # TODO class AllPr...
from persistent_dict import * class PreservedGame(): def game_name(self): return "Freddo" # TODO class AllPreservedGames(): def __init__(self, filename): self.games = PersistentDict(filename, 'c', format='pickle') def add_game(self, pg): self.games[pg.game_name()] = pg sel...
Add login failed flash message
from django.http import HttpResponseRedirect from django.shortcuts import render from django.core.urlresolvers import reverse from django.contrib.auth import authenticate, login as auth_login, logout as auth_logout from django.contrib.auth.decorators import login_required from cloudfish.models import Cloud def login(...
from django.http import HttpResponseRedirect from django.shortcuts import render from django.core.urlresolvers import reverse from django.contrib.auth import authenticate, login as auth_login, logout as auth_logout from django.contrib.auth.decorators import login_required from cloudfish.models import Cloud def login(...
Fix flake8 error in travis
from flask import abort, Blueprint, jsonify from httpobs import SOURCE_URL, VERSION from httpobs.database import get_cursor monitoring_api = Blueprint('monitoring-api', __name__) @monitoring_api.route('/__heartbeat__') def heartbeat(): # TODO: check celery status try: # Check the database w...
from flask import abort, Blueprint, jsonify from httpobs import SOURCE_URL, VERSION from httpobs.conf import BROKER_URL from httpobs.database import get_cursor import kombu monitoring_api = Blueprint('monitoring-api', __name__) @monitoring_api.route('/__heartbeat__') def heartbeat(): # TODO: check celery statu...
Fix the "skip over files beginning with a dot" feature
<?php /** * Functions file * * This file is for general purpose functions required by the front controller * and any other output-related features. * * @version 1.0.3 * @author Teppo Koivula <teppo.koivula@gmail.com> * @license http://www.gnu.org/licenses/gpl-2.0.txt GNU General Public License, version 2 */ ...
<?php /** * Functions file * * This file is for general purpose functions required by the front controller * and any other output-related features. * * @version 1.0.2 * @author Teppo Koivula <teppo.koivula@gmail.com> * @license http://www.gnu.org/licenses/gpl-2.0.txt GNU General Public License, version 2 */ ...
Add missing preventDefault when opening links in _blank window
$(document).on('click', 'a', function(event) { var lnk = event.currentTarget; //for backwards compatibility var rels = lnk.rel.split(' '); $.each(rels, function() { if (this.match(/^popup/)) { var relProperties = this.split('_'); //$(lnk).addClass('webLinkPopup'); ...
$(document).on('click', 'a', function(event) { var lnk = event.currentTarget; //for backwards compatibility var rels = lnk.rel.split(' '); $.each(rels, function() { if (this.match(/^popup/)) { var relProperties = this.split('_'); //$(lnk).addClass('webLinkPopup'); ...
Split the version metric out to its own package
/* Copyright 2016 The Kubernetes 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 applicable law or agreed to in writing, ...
/* Copyright 2016 The Kubernetes 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 applicable law or agreed to in writing, ...
Set the final version number
"""Rachiopy setup script.""" from setuptools import find_packages, setup from datetime import datetime VERSION = "1.0.0" GITHUB_USERNAME = "rfverbruggen" GITHUB_REPOSITORY = "rachiopy" GITHUB_PATH = f"{GITHUB_USERNAME}/{GITHUB_REPOSITORY}" GITHUB_URL = f"https://github.com/{GITHUB_PATH}" DOWNLOAD_URL = f"{GITHUB_UR...
"""Rachiopy setup script.""" from setuptools import find_packages, setup from datetime import datetime NOW = datetime.now().strftime("%m/%d/%Y%H%M%S") VERSION = f"1.0.0-dev{NOW}" GITHUB_USERNAME = "rfverbruggen" GITHUB_REPOSITORY = "rachiopy" GITHUB_PATH = f"{GITHUB_USERNAME}/{GITHUB_REPOSITORY}" GITHUB_URL = f"htt...
Fix issue with startsWith not existing(?)
/* global angular */ angular.module('app') .factory('Storage', function ($window) { 'use strict'; function getItem(key) { var value = $window.localStorage.getItem(key); if (value) { return JSON.parse(value); } else { return null; } } function setItem(key, value) { $window.localStorage.setItem(key...
/* global angular */ angular.module('app') .factory('Storage', function ($window) { 'use strict'; function getItem(key) { var value = $window.localStorage.getItem(key); if (value) { return JSON.parse(value); } else { return null; } } function setItem(key, value) { $window.localStorage.setItem(key...
Remove explicit named export from rollup
import babel from 'rollup-plugin-babel' import babelrc from 'babelrc-rollup' import replace from 'rollup-plugin-replace' import commonjs from 'rollup-plugin-commonjs' import resolve from 'rollup-plugin-node-resolve' let pkg = require('./package.json') let external = Object.keys(pkg.peerDependencies) const config = { ...
import babel from 'rollup-plugin-babel' import babelrc from 'babelrc-rollup' import replace from 'rollup-plugin-replace' import commonjs from 'rollup-plugin-commonjs' import resolve from 'rollup-plugin-node-resolve' let pkg = require('./package.json') let external = Object.keys(pkg.peerDependencies) const config = { ...
Fix BC for older PHPCodeCoverage versions
<?php namespace Paraunit\Proxy\Coverage; use Paraunit\Configuration\OutputFile; use SebastianBergmann\CodeCoverage\Report\Text; /** * Class TextResult * @package Paraunit\Proxy\Coverage */ class TextResult { /** @var Text */ private $text; /** * TextResult constructor. */ public functi...
<?php namespace Paraunit\Proxy\Coverage; use Paraunit\Configuration\OutputFile; use SebastianBergmann\CodeCoverage\Report\Text; /** * Class TextResult * @package Paraunit\Proxy\Coverage */ class TextResult { /** @var Text */ private $text; /** * TextResult constructor. */ public functi...
Fix deprecation notice: The method bindCallback will require a new argument in next major version back_consumer_1 | consumer1 | [2019-05-24 12:57:13] php.INFO: User Deprecated: The "Enqueue\Consumption\QueueConsumer::bindCallback()" method will require a new "string|InteropQueue $queueName" argument in the next majo...
<?php namespace Enqueue\Consumption; use Interop\Queue\Context; use Interop\Queue\Processor; use Interop\Queue\Queue as InteropQueue; interface QueueConsumerInterface { /** * In milliseconds. */ public function setReceiveTimeout(int $timeout): void; /** * In milliseconds. */ publ...
<?php namespace Enqueue\Consumption; use Interop\Queue\Context; use Interop\Queue\Processor; use Interop\Queue\Queue as InteropQueue; interface QueueConsumerInterface { /** * In milliseconds. */ public function setReceiveTimeout(int $timeout): void; /** * In milliseconds. */ publ...
Check that Apache Commons DBCP2 is on the classpath before trying to use it.
package org.springframework.cloud.service.relational; import javax.sql.DataSource; import org.springframework.cloud.service.ServiceConnectorConfig; import org.springframework.cloud.service.common.RelationalServiceInfo; import static org.springframework.cloud.service.Util.hasClass; /** * * @author Ramnivas Laddad ...
package org.springframework.cloud.service.relational; import javax.sql.DataSource; import org.springframework.cloud.service.ServiceConnectorConfig; import org.springframework.cloud.service.common.RelationalServiceInfo; /** * * @author Ramnivas Laddad * @author Scott Frederick * * @param <SI> the {@link Relation...
Add feature: error handling for paste command
package me.jacobcrofts.simplestructureloader.commands; import java.io.IOException; import org.bukkit.ChatColor; import org.bukkit.GameMode; import org.bukkit.command.Command; import org.bukkit.command.CommandExecutor; import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; import org.json.simple.par...
package me.jacobcrofts.simplestructureloader.commands; import java.io.IOException; import org.bukkit.command.Command; import org.bukkit.command.CommandExecutor; import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; import org.json.simple.parser.ParseException; import me.jacobcrofts.simplestructur...
Add query for deleting a migration
'use strict'; module.exports = { CREATE_MIGRATIONS_TABLE: `CREATE TABLE "_migrations" ( id SERIAL UNIQUE PRIMARY KEY, version VARCHAR(255) NOT NULL, name VARCHAR(255) NOT NULL, date TIMESTAMP DEFAULT now() );`, CHECK_MIGRATIONS_TABLE_EXISTENCE: `SELECT EXISTS ( SELECT 1 FROM pg_cata...
'use strict'; module.exports = { CREATE_MIGRATIONS_TABLE: `CREATE TABLE "_migrations" ( id SERIAL UNIQUE PRIMARY KEY, version VARCHAR(255) NOT NULL, name VARCHAR(255) NOT NULL, date TIMESTAMP DEFAULT now() );`, CHECK_MIGRATIONS_TABLE_EXISTENCE: `SELECT EXISTS ( SELECT 1 FROM pg_cata...
Fix the second parameter passing to onUpdate
/** * @jsx React.DOM */ 'use strict'; var React = require('react/addons'); var cx = React.addons.classSet; var FormMixin = require('./FormMixin'); var FormFor = require('./FormFor'); var v = require('./validation'); var Form = React.createClass({ mixins: [FormMixin], propTypes: { compo...
/** * @jsx React.DOM */ 'use strict'; var React = require('react/addons'); var cx = React.addons.classSet; var FormMixin = require('./FormMixin'); var FormFor = require('./FormFor'); var v = require('./validation'); var Form = React.createClass({ mixins: [FormMixin], propTypes: { compo...
Allow dynamicObject update only when session is of type admin
<?php /** * @package plugins.metadata * @subpackage model */ class MetadataDynamicObjectPeer extends MetadataPeer implements IMetadataPeer { public static function validateMetadataObjects($profileField, $objectIds, &$errorMessage) { /** @var MetadataProfileField $profileField */ $subMetadataProf...
<?php /** * @package plugins.metadata * @subpackage model */ class MetadataDynamicObjectPeer extends MetadataPeer implements IMetadataPeer { public static function validateMetadataObjects($profileField, $objectIds, &$errorMessage) { /** @var MetadataProfileField $profileField */ $subMetadataProf...
Add reminder comment on wheel creation
# -*- coding: utf-8 -*- from setuptools import setup, find_packages from aldryn_categories import __version__ # git tag '[version]' # git push --tags origin master # python setup.py sdist upload # python setup.py bdist_wheel upload setup( name='aldryn-categories', version=__version__, url='https://github...
# -*- coding: utf-8 -*- from setuptools import setup, find_packages from aldryn_categories import __version__ # git tag '[version]' # git push --tags origin master # python setup.py sdist upload setup( name='aldryn-categories', version=__version__, url='https://github.com/aldryn/aldryn-categories', l...
Make exception more specific when retrieving a calendar type that does not exist in the calendar factory.
<?php namespace Plummer\Calendarful\Calendar; class CalendarFactory implements CalendarFactoryInterface { private $calendarTypes = []; public function addCalendarType($type, $calendarType) { if(is_string($calendarType) and !class_exists($calendarType)) { throw new \InvalidArgumentException("Class {$calendarT...
<?php namespace Plummer\Calendarful\Calendar; class CalendarFactory implements CalendarFactoryInterface { private $calendarTypes = []; public function addCalendarType($type, $calendarType) { if(is_string($calendarType) and !class_exists($calendarType)) { throw new \InvalidArgumentException("Class {$calendarT...
Use this.ui.write instead of console.log.
/* eslint-env node */ const path = require('path'); let TsPreprocessor; try { TsPreprocessor = require('./lib/typescript-preprocessor'); } catch (ex) { // Do nothing; we just won't have the plugin available. This means that if you // somehow end up in a state where it doesn't load, the preprocessor *will* // f...
/* eslint-env node */ 'use strict'; var path = require('path'); var process = require('process'); let TsPreprocessor; try { TsPreprocessor = require('./lib/typescript-preprocessor'); } catch ( ex ) { // Do nothing; we just won't have the plugin available. This means that if you // somehow end up in a state...
Allow empty properties in Property action.
/******************************************************************************* * Copyright 2014 Rafael Garcia Moreno. * * 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://w...
/******************************************************************************* * Copyright 2014 Rafael Garcia Moreno. * * 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://w...
Use container-sm on the index page also
@extends('layouts.master') @section('title', 'Do you know the way?') @section('content') <div class="container-sm text-center"> <p>{{ env('DOMAIN') }} is a private file hosting website.</p> <p>Accounts are given with approval from {{ env('OWNER_NAME') }} &lt;<a href="mailto:{{ ...
@extends('layouts.master') @section('title', 'Do you know the way?') @section('content') <div class="text-center"> <p>{{ env('DOMAIN') }} is a private file hosting website.</p> <p>Accounts are given with approval from {{ env('OWNER_NAME') }} &lt;<a href="mailto:{{ env('OWNER_EM...
Add test for tiles (correct number)
<?php namespace Tests\AppBundle\API; use AppBundle\API\FlowerColor; use Symfony\Bundle\FrameworkBundle\Test\KernelTestCase; class FlowerColorTest extends KernelTestCase { /** * @var \Doctrine\Bundle\DoctrineBundle\Registry */ private $doctrine; private $flowerColor; /** * {@inheritDoc...
<?php namespace Tests\AppBundle\API; use AppBundle\API\FlowerColor; use Symfony\Bundle\FrameworkBundle\Test\KernelTestCase; class FlowerColorTest extends KernelTestCase { /** * @var \Doctrine\Bundle\DoctrineBundle\Registry */ private $doctrine; private $flowerColor; /** * {@inheritDoc...
Add another polling command test.
package org.jenkinsci.plugins.visualworks_store; import hudson.util.ArgumentListBuilder; import org.junit.Test; import java.util.Arrays; import java.util.List; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertTrue; public class StoreSCMTest { @Test public void preparesPollin...
package org.jenkinsci.plugins.visualworks_store; import hudson.util.ArgumentListBuilder; import org.junit.Test; import java.util.Arrays; import java.util.List; import static org.junit.Assert.assertEquals; public class StoreSCMTest { @Test public void preparesPollingCommandForSinglePundle() { List<Pu...
Set default priority level to None
from __future__ import unicode_literals from functools import total_ordering from binary_heap import BinaryHeap @total_ordering # Will build out the remaining comparison methods class QNode(object): """A class for a queue node.""" def __init__(self, val, priority=None): super(QNode, self).__init__()...
from __future__ import unicode_literals from functools import total_ordering from binary_heap import BinaryHeap @total_ordering # Will build out the remaining comparison methods class QNode(object): """A class for a queue node.""" def __init__(self, val, priority): super(QNode, self).__init__() ...
Fix type mismatch in default API version JSDoc.
/** * index.js * Client entry point. * * @author Francis Brito <fr.br94@gmail.com> * @license MIT */ 'use strict'; /** * Client * Provides methods to access PrintHouse's API. * * @param {String} apiKey API key identifying account owner. * @param {Object} opts Contains options to be passed to the clien...
/** * index.js * Client entry point. * * @author Francis Brito <fr.br94@gmail.com> * @license MIT */ 'use strict'; /** * Client * Provides methods to access PrintHouse's API. * * @param {String} apiKey API key identifying account owner. * @param {Object} opts Contains options to be passed to the clien...
Reformat code and optimize imports.
package org.ops4j.pax.web.service.internal.model; import javax.servlet.Filter; public class FilterModel extends BasicModel { private final Filter m_filter; private final String[] m_urlPatterns; private final String[] m_servletNames; public FilterModel( final Filter filter, fi...
package org.ops4j.pax.web.service.internal.model; import javax.servlet.Filter; public class FilterModel extends BasicModel { private final Filter m_filter; private final String[] m_urlPatterns; private final String[] m_servletNames; public FilterModel( final Filter filter, ...
Add cDatePublic to indexed search result constructor Former-commit-id: 5c4c6da19612c683470a11ed997e515bed375b7f
<? defined('C5_EXECUTE') or die("Access Denied."); class Concrete5_Library_IndexedSearchResult { public function __construct($id, $name, $description, $score, $cPath, $content, $cDatePublic = false) { $this->cID = $id; $this->cName = $name; $this->cDescription = $description; $this->score = $score; $this-...
<? defined('C5_EXECUTE') or die("Access Denied."); class Concrete5_Library_IndexedSearchResult { public function __construct($id, $name, $description, $score, $cPath, $content) { $this->cID = $id; $this->cName = $name; $this->cDescription = $description; $this->score = $score; $this->cPath = $cPath; $th...
Fix CommentModel m2m null warning
# -*- coding: utf-8 -*- import os from django.db import models from django.conf import settings class UserModel(models.Model): name = models.CharField(max_length=20) upload_to = os.path.join(settings.FILE_STORAGE_DIR, 'test_serializers') class CommentModel(models.Model): user = models.ForeignKey( ...
# -*- coding: utf-8 -*- import os from django.db import models from django.conf import settings class UserModel(models.Model): name = models.CharField(max_length=20) upload_to = os.path.join(settings.FILE_STORAGE_DIR, 'test_serializers') class CommentModel(models.Model): user = models.ForeignKey( ...
Change the default number of engines to 4. Only 4 are needed for our current tests.
""" Simple runner for `ipcluster start` or `ipcluster stop` on Python 2 or 3, as appropriate. """ import sys import six from subprocess import Popen, PIPE if six.PY2: ipcluster_cmd = 'ipcluster' elif six.PY3: ipcluster_cmd = 'ipcluster3' else: raise NotImplementedError("Not run with Python 2 *or* 3?") ...
""" Simple runner for `ipcluster start` or `ipcluster stop` on Python 2 or 3, as appropriate. """ import sys import six from subprocess import Popen, PIPE if six.PY2: ipcluster_cmd = 'ipcluster' elif six.PY3: ipcluster_cmd = 'ipcluster3' else: raise NotImplementedError("Not run with Python 2 *or* 3?") ...
Update documentation for Route53 service
/** * Copyright 2012-2013 Amazon.com, Inc. or its affiliates. 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. A copy of * the License is located at * * http://aws.amazon.com/apache2.0/ * * or in the ...
/** * Copyright 2012-2013 Amazon.com, Inc. or its affiliates. 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. A copy of * the License is located at * * http://aws.amazon.com/apache2.0/ * * or in the ...
Add method to count filled bytes Calculate the sum of element's filledBytes().
package net.ihiroky.niotty.buffer; import java.util.ArrayDeque; import java.util.Deque; import java.util.Iterator; /** * @author Hiroki Itoh */ public class EncodeBufferGroup implements Iterable<EncodeBuffer> { private Deque<EncodeBuffer> group = new ArrayDeque<>(); public void addLast(EncodeBuffer encode...
package net.ihiroky.niotty.buffer; import java.util.ArrayDeque; import java.util.Deque; import java.util.Iterator; /** * @author Hiroki Itoh */ public class EncodeBufferGroup implements Iterable<EncodeBuffer> { private Deque<EncodeBuffer> group = new ArrayDeque<>(); public void addLast(EncodeBuffer encode...
Switch ordering of short-circuited OR on line 12.
/*global require:true*/ var gutil = require('gulp-util'); var Grunticon = require( 'grunticon-lib' ); module.exports = function( files, config ) { "use strict"; return function(callback) { // get the config config.logger = { verbose: config.verbose || function() {}, fatal: function() {}, ...
/*global require:true*/ var gutil = require('gulp-util'); var Grunticon = require( 'grunticon-lib' ); module.exports = function( files, config ) { "use strict"; return function(callback) { // get the config config.logger = { verbose: function() {} || config.verbose, fatal: function() {}, ...
Remove output expect when there is an error.
''' Main command which is meant to be run daily to get the information from various social networks into the local db. ''' import traceback from django.core.management.base import BaseCommand, CommandError from django.core.exceptions import ImproperlyConfigured from socializr.base import get_socializr_configs clas...
''' Main command which is meant to be run daily to get the information from various social networks into the local db. ''' import traceback from django.core.management.base import BaseCommand, CommandError from django.core.exceptions import ImproperlyConfigured from socializr.base import get_socializr_configs clas...
Use array of TimeRanges to store availability
// Copyright 2019 Google LLC // // 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 // // https://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in ...
// Copyright 2019 Google LLC // // 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 // // https://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in ...
Add try for catching server error
from flask import Flask, render_template, url_for, redirect from flask import session, escape, request from peewee import * #from datetime import date app = Flask(__name__) # http://docs.peewee-orm.com/en/latest/peewee/quickstart.html database = SqliteDatabase('developmentData.db') #class Device(Model): # idNumber = ...
from flask import Flask, render_template, url_for, redirect from flask import session, escape, request from peewee import * #from datetime import date app = Flask(__name__) # http://docs.peewee-orm.com/en/latest/peewee/quickstart.html database = SqliteDatabase('developmentData.db') #class Device(Model): # idNumber = ...
Fix version warning when react isn't installed https://github.com/fusionjs/eslint-config-fusion/pull/140
// @flow module.exports = { extends: [ 'plugin:flowtype/recommended', 'plugin:react/recommended', 'plugin:jest/recommended', './rules/imports.js', // This comes last so that prettier-config can turn off appropriate rules given the order of precedence by eslint 'extends' require.resolve('eslint...
// @flow module.exports = { extends: [ 'plugin:flowtype/recommended', 'plugin:react/recommended', 'plugin:jest/recommended', './rules/imports.js', // This comes last so that prettier-config can turn off appropriate rules given the order of precedence by eslint 'extends' require.resolve('eslint...
Replace value even if not change event is triggered
/** * @class CM_FormField_Text * @extends CM_FormField_Abstract */ var CM_FormField_Text = CM_FormField_Abstract.extend({ _class: 'CM_FormField_Text', /** @type Boolean */ _skipTriggerChange: false, /** @type String */ _valueLast: null, events: { 'blur input, textarea': function() { this.tri...
/** * @class CM_FormField_Text * @extends CM_FormField_Abstract */ var CM_FormField_Text = CM_FormField_Abstract.extend({ _class: 'CM_FormField_Text', /** @type Boolean */ _skipTriggerChange: false, /** @type String */ _valueLast: null, events: { 'blur input, textarea': function() { this.tri...
Fix the blocking problem of NMSI with 2PC.
package fr.inria.jessy.protocol; import java.util.Set; import fr.inria.jessy.communication.JessyGroupManager; import fr.inria.jessy.store.DataStore; import fr.inria.jessy.transaction.ExecutionHistory; import fr.inria.jessy.transaction.termination.TwoPhaseCommit; import fr.inria.jessy.transaction.termination.vote.Vot...
package fr.inria.jessy.protocol; import java.util.Set; import fr.inria.jessy.communication.JessyGroupManager; import fr.inria.jessy.store.DataStore; import fr.inria.jessy.transaction.ExecutionHistory; import fr.inria.jessy.transaction.termination.TwoPhaseCommit; /** * This class implements Non-Monotonic Snapshot I...
Fix issue with extension point
from setuptools import setup, find_packages setup(name='pygments-hackasm-lexer', version='0.1', description='Pygments lexer for the Nand2Tetris Hack Assembler', packages = setuptools.find_packages(), url='https://github.com/cprieto/pygments_hack_asm', author='Cristian Prieto', autho...
from setuptools import setup, find_packages setup(name='pygments-hackasm-lexer', version='0.1', description='Pygments lexer for the Nand2Tetris Hack Assembler', packages = setuptools.find_packages(), url='https://github.com/cprieto/pygments_hack_asm', author='Cristian Prieto', autho...
Disable template cache if directory is not writable
<?php Class TemplateParser { static function find_template($template) { if (!file_exists($template)) { throw new Exception('\''.$template.'\' template not found.'); } return preg_replace('/.+\//', '', $template); } static function parse($data, $template) { $template = self::find_template...
<?php Class TemplateParser { static function find_template($template) { if (!file_exists($template)) { throw new Exception('\''.$template.'\' template not found.'); } return preg_replace('/.+\//', '', $template); } static function parse($data, $template) { $template = self::find_template...
Remove run player. Fix output
#!/usr/bin/env node 'use strict'; import program from 'commander'; import animeDl from 'anime-dl'; import chalk from 'chalk'; import updateNotifier from 'update-notifier'; import pkg from '../package.json'; updateNotifier({pkg}).notify(); program .version(pkg.version) .usage('-a <anime> -c <chapter>') .descri...
#!/usr/bin/env node 'use strict'; import {spawn} from 'child_process'; import program from 'commander'; import animeDl from 'anime-dl'; import chalk from 'chalk'; import updateNotifier from 'update-notifier'; import pkg from '../package.json'; updateNotifier({pkg}).notify(); program .version(pkg.version) .usage...
Add postgres as response processing for travis
DEBUG = False BROKER_URL = 'amqp://guest@localhost' RECORD_HTTP_TRANSACTIONS = False CELERY_EAGER_PROPAGATES_EXCEPTIONS = True RAW_PROCESSING = ['cassandra', 'postgres'] NORMALIZED_PROCESSING = ['elasticsearch', 'cassandra', 'postgres'] RESPONSE_PROCESSING = 'postgres' SENTRY_DSN = None USE_FLUENTD = False CASSA...
DEBUG = False BROKER_URL = 'amqp://guest@localhost' RECORD_HTTP_TRANSACTIONS = False CELERY_EAGER_PROPAGATES_EXCEPTIONS = True RAW_PROCESSING = ['cassandra', 'postgres'] NORMALIZED_PROCESSING = ['elasticsearch', 'cassandra', 'postgres'] RESPONSE_PROCESSING = None SENTRY_DSN = None USE_FLUENTD = False CASSANDRA_U...