text
stringlengths
16
4.96k
positive
stringlengths
321
2.24k
negative
stringlengths
310
2.21k
Change location of default settings in WSGI
""" WSGI config for workout_manager project. This module contains the WSGI application used by Django's development server and any production WSGI deployments. It should expose a module-level variable named ``application``. Django's ``runserver`` and ``runfcgi`` commands discover this application via the ``WSGI_APPLIC...
""" WSGI config for workout_manager project. This module contains the WSGI application used by Django's development server and any production WSGI deployments. It should expose a module-level variable named ``application``. Django's ``runserver`` and ``runfcgi`` commands discover this application via the ``WSGI_APPLIC...
Refactor the script file url
<?php /** * Application component for registering with the Grunt's live reload plugin. */ class LiveReload extends CApplicationComponent { /** * @var string the host name of the server running the live reload server. */ public $host = 'localhost'; /** * @var array live reload ports. *...
<?php /** * Application component for registering with the Grunt's live reload plugin. */ class LiveReload extends CApplicationComponent { /** * @var string the host name of the server running the live reload server. */ public $host = 'localhost'; /** * @var array live reload ports. *...
Fix LinkTag mit mehreren News Komponenten es wurde immer die erste ausgewählt = != ==
<?php class Vpc_Basic_LinkTag_News_Form extends Vpc_Abstract_Form { protected function _initFields() { parent::_initFields(); } public function __construct($name, $class, $id = null) { parent::__construct($name, $class, $id); $this->add(new Vps_Form_Field_Select('news_id', t...
<?php class Vpc_Basic_LinkTag_News_Form extends Vpc_Abstract_Form { protected function _initFields() { parent::_initFields(); } public function __construct($name, $class, $id = null) { parent::__construct($name, $class, $id); $this->add(new Vps_Form_Field_Select('news_id', t...
108536374: Change to a generic message for database errors. Need a story to handle db exceptions in the dao layer
from datetime import datetime from flask import render_template, redirect, jsonify from app.main import main from app.main.dao import users_dao from app.main.forms import RegisterUserForm from app.models import User @main.route("/register", methods=['GET']) def render_register(): return render_template('registe...
from datetime import datetime from flask import render_template, redirect, jsonify from app.main import main from app.main.dao import users_dao from app.main.forms import RegisterUserForm from app.models import User @main.route("/register", methods=['GET']) def render_register(): return render_template('registe...
Add owner to API call for tournaments list
<?php namespace App\Transformers; use App\Models\Tournament; use League\Fractal\TransformerAbstract; class TournamentTransformer extends TransformerAbstract { public function transform(Tournament $tournament) { $teams = []; foreach ($tournament->tournamentTeams as $tournamentTeam) { ...
<?php namespace App\Transformers; use App\Models\Tournament; use League\Fractal\TransformerAbstract; class TournamentTransformer extends TransformerAbstract { public function transform(Tournament $tournament) { $teams = []; foreach ($tournament->tournamentTeams as $tournamentTeam) { ...
Add progress back into the reducer list
import { combineReducers } from 'redux'; import settings from './settings'; import application from './application'; import assessment from './assessment'; import assessmentProgress from './assessment_progress'; import jwt ...
import { combineReducers } from 'redux'; import settings from './settings'; import application from './application'; import assessment from './assessment'; import assessmentProgress from './assessment_progress'; import jwt ...
Use os.path.expanduser to find config directory Works on Windows and Unix.
import click import os import yaml from panoptes_client import Panoptes @click.group() @click.option( '--endpoint', type=str ) @click.pass_context def cli(ctx, endpoint): ctx.config_dir = os.path.expanduser('~/.panoptes/') ctx.config_file = os.path.join(ctx.config_dir, 'config.yml') ctx.config = { ...
import click import os import yaml from panoptes_client import Panoptes @click.group() @click.option( '--endpoint', type=str ) @click.pass_context def cli(ctx, endpoint): ctx.config_dir = os.path.join(os.environ['HOME'], '.panoptes') ctx.config_file = os.path.join(ctx.config_dir, 'config.yml') ctx.conf...
Clear ResourceBundle cache on reload
package fr.aumgn.dac2; import fr.aumgn.bukkitutils.localization.PluginResourceBundles; import fr.aumgn.bukkitutils.localization.bundle.PluginResourceBundle; import fr.aumgn.dac2.config.DACConfig; public class DAC { private final DACPlugin plugin; private DACConfig config; private PluginResourceBundle cm...
package fr.aumgn.dac2; import fr.aumgn.bukkitutils.localization.PluginResourceBundles; import fr.aumgn.bukkitutils.localization.bundle.PluginResourceBundle; import fr.aumgn.dac2.config.DACConfig; public class DAC { private final DACPlugin plugin; private DACConfig config; private PluginResourceBundle cm...
Check if any translations are present in file
<?php declare(strict_types=1); namespace Wingu\FluffyPoRobot\Translation\Loader; use Symfony\Component\Translation\Exception\InvalidResourceException; use Symfony\Component\Yaml\Exception\ParseException; use Symfony\Component\Yaml\Parser as YamlParser; use Symfony\Component\Yaml\Yaml; use function array_values; use ...
<?php declare(strict_types=1); namespace Wingu\FluffyPoRobot\Translation\Loader; use Symfony\Component\Translation\Exception\InvalidResourceException; use Symfony\Component\Yaml\Exception\ParseException; use Symfony\Component\Yaml\Parser as YamlParser; use Symfony\Component\Yaml\Yaml; use function array_values; use ...
Add service name for replacement pattern registry
<?php /* * This file is part of the PcdxParameterEncryptionBundle package. * * (c) picodexter <https://picodexter.io/> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Picodexter\ParameterEncryptionBundle\DependencyInjec...
<?php /* * This file is part of the PcdxParameterEncryptionBundle package. * * (c) picodexter <https://picodexter.io/> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Picodexter\ParameterEncryptionBundle\DependencyInjec...
Switch to hex encoding for key values
package com.kryptnostic.api.v1.client; import java.io.File; import java.io.IOException; import org.apache.commons.codec.binary.Hex; import com.google.common.hash.HashFunction; import com.google.common.hash.Hashing; import com.google.common.io.Files; import com.kryptnostic.kodex.v1.storage.DataStore; /** * A simple...
package com.kryptnostic.api.v1.client; import java.io.File; import java.io.IOException; import com.google.common.hash.HashFunction; import com.google.common.hash.Hashing; import com.google.common.io.Files; import com.kryptnostic.kodex.v1.storage.DataStore; /** * A simple implementation of the client datastore. The ...
Fix globus-sdk python package name To match recent change in SDK repo
from setuptools import setup, find_packages setup( name="globus-cli", version="0.1.0", packages=find_packages(), install_requires=['globus-sdk'], # for now, install directly from GitHub # TODO: once this is on pypi, install from there dependency_links=[ ('https://github.com/globuson...
from setuptools import setup, find_packages setup( name="globus-cli", version="0.1.0", packages=find_packages(), install_requires=['globus-sdk-python'], # for now, install directly from GitHub # TODO: once this is on pypi, install from there dependency_links=[ ('https://github.com/g...
Change EnumSet to Set for better polymorphism.
package language; import java.util.EnumSet; import java.util.Set; /** * {@code Difficulty} is an enumeration of properties which define how objects * of {@link Word} are formatted and also provides for "difficulty" properties * for use in a word game. * * <p> The properties defined in this class are designed ...
package language; import java.util.EnumSet; /** * {@code Difficulty} is an enumeration of properties which define how objects * of {@link Word} are formatted and also provides for "difficulty" properties * for use in a word game. * * <p> The properties defined in this class are designed to be * implementati...
Fix invalid reference before first scroll
'use strict'; // http://stackoverflow.com/a/872537 function getScrollTop(){ if ( typeof window.pageYOffset !== 'undefined' ) { // most browsers except IE before #9 return window.pageYOffset; } else { var b = document.body; // IE 'quirks' var d = document.documentElement; // IE with doctype retu...
'use strict'; // http://stackoverflow.com/a/872537 function getScrollTop(){ if ( typeof window.pageYOffset !== 'undefined' ) { // most browsers except IE before #9 return window.pageYOffset; } else { var b = document.body; // IE 'quirks' var d = document.documentElement; // IE with doctype retu...
Fix forceUpdate sometimes called on unmounted component.
/* @flow */ import React from 'react' import MessageView from '../Message' import type { Message } from 'types' import styles from './style.css' type Props = { messages: Array<Message> } export default class MessageList extends React.Component<*, Props, *> { timer: Object constructor (props: Props) { super...
/* @flow */ import React from 'react' import MessageView from '../Message' import type { Message } from 'types' import styles from './style.css' type Props = { messages: Array<Message> } export default class MessageList extends React.Component<*, Props, *> { constructor (props: Props) { super(props) // Ev...
Use <div> instead of <span> when dynamically generating module routes and containers The `getModuleRoutes` method appears to generate a routing entry for all loaded stripes modules. It then maps those routes to a container node that sort of functions as a namespace for the different UI modules installed in the Folio ...
import React from 'react'; import Route from 'react-router-dom/Route'; import { connectFor } from '@folio/stripes-connect'; import { modules } from 'stripes-loader'; // eslint-disable-line import AddContext from './AddContext'; if (!Array.isArray(modules.app) && modules.length < 0) { throw new Error('At least one mo...
import React from 'react'; import Route from 'react-router-dom/Route'; import { connectFor } from '@folio/stripes-connect'; import { modules } from 'stripes-loader'; // eslint-disable-line import AddContext from './AddContext'; if (!Array.isArray(modules.app) && modules.length < 0) { throw new Error('At least one mo...
Mark package as not zip_safe
#!/usr/bin/env python import os from setuptools import setup def read(fname): return open(os.path.join(os.path.dirname(__file__), fname)).read() setup( name="statprof-smarkets", version="0.2.0c1", author="Smarkets", author_email="support@smarkets.com", description="Statistical profiling for...
#!/usr/bin/env python import os from setuptools import setup def read(fname): return open(os.path.join(os.path.dirname(__file__), fname)).read() setup( name="statprof-smarkets", version="0.2.0c1", author="Smarkets", author_email="support@smarkets.com", description="Statistical profiling for...
Add own tuple_index function to stay compatible with python 2.5
from social_auth.backends import PIPELINE from social_auth.utils import setting PIPELINE_ENTRY = 'social_auth.backends.pipeline.misc.save_status_to_session' def tuple_index(t, e): for (i, te) in enumerate(t): if te == e: return i return None def save_status_to_session(request, auth, *arg...
from social_auth.backends import PIPELINE from social_auth.utils import setting PIPELINE_ENTRY = 'social_auth.backends.pipeline.misc.save_status_to_session' def save_status_to_session(request, auth, *args, **kwargs): """Saves current social-auth status to session.""" next_entry = setting('SOCIAL_AUTH_PIPELI...
Send annotation tags as array.
angular.module("Prometheus.services").factory('AnnotationRefresher', ["$http", function($http) { return function(graph, scope) { var tags = graph.tags.map(function(e) { if (e.name) { return e.name.split(",").map(function(s) { return s.trim(); }); } else { return ""; } }) ...
angular.module("Prometheus.services").factory('AnnotationRefresher', ["$http", function($http) { return function(graph, scope) { var tags = graph.tags.map(function(e) { if (e.name) { return e.name.split(",").map(function(s) { return s.trim(); }); } else { return ""; } }) ...
Load the group when we load the store page
import angular from "angular"; import uiRouter from "angular-ui-router"; import storeDetailComponent from "./storeDetail.component"; let storeDetailModule = angular.module("storeDetail", [ uiRouter ]) .component("storeDetail", storeDetailComponent) .config(($stateProvider, hookProvider) => { "ngInject"; $state...
import angular from "angular"; import uiRouter from "angular-ui-router"; import storeDetailComponent from "./storeDetail.component"; let storeDetailModule = angular.module("storeDetail", [ uiRouter ]) .component("storeDetail", storeDetailComponent) .config(($stateProvider, hookProvider) => { "ngInject"; $state...
Correct blocmetrics route to include v1
var elements = document.getElementsByTagName('script') Array.prototype.forEach.call(elements, function(element) { if (element.type.indexOf('math/tex') != -1) { // Extract math markdown var textToRender = element.innerText || element.textContent; // Create span for KaTeX var katexElement = docume...
var elements = document.getElementsByTagName('script') Array.prototype.forEach.call(elements, function(element) { if (element.type.indexOf('math/tex') != -1) { // Extract math markdown var textToRender = element.innerText || element.textContent; // Create span for KaTeX var katexElement = docume...
Fix generics as a result of Java 7 upgrade
package io.mypojo.framework; import io.mypojo.felix.framework.ServiceRegistry; import io.mypojo.felix.framework.util.EventDispatcher; import org.osgi.framework.Bundle; import org.osgi.framework.BundleContext; import org.osgi.framework.ServiceEvent; import java.util.Dictionary; import java.util.HashMap; import java.ut...
package io.mypojo.framework; import io.mypojo.felix.framework.ServiceRegistry; import io.mypojo.felix.framework.util.EventDispatcher; import org.osgi.framework.Bundle; import org.osgi.framework.BundleContext; import org.osgi.framework.ServiceEvent; import java.util.Dictionary; import java.util.HashMap; import java.ut...
Fix - call function on null in activity api
<?php namespace App\Repositories; use App\Models\Activity; use Illuminate\Database\Eloquent\Collection; class ActivityRepository { /** * @var mixed */ protected $model; /** * @param Activity $activity */ public function __construct(Activity $activity) { $this->model =...
<?php namespace App\Repositories; use App\Models\Activity; use Illuminate\Database\Eloquent\Collection; class ActivityRepository { /** * @var mixed */ protected $model; /** * @param Activity $activity */ public function __construct(Activity $activity) { $this->model =...
Remove docs count for user prompt - it simply took too long to query the DB for when the DB is more full (30+ secs) - put indexes on, however would only with with '_id' + 'url', and then querying per doc type ended up taking minutes even with index :/ - now do it async in the background and remove the count given to u...
import db, { normaliseFindResult } from 'src/pouchdb' import { deleteDocs } from 'src/page-storage/deletion' import { addToBlacklist } from '..' /** * Handles confirmation and running of a quick blacklist request from the popup script. * * @param {string} url The URL being blacklisted. */ export default function q...
import db, { normaliseFindResult } from 'src/pouchdb' import { deleteDocs } from 'src/page-storage/deletion' import { addToBlacklist } from '..' /** * Handles confirmation and running of a quick blacklist request from the popup script. * * @param {string} url The URL being blacklisted. */ export default async func...
Allow js requests from any website
<?php // // NOTE! // Этот PHP скриптик вытаскивает все картинки с расписанием со странички: // http://lumenfilm.com/gusev/affishe // // и возвращает JSON, который затем используется в kino_lumen.html // header("Content-type:application/json"); header("Access-Control-Allow-Origin:*"); $html = file_get_contents('http:...
<?php // // NOTE! // Этот PHP скриптик вытаскивает все картинки с расписанием со странички: // http://lumenfilm.com/gusev/affishe // // и возвращает JSON, который затем используется в kino_lumen.html // header("Content-type:application/json"); $html = file_get_contents('http://lumenfilm.com/gusev/affishe'); preg_ma...
Change of request (sensitive problem)
<?php class Search { protected static $_pdo; protected $_table = "aliments"; public function __construct() { try { self::$_pdo = new PDO('mysql:host=localhost; dbname=nutriproject', 'root', ''); self::$_pdo->exec("SET NAMES 'UTF8'"); } catch (Exception $e) { die('Erreur : ' . $e->getMessage()); ...
<?php class Search { protected static $_pdo; protected $_table = "aliments"; public function __construct() { try { self::$_pdo = new PDO('mysql:host=localhost; dbname=nutriproject', 'root', ''); self::$_pdo->exec("SET NAMES 'UTF8'"); } catch (Exception $e) { die('Erreur : ' . $e->getMessage()); ...
Add debug output to console in onBeforeSendRequestHeaders callback
/* Author: mythern Copyright (C) 2014, MIT License http://www.opensource.org/licenses/mit-license.php Adressaway is provided free of charge, to any person obtaining a copy of this software and associated documentation files, to deal in the Software without restriction, including without li...
/* Author: mythern Copyright (C) 2014, MIT License http://www.opensource.org/licenses/mit-license.php Adressaway is provided free of charge, to any person obtaining a copy of this software and associated documentation files, to deal in the Software without restriction, including without li...
Remove coverage options from default test run These were getting annoying for normal runs.
#!/usr/bin/env python import sys import logging from optparse import OptionParser from tests.config import configure logging.disable(logging.CRITICAL) def run_tests(*test_args): from django_nose import NoseTestSuiteRunner test_runner = NoseTestSuiteRunner() if not test_args: test_args = ['tests'...
#!/usr/bin/env python import sys import logging from optparse import OptionParser from tests.config import configure logging.disable(logging.CRITICAL) def run_tests(*test_args): from django_nose import NoseTestSuiteRunner test_runner = NoseTestSuiteRunner() if not test_args: test_args = ['tests'...
Test update as lib, not in bin.
'use strict'; /** * Run package tests. * (C) 2014 Alex Fernández. */ // requires var testing = require('testing'); var Log = require('log'); // globals var log = new Log('info'); /** * Run all module tests. */ exports.test = function(callback) { log.debug('Running tests'); var tests = {}; var libs = ['esti...
'use strict'; /** * Run package tests. * (C) 2014 Alex Fernández. */ // requires var testing = require('testing'); var Log = require('log'); // globals var log = new Log('info'); /** * Run all module tests. */ exports.test = function(callback) { log.debug('Running tests'); var tests = {}; var libs = ['esti...
Fix watch was referring to subtask with typo
'use strict'; module.exports = function (grunt) { grunt.initConfig({ pkg: grunt.file.readJSON('package.json'), watch: { scss: { files: ['app/styles/**/*.scss'], tasks: ['sass'] } }, sass: { dist: { files: [{ expand: true, cwd: 'app/style...
'use strict'; module.exports = function (grunt) { grunt.initConfig({ pkg: grunt.file.readJSON('package.json'), watch: { scss: { files: ['app/styles/**/*.scss'], tasks: ['scss'] } }, sass: { dist: { files: [{ expand: true, cwd: 'app/style...
Make hex object id possible in path params.
package routes import ( "errors" "fmt" "strings" ) // Converts patterns like "/users/:id" to "/users/(?P<id>\d+)" func convertSimplePatternToRegexp(pattern string) string { parts := strings.Split(pattern, "/") for i, part := range parts { if len(part) != 0 && part[0] == ':' { parts[i] = fmt.Sprintf(`(?P<%s>...
package routes import ( "errors" "fmt" "strings" ) // Converts patterns like "/users/:id" to "/users/(?P<id>\d+)" func convertSimplePatternToRegexp(pattern string) string { parts := strings.Split(pattern, "/") for i, part := range parts { if len(part) != 0 && part[0] == ':' { parts[i] = fmt.Sprintf(`(?P<%s>...
Remove existing JARs before building new ones
#!/usr/bin/env python import os import shutil from glob import glob from subprocess import call, check_output OUTPUT_DIR_NAME = 'jars' def call_unsafe(*args, **kwargs): kwargs['shell'] = True call(*args, **kwargs) call_unsafe('./gradlew clean javadocRelease jarRelease') try: os.mkdir(OUTPUT_DIR_NAME)...
#!/usr/bin/env python import os import shutil from glob import glob from subprocess import call, check_output OUTPUT_DIR_NAME = 'jars' def call_unsafe(*args, **kwargs): kwargs['shell'] = True call(*args, **kwargs) call_unsafe('./gradlew clean javadocRelease jarRelease') try: os.mkdir(OUTPUT_DIR_NAME)...
Increase history capable days from 15 to 60 for White Ninja
from comics.crawler.base import BaseComicCrawler from comics.crawler.meta import BaseComicMeta from comics.crawler.utils.lxmlparser import LxmlParser class ComicMeta(BaseComicMeta): name = 'White Ninja' language = 'en' url = 'http://www.whiteninjacomics.com/' start_date = '2002-01-01' history_capab...
from comics.crawler.base import BaseComicCrawler from comics.crawler.meta import BaseComicMeta from comics.crawler.utils.lxmlparser import LxmlParser class ComicMeta(BaseComicMeta): name = 'White Ninja' language = 'en' url = 'http://www.whiteninjacomics.com/' start_date = '2002-01-01' history_capab...
Add warning about failing functional test
#!/usr/bin/env python from unittest import TestCase import mechanize class ResponseTests(TestCase): def test_close_pickle_load(self): print ("This test is expected to fail unless Python standard library" "patch http://python.org/sf/1144636 has been applied") import pickle ...
#!/usr/bin/env python from unittest import TestCase import mechanize class ResponseTests(TestCase): def test_close_pickle_load(self): import pickle b = mechanize.Browser() r = b.open("http://wwwsearch.sf.net/bits/cctest2.txt") r.read() r.close() r.seek(0) ...
refactor: Use promise instead async fn
import mapService from 'new-dashboard/core/map-service'; import { visualizations as fakeVisualizations } from '../fixtures/visualizations'; jest.mock('carto-node'); describe('mapService', () => { describe('.fetchMaps', () => { describe('when no parameters are given', () => { let response; beforeAll(d...
import mapService from 'new-dashboard/core/map-service'; import { visualizations as fakeVisualizations } from '../fixtures/visualizations'; jest.mock('carto-node'); describe('mapService', () => { describe('.fetchMaps', () => { describe('when no parameters are given', () => { let response; beforeAll(a...
Fix hot pepper cheese hardness bug
package simplemods.cheesemod.blocks; import java.util.Random; import simplemods.cheesemod.BaseMod; import simplemods.cheesemod.CommonProxy; import simplemods.cheesemod.inventory.CCreativeTabs; import net.minecraft.block.Block; import net.minecraft.block.material.Material; import net.minecraft.item.Item; imp...
package simplemods.cheesemod.blocks; import java.util.Random; import simplemods.cheesemod.BaseMod; import simplemods.cheesemod.CommonProxy; import simplemods.cheesemod.inventory.CCreativeTabs; import net.minecraft.block.Block; import net.minecraft.block.material.Material; import net.minecraft.item.Item; /** * No, th...
Stop polluting git workspace with temporary files created while running unit tests fix #156
package helper import ( "fmt" "io/ioutil" "os" ) func WithDummyCredentials(fn func(dir string)) { dir, err := ioutil.TempDir("", "dummy-credentials") if err != nil { panic(err) } // Remove all the contents in the dir including *.pem.enc created by ReadOrUpdateCompactTLSAssets() // Otherwise we end up with...
package helper import ( "fmt" "io/ioutil" "os" ) func WithDummyCredentials(fn func(dir string)) { if _, err := ioutil.ReadDir("temp"); err != nil { if err := os.Mkdir("temp", 0755); err != nil { panic(err) } } dir, err := ioutil.TempDir("temp", "dummy-credentials") if err != nil { panic(err) } //...
Change return object, use gulp from args
var modula = require('modula-loader'), _ = require('lodash'), plugins = require('gulp-load-plugins')() plugins.uglify = require('gulp-uglify') plugins.cleanCSS = require('gulp-clean-css') plugins.path = require('path') plugins.gutil = require('gulp-util') function taskify(config){ var opts = conf...
var gulp = require('gulp'), modula = require('modula-loader'), _ = require('lodash'), plugins = require('gulp-load-plugins')() plugins.uglify = require('gulp-uglify') plugins.minifycss = require('gulp-minify-css') plugins.path = require('path') plugins.gutil = require('gulp-util') function taski...
Disable secure cookies for admin development.
from datetime import timedelta from pathlib import Path DEBUG = True PERMANENT_SESSION_LIFETIME = timedelta(14) SECRET_KEY = b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00' SESSION_COOKIE_SECURE = False LOCALE = 'de_DE.UTF-8' LOCALES_FORMS = ['de'] SQLALCHEMY_DATA...
from datetime import timedelta from pathlib import Path DEBUG = True PERMANENT_SESSION_LIFETIME = timedelta(14) SECRET_KEY = b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00' SESSION_COOKIE_SECURE = True LOCALE = 'de_DE.UTF-8' LOCALES_FORMS = ['de'] SQLALCHEMY_DATAB...
Add ability to customize default routing port
package main import ( "fmt" "net/http/httputil" "net/url" "os" docker "github.com/fsouza/go-dockerclient" ) type DestinationMap map[string]*Destination type Destination struct { targetUrl *url.URL proxy *httputil.ReverseProxy } func getDefaultPort() string { port := os.Getenv("DEFAULT_PORT") if port =...
package main import ( "fmt" "net/http/httputil" "net/url" docker "github.com/fsouza/go-dockerclient" ) type DestinationMap map[string]*Destination type Destination struct { targetUrl *url.URL proxy *httputil.ReverseProxy } func NewDestination(container *docker.Container) (*Destination, error) { ip := co...
Create chart set api updated
'use strict'; /** * @ngdoc function * @name eagleeye.controller:ChartSetCreationController * @description * # ChartSetCreationController * Controller of the eagleeye */ angular.module('eagleeye') .controller('ChartSetCreationController', [ '$state', 'EagleEyeWebService', function ($state, EagleEyeW...
'use strict'; /** * @ngdoc function * @name eagleeye.controller:ChartSetCreationController * @description * # ChartSetCreationController * Controller of the eagleeye */ angular.module('eagleeye') .controller('ChartSetCreationController', [ '$state', 'EagleEyeWebService', function ($state, EagleEyeW...
Fix token precedence for variable names / operators.
package org.nwapw.abacus.tree; /** * Enum to represent the type of the token that has been matched * by the lexer. */ public enum TokenType { INTERNAL_FUNCTION_END(-1), ANY(0), WHITESPACE(1), COMMA(2), VARIABLE(3), OP(4), TREE_VALUE_OP(4), NUM(5), FUNCTION(6), TREE_VALUE_FUNCTION(6), OPEN_PARENTH(7), C...
package org.nwapw.abacus.tree; /** * Enum to represent the type of the token that has been matched * by the lexer. */ public enum TokenType { INTERNAL_FUNCTION_END(-1), ANY(0), WHITESPACE(1), COMMA(2), OP(3), TREE_VALUE_OP(3), NUM(4), VARIABLE(5), FUNCTION(6), TREE_VALUE_FUNCTION(6), OPEN_PARENTH(7), C...
Add -- to git log call
import os from dateutil.parser import parse from ..common import run, chdir def check_dates(spec_id, username, spec, basedir): """ Port of the CheckDates program from C++ Finds the first submission date for an assignment by comparing first commits for all files in the spec and ret...
import os from dateutil.parser import parse from ..common import run, chdir def check_dates(spec_id, username, spec, basedir): """ Port of the CheckDates program from C++ Finds the first submission date for an assignment by comparing first commits for all files in the spec and ret...
Add voluptuous as a dependency
#! /usr/bin/env python3 # -*- coding: utf-8 -*- from setuptools import setup from dlstats import version import os setup(name='dlstats', version=version.version, description='A python module that provides an interface between statistics providers and pandas.', author='Widukind team', author_email='dev@mic...
#! /usr/bin/env python3 # -*- coding: utf-8 -*- from setuptools import setup from dlstats import version import os setup(name='dlstats', version=version.version, description='A python module that provides an interface between statistics providers and pandas.', author='Widukind team', author_email='dev@mic...
Revert "reverse changes to MorhiaFixtures which is specific to 1.2.1" This reverts commit 4e00685568a7eb9edcf39bd20d2c5272f5d365aa.
package play.test; import java.util.List; import play.Play; import play.modules.morphia.Model; import play.modules.morphia.MorphiaPlugin; import play.test.Fixtures; import com.google.code.morphia.Datastore; public class MorphiaFixtures extends Fixtures { private static Datastore ds() { return MorphiaP...
package play.test; import java.util.List; import play.Play; import play.modules.morphia.Model; import play.modules.morphia.MorphiaPlugin; import play.test.Fixtures; import com.google.code.morphia.Datastore; public class MorphiaFixtures extends Fixtures { private static Datastore ds() { return MorphiaP...
Add a doc string to make using this dataset easier
# -*- coding: utf-8 -*- # modified from https://github.com/CamDavidsonPilon/lifelines/ import pandas as pd from pkg_resources import resource_filename __all__ = [ 'load_cdnow', 'load_transaction_data', ] def load_dataset(filename, **kwargs): ''' Load a dataset from lifetimes.datasets Parameters...
# -*- coding: utf-8 -*- # modified from https://github.com/CamDavidsonPilon/lifelines/ import pandas as pd from pkg_resources import resource_filename __all__ = [ 'load_cdnow', 'load_transaction_data', ] def load_dataset(filename, **kwargs): ''' Load a dataset from lifetimes.datasets Parameters...
Make column numbers in Location mandatory
var esprima = require('esprima'); /** * Position in the source file. * * @see [SpiderMonkey Parser API] * {@link https://developer.mozilla.org/en-US/docs/Mozilla/Projects/SpiderMonkey/Parser_API} * * @typedef {Object} Position * @property {number} line - Line number, 1-indexed. * @property {?number} column ...
var esprima = require('esprima'); /** * Position in the source file. * * @see [SpiderMonkey Parser API] * {@link https://developer.mozilla.org/en-US/docs/Mozilla/Projects/SpiderMonkey/Parser_API} * * @typedef {Object} Position * @property {number} line - Line number, 1-indexed. * @property {?number} column...
Javadoc: Correct typo and add missing return description git-svn-id: https://svn.apache.org/repos/asf/jmeter/trunk@1776143 13f79535-47bb-0310-9956-ffa450edef68 Former-commit-id: cd0402100b64b469e5e64c92fc87013f44cb1a3c
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may ...
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may ...
Create packet assuming variable LiveID length Fixes #7
var dgram = require('dgram'); const PORT = 5050; module.exports = Xbox; function Xbox(ip, id) { this.ip = ip; this.id = id; return this; } Xbox.prototype.powerOn = function(callback) { callback = callback || function() {}; // Open socket var socket = dgram.createSocket('udp4'); // Create payload v...
var dgram = require('dgram'); const PORT = 5050 const PING_PAYLOAD = "dd00000a000000000000000400000002" const POWER_PAYLOAD = "dd02001300000010" module.exports = Xbox; function Xbox(ip, id) { this.ip = ip; this.id = id; return this; } Xbox.prototype.powerOn = function(callback) { callback = callback || func...
Remove unused import from label component spec
import React from 'react'; import { render } from 'enzyme'; import { expect } from 'chai'; import { Label } from '../../src/components/label'; import { Colors } from '../../src/enums'; // TODO: Add test cases for invalid enum values describe('Label component', () => { it('sets tag name', () => { const componen...
import React from 'react'; import { render } from 'enzyme'; import { expect } from 'chai'; import { Label, LabelColors } from '../../src/components/label'; import { Colors } from '../../src/enums'; // TODO: Add test cases for invalid enum values describe('Label component', () => { it('sets tag name', () => { c...
Fix Place spell with copy
package com.elmakers.mine.bukkit.plugins.magic.spells; import org.bukkit.block.Block; import com.elmakers.mine.bukkit.blocks.BlockList; import com.elmakers.mine.bukkit.blocks.MaterialBrush; import com.elmakers.mine.bukkit.plugins.magic.BrushSpell; import com.elmakers.mine.bukkit.plugins.magic.SpellResult; import com....
package com.elmakers.mine.bukkit.plugins.magic.spells; import org.bukkit.block.Block; import com.elmakers.mine.bukkit.blocks.BlockList; import com.elmakers.mine.bukkit.blocks.MaterialBrush; import com.elmakers.mine.bukkit.plugins.magic.BrushSpell; import com.elmakers.mine.bukkit.plugins.magic.SpellResult; import com....
Update Jasmine syntax examples to make them shorter.
describe("Gilded Rose", function() { // var foo; // beforeEach(function() { // foo = 0; // }); // afterEach(function() { // foo = 0; // }); it("should do something", function() { }); // it("is a syntax example", function() { // expect(true).toBe(true); // }); // it("can have a nega...
describe("Gilded Rose", function() { var foo; // beforeEach(function() { // foo = 0; // foo += 1; // }); // afterEach(function() { // foo = 0; // }); it("should do something", function() { }); // it("is a syntax example", function() { // expect(true).toBe(true); // }); // it("c...
Index location into a geopoint The geopoint is a geolocation type which amongst other things supports geohashing. KB-351
'use strict'; module.exports = metadata => { var coordinates; if (metadata.google_maps_coordinates) { coordinates = metadata.google_maps_coordinates; metadata.location_is_approximate = false; } else if (metadata.google_maps_coordinates_crowd) { coordinates = metadata.google_maps_coordinates_crowd; ...
'use strict'; module.exports = metadata => { var coordinates; if (metadata.google_maps_coordinates) { coordinates = metadata.google_maps_coordinates; metadata.location_is_approximate = false; } else if (metadata.google_maps_coordinates_crowd) { coordinates = metadata.google_maps_coordinates_crowd; ...
Fix testing if element exists.
$(function() { var cookieName = '_wheelmap_splash_seen'; var setCookie = function() { $.cookie(cookieName, true, { expires: 1000 }); }; if(!$.cookie(cookieName)) { var width = 600; // splash width // calculate left edge so it is centered var left = (0.5 - (width / 2)/($(window).width())) * 100...
$(function() { var cookieName = '_wheelmap_splash_seen'; var setCookie = function() { $.cookie(cookieName, true, { expires: 1000 }); }; if(!$.cookie(cookieName)) { var width = 600; // splash width // calculate left edge so it is centered var left = (0.5 - (width / 2)/($(window).width())) * 100...
Set 0.1.1 as minimum version of loam
from setuptools import setup with open('README.rst') as rdm: README = rdm.read() setup( name='qjobs', use_scm_version=True, description='Get a clean and flexible output from qstat', long_description=README, url='https://github.com/amorison/qjobs', author='Adrien Morison', author_ema...
from setuptools import setup with open('README.rst') as rdm: README = rdm.read() setup( name='qjobs', use_scm_version=True, description='Get a clean and flexible output from qstat', long_description=README, url='https://github.com/amorison/qjobs', author='Adrien Morison', author_ema...
Use an iframe to create a testDocument… instead of `createHTMLDocument` since it isn't fully support by the browsers we care about. fixes #606 fixes #454
/** * Copyright 2013 Facebook, Inc. * * 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 ...
/** * Copyright 2013 Facebook, Inc. * * 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 ...
Fix potential NPE in constructor
/* * Copyright 2010 DTO Labs, Inc. (http://dtolabs.com) * * 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...
/* * Copyright 2010 DTO Labs, Inc. (http://dtolabs.com) * * 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...
cmd/bintogo: Remove need to get file size in advance.
package main import ( "bufio" "io" "os" "text/template" ) const ( dataTmpl = `// This file was auto-generated. package {{.Pkg}} var {{.Name}}Data = [...]byte{ {{range .Data}} {{printf "0x%02X" .}}, {{end}}}` ) var tmpl = new(template.Template) func init() { template.Must(tmpl.New("data").Parse(dataTmpl)) } ...
package main import ( "bufio" "io" "os" "text/template" ) const ( dataTmpl = `// This file was auto-generated. package {{.Pkg}} var {{.Name}}Data = [{{.Size}}]byte{ {{range .Data}} {{printf "0x%02X" .}}, {{end}}}` ) var tmpl = new(template.Template) func init() { template.Must(tmpl.New("data").Parse(dataTmp...
Remove fixture teardown since nothing should be saved (tmpdir)
import string import pytest @pytest.fixture def identity_fixures(): l = [] for i, c in enumerate(string.ascii_uppercase): l.append(dict( name='identity_{0}'.format(i), access_key_id='someaccesskey_{0}'.format(c), secret_access_key='notasecret_{0}_{1}'.format(i, c), ...
import string import pytest @pytest.fixture def identity_fixures(): l = [] for i, c in enumerate(string.ascii_uppercase): l.append(dict( name='identity_{0}'.format(i), access_key_id='someaccesskey_{0}'.format(c), secret_access_key='notasecret_{0}_{1}'.format(i, c), ...
Test all the Jmbo content types
from os.path import expanduser from foundry.settings import * # Postgis because we want to test full functionality DATABASES = { 'default': { 'ENGINE': 'django.contrib.gis.db.backends.postgis', 'NAME': 'jmbo_spatial', 'USER': 'postgres', 'PASSWORD': '', 'HOST': '', ...
from os.path import expanduser from foundry.settings import * # Postgis because we want to test full functionality DATABASES = { 'default': { 'ENGINE': 'django.contrib.gis.db.backends.postgis', 'NAME': 'jmbo_spatial', 'USER': 'postgres', 'PASSWORD': '', 'HOST': '', ...
Use PORT env var for heroku demo
require('./lib/seed')() const { compose } = require('ramda') const http = require('http') const util = require('util') const { logger, methods, mount, parseJson, redirect, routes, static } = require('..') const { createCourse, fetchCourse, fetchCourses, updateCourse } = require('./api/courses') const...
require('./lib/seed')() const { compose } = require('ramda') const http = require('http') const util = require('util') const { logger, methods, mount, parseJson, redirect, routes, static } = require('..') const { createCourse, fetchCourse, fetchCourses, updateCourse } = require('./api/courses') const...
Add missing line of code (merge/rebase effect).
#!/usr/bin/env python from setuptools import setup setup( name="letsencrypt", version="0.1", description="Let's Encrypt", author="Let's Encrypt Project", license="", url="https://letsencrypt.org", packages=[ 'letsencrypt', 'letsencrypt.client', 'letsencrypt.scripts'...
#!/usr/bin/env python from setuptools import setup setup( name="letsencrypt", version="0.1", description="Let's Encrypt", author="Let's Encrypt Project", license="", url="https://letsencrypt.org", packages=[ 'letsencrypt', 'letsencrypt.client', 'letsencrypt.scripts'...
Remove "Bg" namespace from widgets
<?php class sfWidgetFormI18nSelect2ChoiceCurrency extends sfWidgetFormSelect2Choice { protected function configure($options = array(), $attributes = array()) { parent::configure($options, $attributes); $this->addOption('culture', sfContext::getInstance()->getUser()->getCulture()); ...
<?php class sfWidgetFormI18nSelect2ChoiceCurrency extends BgWidgetFormSelect2Choice { protected function configure($options = array(), $attributes = array()) { parent::configure($options, $attributes); $this->addOption('culture', sfContext::getInstance()->getUser()->getCulture()); ...
Add patient code number sequence
/* eslint-disable import/prefer-default-export */ /** * mSupply Mobile * Sustainable Solutions (NZ) Ltd. 2019 */ const HOURS_PER_DAY = 24; const MINUTES_PER_HOUR = 60; const SECONDS_PER_MINUTE = 60; const MILLISECONDS_PER_SECOND = 1000; export const MILLISECONDS_PER_MINUTE = MILLISECONDS_PER_SECOND * SECONDS_PER_M...
/* eslint-disable import/prefer-default-export */ /** * mSupply Mobile * Sustainable Solutions (NZ) Ltd. 2019 */ const HOURS_PER_DAY = 24; const MINUTES_PER_HOUR = 60; const SECONDS_PER_MINUTE = 60; const MILLISECONDS_PER_SECOND = 1000; export const MILLISECONDS_PER_MINUTE = MILLISECONDS_PER_SECOND * SECONDS_PER_M...
Update recommended libspotify and pyspotify version
"""A backend for playing music from Spotify `Spotify <http://www.spotify.com/>`_ is a music streaming service. The backend uses the official `libspotify <http://developer.spotify.com/en/libspotify/overview/>`_ library and the `pyspotify <http://github.com/mopidy/pyspotify/>`_ Python bindings for libspotify. This backe...
"""A backend for playing music from Spotify `Spotify <http://www.spotify.com/>`_ is a music streaming service. The backend uses the official `libspotify <http://developer.spotify.com/en/libspotify/overview/>`_ library and the `pyspotify <http://github.com/mopidy/pyspotify/>`_ Python bindings for libspotify. This backe...
Allow to add a base url to find media
# -*- coding: utf-8 -*- from markdown2 import markdown, markdown_path from weasyprint import HTML, CSS from .exceptions import ValidationError __title__ = 'md2pdf' __version__ = '0.2.1' __author__ = 'Julien Maupetit' __license__ = 'MIT' __copyright__ = 'Copyright 2013 Julien Maupetit' def md2pdf(pdf_file_path, md_...
# -*- coding: utf-8 -*- from markdown2 import markdown, markdown_path from weasyprint import HTML, CSS from .exceptions import ValidationError __title__ = 'md2pdf' __version__ = '0.2.1' __author__ = 'Julien Maupetit' __license__ = 'MIT' __copyright__ = 'Copyright 2013 Julien Maupetit' def md2pdf(pdf_file_path, md_...
Declare egg to not be zip-safe If the egg is installed zipped, `python manage.py collectstatic` will fail to find the resources under `static`.
from os import path from setuptools import setup from subprocess import check_call from distutils.command.build import build from setuptools.command.develop import develop def get_submodules(): if path.exists('.git'): check_call(['rm', '-rf', 'pagedown/static/pagedown']) check_call(['git', 'reset'...
from os import path from setuptools import setup from subprocess import check_call from distutils.command.build import build from setuptools.command.develop import develop def get_submodules(): if path.exists('.git'): check_call(['rm', '-rf', 'pagedown/static/pagedown']) check_call(['git', 'reset'...
:bug: Fix NPE in protobuffer example test class [skip ci]
package org.restheart.examples; import java.io.IOException; import com.google.protobuf.InvalidProtocolBufferException; import com.mashape.unirest.http.Unirest; import com.mashape.unirest.http.exceptions.UnirestException; public class Test { public static void main(String[] args) throws Exception { testRe...
package org.restheart.examples; import java.io.IOException; import com.google.protobuf.InvalidProtocolBufferException; import com.mashape.unirest.http.Unirest; import com.mashape.unirest.http.exceptions.UnirestException; public class Test { public static void main(String[] args) throws Exception { testRe...
Fix focus style for links.
import React from 'react' import Link from 'next/link' import {A} from './styled' import {css} from 'react-emotion' const common = ` position: relative; outline: none; color: inherit; text-decoration: none; text-transform: uppercase; letter-spacing: 1px; font-weight: 300; font-size: 1.25rem; line-hei...
import React from 'react' import Link from 'next/link' import {A} from './styled' import {css} from 'react-emotion' const common = ` position: relative; outline: none; color: inherit; text-decoration: none; text-transform: uppercase; letter-spacing: 1px; font-weight: 300; font-size: 1.25rem; line-hei...
Raise system code on exit from `python -m detox`
import sys import py import detox from detox.proc import Detox def parse(args): from tox.session import prepare return prepare(args) def main(args=None): if args is None: args = sys.argv[1:] config = parse(args) #now = py.std.time.time() detox = Detox(config) detox.startloopreport(...
import sys import py import detox from detox.proc import Detox def parse(args): from tox.session import prepare return prepare(args) def main(args=None): if args is None: args = sys.argv[1:] config = parse(args) #now = py.std.time.time() detox = Detox(config) detox.startloopreport(...
Change output filename for combined results to avoid recursive accumulation
#!/usr/bin/env python """ Simple script to combine JUnit test results into a single XML file. Useful for Jenkins. TODO: Pretty indentation """ import os from xml.etree import cElementTree as ET def find_all(name, path): result = [] for root, dirs, files in os.walk(path): if name in files: ...
#!/usr/bin/env python """ Simple script to combine JUnit test results into a single XML file. Useful for Jenkins. TODO: Pretty indentation """ import os from xml.etree import cElementTree as ET def find_all(name, path): result = [] for root, dirs, files in os.walk(path): if name in files: ...
Check for right kind of error in invalid creds test
from oauthlib.oauth2 import InvalidClientError import pytest from test import configure_mendeley, cassette def test_should_get_authenticated_session(): mendeley = configure_mendeley() auth = mendeley.start_client_credentials_flow() with cassette('fixtures/auth/client_credentials/get_authenticated_sessio...
from oauthlib.oauth2 import InvalidClientError import pytest from test import configure_mendeley, cassette def test_should_get_authenticated_session(): mendeley = configure_mendeley() auth = mendeley.start_client_credentials_flow() with cassette('fixtures/auth/client_credentials/get_authenticated_sessio...
Fix test to run under Linux CI
<?php use Valet\PhpFpm; use Illuminate\Container\Container; class PhpFpmTest extends PHPUnit_Framework_TestCase { public function setUp() { $_SERVER['SUDO_USER'] = user(); Container::setInstance(new Container); } public function tearDown() { exec('rm -rf '.__DIR__.'/outp...
<?php use Valet\PhpFpm; use Illuminate\Container\Container; class PhpFpmTest extends PHPUnit_Framework_TestCase { public function setUp() { $_SERVER['SUDO_USER'] = user(); Container::setInstance(new Container); } public function tearDown() { exec('rm -rf '.__DIR__.'/outp...
Switch to function to supress error
<?php namespace Cjm\Behat; use Behat\Gherkin\Node\FeatureNode; use Behat\Gherkin\Node\ScenarioInterface; use Behat\Gherkin\Node\TaggedNodeInterface; use Cjm\Testing\SemVer\Tag; use Cjm\Testing\SemVer\Test; class TestFactory { /** * @return Test */ public function fromTaggedNode(TaggedNodeInterface ...
<?php namespace Cjm\Behat; use Behat\Gherkin\Node\FeatureNode; use Behat\Gherkin\Node\ScenarioInterface; use Behat\Gherkin\Node\TaggedNodeInterface; use Cjm\Testing\SemVer\Test; class TestFactory { private $tagConstructor = ['Cjm\Testing\Semver\Tag', 'fromString']; /** * @return Test */ public...
[FIX] Fix array syntax for old PHP versions
<?php namespace N98\Magento\Command; use N98\Magento\Command\PHPUnit\TestCase; use Symfony\Component\Console\Tester\CommandTester; class ListCommandTest extends TestCase { public function testExecute() { $command = $this->getApplication()->find('list'); $commandTester = new CommandTester($co...
<?php namespace N98\Magento\Command; use N98\Magento\Command\PHPUnit\TestCase; use Symfony\Component\Console\Tester\CommandTester; class ListCommandTest extends TestCase { public function testExecute() { $command = $this->getApplication()->find('list'); $commandTester = new CommandTester($co...
Fix test - change in client redirection previously overlooked.
"""Unit test module for auth""" import json from flask.ext.login import login_user, logout_user from tests import TestCase, LAST_NAME, FIRST_NAME, TEST_USER_ID from portal.extensions import db from portal.models.auth import Client class TestAuth(TestCase): def test_client_edit(self): # Generate a minimal...
"""Unit test module for auth""" import json from flask.ext.login import login_user, logout_user from tests import TestCase, LAST_NAME, FIRST_NAME, TEST_USER_ID from portal.extensions import db from portal.models.auth import Client class TestAuth(TestCase): def test_client_edit(self): # Generate a minimal...
Remove fromToMultiplier and fix up lerp logic
/*! * tweensy - Copyright (c) 2017 Jacob Buck * https://github.com/jacobbuck/tweensy * Licensed under the terms of the MIT license. */ import now from "performance-now"; import rafq from "rafq"; const queue = rafq(); const defaultOptions = { duration: 0, easing: t => t, from: 0, onComplete: () => {}, on...
/*! * tweensy - Copyright (c) 2017 Jacob Buck * https://github.com/jacobbuck/tweensy * Licensed under the terms of the MIT license. */ import now from "performance-now"; import rafq from "rafq"; const queue = rafq(); const defaultOptions = { duration: 0, easing: t => t, from: 0, onComplete: () => {}, on...
Modify django orm filter, add only
"""info services.""" from info.models import Article, News, Column def get_column_object(uid): """Get column object.""" try: obj = Column.objects.get(uid=uid) except Column.DoesNotExist: obj = None return obj def get_articles_by_column(uid): """Get_articles_by_column.""" quer...
"""info services.""" from info.models import Article, News, Column def get_column_object(uid): """Get column object.""" try: obj = Column.objects.get(uid=uid) except Column.DoesNotExist: obj = None return obj def get_articles_by_column(uid): """Get_articles_by_column.""" quer...
Determine what to encode based in skip options.
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # Copyright (c) Ubuntu Podcast # http://www.ubuntupodcast.org # See the file "LICENSE" for the full license governing this code. from podpublish import configuration from podpublish import encoder def main(): config = configuration.Configuration('podcoder.ini') i...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # Copyright (c) Ubuntu Podcast # http://www.ubuntupodcast.org # See the file "LICENSE" for the full license governing this code. from podpublish import configuration from podpublish import encoder from podpublish import uploader def main(): config = configuration.Con...
Allow 'python -m glitch database' as well as with a dot
from . import config from . import apikeys import argparse # Hack: Allow "python -m glitch database" to be the same as "glitch.database" import sys if len(sys.argv) > 1 and sys.argv[1] == "database": from . import database import clize sys.exit(clize.run(*database.commands, args=sys.argv[1:])) import logging parse...
from . import config from . import apikeys import argparse import logging parser = argparse.ArgumentParser(description="Invoke the Infinite Glitch server(s)") parser.add_argument("server", help="Server to invoke", choices=["main", "renderer"], nargs="?", default="main") parser.add_argument("-l", "--log", help="Logging...
Improve async loading bar test The waitFor helper is allows us to wait for what we are actually testing instead of a time which sometimes blocks the rendering and causes the test to be flaky.
import { module, test } from 'qunit'; import { setupRenderingTest } from 'ember-qunit'; import { render, find, waitFor } from '@ember/test-helpers'; import hbs from 'htmlbars-inline-precompile'; import { later } from '@ember/runloop'; module('Integration | Component | loading bar', function(hooks) { setupRenderingTe...
import { module, test } from 'qunit'; import { setupRenderingTest } from 'ember-qunit'; import { render, find } from '@ember/test-helpers'; import hbs from 'htmlbars-inline-precompile'; import { later } from '@ember/runloop'; module('Integration | Component | loading bar', function(hooks) { setupRenderingTest(hooks)...
Disable test cleanup for debugging
/** * require dependencies */ WebdriverIO = require('webdriverio'); WebdriverCSS = require('../index.js'); fs = require('fs-extra'); gm = require('gm'); glob = require('glob'); async = require('async'); should = require('chai').should(); expect = require('chai').expect; capabilities = {logLevel: 'silent',desiredCap...
/** * require dependencies */ WebdriverIO = require('webdriverio'); WebdriverCSS = require('../index.js'); fs = require('fs-extra'); gm = require('gm'); glob = require('glob'); async = require('async'); should = require('chai').should(); expect = require('chai').expect; capabilities = {logLevel: 'silent',desiredCap...
Change karma log lvl to WARN
const browsers = ['Firefox']; if (!process.env.CI) { browsers.push('Chrome'); switch (process.platform) { case 'darwin': browsers.push('Safari'); break; case 'win32': browsers.push('IE'); browsers.push('Edge'); break; } } module.e...
const browsers = ['Firefox']; if (!process.env.CI) { browsers.push('Chrome'); switch (process.platform) { case 'darwin': browsers.push('Safari'); break; case 'win32': browsers.push('IE'); browsers.push('Edge'); break; } } module.e...
Revert previous commit as fuse-python doesn't seem to play nicely with easy_install (at least on Ubuntu).
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright (C) 2008 Jason Davies # All rights reserved. # # This software is licensed as described in the file COPYING, which # you should have received as part of this distribution. try: from setuptools import setup except ImportError: from distutils.core impor...
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright (C) 2008 Jason Davies # All rights reserved. # # This software is licensed as described in the file COPYING, which # you should have received as part of this distribution. try: from setuptools import setup except ImportError: from distutils.core impor...
Include default timeout value from interface Both the interface (`Interop\Queue\PsrConsumer`) and the implementation (for example `Enqueue\AmqpBunny\AmqpConsumer`) seem to have a default value for the `receive()` method's first and only parameter `$timeout`. This default value (`0`) isn't included in the `@method` ann...
<?php namespace Interop\Amqp; use Interop\Queue\PsrConsumer; /** * @method AmqpMessage|null receiveNoWait() * @method AmqpMessage|null receive(int $timeout = 0) * @method AmqpQueue getQueue() * @method void acknowledge(AmqpMessage $message) * @method void reject(AmqpMessage $message, bool $requeue) */ interfac...
<?php namespace Interop\Amqp; use Interop\Queue\PsrConsumer; /** * @method AmqpMessage|null receiveNoWait() * @method AmqpMessage|null receive(int $timeout) * @method AmqpQueue getQueue() * @method void acknowledge(AmqpMessage $message) * @method void reject(AmqpMessage $message, bool $requeue) */ interface Am...
Change HTTP method to GET
var express = require('express'); var Global = require('../global'); var search = require('../commands/search'); var router = express.Router(); router.get('/*', function(req, res) { var response = ''; var arg = req.body.text; console.log(req.body); //TODO delete console.log(req.body.token); //TODO delete ...
var express = require('express'); var Global = require('../global'); var search = require('../commands/search'); var router = express.Router(); router.get('/*', function(req, res) { var response = ''; var arg = req.body.text; console.log(req.body); //TODO delete console.log(req.body.token); //TODO delete ...
Call of console was deleted
import { certificates, certificatesAsync } from './certificates'; import { sign, signAsync } from './sign'; import { paramsForDetachedSignature, paramsForDetachedSignatureAsync, } from './params_for_detached_signature'; import { digestValue, digestValueAsync } from './digest_value'; import { cadesplugin } from './c...
import { certificates, certificatesAsync } from './certificates'; import { sign, signAsync } from './sign'; import { paramsForDetachedSignature, paramsForDetachedSignatureAsync, } from './params_for_detached_signature'; import { digestValue, digestValueAsync } from './digest_value'; import { cadesplugin } from './c...
Update Pretender version to ~0.10.1 Changes from version 0.9 include better synchronous xhr support, some fixes for content-type header and event firing on `passthrough`'d requests, better error messages. See the changes from Pretender 0.10.0 -> 0.10.1 [here](https://github.com/pretenderjs/pretender/blob/master/CHA...
/*jshint node:true*/ 'use strict'; var path = require('path'); module.exports = { normalizeEntityName: function() { // this prevents an error when the entityName is // not specified (since that doesn't actually matter // to us }, fileMapTokens: function() { return { __root__: function(op...
/*jshint node:true*/ 'use strict'; var path = require('path'); module.exports = { normalizeEntityName: function() { // this prevents an error when the entityName is // not specified (since that doesn't actually matter // to us }, fileMapTokens: function() { return { __root__: function(op...
Fix environment variable name in comment
// Copyright (c) 2016-present, salesforce.com, inc. All rights reserved // Licensed under BSD 3-Clause - see LICENSE.txt or git.io/sfdc-license 'use strict' const express = require('express') const app = express() const auth = require('http-auth') const port = process.env.PORT || 3000 // Basic auth // Set USERNAME ...
// Copyright (c) 2016-present, salesforce.com, inc. All rights reserved // Licensed under BSD 3-Clause - see LICENSE.txt or git.io/sfdc-license 'use strict' const express = require('express') const app = express() const auth = require('http-auth') const port = process.env.PORT || 3000 // Basic auth // Set USER and ...
Change selector to take current_user from state
/* This file is a part of libertysoil.org website Copyright (C) 2015 Loki Education (Social Enterprise) 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 License, o...
/* This file is a part of libertysoil.org website Copyright (C) 2015 Loki Education (Social Enterprise) 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 License, o...
Add info on where to report a bug for the pear2 website.
<?php // Set the title for the main template $parent->context->page_title = 'Support - ' . $frontend->title; ?> <div class="support"> <h2>Support</h2> <ul> <li>There's a Pyrus section in <a href="http://pear.php.net/manual/en/pyrus.php">PEAR manual</a>.</li> <li>There are some PEAR...
<?php // Set the title for the main template $parent->context->page_title = 'Support - ' . $frontend->title; ?> <div class="support"> <h2>Support</h2> <ul> <li>There's a Pyrus section in <a href="http://pear.php.net/manual/en/pyrus.php">PEAR manual</a>.</li> <li>There are some PEAR...
Increase number of updated repos
const express = require('express'); const StorageHandler = require('../lib/storage-handler'); const router = express.Router(); const storageHandler = new StorageHandler(); const REPO_KEY = 'REPOSITORIES'; const WIKI_KEY = 'WIKI_EDITS'; const MAX_RETURN_ROWS_NEW = 200; const MAX_RETURN_ROWS_UPDATED = 200; /* GET home ...
const express = require('express'); const StorageHandler = require('../lib/storage-handler'); const router = express.Router(); const storageHandler = new StorageHandler(); const REPO_KEY = 'REPOSITORIES'; const WIKI_KEY = 'WIKI_EDITS'; /* GET home page. */ router.get('/', (req, res, next) => { const repos = storage...
Chrome: Throw an exception when a localised string is not found
/** * The MIT License * * Copyright (c) 2010 Steven G. Brown * * 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, ...
/** * The MIT License * * Copyright (c) 2010 Steven G. Brown * * 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, ...
Add Slash Command help text
var help = [ 'JukeBot - Slack-Enabled Syncronized Music Listening', 'Available Commands:', ' add [youtube-link] - Add a video to the queue', ' help - This help text' ]; module.exports = { slash: function(req, res) { var params = req.allParams(); if (params.token !== process.env.SLASH_TOKEN) { ...
module.exports = { add: function(req, res) { YouTubeService.getYouTubeVideo(req.body.key, req.body.user).then(SyncService.addVideo).then(SyncService.sendAddMessages).then(function(video) { return res.send(200); }); }, slash: function(req, res) { var params = req.allParams(); if (params.toke...
Fix potential problem with sending admin value Parses a true value as a boolean true value and anything else as false
exports.action = { name: 'userCreate', description: 'Creates a User', version: 1, inputs: { required: [ 'name', 'organizationId', 'email', 'password', 'admin' ], optional: [] }, outputExample: {}, run: function (api, connection, next) { var id = api.mongoose.Types.Ob...
exports.action = { name: 'userCreate', description: 'Creates a User', version: 1, inputs: { required: [ 'name', 'organizationId', 'email', 'password', 'admin' ], optional: [] }, outputExample: {}, run: function (api, connection, next) { var id = api.mongoose.Types.Ob...
Fix return get_types for ClipboardXsel
''' Clipboard xsel: an implementation of the Clipboard using xsel command line tool. ''' __all__ = ('ClipboardXsel', ) from kivy.utils import platform from kivy.core.clipboard import ClipboardBase if platform != 'linux': raise SystemError('unsupported platform for xsel clipboard') try: import subprocess ...
''' Clipboard xsel: an implementation of the Clipboard using xsel command line tool. ''' __all__ = ('ClipboardXsel', ) from kivy.utils import platform from kivy.core.clipboard import ClipboardBase if platform != 'linux': raise SystemError('unsupported platform for xsel clipboard') try: import subprocess ...
Fix java chart install link broken issue
(function () { 'use strict'; var isMac = /Mac/i.test(navigator.platform), isIOS = /iPhone|iPad|iPod/i.test(navigator.userAgent), isAndroid = /Android/i.test(navigator.userAgent), isWindowsPhone = /Windows Phone/i.test(navigator.userAgent), isJavaInstalled = (deployJava.getJREs(...
(function () { 'use strict'; var isMac = /Mac/i.test(navigator.platform), isIOS = /iPhone|iPad|iPod/i.test(navigator.userAgent), isAndroid = /Android/i.test(navigator.userAgent), isWindowsPhone = /Windows Phone/i.test(navigator.userAgent), isJavaInstalled = (deployJava.getJREs(...
Remove unobvious default limit for followers. Now its Infinity by default.
var _ = require('underscore'); var util = require('util'); var FeedBase = require('./feed-base'); function AccountFollowersFeed(session, accountId, limit) { this.accountId = accountId; this.limit = limit || Infinity; this.timeout = 10 * 60 * 1000; FeedBase.apply(this, arguments); } util.inherits(Accoun...
var _ = require('underscore'); var util = require('util'); var FeedBase = require('./feed-base'); function AccountFollowersFeed(session, accountId, limit) { this.accountId = accountId; this.limit = limit || 7500; // Should be enought for 7500 records this.timeout = 10 * 60 * 1000; FeedBase.apply(th...
Remove subsystem() usage in favor of fraction()
/* * Copyright 2015 Red Hat, Inc. and/or its affiliates. * * Licensed under the Apache License version 2.0, available at http://www.apache.org/licenses/LICENSE-2.0 */ package org.wildfly.swarm.examples.transactions; import org.jboss.shrinkwrap.api.ShrinkWrap; import org.wildfly.swarm.container.Container; import or...
/* * Copyright 2015 Red Hat, Inc. and/or its affiliates. * * Licensed under the Apache License version 2.0, available at http://www.apache.org/licenses/LICENSE-2.0 */ package org.wildfly.swarm.examples.transactions; import org.jboss.shrinkwrap.api.ShrinkWrap; import org.wildfly.swarm.container.Container; import or...
Make scenarios pass in both Cucumber and Cucumber-Electron
const fs = require('fs') const path = require('path') const { setWorldConstructor } = require('cucumber') const TodoList = require('../../lib/TodoList') const mountBrowserApp = require('../../lib/mountBrowserApp') const DomTodoList = require('../../test_support/DomTodoList') class TodoWorld { constructor() { co...
const fs = require('fs') const path = require('path') const { setWorldConstructor } = require('cucumber') const TodoList = require('../../lib/TodoList') const mountBrowserApp = require('../../lib/mountBrowserApp') const DomTodoList = require('../../test_support/DomTodoList') class TodoWorld { constructor() { co...