text
stringlengths
16
4.96k
positive
stringlengths
321
2.24k
negative
stringlengths
310
2.21k
Increment the version to 0.9 and set to beta. Getting close to stable and 1.0 release.
from setuptools import find_packages, setup setup_args = dict( name='furious', version='0.9', license='Apache', description='Furious is a lightweight library that wraps Google App Engine' 'taskqueues to make building dynamic workflows easy.', author='Robert Kluin', author_email...
from setuptools import find_packages, setup setup_args = dict( name='furious', version='0.1', license='Apache', description='Furious is a lightweight library that wraps Google App Engine' 'taskqueues to make building dynamic workflows easy.', author='Robert Kluin', author_email...
Update server: remove process.env read
import express from 'express'; import bodyParser from 'body-parser'; import favicon from 'serve-favicon'; import path from 'path'; import helmet from 'helmet'; import fs from 'fs'; import webpackCommonConfig from '../../webpack/config'; import envConfig from '../config'; const app = express(); const outputPath = webpa...
import express from 'express'; import bodyParser from 'body-parser'; import favicon from 'serve-favicon'; import path from 'path'; import helmet from 'helmet'; import fs from 'fs'; import webpackCommonConfig from '../../webpack/config'; import envConfig from '../config'; const app = express(); const outputPath = webpa...
Make text labels break into multi-lines by default.
// @flow import React from 'react'; import PropTypes from 'prop-types'; import type { ReactChildren } from 'react-flow-types'; import FlexCell from './FlexCell'; import Tag from './Tag'; import wrapIfNotElement from './utils/wrapIfNotElement'; export type Props = { basic?: ReactChildren, tag?: ReactChildren,...
// @flow import React from 'react'; import PropTypes from 'prop-types'; import type { ReactChildren } from 'react-flow-types'; import FlexCell from './FlexCell'; import Tag from './Tag'; import TextEllipsis from './TextEllipsis'; import wrapIfNotElement from './utils/wrapIfNotElement'; export type Props = { basi...
Use content.outputFilePath and use pass sourcemap
var DtsCreator = require('typed-css-modules'); var loaderUtils = require('loader-utils'); var objectAssign = require('object-assign'); module.exports = function(source, map) { this.cacheable && this.cacheable(); var callback = this.async(); // Pass on query parameters as an options object to the DtsCreator. Thi...
var DtsCreator = require('typed-css-modules'); var loaderUtils = require('loader-utils'); var objectAssign = require('object-assign'); module.exports = function(source, map) { this.cacheable && this.cacheable(); var callback = this.async(); // Pass on query parameters as an options object to the DtsCreator. Thi...
Make status indicators more like current site
import React, { Component } from 'react'; import { StyleSheet, View, } from 'react-native'; import { UserStatus } from '../api'; const styles = StyleSheet.create({ common: { width: 12, height: 12, borderRadius: 100, }, active: { backgroundColor: '#44c21d', }, idle: { backgroundColor:...
import React, { Component } from 'react'; import { StyleSheet, View, } from 'react-native'; import { UserStatus } from '../api'; const styles = StyleSheet.create({ common: { width: 16, height: 16, borderRadius: 100, }, active: { borderColor: 'pink', backgroundColor: 'green', }, idle:...
Simplify 'wait until interrupt signal' code (thanks to Uriel on #go-nuts)
package main import ( "flag" "log" "os" "os/signal" ) var ( listen = flag.String("listen", ":8053", "set the listener address") flaglog = flag.Bool("log", false, "be more verbose") flagrun = flag.Bool("run", false, "run server") ) func main() { log.SetPrefix("geodns ") log.SetFlags(log.Lmicroseconds | log...
package main import ( "flag" "log" "os" "os/signal" ) var ( listen = flag.String("listen", ":8053", "set the listener address") flaglog = flag.Bool("log", false, "be more verbose") flagrun = flag.Bool("run", false, "run server") ) func main() { log.SetPrefix("geodns ") log.SetFlags(log.Lmicroseconds | log...
Update default value for backtesting clock
import decimal from datetime import datetime import click from .controller import Controller, SimulatedClock from .broker import OandaBacktestBroker from .instruments import InstrumentParamType from .lib import oandapy from .conf import settings @click.command() @click.option('--instrument', '-i', 'instruments', mu...
import decimal from datetime import datetime import click from .controller import Controller, SimulatedClock from .broker import OandaBacktestBroker from .instruments import InstrumentParamType from .lib import oandapy from .conf import settings @click.command() @click.option('--instrument', '-i', 'instruments', mu...
Remove unused lambda function pool from websocket server
import { Server } from 'ws' import debugLog from '../debugLog.js' import serverlessLog from '../serverlessLog.js' import { createUniqueId } from '../utils/index.js' export default class WebSocketServer { constructor(options, webSocketClients, sharedServer) { this._options = options this._server = new Server...
import { Server } from 'ws' import debugLog from '../debugLog.js' import LambdaFunctionPool from '../lambda/index.js' import serverlessLog from '../serverlessLog.js' import { createUniqueId } from '../utils/index.js' export default class WebSocketServer { constructor(options, webSocketClients, sharedServer) { th...
Use enumerator instead of lists
angular .module('ngSharepoint.Lists') .factory('JSOMConnector', function($q, $sp) { return ({ getLists: function() { return $q(function(resolve, reject) { var context = $sp.getContext(); var lists = context.get_web().get_lists(); ...
angular .module('ngSharepoint.Lists') .factory('JSOMConnector', function($q, $sp) { return ({ getLists: function() { return $q(function(resolve, reject) { var context = $sp.getContext(); var lists = context.get_web().get_lists(); ...
Handle differences between semver and PEP440 Signed-off-by: Sylvain Hellegouarch <16795633e2c1543064a3ad70ac3ba71d3d589b3b@defuze.org>
# -*- coding: utf-8 -*- from unittest.mock import patch import semver from chaostoolkit import __version__ from chaostoolkit.check import check_newer_version class FakeResponse: def __init__(self, status=200, url=None, response=None): self.status_code = status self.url = url self.respons...
# -*- coding: utf-8 -*- from unittest.mock import patch import semver from chaostoolkit import __version__ from chaostoolkit.check import check_newer_version class FakeResponse: def __init__(self, status=200, url=None, response=None): self.status_code = status self.url = url self.respons...
Disable filtering and sorting if not providing path
import { startCase } from "lodash"; export default schema => { let schemaToUse = schema; if (!schemaToUse.fields && Array.isArray(schema)) { schemaToUse = { fields: schema }; } schemaToUse = { ...schemaToUse }; schemaToUse.fields = schemaToUse.fields.map((field, i) => { let fieldToUse...
import { startCase } from "lodash"; export default schema => { let schemaToUse = schema; if (!schemaToUse.fields && Array.isArray(schema)) { schemaToUse = { fields: schema }; } schemaToUse = { ...schemaToUse }; schemaToUse.fields = schemaToUse.fields.map((field, i) => { let fieldToUse...
Revert "Remove unnecessary lock logging" This reverts commit ffce61611933786a9f01d01925fc154f6a7f1ecd.
var locks = require('locks'); //Map lock only used to create new partitionLocks entries var mapLock = locks.createMutex(); var partitionLocks = new Object(); var timeoutSeconds = 2; //key is unique for the namespace & partition. module.exports.lockedOperation = function lockedOperation (key, callback) { var keyStr =...
var locks = require('locks'); //Map lock only used to create new partitionLocks entries var mapLock = locks.createMutex(); var partitionLocks = new Object(); var timeoutSeconds = 2; //key is unique for the namespace & partition. module.exports.lockedOperation = function lockedOperation (key, callback) { var keyStr =...
Add cyrillic symbols support in mention regexp
// common chinese symbols: \u4e00-\u9eff - http://stackoverflow.com/a/1366113/837709 // hiragana (japanese): \u3040-\u309F - https://gist.github.com/ryanmcgrath/982242#file-japaneseregex-js // katakana (japanese): \u30A0-\u30FF - https://gist.github.com/ryanmcgrath/982242#file-japaneseregex-js // For an advanced explai...
// common chinese symbols: \u4e00-\u9eff - http://stackoverflow.com/a/1366113/837709 // hiragana (japanese): \u3040-\u309F - https://gist.github.com/ryanmcgrath/982242#file-japaneseregex-js // katakana (japanese): \u30A0-\u30FF - https://gist.github.com/ryanmcgrath/982242#file-japaneseregex-js // For an advanced explai...
Remove extension from grunt file
module.exports = function (grunt) { // Project configuration. grunt.initConfig({ ts: { default: { src: ["*.ts", "node_modules/dimensions/**/*.ts", "spec/**/*.ts"], outDir: 'build' }, options: { lib: ['es2015'] ...
module.exports = function (grunt) { // Project configuration. grunt.initConfig({ ts: { default: { src: ["*.ts", "node_modules/dimensions/**/*.ts", "extensions/1.3.5-patch/**/*.ts", "spec/**/*.ts"], outDir: 'build' }, options: { ...
Remove the logger from the heap
package io.quarkus.mutiny.runtime; import java.util.concurrent.ExecutorService; import java.util.function.BooleanSupplier; import java.util.function.Consumer; import org.jboss.logging.Logger; import io.quarkus.runtime.annotations.Recorder; import io.smallrye.mutiny.infrastructure.Infrastructure; @Recorder public cl...
package io.quarkus.mutiny.runtime; import java.util.concurrent.ExecutorService; import java.util.function.BooleanSupplier; import java.util.function.Consumer; import org.jboss.logging.Logger; import io.quarkus.runtime.annotations.Recorder; import io.smallrye.mutiny.infrastructure.Infrastructure; @Recorder public cl...
Add a couple todo's in the reset functions
<?php function reset_new($Userid) { //TODO: Delete any old entries //TODO: Delete any entries for this user if they exist global $ResetsTable; $code = reset_generate_code(); $created = time(); $sql = "INSERT INTO $ResetsTable (Userid, Code, Created) VALUES (".escape($U...
<?php function reset_new($Userid) { global $ResetsTable; $code = reset_generate_code(); $created = time(); $sql = "INSERT INTO $ResetsTable (Userid, Code, Created) VALUES (".escape($Userid).", ".escape($code).", $created ...
Change test of configure() to validate if configure sets de parameters on the Leafbird config
/* Copyright 2015 Leafbird 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 Leafbird 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...
Set stack when deploying for integration tests
package integration_test import ( "path/filepath" "github.com/cloudfoundry/libbuildpack/cutlass" . "github.com/onsi/ginkgo" . "github.com/onsi/gomega" "os" ) var _ = Describe("CF Binary Buildpack", func() { var app *cutlass.App AfterEach(func() { if app != nil { app.Destroy() } app = nil }) Descr...
package integration_test import ( "path/filepath" "github.com/cloudfoundry/libbuildpack/cutlass" . "github.com/onsi/ginkgo" . "github.com/onsi/gomega" ) var _ = Describe("CF Binary Buildpack", func() { var app *cutlass.App AfterEach(func() { if app != nil { app.Destroy() } app = nil }) Describe("d...
Use KeyboardEvent.key instead of code
import { Mixin, InitialRender } from './ce'; import { triggerEvent } from './events'; import { DisableBehavior } from './disabled'; import { FocusableBehavior } from './focus'; /** * Mixin that provides the behavior of a button. This set the role of the * element to `button`, add support for disabling it and normal...
import { Mixin, InitialRender } from './ce'; import { triggerEvent } from './events'; import { DisableBehavior } from './disabled'; import { FocusableBehavior } from './focus'; /** * Mixin that provides the behavior of a button. This set the role of the * element to `button`, add support for disabling it and normal...
Make truncate to be available at php 5.3 and 5.4
<?php namespace Coduo\PHPHumanizer\String; class Truncate { /** * @var string */ private $text; /** * @var int */ private $charactersCount; /** * @var string */ private $append; /** * @param string $text * @param int $charactersCount * @param...
<?php namespace Coduo\PHPHumanizer\String; class Truncate { /** * @var string */ private $text; /** * @var int */ private $charactersCount; /** * @var string */ private $append; /** * @param string $text * @param int $charactersCount * @param...
Fix Trace ::start -> ::load
<?php use OpenCensus\Trace\Tracer; use OpenCensus\Trace\Exporter\StackdriverExporter; require __DIR__ . '/helpers.php'; if (is_gae() && (php_sapi_name() != 'cli')){ if (is_gae_flex()){ Tracer::start(new StackdriverExporter(['async' => true])); } else { // TODO: Async on Standard En...
<?php use OpenCensus\Trace\Tracer; use OpenCensus\Trace\Exporter\StackdriverExporter; require __DIR__ . '/helpers.php'; if (is_gae() && (php_sapi_name() != 'cli')){ if (is_gae_flex()){ Tracer::start(new StackdriverExporter(['async' => true])); } else { // TODO: Async on Standard En...
Move to buttons & remove hardcoding of image size
# coding: utf-8 # ui.View subclass for the top ten iTunes songs. # Pull requests gladly accepted. import feedparser, requests, ui url = 'https://itunes.apple.com/us/rss/topsongs/limit=10/xml' def get_image_urls(itunes_url): for entry in feedparser.parse(itunes_url).entries: yield entry['summary'].partit...
# coding: utf-8 # ui.View subclass for the top ten iTunes songs. # Pull requests gladly accepted. import feedparser, requests, ui url = 'https://itunes.apple.com/us/rss/topsongs/limit=10/xml' def get_image_urls(itunes_url): for entry in feedparser.parse(itunes_url).entries: yield entry['summary'].partit...
Use QuerySelectorAll to find links Faster, and avoid <A> that lack hrefs.
// Entire frame is insecure? if ((document.location.protocol == "http:") || (document.location.protocol == "ftp:")) { document.body.style.backgroundColor="#E04343"; } var lnks = document.querySelectorAll("a[href]"); var arrUnsecure = []; for (var i = 0; i < lnks.length; i++) { var thisLink = lnks[i]; var ...
// Entire frame is insecure? if ((document.location.protocol == "http:") || (document.location.protocol == "ftp:")) { document.body.style.backgroundColor="#E04343"; } var lnks = document.getElementsByTagName("a"); var arrUnsecure = []; for(var i = 0; i < lnks.length; i++) { var thisLink = ...
Return translation instead of tuple Fixes Attributerror: 'tuple' object has no attribute 'format' when POSTing with no value for an Enum field.
from django.utils.translation import ugettext_lazy as _ from rest_framework.fields import ChoiceField class EnumField(ChoiceField): default_error_messages = { 'invalid': _("No matching enum type.") } def __init__(self, **kwargs): self.enum_type = kwargs.pop("enum_type") kwargs.pop...
from rest_framework.fields import ChoiceField class EnumField(ChoiceField): default_error_messages = { 'invalid': ("No matching enum type.",) } def __init__(self, **kwargs): self.enum_type = kwargs.pop("enum_type") kwargs.pop("choices", None) super(EnumField, self).__init_...
Use image schema, thumbs are deprecated
import mongoose from 'mongoose'; import { ImageSchema } from 'src/models/ImageModel'; const { Schema } = mongoose; export const PostSchema = new Schema({ title: { type: String, unique: true, required: true, }, created: { type: Date, default: Date.now, }, lastEdited: { type: Date, ...
import mongoose from 'mongoose'; import { ImageSchema } from 'src/models/ImageModel'; import { ThumbnailSchema } from 'src/models/ThumbnailModel'; const { Schema } = mongoose; export const PostSchema = new Schema({ title: { type: String, unique: true, required: true, }, created: { type: Date, ...
LogglyWriter: Fix goroutine leak when replacing LogglyWriter instance Each config update (after the first setting) of "gop"/"loggly_logging_token" was leaking a goro.
package gop import ( "fmt" "os" "github.com/cocoonlife/go-loggly" ) // A timber.LogWriter for the loggly service. // LogglyWriter is a Timber writer to send logging to the loggly // service. See: https://loggly.com. type LogglyWriter struct { c *loggly.Client } // NewLogEntriesWriter creates a new writer for s...
package gop import ( "fmt" "os" "github.com/segmentio/go-loggly" ) // A timber.LogWriter for the loggly service. // LogglyWriter is a Timber writer to send logging to the loggly // service. See: https://loggly.com. type LogglyWriter struct { c *loggly.Client } // NewLogEntriesWriter creates a new writer for se...
Remove security advisory rss feed link until it's ready
<div class="row page-content-header"> <div class="col-md-4"> <h1>Security Advisories</h1> </div> <div class="col-md-5 col-md-offset-3"> <form role="form" action="/security/advisory/" method="get"> <input name="id" type="text" class="form-control" placeholder="Advisory identifier"> <button type="submit" cla...
<div class="row page-content-header"> <div class="col-md-4"> <h1>Security Advisories</h1> <a href="/security/advisories/feed" class="rss-button">RSS</a> </div> <div class="col-md-5 col-md-offset-3"> <form role="form" action="/security/advisory/" method="get"> <input name="id" type="text" class="form-control...
Add image upload to event form
"""Forms definitions.""" from django import forms from .models import Event class EventForm(forms.ModelForm): """Form for EventCreateView.""" class Meta: # noqa model = Event fields = ( 'title', 'date', 'venue', 'description', 'fb_...
"""Forms definitions.""" from django import forms from .models import Event class EventForm(forms.ModelForm): """Form for EventCreateView.""" class Meta: # noqa model = Event fields = ( 'title', 'date', 'venue', 'description', 'fb_...
Allow more than one test class (at least for annotation reading).
import java.util.*; import java.lang.*; import java.lang.reflect.*; import java.lang.annotation.*; public class ReadForbidden { public static void main(String args[]) throws Exception { if(args.length != 1) { System.err.println("missing class argument"); System.exit(-1); } String grep = "egrep '(java/lan...
import java.util.*; import java.lang.*; import java.lang.reflect.*; import java.lang.annotation.*; public class ReadForbidden { public static void main(String args[]) throws Exception { if(args.length != 1) { System.err.println("missing class argument"); System.exit(-1); } String tcln = args[0]; ClassLo...
Fix duplicate key in webpack config Fix that `compress` key appears twice in `webpack.optimize.UglifyJsPlugin` params.
const webpack = require('webpack'); const webpackMerge = require('webpack-merge'); const commonConfig = require('./webpack.common.js'); const ENV = process.env.NODE_ENV = process.env.ENV = 'production'; module.exports = webpackMerge(commonConfig, { devtool: 'source-map', externals: { 'react': 'React',...
const webpack = require('webpack'); const webpackMerge = require('webpack-merge'); const commonConfig = require('./webpack.common.js'); const ENV = process.env.NODE_ENV = process.env.ENV = 'production'; module.exports = webpackMerge(commonConfig, { devtool: 'source-map', externals: { 'react': 'React',...
Split out mock test, removed failing test. Verified Travis is working.
import chai, { expect } from 'chai'; import sinon from 'sinon'; import sinonChai from 'sinon-chai'; import System from 'systemjs'; import '../config.js'; chai.use(sinonChai); describe('myModule', () => { let _, myModule; before(() => { return System.import('lodash') .then((lodash) => { _ = loda...
import chai, { expect } from 'chai'; import sinon from 'sinon'; import sinonChai from 'sinon-chai'; import System from 'systemjs'; import '../config.js'; chai.use(sinonChai); describe('myModule', () => { let _, myModule; before(() => { return System.import('lodash') .then((lodash) => { _ = loda...
Revert "use environment variable for port" This reverts commit 03abed36a666e1bd0e422b3eb7a0602905d57de5.
/* AIDA Source Code */ /* Contributors located at: github.com/2nd47/CSC309-A4 */ // main app // server modules var bcrypt = require('bcryptjs'); var express = require('express'); var mongoose = require('mongoose'); var session = require('express-session'); var validator = require('validator'); var qs = require('query...
/* AIDA Source Code */ /* Contributors located at: github.com/2nd47/CSC309-A4 */ // main app // server modules var bcrypt = require('bcryptjs'); var express = require('express'); var mongoose = require('mongoose'); var session = require('express-session'); var validator = require('validator'); var qs = require('query...
[OWL-277] Fix ambiguous message while connecting to database
package db import ( "database/sql" "fmt" _ "github.com/go-sql-driver/mysql" "github.com/open-falcon/hbs/g" "log" ) var DB *sql.DB func Init() { err := dbInit(g.Config().Database) if err != nil { log.Fatalln(err) } DB.SetMaxIdleConns(g.Config().MaxIdle) } func dbInit(dsn string) (err error) { if DB, er...
package db import ( "database/sql" _ "github.com/go-sql-driver/mysql" "github.com/open-falcon/hbs/g" "log" ) var DB *sql.DB func Init() { err := dbInit(g.Config().Database) if err != nil { log.Fatalf("open db fail: %v", err) } DB.SetMaxIdleConns(g.Config().MaxIdle) } func dbInit(dsn string) (err error) ...
Add logging at the beginning of gitPull().
// First, import everything we need (I assume that you installed Flick via the above command). var connect = require( 'connect' ), shell = require( 'shelljs' ), flick = require( '..' ), handler = flick( { whitelist: { local: true } } ), app = connect(); // Then, define the action to run once we'll rec...
// First, import everything we need (I assume that you installed Flick via the above command). var connect = require( 'connect' ), shell = require( 'shelljs' ), flick = require( '..' ), handler = flick( { whitelist: { local: true } } ), app = connect(); // Then, define the action to run once we'll rec...
Revert accidental committal of client test-data Client should not get test-data right now; that was just for debugging.
Package.describe({ summary: "Given the set of the constraints, picks a satisfying configuration", version: "1.0.15" }); Npm.depends({ 'mori': '0.2.6' }); Package.on_use(function (api) { api.export('ConstraintSolver'); api.use(['underscore', 'ejson', 'check', 'package-version-parser', 'binary-heap...
Package.describe({ summary: "Given the set of the constraints, picks a satisfying configuration", version: "1.0.15" }); Npm.depends({ 'mori': '0.2.6' }); Package.on_use(function (api) { api.export('ConstraintSolver'); api.use(['underscore', 'ejson', 'check', 'package-version-parser', 'binary-heap...
Add netlify badge to qualify for open source plan
import React from 'react'; import { Container, Row, Col } from 'reactstrap'; export default () => { return ( <div className="footer"> <Container> <Row> <Col className="text-center"> <p className="social"> <iframe src="https://ghbtns.com/github-btn.html?user=react...
import React from 'react'; import { Container, Row, Col } from 'reactstrap'; export default () => { return ( <div className="footer"> <Container> <Row> <Col className="text-center"> <p className="social"> <iframe src="https://ghbtns.com/github-btn.html?user=react...
[DDW-667] Hide staking from app menu
// @flow import { ROUTES } from '../routes-config'; import walletsIcon from '../assets/images/sidebar/wallet-ic.inline.svg'; import settingsIcon from '../assets/images/sidebar/settings-ic.inline.svg'; import paperWalletCertificateIcon from '../assets/images/sidebar/paper-certificate-ic.inline.svg'; import stakingIcon f...
// @flow import { ROUTES } from '../routes-config'; import walletsIcon from '../assets/images/sidebar/wallet-ic.inline.svg'; import settingsIcon from '../assets/images/sidebar/settings-ic.inline.svg'; import paperWalletCertificateIcon from '../assets/images/sidebar/paper-certificate-ic.inline.svg'; import stakingIcon f...
Send message where there are no members present at the office
// Description: // Check who's at the office // // Commands // @kontoret / @office - Reply with everyone at the office const _ = require('lodash'); const presence = require('../lib/presence'); const createMention = username => `@${username}`; module.exports = robot => { robot.hear(/@kontoret|@office/i, msg => ...
// Description: // Check who's at the office // // Commands // @kontoret / @office - Reply with everyone at the office const _ = require('lodash'); const presence = require('../lib/presence'); const createMention = username => `@${username}`; module.exports = robot => { robot.hear(/@kontoret|@office/i, msg => ...
Update administration tool copyright year
<?php /* $Id$ osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com Copyright (c) 2008 osCommerce Released under the GNU General Public License */ ?> <br> <table border="0" width="100%" cellspacing="0" cellpadding="2"> <tr> <td align="center" class="smallText"> <?php /* The followi...
<?php /* $Id$ osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com Copyright (c) 2008 osCommerce Released under the GNU General Public License */ ?> <br> <table border="0" width="100%" cellspacing="0" cellpadding="2"> <tr> <td align="center" class="smallText"> <?php /* The followi...
Add callback to handle result of promises queued
export class PromiseQueue { constructor(result_callback) { this.promises = []; this.resultCallback = result_callback; this.endCallback; this.exceptionCallback; this.running; } run() { if(!this.running) { if(this.promises.isEmpty()) { if(this.endCallback) { this.endCallback(); } } el...
'use strict'; export class PromiseQueue { constructor() { this.promises = []; this.endCallback; this.exceptionCallback; this.running; } run() { if(!this.running) { if(this.promises.isEmpty()) { if(this.endCallback) { this.endCallback(); } } else { this.running = this.promises.shi...
Allow user to set their initial amount of cash and drugs
from selenium import webdriver from selenium.webdriver.common.keys import Keys import time driver = webdriver.Chrome() driver.get("http://clickingbad.nullism.com/") # Amount you'd like to have in terms of cash and # drugs to start the game init_drugs = 10000 init_cash = 10000 # Number of cooks and sells to do in a r...
from selenium import webdriver from selenium.webdriver.common.keys import Keys import time driver = webdriver.Chrome() driver.get("http://clickingbad.nullism.com/") num_cooks = 100 num_sells = 50 cook = driver.find_element_by_id('make_btn') sell = driver.find_element_by_id('sell_btn') while True: try: c...
Add example in Eval class
<?php /** * Execute arbitrary PHP code. * * ## EXAMPLES * * # Display WordPress content directory. * $ wp eval 'echo WP_CONTENT_DIR;' * /var/www/wordpress/wp-content * * # Generate a random number. * $ wp eval 'echo rand();' --skip-wordpress * 479620423 */ class Eval_Command extends...
<?php class Eval_Command extends WP_CLI_Command { /** * Execute arbitrary PHP code. * * ## OPTIONS * * <php-code> * : The code to execute, as a string. * * [--skip-wordpress] * : Execute code without loading WordPress. * * @when before_wp_load * * ## EXAMPLES * * $ wp eval 'echo WP_...
Sort tallied measurements for consistent display
import React from 'react'; const tally = (measurements, buffer) => { const tallied = measurements.reduce((accum, value) => { accum[value+buffer] = (accum[value+buffer] || 0) + 1; return accum; }, {}); return ( <table className="MeasurementsTally table table-bordered"> <thead> <tr> ...
import React from 'react'; const tally = (measurements, buffer) => { const tallied = measurements.reduce((accum, value) => { accum[value+buffer] = (accum[value+buffer] || 0) + 1; return accum; }, {}); return ( <table className="MeasurementsTally table table-bordered"> <thead> <tr> ...
Introduce bitfield describing edge capabilities.
// gogl provides a framework for representing and working with graphs. package gogl // Constants defining graph capabilities and behaviors. const ( E_DIRECTED, EM_DIRECTED = 1 << iota, 1 << iota - 1 E_UNDIRECTED, EM_UNDIRECTED E_WEIGHTED, EM_WEIGHTED E_TYPED, EM_TYPED E_SIGNED, EM_SIGNED E_LOOPS, EM_LOOPS ...
// gogl provides a framework for representing and working with graphs. package gogl type Vertex interface{} type Graph interface { EachVertex(f func(vertex Vertex)) EachEdge(f func(source Vertex, target Vertex)) EachAdjacent(vertex Vertex, f func(adjacent Vertex)) HasVertex(vertex Vertex) bool GetSubgraph([]Vert...
Include query string in URL as cache ID.
var Data = require('./data'); var data = new Data(); function feedPocketPage(req, res) { res.render('feedpocket.html', { layout: 'layout', locals: { categories: data.categoryList } }); } function feedData(req, res) { data.getFeed(req.params.feedId, function (err, articles) { if (err) { ...
var Data = require('./data'); var data = new Data(); function feedPocketPage(req, res) { res.render('feedpocket.html', { layout: 'layout', locals: { categories: data.categoryList } }); } function feedData(req, res) { data.getFeed(req.params.feedId, function (err, articles) { if (err) { ...
Update name of callback functions
import "es6-symbol"; import "weakmap"; import svgLoader from "./loader.js"; import Icon from "./components/Icon.js"; import Sprite from "./components/Sprite.js"; import Theme from "./components/Theme.js"; var callback = function callback() { }; const icons = Icon; const initLoader = svgLoader; // loads an external...
import "es6-symbol"; import "weakmap"; import svgLoader from "./loader.js"; import Icon from "./components/Icon.js"; import Sprite from "./components/Sprite.js"; import Theme from "./components/Theme.js"; var callback = function callback() { }; const icons = Icon; const initLoader = svgLoader; // loads an external...
Fix resolution of submit function
'use strict'; var assign = require('es5-ext/object/assign') , promisify = require('deferred').promisify , bcrypt = require('bcrypt') , dbjsCreate = require('mano/lib/utils/dbjs-form-create') , submit = require('mano/utils/save') , changePassword = require('mano-auth/controlle...
'use strict'; var assign = require('es5-ext/object/assign') , promisify = require('deferred').promisify , bcrypt = require('bcrypt') , dbjsCreate = require('mano/lib/utils/dbjs-form-create') , router = require('mano/server/post-router') , changePassword = require('mano-auth/c...
Add integrity test for touch events
window.addEventListener('load', function(){ module('touchstart'); test('should use touchstart when touchstart is supported', function() { assert({ listener:'touchstart', receives:'touchstart' }); }); test('should use mousedown when touchstart is unsupported', function() { assert({ listener:'touchstar...
window.addEventListener('load', function(){ module('touchstart'); test('should use touchstart when touchstart is supported', function() { ok(false, 'not implemented'); // assert({ listener:'touchstart', receives:'touchstart' }); }); test('should use mousedown when touchstart is unsupported', function...
Reduce the verbosity of password checking on every security check.
package ca.corefacility.bioinformatics.irida.security; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.security.authentication.CredentialsExpiredException; import org.springframework.security.core.userdetails.UserDetails; import org.springframework.security.core.userdetails.UserDeta...
package ca.corefacility.bioinformatics.irida.security; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.security.authentication.CredentialsExpiredException; import org.springframework.security.core.userdetails.UserDetails; import org.springframework.security.core.userdetails.UserDeta...
Return error for invalid base
package allyourbase import ( "errors" "fmt" "math" ) func ConvertToBase(inputBase int, inputDigits []int, outputBase int) (outputDigits []int, e error) { if inputBase < 2 { return []int{}, errors.New("input base must be >= 2") } base10 := getBase10Input(inputBase, inputDigits) if base10 == 0 { return []int...
package allyourbase import ( "fmt" "math" ) func ConvertToBase(inputBase int, inputDigits []int, outputBase int) (outputDigits []int, e error) { base10 := getBase10Input(inputBase, inputDigits) if base10 == 0 { return []int{0}, nil } for base10 > 0 { digit := base10 % outputBase outputDigits = append([]in...
Remove dotenv execution, create library object that contain library infos. watch if DEV MODE and UGLIFY if PROD MODE
const path = require('path') const UglifyJsPlugin = require('uglifyjs-webpack-plugin') const config = require('./package.json') const webpack = require('webpack') // Config object const library = { name: 'VueAutoscroll', target: 'umd' } const DEV = process.env.NODE_ENV === 'development'; let webpackConfig = { ...
const path = require('path'); const config = require('./package.json'); const webpack = require('webpack'); require('dotenv').config(); const PROD = process.env.NODE_ENV === 'production'; // let plugins = []; // PROD ? [ // plugins.push(new webpack.optimize.UglifyJsPlugin({ // compress: { warnings: false } //...
Remove unused import of EAgainException
package nanomsg; import nanomsg.exceptions.IOException; /** * Common interface that should implement all sockets. */ public interface ISocket { public void close(); public int getNativeSocket(); public void bind(final String dir) throws IOException; public void connect(final String dir) throws IOExc...
package nanomsg; import nanomsg.exceptions.IOException; import nanomsg.exceptions.EAgainException; /** * Common interface that should implement all sockets. */ public interface ISocket { public void close(); public int getNativeSocket(); public void bind(final String dir) throws IOException; public ...
Use latest from master as a base.
"use strict"; var path = require("path"); var clc = require("cli-color"); var _ = require("lodash"); module.exports = function (mPath, moduleIsOptional, opts) { var resolvedRequire; mPath = mPath.trim(); var runOpts = _.assign({ require: require, console: console }, opts); if (mPath.charAt(0) === ...
"use strict"; var path = require("path"); var clc = require("cli-color"); var _ = require("lodash"); module.exports = function (mPath, moduleIsOptional, opts) { var resolvedRequire; mPath = mPath.trim(); var runOpts = _.assign({ require: require, console: console }, opts); if (mPath.charAt(0) === ...
Update the output when the app is running
const express = require('express') const app = express() const path = require('path') const nunjucks = require('nunjucks') // Set up App const appViews = [ path.join(__dirname, '/app/views/'), path.join(__dirname, '/app/templates/') ] nunjucks.configure(appViews, { autoescape: true, express: app, noCache: t...
const express = require('express') const app = express() const path = require('path') const nunjucks = require('nunjucks') // Set up App const appViews = [ path.join(__dirname, '/app/views/'), path.join(__dirname, '/app/templates/') ] nunjucks.configure(appViews, { autoescape: true, express: app, noCache: t...
Add required skills to display.
window.onload = function onLoad() { getVolunteeringOpportunities(); }; async function getVolunteeringOpportunities() { const response = await fetch('/event-volunteering-data'); const opportunities = await response.json() for (const key in opportunities) { console.log(opportunities[key].name); console.l...
window.onload = function onLoad() { getVolunteeringOpportunities(); }; async function getVolunteeringOpportunities() { const response = await fetch('/event-volunteering-data'); const opportunities = await response.json() console.log(opportunities); const opportunitiesArray = JSON.parse(opportunities...
CHange script installation to /usr/bin/ instead of /bin
#! /usr/bin/env python3 from distutils.core import setup setup( description = 'File downloader for danbooru', author = 'Todd Gaunt', url = 'https://www.github.com/toddgaunt/danboorsync', download_url = 'https://www.github.com/toddgaunt/danboorsync', author_email = 'toddgaunt@protonmail.ch', ver...
#! /usr/bin/env python3 from distutils.core import setup setup( description = 'File downloader for danbooru', author = 'Todd Gaunt', url = 'https://www.github.com/toddgaunt/danboorsync', download_url = 'https://www.github.com/toddgaunt/danboorsync', author_email = 'toddgaunt@protonmail.ch', ver...
Stop logging safari-extension:// CSP blocking
var utils = require('../lib/utils'); module.exports = { ping: function(request, reply) { return reply('ok').code(200); }, status: function(appVersion) { return function(request, reply) { var info = { status: 'ok', pid: process.pid, app: process.title, host: process....
var utils = require('../lib/utils'); module.exports = { ping: function(request, reply) { return reply('ok').code(200); }, status: function(appVersion) { return function(request, reply) { var info = { status: 'ok', pid: process.pid, app: process.title, host: process....
Correct path for Spot2 service provider
<?php use App\Application; // Create new app $app = new Application(); // Core silex providers $app->register(new Silex\Provider\ServiceControllerServiceProvider()); $app->register(new Silex\Provider\RoutingServiceProvider()); $app->register(new Silex\Provider\SessionServiceProvider()); $app->register(new Silex\Prov...
<?php use App\Application; // Create new app $app = new Application(); // Core silex providers $app->register(new Silex\Provider\ServiceControllerServiceProvider()); $app->register(new Silex\Provider\RoutingServiceProvider()); $app->register(new Silex\Provider\SessionServiceProvider()); $app->register(new Silex\Prov...
Adjust url from custom baselayer in OSM
PluginsAPI.Map.addActionButton(function(options){ if (options.tiles.length > 0){ // TODO: pick the topmost layer instead // of the first on the list, to support // maps that display multiple tasks. var tile = options.tiles[0]; var url = window.location.protocol + "//" + window.location.host + til...
PluginsAPI.Map.addActionButton(function(options){ if (options.tiles.length > 0){ // TODO: pick the topmost layer instead // of the first on the list, to support // maps that display multiple tasks. var tile = options.tiles[0]; var url = window.location.protocol + "//" + window.location.host + til...
[FIX] mrp_subcontracting: Allow to select any type of subcontracting product
# -*- encoding: utf-8 -*- ############################################################################## # # This program 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...
# -*- encoding: utf-8 -*- ############################################################################## # # This program 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...
Build app before running bozon test with no arguments
#! /usr/bin/env node var path = require('path') var program = require('commander') var bozon = require('../bozon') var json = require('../../package.json') program .version(json.version) program .command('new <name>') .description('Generate scaffold for new Electron application') .action(function (name, optio...
#! /usr/bin/env node var path = require('path') var program = require('commander') var bozon = require('../bozon') var json = require('../../package.json') program .version(json.version) program .command('new <name>') .description('Generate scaffold for new Electron application') .action(function (name, optio...
Fix tree builder without a root node deprecation in Symfony/Config 4.2+
<?php namespace BW\ActiveMenuItemBundle\DependencyInjection; use Symfony\Component\Config\Definition\Builder\TreeBuilder; use Symfony\Component\Config\Definition\ConfigurationInterface; /** * This is the class that validates and merges configuration from your app/config files * * To learn more see {@link http://s...
<?php namespace BW\ActiveMenuItemBundle\DependencyInjection; use Symfony\Component\Config\Definition\Builder\TreeBuilder; use Symfony\Component\Config\Definition\ConfigurationInterface; /** * This is the class that validates and merges configuration from your app/config files * * To learn more see {@link http://s...
Save stocks when prices change
(function(exports) { const randInt = (min, max) => { const range = max - min; return Math.round( min + Math.random() * range ); }; function generateStocks({minPrice, maxPrice}) { const symbols = [ 'Amazon', 'Google', 'Facebook', 'Microsoft', 'Facebook', '...
(function(exports) { const randInt = (min, max) => { const range = max - min; return Math.round( min + Math.random() * range ); }; function generateStocks({minPrice, maxPrice}) { const symbols = [ 'Amazon', 'Google', 'Facebook', 'Microsoft', 'Facebook', '...
Use simpler syntax for webpack CSS loaders
var path = require('path'); var webpack = require('webpack'); module.exports = { devtool: 'cheap-module-eval-source-map', entry: [ 'webpack-hot-middleware/client', './index' ], output: { path: path.join(__dirname, 'dist'), filename: 'bundle.js', publicPath: '/static/' }, plugins: [ ...
var path = require('path'); var webpack = require('webpack'); module.exports = { devtool: 'cheap-module-eval-source-map', entry: [ 'webpack-hot-middleware/client', './index' ], output: { path: path.join(__dirname, 'dist'), filename: 'bundle.js', publicPath: '/static/' }, plugins: [ ...
Refresh annotation using annotations command
<?php declare(strict_types=1); namespace ApiClients\Client\Travis\Resource\Async; use ApiClients\Client\Travis\CommandBus\Command\AnnotationsCommand; use ApiClients\Client\Travis\Resource\Annotation as BaseAnnotation; use ApiClients\Client\Travis\Resource\AnnotationInterface; use React\Promise\PromiseInterface; use R...
<?php declare(strict_types=1); namespace ApiClients\Client\Travis\Resource\Async; use ApiClients\Foundation\Hydrator\CommandBus\Command\HydrateCommand; use ApiClients\Foundation\Transport\CommandBus\Command\SimpleRequestCommand; use React\Promise\PromiseInterface; use ApiClients\Client\Travis\Resource\Annotation as B...
Support spring loaded for remote process.
package org.jetbrains.plugins.groovy.springloaded; import com.intellij.debugger.PositionManager; import com.intellij.debugger.PositionManagerFactory; import com.intellij.debugger.engine.DebugProcess; import com.intellij.openapi.application.AccessToken; import com.intellij.openapi.application.ApplicationManager; import...
package org.jetbrains.plugins.groovy.springloaded; import com.intellij.debugger.PositionManager; import com.intellij.debugger.PositionManagerFactory; import com.intellij.debugger.engine.DebugProcess; /** * Factory for position manager to debug classes reloaded by com.springsource.springloaded * @author Sergey Evdok...
Update up to changes in es5-ext
'use strict'; var copy = require('es5-ext/lib/List/copy') , curry = require('es5-ext/lib/Function/curry').call , merge = require('es5-ext/lib/Object/merge').call , ee = require('event-emitter'); var o = ee(exports = { init: function () { this.msg = []; this.passed = []; this.errored = []; this.fail...
'use strict'; var clone = require('es5-ext/lib/Array/clone').call , curry = require('es5-ext/lib/Function/curry').call , merge = require('es5-ext/lib/Object/merge').call , ee = require('event-emitter'); var o = ee(exports = { init: function () { this.msg = []; this.passed = []; this.errored =...
Hide search and delegate options
// custom mods document.addEventListener("DOMContentLoaded", function(event) { // hide email right/sharing menu entries (as they do not work with some imap servers) var hideElements = [ 'body > main > md-sidenav > md-content > section > md-list > md-list-item > div > div.md-secondary-container > button:nth-chi...
// custom mods document.addEventListener("DOMContentLoaded", function(event) { // hide email right/sharing menu entries (as they do not work with some imap servers) var hideElements = [ 'body > main > md-sidenav > md-content > section > md-list > md-list-item > div > div.md-secondary-container > button:nth-chi...
Test that Functional Interfaces has only one declared method
package es.sandbox.spikes.java8.interfaces; import es.sandbox.spikes.java8.InvocationSpy; import org.junit.Before; import org.junit.Test; import java.lang.reflect.Method; import static es.sandbox.spikes.java8.FunctionalInterfaceCaller.call; import static es.sandbox.spikes.java8.InvocationSpy.spy; import static org.a...
package es.sandbox.spikes.java8.interfaces; import es.sandbox.spikes.java8.InvocationSpy; import org.junit.Before; import org.junit.Test; import static es.sandbox.spikes.java8.FunctionalInterfaceCaller.call; import static es.sandbox.spikes.java8.InvocationSpy.spy; import static org.assertj.core.api.Assertions.assertT...
Change the return type to boolean
''' prime_test(n) returns a True if n is a prime number else it returns False ''' def prime_test(n): if n <= 1: return False if n==2 or n==3: return True if n%2==0 or n%3==0: return False j = 5 while(j*j <= n): if n%(j)==0 or n%(j+2)==0: return False ...
''' prime_test(n) returns a True if n is a prime number else it returns False ''' def prime_test(n): if n <= 1: return False if n==2 or n==3: return True if n%2==0 or n%3==0: return False j = 5 while(j*j <= n): if n%(j)==0 or n%(j+2)==0: return False ...
Make sparse / complete more distinguishable
package org.jusecase.properties.ui; import org.jusecase.properties.entities.Key; import org.jusecase.properties.entities.KeyPopulation; import javax.swing.*; import java.awt.*; import java.util.HashMap; import java.util.Map; public class KeyListCellRenderer extends DefaultListCellRenderer { Map<KeyPopulation, Co...
package org.jusecase.properties.ui; import org.jusecase.properties.entities.Key; import org.jusecase.properties.entities.KeyPopulation; import javax.swing.*; import java.awt.*; import java.util.HashMap; import java.util.Map; public class KeyListCellRenderer extends DefaultListCellRenderer { Map<KeyPopulation, Co...
Add pid in log statement
package in.dream_lab.goffish.giraph.examples; import in.dream_lab.goffish.api.*; import org.apache.hadoop.io.BytesWritable; import org.apache.hadoop.io.DoubleWritable; import org.apache.hadoop.io.LongWritable; import org.apache.hadoop.io.NullWritable; import java.io.IOException; import java.util.LinkedList; /** * C...
package in.dream_lab.goffish.giraph.examples; import in.dream_lab.goffish.api.*; import org.apache.hadoop.io.BytesWritable; import org.apache.hadoop.io.DoubleWritable; import org.apache.hadoop.io.LongWritable; import org.apache.hadoop.io.NullWritable; import java.io.IOException; import java.util.LinkedList; /** * C...
Fix the ‘arr1 is not defined’ error
/** * IsEqual * * @param {object} obj1 * @param {object} obj2 */ var isEqual = function(obj1, obj2) { /** * Arrays */ if (isArray(obj1, obj2)) { if (obj1.length !== obj2.length) { return false; } return every(obj1, function(value, index, context) { return obj2[index] === value;...
/** * IsEqual * * @param {object} obj1 * @param {object} obj2 */ var isEqual = function(obj1, obj2) { /** * Arrays */ if (isArray(obj1, obj2)) { if (arr1.length !== arr2.length) { return false; } return every(arr1, function(value, index, context) { return arr2[index] === value;...
Format simple timers when they are printed.
package org.yi.happy.metric; /** * I am a simple timer. */ public class SimpleTimer { /** * create started. */ public SimpleTimer() { startTime = System.currentTimeMillis(); stopTime = startTime - 1; } /** * when the timer started. */ private long startTime; ...
package org.yi.happy.metric; /** * I am a simple timer. */ public class SimpleTimer { /** * create started. */ public SimpleTimer() { startTime = System.currentTimeMillis(); stopTime = startTime - 1; } /** * when the timer started. */ private long startTime; ...
Use new (?) repository transferred hook.
import json import uuid from flask_hookserver import Hooks from .db import redis from .members.models import User from .projects.tasks import update_project_by_hook from .tasks import spinach hooks = Hooks() @hooks.hook("ping") def ping(data, guid): return "pong" @hooks.hook("membership") def membership(dat...
import json import uuid from flask_hookserver import Hooks from .db import redis from .members.models import User from .projects.tasks import update_project_by_hook from .tasks import spinach hooks = Hooks() @hooks.hook("ping") def ping(data, guid): return "pong" @hooks.hook("membership") def membership(dat...
git: Put prod back on the list of branches to send notices about. (imported from commit e608d7050b4e68045b03341dc41e8654e45a3af3)
# Humbug Inc's internal git plugin configuration. # The plugin and example config are under api/integrations/ # Leaving all the instructions out of this file to avoid having to # sync them as we update the comments. HUMBUG_USER = "humbug+commits@humbughq.com" HUMBUG_API_KEY = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" # com...
# Humbug Inc's internal git plugin configuration. # The plugin and example config are under api/integrations/ # Leaving all the instructions out of this file to avoid having to # sync them as we update the comments. HUMBUG_USER = "humbug+commits@humbughq.com" HUMBUG_API_KEY = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" # com...
Add docs to server init
// {{{ Express HTTP server setup let express = require('express'); let less = require('less-middleware'); let app = express(); // Set up EJS views app.set('views', __dirname + '/views'); app.set('view engine', 'ejs'); // Set LESS for CSS pre-processing app.use(less(__dirname + '/static')); // Set up static directory a...
// {{{ Express HTTP server setup let express = require('express'); let less = require('less-middleware'); let app = express(); app.set('views', __dirname + '/views'); app.set('view engine', 'ejs'); app.use(less(__dirname + '/static')); app.use(express.static(__dirname + '/static')); const port = 3000; // Routers let...
Change geometry name in the basic example
const createContext = require('pex-context') //const createRenderer = require('pex-renderer') const createRenderer = require('../..') const createSphere = require('primitive-sphere') const ctx = createContext({ width: 800, height: 600 }) const renderer = createRenderer({ ctx: ctx }) const camera = renderer.entity(...
const createContext = require('pex-context') //const createRenderer = require('pex-renderer') const createRenderer = require('../..') const createSphere = require('primitive-sphere') const ctx = createContext({ width: 800, height: 600 }) const renderer = createRenderer({ ctx: ctx }) const camera = renderer.entity(...
Fix bad comma in object
/*global angular */ require.config({ shim: { 'angular': { exports: 'angular' } }, paths: { app: 'js/app', angular: './components/angular/angular' }, baseUrl: '/' }); (function() { console.time('requirejs'); require([ // application 'app', 'js/mobile-nav.js', 'js/lib/...
/*global angular */ require.config({ shim: { 'angular': { exports: 'angular' } }, paths: { app: 'js/app', angular: './components/angular/angular' }, baseUrl: '/' }); (function() { console.time('requirejs'); require([ // application 'app', 'js/mobile-nav.js', 'js/lib/...
Add notice on how to add custom apps for development
""" Django settings for laufpartner_server project. Generated by 'django-admin startproject' using Django 1.8.1. For more information on this file, see https://docs.djangoproject.com/en/1.8/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.8/ref/settings/ """ f...
""" Django settings for laufpartner_server project. Generated by 'django-admin startproject' using Django 1.8.1. For more information on this file, see https://docs.djangoproject.com/en/1.8/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.8/ref/settings/ """ f...
Update Sharing Tweet message (add emojis too :))
<?php /** * @author Pierre-Henry Soria <hello@ph7cms.com> * @copyright (c) 2018-2019, Pierre-Henry Soria. All Rights Reserved. * @license GNU General Public License; See PH7.LICENSE.txt and PH7.COPYRIGHT.txt in the root directory. * @package PH7 / App / System / Module / Admin / Inc / Cla...
<?php /** * @author Pierre-Henry Soria <hello@ph7cms.com> * @copyright (c) 2018, Pierre-Henry Soria. All Rights Reserved. * @license GNU General Public License; See PH7.LICENSE.txt and PH7.COPYRIGHT.txt in the root directory. * @package PH7 / App / System / Module / Admin / Inc / Class *...
Update how we parse svg
import path from 'path'; import fs from 'fs'; const getViewBoxDimensions = dir => file => { const fileContent = fs.readFileSync(path.join(dir, file), 'utf-8'); const matches = fileContent.match(/viewBox=\"(\d+(?:\.\d+)?) (\d+(?:\.\d+)?) (\d+(?:\.\d+)?) (\d+(?:\.\d+)?)\"/); if ( ! matches) return; return { ...
import path from 'path'; import fs from 'fs'; const getViewBoxDimensions = dir => file => { const fileContent = fs.readFileSync(path.join(dir, file), 'utf-8'); const matches = fileContent.match(/viewBox=\"0 0 (\d+(?:\.\d+)?) (\d+(?:\.\d+)?)\"/); if ( ! matches) return; return { width: parseFloat(matches[1]...
Fix text file overflowing message below it
'use strict' import React, { useEffect, useState } from 'react' import PropTypes from 'prop-types' import Highlight from '../Highlight' import { getFileExtension } from '../../utils/file-helpers' function PreviewTextFile ({ blob, filename, onLoad, ...rest }) { const [fileContent, setfileContent] = useState(null) ...
'use strict' import React, { useEffect, useState } from 'react' import PropTypes from 'prop-types' import Highlight from '../Highlight' import { getFileExtension } from '../../utils/file-helpers' function PreviewTextFile ({ blob, filename, onLoad, ...rest }) { const [fileContent, setfileContent] = useState(null) ...
Change get_preview_image to same as other blocks (because we fix ipl to pil convert for 1-channel images)
# -*- coding: utf-8 -*- import ipfblock import ioport import ipf.ipfblock.processing from ipf.ipftype.ipfimage3ctype import IPFImage3cType from ipf.ipftype.ipfimage1ctype import IPFImage1cType class RGB2Gray(ipfblock.IPFBlock): """ Convert 3 channel image to 1 channel gray block class """ type = "RG...
# -*- coding: utf-8 -*- import ipfblock import ioport import ipf.ipfblock.processing from ipf.ipftype.ipfimage3ctype import IPFImage3cType from ipf.ipftype.ipfimage1ctype import IPFImage1cType class RGB2Gray(ipfblock.IPFBlock): """ Convert 3 channel image to 1 channel gray block class """ type = "RG...
Add Request/Response import points for pylons. --HG-- branch : trunk
"""Base objects to be exported for use in Controllers""" # Import pkg_resources first so namespace handling is properly done so the # paste imports work import pkg_resources from paste.registry import StackedObjectProxy from pylons.configuration import config from pylons.controllers.util import Request from pylons.con...
"""Base objects to be exported for use in Controllers""" # Import pkg_resources first so namespace handling is properly done so the # paste imports work import pkg_resources from paste.registry import StackedObjectProxy from pylons.configuration import config __all__ = ['app_globals', 'cache', 'config', 'request', 'r...
Replace call_user_func_array() with unpack syntax
<?php namespace util; use lang\reflect\InvocationHandler; use lang\Throwable; use lang\ClassCastException; /** * Lazy initializable InvokationHandler * * @test xp://net.xp_framework.unittest.util.DeferredInvokationHandlerTest */ abstract class AbstractDeferredInvokationHandler extends \lang\Object implements In...
<?php namespace util; use lang\reflect\InvocationHandler; use lang\Throwable; use lang\ClassCastException; /** * Lazy initializable InvokationHandler * * @test xp://net.xp_framework.unittest.util.DeferredInvokationHandlerTest */ abstract class AbstractDeferredInvokationHandler extends \lang\Object implements In...
Fix Apollo Client instance caching on client-side
import {ApolloClient, HttpLink, InMemoryCache} from "@apollo/client" import fetch from "isomorphic-fetch" /** * @typedef {import("@apollo/client").NormalizedCacheObject} NormalizedCacheObject */ /** * @type {ApolloClient<NormalizedCacheObject>} */ let cachedClient = null const createApollo = () => new ApolloCli...
import {ApolloClient, HttpLink, InMemoryCache} from "@apollo/client" import fetch from "isomorphic-fetch" /** * @typedef {import("@apollo/client").NormalizedCacheObject} NormalizedCacheObject */ /** * @type {ApolloClient<NormalizedCacheObject>} */ let cachedClient = null const createApollo = () => new ApolloCli...
Convert module code to upper case for routing
define(['underscore', 'require', 'app', 'backbone.marionette'], function (_, require, App, Marionette) { 'use strict'; var navigationItem = App.request('addNavigationItem', { name: 'Modules', icon: 'search', url: '#modules' }); return Marionette.Controller.extend({ showModule...
define(['underscore', 'require', 'app', 'backbone.marionette'], function (_, require, App, Marionette) { 'use strict'; var navigationItem = App.request('addNavigationItem', { name: 'Modules', icon: 'search', url: '#modules' }); return Marionette.Controller.extend({ showModule...
Update copyright notice with MIT license
/*++ NASM Assembly Language Plugin Copyright (c) 2017-2018 Aidan Khoury Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use...
/*++ NASM Assembly Language Plugin Copyright (c) 2017-2018 Aidan Khoury. All rights reserved. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your opt...
Rename base exception class; less ugly
""" Custom *xml4h* exceptions. """ class Xml4hException(Exception): """ Base exception class for all non-standard exceptions raised by *xml4h*. """ pass class FeatureUnavailableException(Xml4hException): """ User has attempted to use a feature that is available in some *xml4h* implementa...
""" Custom *xml4h* exceptions. """ class BaseXml4hException(Exception): """ Base exception class for all non-standard exceptions raised by *xml4h*. """ pass class FeatureUnavailableException(BaseXml4hException): """ User has attempted to use a feature that is available in some *xml4h* im...
Convert path to lowercase when normalizing
import re import os def normalize_path(path): """ Normalizes a path: * Removes extra and trailing slashes * Converts special characters to underscore """ if path is None: return "" path = re.sub(r'/+', '/', path) # repeated slash path = re.sub(r'/*$', '', path) # tr...
import re import os def normalize_path(path): """ Normalizes a path: * Removes extra and trailing slashes * Converts special characters to underscore """ path = re.sub(r'/+', '/', path) # repeated slash path = re.sub(r'/*$', '', path) # trailing slash path = [to_slug(p)...
Add s2TakeId properties in S2 model to match PEPS S2 definition
<?php /* * Copyright 2014 Jérôme Gasperi * * Licensed under the Apache License, version 2.0 (the "License"); * You may not use this file except in compliance with the License. * You may obtain a copy of the License at: * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or ag...
<?php /* * Copyright 2014 Jérôme Gasperi * * Licensed under the Apache License, version 2.0 (the "License"); * You may not use this file except in compliance with the License. * You may obtain a copy of the License at: * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or ag...
Make the return link work again
# -*- coding: utf-8 -*- from selenium.webdriver.support.ui import Select from page_objects import PageObject, PageElement, MultiPageElement class SettingsPage(PageObject): return_link = PageElement(css='#sidebar-brand a') inlist_delete_confirm = PageElement(name='inlist_delete_confirm') action_delete_confi...
# -*- coding: utf-8 -*- from selenium.webdriver.support.ui import Select from page_objects import PageObject, PageElement, MultiPageElement class SettingsPage(PageObject): return_link = PageElement(css='.mui--text-title a.appbar-correct') inlist_delete_confirm = PageElement(name='inlist_delete_confirm') ac...
Fix an issue where the latest Node-RED no longer requires RED.init() and RED.nodes.init() prior to running tests
'use strict'; import * as sinon from 'sinon'; import { assert } from 'chai'; import RED from 'node-red'; import asakusaGikenModule from '../../../../dist/nodes/local-node-asakusa_giken/asakusa_giken.js'; import * as ble from '../../../../dist/nodes/local-node-asakusa_giken/lib/ble'; RED.debug = true; RED._ = sinon.sp...
'use strict'; import { assert } from 'chai'; import RED from 'node-red'; import asakusaGikenModule from '../../../../dist/nodes/local-node-asakusa_giken/asakusa_giken.js'; import * as ble from '../../../../dist/nodes/local-node-asakusa_giken/lib/ble'; RED.debug = true; RED.init({ init: function() {} }, {}); RED.nod...
Use requests package instead of urllib2
import requests import json def send_gcm_message(api_key, regs_id, data, collapse_key=None): """ Send a GCM message for one or more devices, using json data api_key: The API_KEY from your console (https://code.google.com/apis/console, locate Key for Server Apps in Google Cloud Messaging for Androi...
import urllib2 import json def send_gcm_message(api_key, regs_id, data, collapse_key=None): """ Send a GCM message for one or more devices, using json data api_key: The API_KEY from your console (https://code.google.com/apis/console, locate Key for Server Apps in Google Cloud Messaging for Android...
Use filename based type if DetectContentType fails. DetectContentType returns text/plain for our stylesheets and javascripts. That causes chrome to ignore those files.
package blob import ( "bytes" "compress/gzip" "io" "log" "net/http" "strings" ) const ( TemplateFiles = "templates" StaticFiles = "static" ) var mimeMap = map[string]string{ "css": "text/css", "js": "text/javascript", } func GetFile(bucket string, name string) ([]byte, error) { reader := bytes.NewRead...
package blob import ( "bytes" "compress/gzip" "io" "log" "net/http" ) const ( TemplateFiles = "templates" StaticFiles = "static" ) func GetFile(bucket string, name string) ([]byte, error) { reader := bytes.NewReader(files[bucket][name]) gz, err := gzip.NewReader(reader) if err != nil { return nil, err ...
Fix incorrect variable name in Array2d.each.
define(function() { var Array2d = function () { this._columns = {}; }; Array2d.prototype.get = function(location) { var row = this._columns[location.x]; if (row) return row[location.y]; }; Array2d.prototype.set = function (location, value) { var row = this._columns[location.x] || (this._columns[locat...
define(function() { var Array2d = function () { this._columns = {}; }; Array2d.prototype.get = function(location) { var row = this._columns[location.x]; if (row) return row[location.y]; }; Array2d.prototype.set = function (location, value) { var row = this._columns[location.x] || (this._columns[locat...
Update pyyaml requirement from <5.2,>=5.1 to >=5.1,<5.3 Updates the requirements on [pyyaml](https://github.com/yaml/pyyaml) to permit the latest version. - [Release notes](https://github.com/yaml/pyyaml/releases) - [Changelog](https://github.com/yaml/pyyaml/blob/master/CHANGES) - [Commits](https://github.com/yaml/pyy...
from setuptools import setup, find_packages setup( name='panoptescli', version='1.1.1', url='https://github.com/zooniverse/panoptes-cli', author='Adam McMaster', author_email='adam@zooniverse.org', description=( 'A command-line client for Panoptes, the API behind the Zooniverse' ), ...
from setuptools import setup, find_packages setup( name='panoptescli', version='1.1.1', url='https://github.com/zooniverse/panoptes-cli', author='Adam McMaster', author_email='adam@zooniverse.org', description=( 'A command-line client for Panoptes, the API behind the Zooniverse' ), ...
Fix tests for human readable numbers
import unittest from LinkMeBot.utils import get_text_from_markdown, human_readable_download_number class TestUtils(unittest.TestCase): def test_get_text_from_markdown(self): markdown = '**test** [^this](https://google.com) ~~is~~ _a_ test! https://google.com' text = 'test this is a test!' ...
import unittest from LinkMeBot.utils import get_text_from_markdown, human_readable_download_number class TestUtils(unittest.TestCase): def test_get_text_from_markdown(self): markdown = '**test** [^this](https://google.com) ~~is~~ _a_ test! https://google.com' text = 'test this is a test!' ...
Remove chaves do redis referentes a votaçãoi
# coding: utf-8 from django.core.management.base import BaseCommand from ...models import Poll, Option import redis cache = redis.StrictRedis(host='127.0.0.1', port=6379, db=0) class Command(BaseCommand): def handle(self, *args, **kwargs): options = [1, 2, 3, 4] Poll.objects.filter(id=1).delete(...
# coding: utf-8 from django.core.management.base import BaseCommand from ...models import Poll, Option class Command(BaseCommand): def handle(self, *args, **kwargs): Poll.objects.filter(id=1).delete() Option.objects.filter(id__in=[1, 2, 3, 4]).delete() question = Poll.objects.create(id=1...