text
stringlengths
16
4.96k
positive
stringlengths
321
2.24k
negative
stringlengths
310
2.21k
Update version string to 2.6.0-pre.16
'use strict'; var platform = require('enyo/platform'), dispatcher = require('enyo/dispatcher'), gesture = require('enyo/gesture'); exports = module.exports = require('./src/options'); exports.version = '2.6.0-pre.16'; // Override the default holdpulse config to account for greater delays between keydown and keyup...
'use strict'; var platform = require('enyo/platform'), dispatcher = require('enyo/dispatcher'), gesture = require('enyo/gesture'); exports = module.exports = require('./src/options'); exports.version = '2.6.0-pre.14.1'; // Override the default holdpulse config to account for greater delays between keydown and key...
Return last 50 messages only from cache
var express = require('express'); var eventStream = require('express-eventsource')(); var clientSSDP = require('./clients/ssdp'); var clientMDNS = require('./clients/mdns'); var app = express(), messages = []; // Serve all static files in /public app.use(require('serve-static')('public')); // Shared eventso...
var express = require('express'); var eventStream = require('express-eventsource')(); var clientSSDP = require('./clients/ssdp'); var clientMDNS = require('./clients/mdns'); var app = express(), messages = []; // Serve all static files in /public app.use(require('serve-static')('public')); // Shared eventso...
[previews] Fix wrong resolving of referenced type
import React, {PropTypes} from 'react' import resolveRefType from './resolveRefType' import {resolver as previewResolver} from 'part:@sanity/base/preview' export default class SanityPreview extends React.PureComponent { static propTypes = { value: PropTypes.object, type: PropTypes.object.isRequired }; s...
import React, {PropTypes} from 'react' import resolveRefType from './resolveRefType' import {resolver as previewResolver} from 'part:@sanity/base/preview' export default class SanityPreview extends React.PureComponent { static propTypes = { value: PropTypes.object, type: PropTypes.object.isRequired }; s...
Make the widget error message shorter and more understandable.
from .widget import Widget, DOMWidget, CallbackDispatcher, register from .widget_bool import Checkbox, ToggleButton from .widget_button import Button from .widget_box import Box, Popup, FlexBox, HBox, VBox from .widget_float import FloatText, BoundedFloatText, FloatSlider, FloatProgress, FloatRangeSlider from .widget_...
from .widget import Widget, DOMWidget, CallbackDispatcher, register from .widget_bool import Checkbox, ToggleButton from .widget_button import Button from .widget_box import Box, Popup, FlexBox, HBox, VBox from .widget_float import FloatText, BoundedFloatText, FloatSlider, FloatProgress, FloatRangeSlider from .widget_...
Switch to using vars for hostname in gh resolver.
/* @flow */ import type {ExplodedFragment} from './hosted-git-resolver.js'; import HostedGitResolver from './hosted-git-resolver.js'; export default class GitHubResolver extends HostedGitResolver { static protocol = 'github'; static hostname = 'github.com'; static isVersion(pattern: string): boolean { // g...
/* @flow */ import type {ExplodedFragment} from './hosted-git-resolver.js'; import HostedGitResolver from './hosted-git-resolver.js'; export default class GitHubResolver extends HostedGitResolver { static protocol = 'github'; static hostname = 'github.com'; static isVersion(pattern: string): boolean { // g...
Use regular malloc for logserver-container
// Copyright 2019 Oath Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. package com.yahoo.vespa.model.admin; import com.yahoo.config.model.api.container.ContainerServiceType; import com.yahoo.config.model.producer.AbstractConfigProducer; import com.yahoo.vespa.model.container.C...
// Copyright 2019 Oath Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. package com.yahoo.vespa.model.admin; import com.yahoo.config.model.api.container.ContainerServiceType; import com.yahoo.config.model.producer.AbstractConfigProducer; import com.yahoo.vespa.model.container.C...
Fix broken setting of postgres password
""" Creates a database for Molly, and appropriate users, once given login information as super user, or by running as root. """ import os from molly.installer.utils import quiet_exec, CommandFailed def create(dba_user, dba_pass, username, password, database): creds = [] if dba_user: creds += ['-...
""" Creates a database for Molly, and appropriate users, once given login information as super user, or by running as root. """ from molly.installer.utils import quiet_exec, CommandFailed def create(dba_user, dba_pass, username, password, database): creds = [] if dba_user: creds += ['-U', dba_use...
Insert into stat_page_views with LOW_PRIORITY
<?php /** * ocs-webserver * * Copyright 2016 by pling GmbH. * * This file is part of ocs-webserver. * * 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...
<?php /** * ocs-webserver * * Copyright 2016 by pling GmbH. * * This file is part of ocs-webserver. * * 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...
Fix demo being loaded regardless of ESP_PROD
const webpack = require('webpack') const { execSync } = require('child_process') const path = require('path') let hash = execSync('git rev-parse --short HEAD').toString().trim() let lang = process.env.ESP_LANG || 'en' let plugins = [] let devtool = 'source-map' if (process.env.ESP_PROD) { // ignore demo plugins....
const webpack = require('webpack') const { execSync } = require('child_process') const path = require('path') let hash = execSync('git rev-parse --short HEAD').toString().trim() let lang = process.env.ESP_LANG || 'en' let plugins = [] let devtool = 'source-map' if (process.env.ESP_PROD) { // ignore demo plugins....
Fix wrong http code for errors
package errors import ( "encoding/json" "net/http" ) type HttpError struct { Code int `json:"code"` Message string `json:"message"` } var HttpErrors map[string]*HttpError = map[string]*HttpError { "ErrorApiKeyMandatory": &HttpError{Code: 401, Message: "apikey is mandatory"}, "ErrorApiKeyInvalid": &Http...
package errors import ( "encoding/json" "net/http" ) type HttpError struct { Code int `json:"code"` Message string `json:"message"` } var HttpErrors map[string]*HttpError = map[string]*HttpError { "ErrorApiKeyMandatory": &HttpError{Code: 403, Message: "apikey is mandatory"}, "ErrorApiKeyInvalid": &Http...
Add more return types after fixing a typo in my script
<?php /* * This file is part of the Symfony package. * * (c) Fabien Potencier <fabien@symfony.com> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Symfony\Component\Security\Core\Authorization\Voter; use Symfony\Compon...
<?php /* * This file is part of the Symfony package. * * (c) Fabien Potencier <fabien@symfony.com> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Symfony\Component\Security\Core\Authorization\Voter; use Symfony\Compon...
Check the shape of input data earlier Using geo.nVoxel to check the input img shape earlier, before geo is casted to float32 (geox). We should use any() instead of all(), since "!=" is used?
from _Ax import _Ax_ext import numpy as np import copy def Ax(img, geo, angles, projection_type="Siddon"): if img.dtype != np.float32: raise TypeError("Input data should be float32, not "+ str(img.dtype)) if not np.isreal(img).all(): raise ValueError("Complex types not compatible for ...
from _Ax import _Ax_ext import numpy as np import copy def Ax(img, geo, angles, projection_type="Siddon"): if img.dtype != np.float32: raise TypeError("Input data should be float32, not "+ str(img.dtype)) if not np.isreal(img).all(): raise ValueError("Complex types not compatible for ...
Fix message type in factory
<?php /* |-------------------------------------------------------------------------- | Model Factories |-------------------------------------------------------------------------- | | Here you may define all of your model factories. Model factories give | you a convenient way to create models for testing and seeding yo...
<?php /* |-------------------------------------------------------------------------- | Model Factories |-------------------------------------------------------------------------- | | Here you may define all of your model factories. Model factories give | you a convenient way to create models for testing and seeding yo...
Fix regex to support Mininet 20.30.40+++
#!/usr/bin/python from subprocess import check_output as co from sys import exit # Actually run bin/mn rather than importing via python path version = 'Mininet ' + co( 'PYTHONPATH=. bin/mn --version', shell=True ) version = version.strip() # Find all Mininet path references lines = co( "grep -or 'Mininet \w\+\.\w\+\...
#!/usr/bin/python from subprocess import check_output as co from sys import exit # Actually run bin/mn rather than importing via python path version = 'Mininet ' + co( 'PYTHONPATH=. bin/mn --version', shell=True ) version = version.strip() # Find all Mininet path references lines = co( "grep -or 'Mininet \w\.\w\.\w[...
Fix Env command for switching php
<?php namespace PhpBrew\Command; use PhpBrew\Config; class EnvCommand extends \CLIFramework\Command { public function brief() { return 'export environment variables'; } public function execute($version = null) { // get current version if( ! $version ) $version = getenv('PHPBREW...
<?php namespace PhpBrew\Command; use PhpBrew\Config; class EnvCommand extends \CLIFramework\Command { public function brief() { return 'export environment variables'; } public function execute($version = null) { // get current version if( ! $version ) $version = getenv('PHPBREW...
Set default if includeXferAsWithdrawn is not set
<?php namespace TmlpStats\Reports\Arrangements; class TeamMembersByQuarter extends BaseArrangement { /* * Builds an array of TDO attendance for each team member */ public function build($data) { $teamMembersData = $data['teamMembersData']; $includeXferAsWithdrawn = array_get($data...
<?php namespace TmlpStats\Reports\Arrangements; class TeamMembersByQuarter extends BaseArrangement { /* * Builds an array of TDO attendance for each team member */ public function build($data) { $teamMembersData = $data['teamMembersData']; $includeXferAsWithdrawn = $data['includeX...
Fix import error for missing file.
# (c) 2013, AnsibleWorks # # This file is part of Ansible Commander # # Ansible Commander 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 option) any later versio...
# (c) 2013, AnsibleWorks # # This file is part of Ansible Commander # # Ansible Commander 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 option) any later versio...
Remove BeautifulSoup from direct dependency list.
from setuptools import setup, find_packages from tiddlywebwiki import __version__ as VERSION setup( name = 'tiddlywebwiki', version = VERSION, description = 'A TiddlyWeb plugin to provide a multi-user TiddlyWiki environment.', author = 'FND', author_email = 'FNDo@gmx.net', packages = find_pac...
from setuptools import setup, find_packages from tiddlywebwiki import __version__ as VERSION setup( name = 'tiddlywebwiki', version = VERSION, description = 'A TiddlyWeb plugin to provide a multi-user TiddlyWiki environment.', author = 'FND', author_email = 'FNDo@gmx.net', packages = find_pac...
Fix :bug: to display ours/theirs deleted status
/** @babel */ /** @jsx etch.dom */ import etch from 'etch' import {classNameForStatus} from '../helpers' const statusSymbolMap = { added: '+', deleted: '-', modified: '*' } export default class FilePatchListItemView { constructor (props) { this.props = props etch.initialize(this) this.props.regis...
/** @babel */ /** @jsx etch.dom */ import etch from 'etch' import {classNameForStatus} from '../helpers' const statusSymbolMap = { added: '+', removed: '-', modified: '*' } export default class FilePatchListItemView { constructor (props) { this.props = props etch.initialize(this) this.props.regis...
Add table name to bans model.
<?php /** * FluxBB - fast, light, user-friendly PHP forum software * Copyright (C) 2008-2012 FluxBB.org * based on code by Rickard Andersson copyright (C) 2002-2008 PunBB * * 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...
<?php /** * FluxBB - fast, light, user-friendly PHP forum software * Copyright (C) 2008-2012 FluxBB.org * based on code by Rickard Andersson copyright (C) 2002-2008 PunBB * * 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...
Use const instead of var
#!/usr/bin/env node /** * * @typedef {{ * cwd: string, * require: Array, * configNameSearch: string[], * configPath: string, * configBase: string, * modulePath: string, * modulePackage: *, * }} LiftoffEnvironment */ const Liftoff = require("liftoff"); const run = require("../src/run"); const minimist...
#!/usr/bin/env node /** * * @typedef {{ * cwd: string, * require: Array, * configNameSearch: string[], * configPath: string, * configBase: string, * modulePath: string, * modulePackage: *, * }} LiftoffEnvironment */ var Liftoff = require("liftoff"); var run = require("../src/run"); var minimist = req...
Change id field unicode string to ascii string
from django.test import TestCase from django.conf import settings from phonenumber_field.modelfields import PhoneNumberField from whats_fresh.models import * from django.contrib.gis.db import models import os import time import sys import datetime class ImageTestCase(TestCase): def setUp(self): self.exp...
from django.test import TestCase from django.conf import settings from phonenumber_field.modelfields import PhoneNumberField from whats_fresh.models import * from django.contrib.gis.db import models import os import time import sys import datetime class ImageTestCase(TestCase): def setUp(self): self.exp...
Enable Flux logger only for dev
import appReducer from './app/reducer'; import createLogger from 'redux-logger'; import fetch from 'isomorphic-fetch'; import injectDependencies from './lib/injectDependencies'; import promiseMiddleware from 'redux-promise-middleware'; import stateToJS from './lib/stateToJS'; import validate from './validate'; import {...
import appReducer from './app/reducer'; import createLogger from 'redux-logger'; import fetch from 'isomorphic-fetch'; import injectDependencies from './lib/injectDependencies'; import promiseMiddleware from 'redux-promise-middleware'; import stateToJS from './lib/stateToJS'; import validate from './validate'; import {...
Fix tests to work with responses 0.3.0
import pytest from responses import RequestsMock from netvisor import Netvisor @pytest.fixture def netvisor(): kwargs = dict( sender='Test client', partner_id='xxx_yyy', partner_key='E2CEBB1966C7016730C70CA92CBB93DD', customer_id='xx_yyyy_zz', customer_key='7767899D6F5FB33...
import pytest from responses import RequestsMock from netvisor import Netvisor @pytest.fixture def netvisor(): kwargs = dict( sender='Test client', partner_id='xxx_yyy', partner_key='E2CEBB1966C7016730C70CA92CBB93DD', customer_id='xx_yyyy_zz', customer_key='7767899D6F5FB33...
Make email field optional when creating reservation as an admin
<?php namespace Admin\Requests; use System\Classes\FormRequest; class Reservation extends FormRequest { protected function useDataFrom() { return static::DATA_TYPE_POST; } public function rules() { return [ ['location_id', 'admin::lang.reservations.text_restaurant', '...
<?php namespace Admin\Requests; use System\Classes\FormRequest; class Reservation extends FormRequest { protected function useDataFrom() { return static::DATA_TYPE_POST; } public function rules() { return [ ['location_id', 'admin::lang.reservations.text_restaurant', '...
Use threshold for the initial fps state
import React, {Component} from 'react' import collectFps from 'collect-fps' const noop = () => {} export default ({ threshold = 30, fpsCollector = collectFps }) => (Target) => { let endFPSCollection = noop const handleStartFPSCollection = (component) => { if (endFPSCollection !== noop) { endFPSCollection...
import React, {Component} from 'react' import collectFps from 'collect-fps' const noop = () => {} export default ({ threshold = 30, fpsCollector = collectFps }) => (Target) => { let endFPSCollection = noop const handleStartFPSCollection = (component) => { if (endFPSCollection !== noop) { endFPSCollection...
Configure graceful_timeout to actually do something
import multiprocessing from os import getenv bind = '127.0.0.1:8001' workers = multiprocessing.cpu_count() * 3 graceful_timeout = 15 timeout = 30 threads = multiprocessing.cpu_count() * 3 pidfile = '/var/run/gunicorn.pid' errorlog = '/var/log/gunicorn/gunicorn-error.log' loglevel = 'critical' # Read the DEBUG setti...
import multiprocessing from os import getenv bind = '127.0.0.1:8001' workers = multiprocessing.cpu_count() * 3 # graceful_timeout = 600 # timeout = 60 threads = multiprocessing.cpu_count() * 3 # max_requests = 300 pidfile = '/var/run/gunicorn.pid' # max_requests_jitter = 50 errorlog = '/var/log/gunicorn/gunicorn-error...
Update API to support datasources
// +build !noglobals package inj ////////////////////////////////////////////// // Interface definitions ////////////////////////////////////////////// // A Grapher is anything that can represent an application graph type Grapher interface { Provide(inputs ...interface{}) error Inject(fn interface{}, args ...inter...
// +build !noglobals package inj ////////////////////////////////////////////// // Interface definitions ////////////////////////////////////////////// // A Grapher is anything that can represent an application graph type Grapher interface { Provide(inputs ...interface{}) error Inject(fn interface{}, args ...inter...
Move string above the imports so it becomes a docstring
#!/usr/bin/env python """ Simple AFP mock to allow testing the afp-cli. """ from bottle import route from textwrap import dedent from bottledaemon import daemon_run @route('/account') def account(): return """{"test_account": ["test_role"]}""" @route('/account/<account>/<role>') def credentials(account, role): ...
#!/usr/bin/env python from bottle import route from textwrap import dedent from bottledaemon import daemon_run """ Simple AFP mock to allow testing the afp-cli. """ @route('/account') def account(): return """{"test_account": ["test_role"]}""" @route('/account/<account>/<role>') def credentials(account, role): ...
Add regex to validate email in user schema
var mongoose = require('mongoose'), urlFormatter = require('../../app/models/url_formatter.server.model'), Schema = mongoose.Schema; var UserSchema = new Schema({ firstName: String, lastName: String, email: { type: String, index: true, match: /.+\@.+\..+/ }, username: { ...
var mongoose = require('mongoose'), urlFormatter = require('../../app/models/url_formatter.server.model'), Schema = mongoose.Schema; var UserSchema = new Schema({ firstName: String, lastName: String, email: { type: String, index: true }, username: { type: String, ...
Make sphinx building actually work
from distutils.core import setup version = '1.0.2' # If sphinx is installed, enable the command try: from sphinx.setup_command import BuildDoc cmdclass = {'build_sphinx': BuildDoc} command_options = { 'build_sphinx': { 'version': ('setup.py', version), 'release': ('setu...
from distutils.core import setup # If sphinx is installed, enable the command try: from sphinx.setup_command import BuildDoc cmdclass = {'build_sphinx': BuildDoc} command_options = { 'build_sphinx': { 'version': ('setup.py', version), 'release': ('setup.py', version), ...
Replace the placeholder in the live demo
"""Insert the demo into the codemirror site.""" import os import fileinput import shutil proselint_path = os.path.dirname(os.path.dirname(os.path.realpath(__file__))) code_mirror_path = os.path.join( proselint_path, "plugins", "webeditor") code_mirror_demo_path = os.path.join(code_mirror_path, "index.ht...
"""Insert the demo into the codemirror site.""" import os import fileinput import shutil proselint_path = os.path.dirname(os.path.dirname(os.path.realpath(__file__))) code_mirror_path = os.path.join( proselint_path, "plugins", "webeditor") code_mirror_demo_path = os.path.join(code_mirror_path, "index.ht...
Fix regression: 'import pytest' error when starting adhocracy
""" Catalog utilities.""" from substanced import catalog from substanced.interfaces import IIndexingActionProcessor from zope.interface import Interface @catalog.catalog_factory('adhocracy') class AdhocracyCatalogFactory: tag = catalog.Keyword() def includeme(config): """Register catalog utilities.""" c...
""" Catalog utilities.""" from substanced import catalog from substanced.interfaces import IIndexingActionProcessor from zope.interface import Interface @catalog.catalog_factory('adhocracy') class AdhocracyCatalogFactory: tag = catalog.Keyword() def includeme(config): """Register catalog utilities.""" c...
Make 'name' and 'index' columns non-nullable for IndexFile model
import enum from sqlalchemy import Column, Integer, String, Enum from virtool.pg.utils import Base, SQLEnum class IndexType(str, SQLEnum): """ Enumerated type for index file types """ json = "json" fasta = "fasta" bowtie2 = "bowtie2" class IndexFile(Base): """ SQL model to store n...
import enum from sqlalchemy import Column, Integer, String, Enum from virtool.pg.utils import Base, SQLEnum class IndexType(str, SQLEnum): """ Enumerated type for index file types """ json = "json" fasta = "fasta" bowtie2 = "bowtie2" class IndexFile(Base): """ SQL model to store n...
[eslint] Remove no-else-return from being checked Test Plan: - You can write if (something) { return somethingElse; else { return somethingElseEntirely; } without eslint getting mad about the else Change-Id: I92e5bbb2d9dbaed5a903986b7bbfe9f7e5518a62 Reviewed-on: https://gerrit.i...
/* * This file can be used to convey information to other eslint files inside * Canvas. */ module.exports = { globals: { ENV: true, INST: true, }, plugins: [ "promise", "import" ], // 0 - off, 1 - warning, 2 - error rules: { "class-methods-use-this": [0], "comma-dangle": [2, "only-m...
/* * This file can be used to convey information to other eslint files inside * Canvas. */ module.exports = { globals: { ENV: true, INST: true, }, plugins: [ "promise", "import" ], // 0 - off, 1 - warning, 2 - error rules: { "class-methods-use-this": [0], "comma-dangle": [2, "only-m...
Disable dropdown when question marked as answered
$(document).ready(function() { $(document).on('change', '.question-answered-box', function(){ the_id = $(this).data('the-id') text_answer_field = $(this).closest('.text-answer').find('.text-answer-field') if($(this).prop('checked')) { $(text_answer_field).attr("readonly", true) $(text_answer_f...
$(document).ready(function() { $(document).on('change', '.question-answered-box', function(){ the_id = $(this).data('the-id') text_answer_field = $(this).closest('.text-answer').find('.text-answer-field') if($(this).prop('checked')) { $(text_answer_field).attr("readonly", true) $(text_answer_f...
Add skip attribute for CayleyClient send test.
from unittest import TestCase import unittest from pyley import CayleyClient, GraphObject class CayleyClientTests(TestCase): @unittest.skip('Disabled for now!') def test_send(self): client = CayleyClient() g = GraphObject() query = g.V().Has("name", "Casablanca") \ .Out("/f...
from unittest import TestCase from pyley import CayleyClient, GraphObject class CayleyClientTests(TestCase): def test_send(self): client = CayleyClient() g = GraphObject() query = g.V().Has("name", "Casablanca") \ .Out("/film/film/starring") \ .Out("/film/performanc...
Fix Argcomplete Tests on Python <3.2
"""Tests for cement.ext.ext_argcomplete.""" import os from cement.ext import ext_argcomplete from cement.ext.ext_argparse import ArgparseController, expose from cement.utils import test from cement.utils.misc import rando APP = rando()[:12] class MyBaseController(ArgparseController): class Meta: label = ...
"""Tests for cement.ext.ext_argcomplete.""" import os from cement.ext import ext_argcomplete from cement.ext.ext_argparse import ArgparseController, expose from cement.utils import test from cement.utils.misc import rando APP = rando()[:12] class MyBaseController(ArgparseController): class Meta: label = ...
Fix mess-up with variable names.
var util = require('util'), events = require('events'); function Carrier(reader, listener, encoding, separator) { var self = this; self.reader = reader; if (!separator) { separator = /\r?\n/; } if (listener) { self.addListener('line', listener); } var buffer = ''; reader.setEn...
var util = require('util'), events = require('events'); function Carrier(reader, listener, encoding, separator) { var self = this; self.reader = reader; if (!separator) { separator = /\r?\n/; } if (listener) { self.addListener('line', listener); } var buffer = ''; reader.setEn...
Set callback param to false
<?php use Proud\Core; class Submenu extends Core\ProudWidget { function __construct() { parent::__construct( 'submenu', // Base ID __( 'Submenu', 'wp-agency' ), // Name array( 'description' => __( "Display a submenu", 'wp-agency' ), ) // Args ); } func...
<?php use Proud\Core; class Submenu extends Core\ProudWidget { function __construct() { parent::__construct( 'submenu', // Base ID __( 'Submenu', 'wp-agency' ), // Name array( 'description' => __( "Display a submenu", 'wp-agency' ), ) // Args ); } func...
Fix check that would crash if folder didn’t contain a package.json file
import { join } from 'path' import { statSync } from 'fs' import buildWebpackConfig from './config/build-webpack-config' import buildKarmaConfig from './config/build-karma-config' import startDevelop from './action/start-develop' import runTest from './action/run-test' import install from './action/install' import json...
import { join } from 'path' import buildWebpackConfig from './config/build-webpack-config' import buildKarmaConfig from './config/build-karma-config' import startDevelop from './action/start-develop' import runTest from './action/run-test' import install from './action/install' import json from './util/json' export d...
feat(example): Remove dev code in production
const path = require('path') const webpack = require('webpack') module.exports = { entry: './src/index.js', output: { filename: './bundle.js', path: path.resolve('public') }, module: { rules: [ { test: /\.js$/, exclude: /node_modules/, loader: 'babel-loader' } ...
const path = require('path') const webpack = require('webpack') module.exports = { entry: './src/index.js', output: { filename: './bundle.js', path: path.resolve('public') }, module: { rules: [ { test: /\.js$/, exclude: /node_modules/, loader: 'babel-loader' } ...
Add back offline emitting that mysteriously disappeared
'use strict'; import { log, LOG_TYPES } from './log'; import config from './config'; import { io, EVENT_TYPES } from './socketIO'; let peerJSOptions = config.peerJSOptions; export default function (server, app) { let ExpressPeerServer = require('peer').ExpressPeerServer(server, peerJSOptions); ExpressPeer...
'use strict'; import { log, LOG_TYPES } from './log'; import config from './config'; import { io, EVENT_TYPES } from './socketIO'; let peerJSOptions = config.peerJSOptions; export default function (server, app) { let ExpressPeerServer = require('peer').ExpressPeerServer(server, peerJSOptions); ExpressPeer...
Add comments describing the build status enum
/** * JBoss, Home of Professional Open Source. * Copyright 2014 Red Hat, Inc., and individual contributors * as indicated by the @author tags. * * 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 Lice...
/** * JBoss, Home of Professional Open Source. * Copyright 2014 Red Hat, Inc., and individual contributors * as indicated by the @author tags. * * 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 Lice...
refactor: Fix a hard coding of the configuration file name
#!/usr/bin/env node const co = require('co'); const util = require('./lib/util'); const m = require('./lib/main'); const initCommand = require('./lib/init.cmd'); const constants = require('./lib/constants'); const main = function* (argv) { if (argv.help) { return util.writeLn(yield util.help()); } if (argv....
#!/usr/bin/env node const co = require('co'); const util = require('./lib/util'); const m = require('./lib/main'); const initCommand = require('./lib/init.cmd'); const constants = require('./lib/constants'); const main = function* (argv) { if (argv.help) { return util.writeLn(yield util.help()); } if (argv....
Add cache dependency to improve web requests Also add filecache optional to control locks.
from setuptools import setup, find_packages setup(name='tst', version='0.9a18', description='TST Student Testing', url='http://github.com/daltonserey/tst', author='Dalton Serey', author_email='daltonserey@gmail.com', license='MIT', packages=find_packages(), include_packa...
from setuptools import setup, find_packages setup(name='tst', version='0.9a18', description='TST Student Testing', url='http://github.com/daltonserey/tst', author='Dalton Serey', author_email='daltonserey@gmail.com', license='MIT', packages=find_packages(), include_packa...
Fix for https ajax request update payment plans
<?php /** * Created by PhpStorm. * User: jesper * Date: 2015-01-27 * Time: 15:52 */ class Billmate_PartPayment_Block_Adminhtml_System_Config_Form_Updateplans extends Mage_Adminhtml_Block_System_Config_Form_Field { protected function _construct() { parent::_construct(); $this->setTemplate('...
<?php /** * Created by PhpStorm. * User: jesper * Date: 2015-01-27 * Time: 15:52 */ class Billmate_PartPayment_Block_Adminhtml_System_Config_Form_Updateplans extends Mage_Adminhtml_Block_System_Config_Form_Field { protected function _construct() { parent::_construct(); $this->setTemplate('...
Add path to requirements.txt so installation from pip succeeds cf http://lorenamesa.com/packaging-my-first-python-egg.html
import os from pip.download import PipSession from pip.req import parse_requirements from setuptools import setup BASE_DIR = os.path.dirname(os.path.realpath(__file__)) reqs_file = os.path.join(BASE_DIR, 'requirements.txt') install_reqs = parse_requirements(reqs_file, session=PipSession()) setup( name='aws-portkn...
from pip.download import PipSession from pip.req import parse_requirements from setuptools import setup setup( name='aws-portknock', version='0.1', py_modules=['aws_portknock'], description='Port knocking for AWS security groups', author='Michel Alexandre Salim', author_email='michel@michel-slm...
Remove prefix and use name as procId.
package main import ( "bufio" "io" "log" "regexp" "time" "github.com/logplex/logplexc" ) var prefix = regexp.MustCompile(`^(\[\d*\] [^-*#]+|.*)`) func lineWorker(die dieCh, r *bufio.Reader, cfg logplexc.Config, sr *serveRecord) { cfg.Logplex = sr.u target, err := logplexc.NewClient(&cfg) if err != nil { ...
package main import ( "bufio" "io" "log" "time" "github.com/logplex/logplexc" ) func lineWorker(die dieCh, r *bufio.Reader, cfg logplexc.Config, sr *serveRecord) { cfg.Logplex = sr.u target, err := logplexc.NewClient(&cfg) if err != nil { log.Fatalf("could not create logging client: %v", err) } for { ...
Stop the context menu from injecting multiple times. Otherwise this causes an infinite loop on KitKat, since loading more scripts triggers onPageFinished to fire again, which triggers injection of the context menu again, etc.
(function() { 'use strict'; /* global myApp */ /* global appIndexPlaceHolder */ myApp.factory('ContextMenuInjectScript', [ function () { var toInject = function() { if (window.__cordovaAppHarnessData) return; // Short-circuit if I've run on this page before. console.log('...
(function() { 'use strict'; /* global myApp */ /* global appIndexPlaceHolder */ myApp.factory('ContextMenuInjectScript', [ function () { var toInject = function() { console.log('Menu script injected.'); var contextScript = document.createElement('script'); con...
Load boardsLink from local storage.
/** * Created by xubt on 5/26/16. */ kanbanApp.directive('boardBanner', function () { return { restrict: 'E', templateUrl: 'component/board/partials/board-banner.html', replace: true, controller: ['$scope', '$location', 'boardsService', 'localStorageService', function ($scope, $lo...
/** * Created by xubt on 5/26/16. */ kanbanApp.directive('boardBanner', function () { return { restrict: 'E', templateUrl: 'component/board/partials/board-banner.html', replace: true, controller: ['$scope', '$location', 'boardsService', 'localStorageService', function ($scope, $lo...
Fix compilation error in deltaspike quickstart
/* * JBoss, Home of Professional Open Source * Copyright 2013, Red Hat, Inc. and/or its affiliates, and individual * contributors by the @authors tag. See the copyright.txt in the * distribution for a full listing of individual contributors. * * Licensed under the Apache License, Version 2.0 (the "License"); * y...
/* * JBoss, Home of Professional Open Source * Copyright 2013, Red Hat, Inc. and/or its affiliates, and individual * contributors by the @authors tag. See the copyright.txt in the * distribution for a full listing of individual contributors. * * Licensed under the Apache License, Version 2.0 (the "License"); * y...
Refactor utility method to FunctionalInterfaceCaller
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...
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.InvocationSpy.spy; import static org.assertj.core.api.Assertions.assertThat; /** * Created by jeslopalo on 30/12/15. */ public class Functi...
Fix absence of variable reference
<?php /* * This file is part of Flarum. * * (c) Toby Zerner <toby.zerner@gmail.com> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Flarum\Notification\Event; use Flarum\Notification\Blueprint\BlueprintInterface; clas...
<?php /* * This file is part of Flarum. * * (c) Toby Zerner <toby.zerner@gmail.com> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Flarum\Notification\Event; use Flarum\Notification\Blueprint\BlueprintInterface; clas...
Package count chart: fixed labels of x axis
import csv import sqlite3 from flask import Flask, request, render_template, g, jsonify app = Flask(__name__) db_filename = 'db.sqlite' def connect_db(): conn = sqlite3.connect(db_filename) curs = conn.execute('PRAGMA foreign_keys = ON') return conn @app.before_request def before_request(): g.db ...
import csv import sqlite3 from flask import Flask, request, render_template, g, jsonify app = Flask(__name__) db_filename = 'db.sqlite' def connect_db(): conn = sqlite3.connect(db_filename) curs = conn.execute('PRAGMA foreign_keys = ON') return conn @app.before_request def before_request(): g.db ...
Add toggle of loading class to map
// This is a manifest file that'll be compiled into application.js, which will include all the files // listed below. // // Any JavaScript/Coffee file within this directory, lib/assets/javascripts, vendor/assets/javascripts, // or vendor/assets/javascripts of plugins, if any, can be referenced here using a relative pat...
// This is a manifest file that'll be compiled into application.js, which will include all the files // listed below. // // Any JavaScript/Coffee file within this directory, lib/assets/javascripts, vendor/assets/javascripts, // or vendor/assets/javascripts of plugins, if any, can be referenced here using a relative pat...
Add use financial resource in ObjectUpdater
<?php namespace AppBundle\Tests\Services; use AppBundle\Tests\Controller\AbstractApiTest; use AppBundle\Document\Dream; use AppBundle\Document\FinancialResource; class ObjectUpdaterTest extends AbstractApiTest { public function testUpdateObject() { $client = static::createClient(); $dreamO...
<?php namespace AppBundle\Tests\Services; use AppBundle\Tests\Controller\AbstractApiTest; use AppBundle\Document\Dream; class ObjectUpdaterTest extends AbstractApiTest { public function testUpdateObject() { $client = static::createClient(); $dreamOld = $client->getContainer() ...
Create mongoengine connection when taking phantom snapshots
import os import mongoengine as me import rmc.shared.constants as c import rmc.models as m FILE_DIR = os.path.dirname(os.path.realpath(__file__)) HTML_DIR = os.path.join(c.SHARED_DATA_DIR, 'html_snapshots') me.connect(c.MONGO_DB_RMC, host=c.MONGO_HOST, port=c.MONGO_PORT) def write(file_path, content): ensure_...
import os import rmc.shared.constants as c import rmc.models as m FILE_DIR = os.path.dirname(os.path.realpath(__file__)) HTML_DIR = os.path.join(c.SHARED_DATA_DIR, 'html_snapshots') def write(file_path, content): ensure_dir(file_path) with open(file_path, 'w') as f: f.write(content) def ensure_dir...
Fix variable name in Python snippet
#!/usr/bin/env python """Generate fixtures.""" import os import json import math as m import numpy as np from scipy import special # Get the file path: FILE = os.path.realpath(__file__) # Extract the directory in which this file resides: DIR = os.path.dirname(FILE) def gen(x, name): """Generate fixture data a...
#!/usr/bin/env python """Generate fixtures.""" import os import json import math as m import numpy as np from scipy import special # Get the file path: FILE = os.path.realpath(__file__) # Extract the directory in which this file resides: DIR = os.path.dirname(file) def gen(x, name): """Generate fixture data a...
Increase lock timeout for refreshing engagement data task
import logging import time from dash.orgs.tasks import org_task logger = logging.getLogger(__name__) @org_task("refresh-engagement-data", 60 * 60 * 4) def refresh_engagement_data(org, since, until): from .models import PollStats start = time.time() time_filters = list(PollStats.DATA_TIME_FILTERS.keys(...
import logging import time from dash.orgs.tasks import org_task logger = logging.getLogger(__name__) @org_task("refresh-engagement-data", 60 * 60) def refresh_engagement_data(org, since, until): from .models import PollStats start = time.time() time_filters = list(PollStats.DATA_TIME_FILTERS.keys()) ...
Update the gulp config, test only the main module
var gulp = require('gulp'); var jshint = require('gulp-jshint'); var mocha = require('gulp-mocha'); var docco = require('gulp-docco'); var del = require('del'); gulp.task('docs', function () { del(['./docs'], function() { gulp.src('./lib/telegram.link.js') .pipe(docco(/*{'layout': 'linear'}*/))...
var gulp = require('gulp'); var jshint = require('gulp-jshint'); var mocha = require('gulp-mocha'); var docco = require('gulp-docco'); var del = require('del'); gulp.task('docs', function () { del(['./docs'], function() { gulp.src('./lib/telegram.link.js') .pipe(docco(/*{'layout': 'linear'}*/))...
Hide errors for when database not connected
<?php namespace App\Providers; use App\Meetup; use Illuminate\Support\ServiceProvider; use Barryvdh\Debugbar\ServiceProvider as DebugbarServiceProvider; class AppServiceProvider extends ServiceProvider { /** * Bootstrap any application services. * * @return void */ public function boot() ...
<?php namespace App\Providers; use App\Meetup; use Illuminate\Support\ServiceProvider; use Barryvdh\Debugbar\ServiceProvider as DebugbarServiceProvider; class AppServiceProvider extends ServiceProvider { /** * Bootstrap any application services. * * @return void */ public function boot() ...
Make exec play nicely with gulp
'use strict'; const { exec } = require('child_process'); const gutil = require('gulp-util'); module.exports = (gulp) => { /** * Sync the site (_site/) with the S3 bucket */ gulp.task('deploy:site', (cb) => { const command = 'aws s3 sync _site/ s3://www.westeleventh.media/'; return exec(command, (er...
'use strict'; const { exec } = require('child_process'); const gutil = require('gulp-util'); module.exports = (gulp) => { /** * Sync the site (_site/) with the S3 bucket */ gulp.task('deploy:site', () => { const command = 'aws s3 sync _site/ s3://www.westeleventh.media/'; exec(command, (error, stdo...
Remove package namespace in the URLS since it was useless.
from django.conf.urls.defaults import * from piston.resource import Resource from pony_server.api.handlers import PackageHandler, RootHandler, BuildHandler, TagHandler package_handler = Resource(PackageHandler) root_handler = Resource(RootHandler) build_handler = Resource(BuildHandler) tag_handler = Resource(TagHandle...
from django.conf.urls.defaults import * from piston.resource import Resource from pony_server.api.handlers import PackageHandler, RootHandler, BuildHandler, TagHandler package_handler = Resource(PackageHandler) root_handler = Resource(RootHandler) build_handler = Resource(BuildHandler) tag_handler = Resource(TagHandle...
Fix problem on letter list display when the letter is a <space> Work around for now for issue #10. And will need to be permanant, since the real fix to the database import would make removing the space optional.
# encoding: cinje : from cinje.std.html import link, div, span : from urllib.parse import urlencode, quote_plus : def letterscountsbar ctx, letterscountslist : try : selected_letter = ctx.selected_letter : except AttributeError : selected_letter = None : end <div class="col-sm-1 list-grou...
# encoding: cinje : from cinje.std.html import link, div, span : from urllib.parse import urlencode, quote_plus : def letterscountsbar ctx, letterscountslist : try : selected_letter = ctx.selected_letter : except AttributeError : selected_letter = None : end <div class="col-sm-1 list-grou...
Use dedicated port range for length-based TcpServer tests
/* * Copyright (c) 2013 Ramon Servadei * * 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 ...
/* * Copyright (c) 2013 Ramon Servadei * * 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 ...
Google+: Change the name from "Google Plus" to "Google+" It's just not how it's styled.
function ddg_spice_google_plus (api_result) { "use strict"; if(!api_result || !api_result.items || api_result.items.length === 0) { return Spice.failed("googleplus"); } Spice.add({ id: 'googleplus', name: 'Google+', data: api_result.items, meta: { so...
function ddg_spice_google_plus (api_result) { "use strict"; if(!api_result || !api_result.items || api_result.items.length === 0) { return Spice.failed("googleplus"); } Spice.add({ id: 'googleplus', name: 'Google Plus', data: api_result.items, meta: { ...
Allow dots in callback names.
module.exports = function(options) { var cb = (options && options.variable) || 'cb'; var regexp = new RegExp('(?:\\b|&)' + cb + '=([a-zA-Z$_][\.a-zA-Z0-9$_]*)(?:&|$)'); return { reshook: function(server, tile, req, res, result, callback) { if (result.headers['Content-Type'] !== 'application/json') return callba...
module.exports = function(options) { var cb = (options && options.variable) || 'cb'; var regexp = new RegExp('(?:\\b|&)' + cb + '=([a-zA-Z$_][a-zA-Z0-9$_]*)(?:&|$)'); return { reshook: function(server, tile, req, res, result, callback) { if (result.headers['Content-Type'] !== 'application/json') return callback...
Update student from server after checkout completes
import { Store } from 'consus-core/flux'; import CartStore from './cart-store'; import { searchStudent } from '../lib/api-client'; let student = null; class StudentStore extends Store{ hasOverdueItems(items){ return items.some(element => { return element.timestamp <= new Date().getTime(); ...
import { Store } from 'consus-core/flux'; import CartStore from './cart-store'; let student = null; class StudentStore extends Store{ hasOverdueItems(items){ return items.some(element => { return element.timestamp <= new Date().getTime(); }); } getStudent() { return st...
Set default race and class without extra database queries
from django.shortcuts import get_object_or_404, redirect, render from characters.forms import CharacterForm from characters.models import Character, Class, Race def index(request): all_characters = Character.objects.all() context = {'all_characters': all_characters} return render(request, 'characters/ind...
from django.shortcuts import get_object_or_404, redirect, render from characters.forms import CharacterForm from characters.models import Character, Class, Race def index(request): all_characters = Character.objects.all() context = {'all_characters': all_characters} return render(request, 'characters/ind...
Replace singleton to bind main class. Bind Class name instead hardcoding a string.
<?php namespace Edujugon\Skeleton\Providers; use Edujugon\Skeleton\Skeleton; use Illuminate\Support\ServiceProvider; class SkeletonServiceProvider extends ServiceProvider { /** * Bootstrap the application services. * * @return void */ public function boot() { $config_path = fu...
<?php namespace Edujugon\Skeleton\Providers; use Edujugon\Skeleton\Skeleton; use Illuminate\Support\ServiceProvider; class SkeletonServiceProvider extends ServiceProvider { /** * Bootstrap the application services. * * @return void */ public function boot() { $config_path = fu...
Fix authors in databrary citation
module.filter('cite', [ 'pageService', function (page) { return function (volume) { if (!angular.isObject(volume) || angular.isUndefined(volume.access) || angular.isUndefined(volume.name) || angular.isUndefined(volume.id)) { return ''; } var names = []; angular.forEach(volume.access, function (acce...
module.filter('cite', [ 'pageService', function (page) { return function (volume) { if (!angular.isObject(volume) || angular.isUndefined(volume.access) || angular.isUndefined(volume.name) || angular.isUndefined(volume.id)) { return ''; } var names = []; angular.forEach(volume.access, function (acce...
Update module version and tag as v0.4
#!/usr/bin/env python from distutils.core import setup, Extension setup( name='mapcode', ext_modules=[Extension('mapcode', sources=['mapcodemodule.c', 'mapcodelib/mapcoder.c'], include_dirs=['mapcodelib'] )], # version numb...
#!/usr/bin/env python from distutils.core import setup, Extension setup( name='mapcode', ext_modules=[Extension('mapcode', sources=['mapcodemodule.c', 'mapcodelib/mapcoder.c'], include_dirs=['mapcodelib'] )], version='0.3',...
Fix provider check causing Devshell auth failure This commit builds on commit 13c4926, allowing Devshell credentials to be used only with Google storage.
# -*- coding: utf-8 -*- # Copyright 2015 Google Inc. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless require...
# -*- coding: utf-8 -*- # Copyright 2015 Google Inc. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless require...
Fix broken router path tests
package com.continuuity.gateway.router; import com.continuuity.common.conf.Constants; import junit.framework.Assert; import org.junit.Before; import org.junit.Test; /** * To test the RouterPathLookup regular expression tests. */ public class RouterPathTest { @Before public void beforeTests() { RouterPathL...
package com.continuuity.gateway.router; import com.continuuity.common.conf.Constants; import junit.framework.Assert; import org.junit.Test; /** * To test the RouterPathLookup regular expression tests. */ public class RouterPathTest { @Test public void testRouterFlowPathLookUp() throws Exception { String f...
Extend CoreTestCase for access to assertPositve/Negative, others git-svn-id: 4b387fe5ada7764508e2ca96c335714e4c1692c6@136 0d517254-b314-0410-acde-c619094fa49f
package edu.northwestern.bioinformatics.studycalendar.testing; import edu.nwu.bioinformatics.commons.testing.CoreTestCase; import junit.framework.TestCase; import java.lang.reflect.Method; import java.util.Set; import java.util.HashSet; import org.easymock.classextension.EasyMock; /** * @author Rhett Sutphin */ ...
package edu.northwestern.bioinformatics.studycalendar.testing; import junit.framework.TestCase; import java.lang.reflect.Method; import java.util.Set; import java.util.HashSet; import org.easymock.classextension.EasyMock; /** * @author Rhett Sutphin */ public abstract class StudyCalendarTestCase extends TestCase ...
:wrench: Add reference on comment fixtures
<?php namespace OAuthBundle\DataFixtures\ORM; use Doctrine\Common\DataFixtures\AbstractFixture; use Doctrine\Common\DataFixtures\FixtureInterface; use Doctrine\Common\Persistence\ObjectManager; use Doctrine\Common\DataFixtures\OrderedFixtureInterface; use WordPressBundle\Entity\Comment; class LoadCommentData extend...
<?php namespace OAuthBundle\DataFixtures\ORM; use Doctrine\Common\DataFixtures\AbstractFixture; use Doctrine\Common\DataFixtures\FixtureInterface; use Doctrine\Common\Persistence\ObjectManager; use Doctrine\Common\DataFixtures\OrderedFixtureInterface; use WordPressBundle\Entity\Comment; class LoadCommentData extend...
Set protractor host to 8080 instead of 3000.
/** * @author: @AngularClass */ require('ts-node/register'); var helpers = require('./helpers'); exports.config = { baseUrl: 'http://localhost:8080/', // use `npm run e2e` specs: [ helpers.root('src/**/**.e2e.ts'), helpers.root('src/**/*.e2e.ts') ], exclude: [], framework: 'jasmine2', allSc...
/** * @author: @AngularClass */ require('ts-node/register'); var helpers = require('./helpers'); exports.config = { baseUrl: 'http://localhost:3000/', // use `npm run e2e` specs: [ helpers.root('src/**/**.e2e.ts'), helpers.root('src/**/*.e2e.ts') ], exclude: [], framework: 'jasmine2', allSc...
Update path filename for printing
<?php $url = $_POST['url']; $name = preg_split("/\//", $url, 0, PREG_SPLIT_NO_EMPTY); $fileName = dirname(__FILE__) . '/pdf/' . $name[sizeof($name) - 1] . '.pdf'; $baseUrl = $name[0] . '//' . $name[1] . '/cache/'; // $baseUrl = $name[0] . '//' . $name[1] . '/' . $name[2] . '/' . $name[3] . '/'; $output = 'phantom...
<?php $url = $_POST['url']; $name = preg_split("/\//", $url, 0, PREG_SPLIT_NO_EMPTY); $fileName = dirname(__FILE__) . '/pdf/' . $name[sizeof($name) - 1] . '.pdf'; $baseUrl = $name[0] . '//' . $name[1] . '/cached/'; // $baseUrl = $name[0] . '//' . $name[1] . '/' . $name[2] . '/' . $name[3] . '/'; $output = 'phanto...
Add form for accepting contract variation
from flask.ext.wtf import Form from wtforms import BooleanField from wtforms.validators import DataRequired, Length from dmutils.forms import StripWhitespaceStringField class SignerDetailsForm(Form): signerName = StripWhitespaceStringField('Full name', validators=[ DataRequired(message="You must provide t...
from flask.ext.wtf import Form from wtforms import BooleanField from wtforms.validators import DataRequired, Length from dmutils.forms import StripWhitespaceStringField class SignerDetailsForm(Form): signerName = StripWhitespaceStringField('Full name', validators=[ DataRequired(message="You must provide t...
Fix problem with system sending empty answers Some web browsers do not trigger the keyup or keydown events. One of those web browsers is BluStar Agent. This caused the system to think nothing had been entered into the fields. Solve this problem by both listenting to change and keyup event.
function ComponentTextfield( id ) { var self = _ComponentFormControl(id); self.setDefaultState('text-value'); self.bind = function() { self.attachChangeAction( self.node(), self.identifier() ); self.attachKeyUpAction( self.node(), self.identifier() ); }; self.registerAction('change', function() { self.setS...
function ComponentTextfield( id ) { var self = _ComponentFormControl(id); self.setDefaultState('text-value'); self.bind = function() { self.attachKeyUpAction( self.node(), self.identifier() ); }; self.registerAction('keyup', function() { self._states['text-value'] = self.node().value; }); self.select = fun...
Stop using console.log on the web. It seems to only sometimes work in IE.
"use strict"; var Codesearch = function() { return { socket: null, delegate: null, connect: function(delegate) { if (Codesearch.socket !== null) return; Codesearch.remote = null; Codesearch.delegate = delegate; var socket = io.connect("http://" + document.location.host.repl...
"use strict"; var Codesearch = function() { return { socket: null, delegate: null, connect: function(delegate) { if (Codesearch.socket !== null) return; console.log("Connecting..."); Codesearch.remote = null; Codesearch.delegate = delegate; var socket = io.connect("ht...
Remove only links that have not the data.role class.
var Bind = require("github/jillix/bind"); var Events = require("github/jillix/events"); module.exports = function(config) { var self = this; Events.call(self, config); for (var i in config.roles) { $("." + config.roles[i]).hide(); } var cache; self.updateLinks = function (data) { ...
var Bind = require("github/jillix/bind"); var Events = require("github/jillix/events"); module.exports = function(config) { var self = this; Events.call(self, config); for (var i in config.roles) { $("." + config.roles[i]).hide(); } var cache; self.updateLinks = function (data) { ...
Add route to handle ticket filtering by status
<?php /* |-------------------------------------------------------------------------- | Application Routers |-------------------------------------------------------------------------- | | Here is where you can register all of the routes for an application. | It's a breeze. Simply tell Laravel the URIs it should respond...
<?php /* |-------------------------------------------------------------------------- | Application Routers |-------------------------------------------------------------------------- | | Here is where you can register all of the routes for an application. | It's a breeze. Simply tell Laravel the URIs it should respond...
Add path for laptop for fixtures
# Statement for enabling the development environment DEBUG = True TESTING = True # Define the application directory import os BASE_DIR = os.path.abspath(os.path.dirname(__file__)) # Define the database - we are working with # SQLite for this example SQLALCHEMY_DATABASE_URI = 'mysql+pymysql://root:root@localhost/ont...
# Statement for enabling the development environment DEBUG = True TESTING = True # Define the application directory import os BASE_DIR = os.path.abspath(os.path.dirname(__file__)) # Define the database - we are working with # SQLite for this example SQLALCHEMY_DATABASE_URI = 'mysql+pymysql://root:root@localhost/ont...
Add API version into response header
from flask import Flask, g, request import uuid import requests app = Flask(__name__) app.config.from_pyfile("config.py") @app.before_request def before_request(): # Sets the transaction trace id into the global object if it has been provided in the HTTP header from the caller. # Generate a new one if it ha...
from flask import Flask, g, request import uuid import requests app = Flask(__name__) app.config.from_pyfile("config.py") @app.before_request def before_request(): # Sets the transaction trace id into the global object if it has been provided in the HTTP header from the caller. # Generate a new one if it ha...
Add imageBase64: prefix alongside image: for ticket element values
package com.quicktravel.ticket_printer; public class TicketElement { private int x = 0; private int y = 0; protected String value = ""; private int fontSize = 10; private boolean bold = false; private boolean italic = false; public int getX() { return x; } public void setX(int x) { this.x ...
package com.quicktravel.ticket_printer; public class TicketElement { private int x = 0; private int y = 0; private int fontSize = 10; private boolean bold = false; private boolean italic = false; private String value = ""; public boolean isImage() { return this.value.startsWith("image:"); } ...
Fix requestAnimationFrame case for SSR
/** @flow */ type Callback = (timestamp: number) => void; type CancelAnimationFrame = (requestId: number) => void; type RequestAnimationFrame = (callback: Callback) => number; // Properly handle server-side rendering. let win; if (typeof window !== "undefined") { win = window; } else if (typeof self !== "undefined"...
/** @flow */ type Callback = (timestamp: number) => void; type CancelAnimationFrame = (requestId: number) => void; type RequestAnimationFrame = (callback: Callback) => number; // Properly handle server-side rendering. let win; if (typeof window !== "undefined") { win = window; } else if (typeof self !== "undefined"...
Fix missing default value for RateLimitExceeded constructor
"""errors and exceptions.""" from flask.wrappers import Response from werkzeug import exceptions from .typing import Optional from .wrappers import Limit class RateLimitExceeded(exceptions.TooManyRequests): """Exception raised when a rate limit is hit.""" def __init__(self, limit: Limit, response: Optional...
"""errors and exceptions.""" from flask.wrappers import Response from werkzeug import exceptions from .typing import Optional from .wrappers import Limit class RateLimitExceeded(exceptions.TooManyRequests): """Exception raised when a rate limit is hit.""" def __init__(self, limit: Limit, response: Optional...
Fix name parsing for roads
#!/usr/bin/env python # -*- encoding: utf8 -*- import json import sys result = {} INDEX = { "AREA": 5 + 3 * 3 + 3 * 3, "CITY": 5 + 3 * 3, "CODE": 5 } for line in open("ORIGIN.txt"): code = line[:INDEX["CODE"]] city = line[INDEX["CODE"]: INDEX["CITY"]] if not city in result: result[city] = {...
#!/usr/bin/env python # -*- encoding: utf8 -*- import json import sys result = {} INDEX = { "AREA": 5 + 3 * 3 + 3 * 3, "CITY": 5 + 3 * 3, "CODE": 5 } for line in open("ORIGIN.txt"): code = line[:INDEX["CODE"]] city = line[INDEX["CODE"]: INDEX["CITY"]] if not city in result: result[city] = {...
Add details field to launchpads
const mongoose = require('mongoose'); const mongoosePaginate = require('mongoose-paginate-v2'); const idPlugin = require('mongoose-id'); const launchpadSchema = new mongoose.Schema({ name: { type: String, default: null, }, full_name: { type: String, default: null, }, status: { type: Strin...
const mongoose = require('mongoose'); const mongoosePaginate = require('mongoose-paginate-v2'); const idPlugin = require('mongoose-id'); const launchpadSchema = new mongoose.Schema({ name: { type: String, default: null, }, full_name: { type: String, default: null, }, status: { type: Strin...
Fix bug when env.queries is a function
/** * Resolves queries from a map to arrays of maps to field values. * * @param queries A map to arrays of maps to field values. * @param name Query name. * @param rank Query result rank. * @param field Query result field name. * @return Resolved value, or '' if there was an error. */ function queriesObjectRead...
/** * Resolves queries from a map to arrays of maps to field values. * * @param queries A map to arrays of maps to field values. * @param name Query name. * @param rank Query result rank. * @param field Query result field name. * @return Resolved value, or '' if there was an error. */ function queriesObjectRead...
Add readonly text to form
from django.shortcuts import get_object_or_404, render from django import forms class ExampleForm(forms.Form): text = forms.CharField() disabled_text = forms.CharField(disabled=True) readonly_text = forms.CharField( widget=forms.TextInput(attrs={'readonly':'readonly'}) ) checkbox1 = forms....
from django.shortcuts import get_object_or_404, render from django import forms class ExampleForm(forms.Form): text = forms.CharField() disabled_text = forms.CharField(disabled=True) readonly_text = forms.CharField( widget=forms.TextInput(attrs={'readonly':'readonly'}) ) checkbox1 = forms....
Change newline character to LF
#!/usr/bin/env python3 # -*- coding: utf-8 -*- import Tool import time from Tieba import Tieba def main(): print("Local Time:", time.asctime(time.localtime())) # Read Cookies cookies = Tool.load_cookies_path(".") for cookie in cookies: # Login user = Tieba(cookie) ...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- import Tool import time from Tieba import Tieba def main(): print("Local Time:", time.asctime(time.localtime())) # Read Cookies cookies = Tool.load_cookies_path(".") for cookie in cookies: # Login user = Tieba(cookie) ...
Fix a bug not passing license properly
var path = require('path') var tmp = require('tmp') var html = require('./html.js') var pdf = require('./pdf.js') module.exports = ribosome = {} ribosome.translate = function(url, success, error, license) { tmp.dir(function(err, dirPath) { if (err) { error(err) } else { var htmlPath = path.join(...
var path = require('path') var tmp = require('tmp') var html = require('./html.js') var pdf = require('./pdf.js') module.exports = ribosome = {} ribosome.translate = function(url, success, error, license) { tmp.dir(function(err, dirPath) { if (err) { error(err) } else { var htmlPath = path.join(...
Fix conditional for recipient name/playername
var l10n_file = __dirname + '/../l10n/commands/tell.yml'; var l10n = require('../src/l10n')(l10n_file); var CommandUtil = require('../src/command_util').CommandUtil; exports.command = function(rooms, items, players, npcs, Commands) { return function(args, player) { var message = args.split(' '); var recipien...
var l10n_file = __dirname + '/../l10n/commands/tell.yml'; var l10n = require('../src/l10n')(l10n_file); var CommandUtil = require('../src/command_util').CommandUtil; exports.command = function(rooms, items, players, npcs, Commands) { return function(args, player) { var message = args.split(' '); var recipien...
[Debug] Fix deprecated use of DebugClassLoader
<?php /* * This file is part of the Symfony package. * * (c) Fabien Potencier <fabien@symfony.com> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Symfony\Bundle\DebugBundle\DependencyInjection\Compiler; use Symfony\Co...
<?php /* * This file is part of the Symfony package. * * (c) Fabien Potencier <fabien@symfony.com> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Symfony\Bundle\DebugBundle\DependencyInjection\Compiler; use Symfony\Co...
Fix preview still being slightly different.
from django.views.decorators.csrf import csrf_exempt from django.views.generic import View from django.utils.decorators import method_decorator from django.shortcuts import render # Create your views here. class MarkdownPreview(View): template_name = "markdown_preview.html" @method_decorator(csrf_exempt) ...
from django.views.decorators.csrf import csrf_exempt from django.views.generic import View from django.utils.decorators import method_decorator from django.shortcuts import render # Create your views here. class MarkdownPreview(View): template_name = "markdown_preview.html" @method_decorator(csrf_exempt) ...
Remove initial forward slash from url
<?php require 'src/EndpointRouter.php'; require 'src/endpoints/EndpointHandler.php'; require 'src/endpoints/SummaryEndpoint.php'; require 'src/endpoints/IPEndpoint.php'; require 'src/endpoints/RandomColorEndpoint.php'; require 'src/endpoints/TimeEndpoint.php'; header('Content-Type: application/json'); $router = new ...
<?php require 'src/EndpointRouter.php'; require 'src/endpoints/EndpointHandler.php'; require 'src/endpoints/SummaryEndpoint.php'; require 'src/endpoints/IPEndpoint.php'; require 'src/endpoints/RandomColorEndpoint.php'; require 'src/endpoints/TimeEndpoint.php'; header('Content-Type: application/json'); $router = new ...
Add an aipy version requirement
from setuptools import setup import glob import os.path as op from os import listdir from pyuvdata import version import json data = [version.git_origin, version.git_hash, version.git_description, version.git_branch] with open(op.join('pyuvdata', 'GIT_INFO'), 'w') as outfile: json.dump(data, outfile) setup_args =...
from setuptools import setup import glob import os.path as op from os import listdir from pyuvdata import version import json data = [version.git_origin, version.git_hash, version.git_description, version.git_branch] with open(op.join('pyuvdata', 'GIT_INFO'), 'w') as outfile: json.dump(data, outfile) setup_args =...