text stringlengths 16 4.96k | positive stringlengths 321 2.24k | negative stringlengths 310 2.21k |
|---|---|---|
Watch e2e tests for changes and lint | (function(){
'use strict';
var gulp = require('gulp');
var paths = require('./_paths');
gulp.task('watch', function() {
var lr = require('gulp-livereload');
lr.listen();
gulp.watch(paths.fonts, ['copy-fonts']);
gulp.watch(paths.styles.concat(paths.icons), ['sass']);
gulp.watch(paths.image... | (function(){
'use strict';
var gulp = require('gulp');
var paths = require('./_paths');
gulp.task('watch', function() {
var lr = require('gulp-livereload');
lr.listen();
gulp.watch(paths.fonts, ['copy-fonts']);
gulp.watch(paths.styles.concat(paths.icons), ['sass']);
gulp.watch(paths.ima... |
Set the hostname when it localhost | import os
import getpass
from urlparse import urlparse
import keyring
from vr.common.models import Velociraptor
def auth_domain(url):
hostname = urlparse(url).hostname
_, _, default_domain = hostname.partition('.')
return default_domain
def set_password(url, username):
hostname = auth_domain(url)... | import os
import getpass
from urlparse import urlparse
import keyring
from vr.common.models import Velociraptor
def auth_domain(url):
hostname = urlparse(url).hostname
_, _, default_domain = hostname.partition('.')
return default_domain
def set_password(url, username):
hostname = auth_domain(url)... |
Disable test that is non-deterministically failing. | # Licensed under a 3-clause BSD style license - see LICENSE.rst
from __future__ import (absolute_import, division, print_function,
unicode_literals)
# test helper.run_tests function
import warnings
from .. import helper
from ... import _get_test_runner
from .. helper import pytest
# run_test... | # Licensed under a 3-clause BSD style license - see LICENSE.rst
from __future__ import (absolute_import, division, print_function,
unicode_literals)
# test helper.run_tests function
import warnings
from .. import helper
from ... import _get_test_runner
from .. helper import pytest
# run_test... |
WIP: Fix adaptive example with LivePlot | import matplotlib.pyplot as plt
from bluesky import RunEngine
from bluesky.scans import AdaptiveAscan
from bluesky.examples import Mover, SynGauss
from bluesky.callbacks import LivePlot, LiveTable
from bluesky.tests.utils import setup_test_run_engine
#plt.ion()
RE = setup_test_run_engine()
motor = Mover('motor', ['p... | import matplotlib.pyplot as plt
from bluesky import RunEngine, Mover, SynGauss
from bluesky.examples import adaptive_scan
RE = RunEngine()
RE.verbose = False
motor = Mover('motor', ['pos'])
det = SynGauss('det', motor, 'pos', center=0, Imax=1, sigma=1)
def live_scalar_plotter(ax, y, x):
x_data, y_data = [], []... |
Fix receiving an error message for python2 & 3 | # -*- coding: utf-8 -*-
import subprocess
TYPE_WARN_MSG = 'WARNING! A string "%s" passed to a numeric variable. ' \
'Change the variable type or the passed value.' \
class InvalidTokenError(Exception):
pass
class InvalidConfigError(TypeError):
pass
class UnexpectedVariableTypeError(Type... | # -*- coding: utf-8 -*-
import subprocess
TYPE_WARN_MSG = 'WARNING! A string "%s" passed to a numeric variable. ' \
'Change the variable type or the passed value.' \
class InvalidTokenError(Exception):
pass
class InvalidConfigError(TypeError):
pass
class UnexpectedVariableTypeError(Type... |
[sil-bug-reducer] Refactor adding subparsers given that all subparsers have a common swift_build_dir arg. | #!/usr/bin/env python
import argparse
import opt_bug_reducer
import random_bug_finder
def add_subparser(subparsers, module, name):
sparser = subparsers.add_parser(name)
sparser.add_argument('swift_build_dir',
help='Path to the swift build directory '
'conta... | #!/usr/bin/env python
import argparse
import opt_bug_reducer
import random_bug_finder
def main():
parser = argparse.ArgumentParser(description="""\
A program for reducing sib/sil crashers""")
subparsers = parser.add_subparsers()
opt_subparser = subparsers.add_parser("opt")
opt_subparser.add_argume... |
Remove references to src/images folder | module.exports = {
siteMetadata: {
title: `Gatsby Default Starter`,
description: `Kick off your next, great Gatsby project with this default starter. This barebones starter ships with the main Gatsby configuration files you might need.`,
author: `@gatsbyjs`,
},
plugins: [
`gatsby-plugin-react-helm... | module.exports = {
siteMetadata: {
title: `Gatsby Default Starter`,
description: `Kick off your next, great Gatsby project with this default starter. This barebones starter ships with the main Gatsby configuration files you might need.`,
author: `@gatsbyjs`,
},
plugins: [
`gatsby-plugin-react-helm... |
Add an extra explenation on how to use curl on this view. | from djangorestframework.views import View
from djangorestframework.permissions import PerUserThrottling, IsAuthenticated
from django.core.urlresolvers import reverse
class PermissionsExampleView(View):
"""
A container view for permissions examples.
"""
def get(self, request):
return [{'name':... | from djangorestframework.views import View
from djangorestframework.permissions import PerUserThrottling, IsAuthenticated
from django.core.urlresolvers import reverse
class PermissionsExampleView(View):
"""
A container view for permissions examples.
"""
def get(self, request):
return [{'name':... |
Add call for widget tool tips | package info.u_team.u_team_test.screen;
import com.mojang.blaze3d.matrix.MatrixStack;
import info.u_team.u_team_core.gui.UContainerScreen;
import info.u_team.u_team_test.TestMod;
import info.u_team.u_team_test.container.BasicFluidInventoryContainer;
import net.minecraft.entity.player.PlayerInventory;
import net.minec... | package info.u_team.u_team_test.screen;
import com.mojang.blaze3d.matrix.MatrixStack;
import info.u_team.u_team_core.gui.UContainerScreen;
import info.u_team.u_team_test.TestMod;
import info.u_team.u_team_test.container.BasicFluidInventoryContainer;
import net.minecraft.entity.player.PlayerInventory;
import net.minec... |
Add custom message for invalid url | import Messages from 'ember-cp-validations/validators/messages';
export default Messages.extend({
blank: 'Поле не может быть пустым',
email: 'Значение должно быть адресом электронной почты',
emailNotFound: 'Адрес не найден',
notANumber: 'Значение должно быть числом',
notAnInteger: 'Значение должно быть целым... | import Messages from 'ember-cp-validations/validators/messages';
export default Messages.extend({
blank: 'Поле не может быть пустым',
email: 'Значение должно быть адресом электронной почты',
emailNotFound: 'Адрес не найден',
notANumber: 'Значение должно быть числом',
notAnInteger: 'Значение должно быть целым... |
[New] Remove development mode warning log | import Vue from './lib/vue';
import VueWrapper from './VueWrapper';
import './lib/matchesPolyfill';
Vue.config.productionTip = false;
function createElem() {
const elem = document.createElement('div');
document.body.appendChild(elem);
return elem;
}
export default function mount(component, options = {}) {
... | import Vue from './lib/vue';
import VueWrapper from './VueWrapper';
import './lib/matchesPolyfill';
function createElem() {
const elem = document.createElement('div');
document.body.appendChild(elem);
return elem;
}
export default function mount(component, options = {}) {
let elem = null;
const attachToDo... |
Fix retrieval of artifact names
Signed-off-by: Aurélien Bompard <bceb368e7f2cb351af47298f32034f0587bbe4a6@bompard.org> | import logging
from fastapi import Depends
from httpx import AsyncClient
from ..core.config import Settings, get_settings
log = logging.getLogger(__name__)
class DistGitClient:
def __init__(self, settings):
self.client = AsyncClient(base_url=settings.services.distgit_url, timeout=None)
async def g... | import logging
from fastapi import Depends
from httpx import AsyncClient
from ..core.config import Settings, get_settings
log = logging.getLogger(__name__)
class DistGitClient:
def __init__(self, settings):
self.client = AsyncClient(base_url=settings.services.distgit_url, timeout=None)
async def g... |
Install Blog when example data is wanted. | <?php
namespace ForkCMS\Bundle\InstallerBundle\Form\Handler;
use Symfony\Component\Form\Form;
use Symfony\Component\HttpFoundation\Request;
/**
* Validates and saves the data from the modules form
*
* @author Wouter Sioen <wouter.sioen@wijs.be>
*/
class ModulesHandler
{
public function process(Form $form, Re... | <?php
namespace ForkCMS\Bundle\InstallerBundle\Form\Handler;
use Symfony\Component\Form\Form;
use Symfony\Component\HttpFoundation\Request;
/**
* Validates and saves the data from the modules form
*
* @author Wouter Sioen <wouter.sioen@wijs.be>
*/
class ModulesHandler
{
public function process(Form $form, Re... |
Add a default value to the constructor.
svn commit r3127 | <?php
require_once 'Swat/SwatOption.php';
/**
* A class representing a divider in a flydown
*
* This class is for semantic purposed only. The flydown handles all the
* displaying of dividers and regular flydown options.
*
* @package Swat
* @copyright 2005 silverorange
* @license http://www.gnu.org/copylef... | <?php
require_once 'Swat/SwatOption.php';
/**
* A class representing a divider in a flydown
*
* This class is for semantic purposed only. The flydown handles all the
* displaying of dividers and regular flydown options.
*
* @package Swat
* @copyright 2005 silverorange
* @license http://www.gnu.org/copylef... |
Allow any newer pandas version
Co-authored-by: Sabine Haas <7a4a302f5a1f49bb6bebf9ec4d25cae6930e4972@rl-institut.de> | #! /usr/bin/env python
"""Setup information of demandlib.
"""
from setuptools import setup, find_packages
import os
def read(fname):
return open(os.path.join(os.path.dirname(__file__), fname)).read()
setup(name='demandlib',
version='0.1.7dev',
author='oemof developer group',
url='https://oem... | #! /usr/bin/env python
"""Setup information of demandlib.
"""
from setuptools import setup, find_packages
import os
def read(fname):
return open(os.path.join(os.path.dirname(__file__), fname)).read()
setup(name='demandlib',
version='0.1.7dev',
author='oemof developer group',
url='https://oem... |
Update the send to slack listener to allow users to customise the message | <?php
namespace Michaeljennings\Snapshot\Listeners;
use League\Event\EventInterface;
use Maknz\Slack\Client;
use Michaeljennings\Snapshot\Exceptions\EndPointNotSetException;
class SendToSlack extends Listener
{
/**
* Check if slack is enabled, if so send the snapshot to the relevant
* channel.
*
... | <?php
namespace Michaeljennings\Snapshot\Listeners;
use League\Event\EventInterface;
use Maknz\Slack\Client;
use Michaeljennings\Snapshot\Exceptions\EndPointNotSetException;
class SendToSlack extends Listener
{
/**
* Check if slack is enabled, if so send the snapshot to the relevant
* channel.
*
... |
Change callback into external function | const path = require('path')
const fs = require('fs')
const { readFile } = require('./fs.utils')
const { log } = require('./log.utils')
module.exports = exports = configFilename => {
return (modules, options) => {
readFile(configFilename)
.then(data => JSON.parse(data).folder_path)
.then(processModu... | const path = require('path')
const fs = require('fs')
const { readFile } = require('./fs.utils')
const { log } = require('./log.utils')
module.exports = exports = configFilename => {
return (modules, options) => {
readFile(configFilename)
.then(data => JSON.parse(data).folder_path)
.then(folderPath ... |
Add missing commas in res.send() calls | /**
* Get documentation URL
*/
exports.getDocUrl = function (req, res) {
res.sendBody('Documentation for this API can be found at http://github.com/thebinarypenguin/tasty');
};
/**
* Get all bookmarks
*/
exports.getAllBookmarks = function (req, res, params) {
res.send(501, {}, {message: "I'm just a stub."});
};... | /**
* Get documentation URL
*/
exports.getDocUrl = function (req, res) {
res.sendBody('Documentation for this API can be found at http://github.com/thebinarypenguin/tasty');
};
/**
* Get all bookmarks
*/
exports.getAllBookmarks = function (req, res, params) {
res.send(501, {} {message: "I'm just a stub."});
};
... |
Break if the collection is sorted | """
This is pure python implementation of bubble sort algorithm
For doctests run following command:
python -m doctest -v bubble_sort.py
or
python3 -m doctest -v bubble_sort.py
For manual testing run:
python bubble_sort.py
"""
from __future__ import print_function
def bubble_sort(collection):
"""Pure implementa... | """
This is pure python implementation of bubble sort algorithm
For doctests run following command:
python -m doctest -v bubble_sort.py
or
python3 -m doctest -v bubble_sort.py
For manual testing run:
python bubble_sort.py
"""
from __future__ import print_function
def bubble_sort(collection):
"""Pure implementa... |
Add dependency on parse, be more explicit in supported Python versions. | import os
import os.path
import sys
from setuptools import find_packages, setup
requirements = ['parse>=1.1.5', 'PyYAML']
major, minor = sys.version_info[:2]
if major == 2 and minor < 7:
requirements.append('argparse')
setup(
name='behave',
version='1.0',
description='A Cucumber-like BDD tool',
a... | import os
import os.path
import sys
from setuptools import find_packages, setup
requirements = ['PyYAML']
major, minor = sys.version_info[:2]
if major == 2 and minor < 7:
requirements.append('argparse')
setup(
name='behave',
version='1.0',
description='A Cucumber-like BDD tool',
author='Benno Ric... |
Adjust bigInputCard to receive a cardStyle and cardClass args | import m from 'mithril';
const bigInputCard = {
view(ctrl, args) {
const cardClass = args.cardClass || '.w-row.u-marginbottom-30.card.card-terciary.padding-redactor-description.text.optional.project_about_html.field_with_hint';
return m(cardClass, {style: (args.cardStyle||{})}, [
m('di... | import m from 'mithril';
const bigInputCard = {
view(ctrl, args) {
const cardClass = '.w-row.u-marginbottom-30.card.card-terciary.padding-redactor-description.text.optional.project_about_html.field_with_hint';
return m(cardClass, [
m('div', [
m('label.field-label.fontwe... |
Remove app from registry on uninstall | import filePaths from '../utils/file-paths';
import cp from 'child_process';
import path from 'path';
import app from 'app';
import AutoLauncher from './auto-launcher';
class SquirrelEvents {
check(options) {
if (options.squirrelInstall) {
this.spawnSquirrel(['--createShortcut', app.getPath('exe')], app.... | import filePaths from '../utils/file-paths';
import cp from 'child_process';
import path from 'path';
import app from 'app';
class SquirrelEvents {
check(options) {
if (options.squirrelInstall) {
this.spawnSquirrel(['--createShortcut', app.getPath('exe')], app.exit);
return true;
}
if (opti... |
Disable apc cache for building | <?php
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\Debug\Debug;
// This check prevents access to debug front controllers that are deployed by accident to production servers.
// Feel free to remove this, extend it, or make something more sophisticated.
//if (isset($_SERVER['HTTP_CLIENT_IP'])
// ... | <?php
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\Debug\Debug;
// This check prevents access to debug front controllers that are deployed by accident to production servers.
// Feel free to remove this, extend it, or make something more sophisticated.
//if (isset($_SERVER['HTTP_CLIENT_IP'])
// ... |
Use system import for code splitting | import {subscribe, getTodo} from '../todo'
let graphArea
const unsubscribe = {
store: null,
todo: null,
}
export default toggleGraph
function toggleGraph() {
if (graphArea) {
graphArea.remove()
graphArea = null
unsubscribe.store()
unsubscribe.todo()
return false
} else {
graphArea = d... | import {subscribe, getTodo} from '../todo'
import renderGraph from './render'
let graphArea
const unsubscribe = {
store: null,
todo: null,
}
export default toggleGraph
function toggleGraph() {
if (graphArea) {
graphArea.remove()
graphArea = null
unsubscribe.store()
unsubscribe.todo()
return... |
Stop the search of '.editorconfig' files in the parent container | package org.eclipse.ec4e.internal.resource;
import org.eclipse.core.resources.IContainer;
import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IResource;
import org.eclipse.core.runtime.Path;
import org.eclipse.ec4j.core.ResourcePaths.ResourcePath;
import org.eclipse.ec4j.core.Resources.Resource;... | package org.eclipse.ec4e.internal.resource;
import org.eclipse.core.resources.IContainer;
import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IResource;
import org.eclipse.core.runtime.Path;
import org.eclipse.ec4j.core.ResourcePaths.ResourcePath;
import org.eclipse.ec4j.core.Resources.Resource;... |
Fix RegExp pattern to match single quote imports | // Inspired from https://github.com/markokajzer/discord-soundbot
// MIT License - Copyright (c) 2020 Marko Kajzer
const path = require('path');
const replace = require('replace-in-file');
const tsconfig = require('../tsconfig.json');
const pathAliases = tsconfig.compilerOptions.paths;
const from = Object.keys(pathAlia... | // Inspired from https://github.com/markokajzer/discord-soundbot
// MIT License - Copyright (c) 2020 Marko Kajzer
const path = require('path');
const replace = require('replace-in-file');
const tsconfig = require('../tsconfig.json');
const pathAliases = tsconfig.compilerOptions.paths;
const from = Object.keys(pathAlia... |
Handle placeholder deletion before animation fallback | (function () {
var logoPath = '/customize/CryptPad_logo.svg';
if (location.pathname === '/' || location.pathname === '/index.html') {
logoPath = '/customize/CryptPad_logo_hero.svg';
}
var elem = document.createElement('div');
elem.setAttribute('id', 'placeholder');
elem.innerHTML = [
'<div class="placeholder-l... | (function () {
var logoPath = '/customize/CryptPad_logo.svg';
if (location.pathname === '/' || location.pathname === '/index.html') {
logoPath = '/customize/CryptPad_logo_hero.svg';
}
var elem = document.createElement('div');
elem.setAttribute('id', 'placeholder');
elem.innerHTML = [
'<div class="placeholder-l... |
Add $ModuleManager to local space (CallModule) | <?php
require_once 'Utils.php';
class WhatsBotCaller
{
private $ModuleManager = null;
private $Whatsapp = null;
private $Utils = null;
public function __construct(&$MDLM, WhatsappBridge &$WPB)
{
if($MDLM != null && !($MDLM instanceof ModuleManager)) // Podríamos testear en cada método si $this->Module... | <?php
require_once 'Utils.php';
class WhatsBotCaller
{
private $ModuleManager = null;
private $Whatsapp = null;
private $Utils = null;
public function __construct(&$MDLM, WhatsappBridge &$WPB)
{
if($MDLM != null && !($MDLM instanceof ModuleManager)) // Podríamos testear en cada método si $this->Module... |
Fix ceilometerclient mocks for 2.8.0 release
The function name changed in Iae7d60e1cf139b79e74caf81ed7bdbd0bf2bc473.
Change-Id: I1bbe3f32090b9b1fd7508b1b26665bceeea21f49 | #
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# ... | #
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# ... |
Add generic Python 3 trove classifier | from setuptools import setup
setup(
name='tangled.auth',
version='0.1a4.dev0',
description='Tangled auth integration',
long_description=open('README.rst').read(),
url='http://tangledframework.org/',
download_url='https://github.com/TangledWeb/tangled.auth/tags',
author='Wyatt Baldwin',
... | from setuptools import setup
setup(
name='tangled.auth',
version='0.1a4.dev0',
description='Tangled auth integration',
long_description=open('README.rst').read(),
url='http://tangledframework.org/',
download_url='https://github.com/TangledWeb/tangled.auth/tags',
author='Wyatt Baldwin',
... |
Mark 'tvnamer-gui' as a GUI script | #!/usr/bin/env python3
from setuptools import setup
with open("README.rst") as fd:
long_description = fd.read()
setup(
name="tvnamer",
version="1.0.0-dev",
description="Utility to rename lots of TV video files using the TheTVDB.",
long_description=long_description,
author="Tom Leese",
aut... | #!/usr/bin/env python3
from setuptools import setup
with open("README.rst") as fd:
long_description = fd.read()
setup(
name="tvnamer",
version="1.0.0-dev",
description="Utility to rename lots of TV video files using the TheTVDB.",
long_description=long_description,
author="Tom Leese",
aut... |
Add dry run argument to CLI (-n) | #! /usr/bin/env node
'use strict';
var inquirer = require('inquirer');
var list = require('cli-list');
var generator = Object.freeze(require('./generator'));
var questions = Object.freeze(require('./cli.config.json').questions);
var args = list(process.argv.slice(2));
var cliArguments = {};
if (args[0].indexOf('-n') ... | #! /usr/bin/env node
'use strict';
var inquirer = require('inquirer');
var generator = Object.freeze(require('./generator'));
var questions = Object.freeze(require('./cli.config.json').questions);
/*
* - Removes trailing slash
* - Converts to lower case
* - Trims
*/
// TODO: Add test for this
var formatString = f... |
Check if a wallet is loaded before accessing private states | function AppRun(AppConstants, $rootScope, $timeout, Wallet, Alert, $transitions) {
'ngInject';
// Change page title based on state
$transitions.onSuccess({ to: true }, (transition) => {
$rootScope.setPageTitle(transition.router.globals.current.title);
// Enable tooltips globally
$t... | function AppRun(AppConstants, $rootScope, $timeout, Wallet) {
'ngInject';
// change page title based on state
$rootScope.$on('$stateChangeSuccess', (event, toState) => {
$rootScope.setPageTitle(toState.title);
// enable tooltips globally
$timeout( function() {
$('[data-t... |
Refactor strings to template literals in Presto UI | /* global __dirname */
module.exports = {
entry: {
'index': `${__dirname}/index.jsx`,
'query': `${__dirname}/query.jsx`,
'plan': `${__dirname}/plan.jsx`,
'embedded_plan': `${__dirname}/embedded_plan.jsx`,
'stage': `${__dirname}/stage.jsx`,
'worker': `${__dirname}/wor... | module.exports = {
entry: {
'index': __dirname +'/index.jsx',
'query': __dirname +'/query.jsx',
'plan': __dirname +'/plan.jsx',
'embedded_plan': __dirname +'/embedded_plan.jsx',
'stage': __dirname +'/stage.jsx',
'worker': __dirname +'/worker.jsx',
},
mode: "de... |
Add inflection and toml as dependencies for the project | from setuptools import setup
setup(name='openarc',
version='0.5.0',
description='Functional reactive graph backed by PostgreSQL',
classifiers=[
'Development Status :: 3 - Alpha',
'License :: OSI Approved :: BSD License',
'Programming Language :: Python :: 2.7',
'Topic ... | from setuptools import setup
setup(name='openarc',
version='0.5.0',
description='Functional reactive graph backed by PostgreSQL',
classifiers=[
'Development Status :: 3 - Alpha',
'License :: OSI Approved :: BSD License',
'Programming Language :: Python :: 2.7',
'Topic ... |
Add title var for template | <?php
/**
* # Page View Model
*
* Automaticly load page based on slug, throw 404 if page doesn't exist.
*
* @package Flatfile
* @category View Model
* @author Ziopod <ziopod@gmail.com>
* @copyright (c) 2013-2014 Ziopod
* @license http://opensource.org/licenses/MIT
**/
class Flatfile_View_Page extends View_App{
... | <?php
/**
* # Page View Model
*
* Automaticly load page based on slug, throw 404 if page doesn't exist.
*
* @package Flatfile
* @category View Model
* @author Ziopod <ziopod@gmail.com>
* @copyright (c) 2013-2014 Ziopod
* @license http://opensource.org/licenses/MIT
**/
class Flatfile_View_Page extends View_App{
... |
Increase splash screen time to 2 seconds. | package in.testpress.testpress.ui;
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.os.Handler;
import in.testpress.testpress.R;
public class SplashScreenActivity extends Activity {
// Splash screen timer
private static final int SPLASH_TIME_OUT = 2000;
... | package in.testpress.testpress.ui;
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.os.Handler;
import in.testpress.testpress.R;
public class SplashScreenActivity extends Activity {
// Splash screen timer
private static final int SPLASH_TIME_OUT = 1000;
... |
Add locust testing box to allowed IPs, and get the SSL redirect from the environment so that it can be turned off for load testing
pep8 | from .base import *
DEBUG = False
ALLOWED_HOSTS = ['selling-online-overseas.export.great.gov.uk']
ADMINS = (('David Downes', 'david@downes.co.uk'),)
MIDDLEWARE_CLASSES += [
'core.middleware.IpRestrictionMiddleware',
]
INSTALLED_APPS += [
'raven.contrib.django.raven_compat'
]
RAVEN_CONFIG = {
'dsn': os.e... | from .base import *
DEBUG = False
ALLOWED_HOSTS = ['selling-online-overseas.export.great.gov.uk']
ADMINS = (('David Downes', 'david@downes.co.uk'),)
MIDDLEWARE_CLASSES += [
'core.middleware.IpRestrictionMiddleware',
]
INSTALLED_APPS += [
'raven.contrib.django.raven_compat'
]
RAVEN_CONFIG = {
'dsn': os.e... |
Mark instance list as staff-only, and give it a view name | from __future__ import unicode_literals
from django.conf.urls import patterns, url
from . import views
from django.contrib.admin.views.decorators import staff_member_required
urlpatterns = patterns(
"",
url(r"^hello/$", "badgekit_webhooks.views.hello", name="badgekit_webhooks_hello"),
url(r"^issued/$", "b... | from __future__ import unicode_literals
from django.conf.urls import patterns, url
from . import views
from django.contrib.admin.views.decorators import staff_member_required
urlpatterns = patterns(
"",
url(r"^hello/$", "badgekit_webhooks.views.hello", name="badgekit_webhooks_hello"),
url(r"^issued/$", "b... |
Use flask's redirect() method to go to result link | from flask import Flask, render_template, redirect
from setup_cardsets import CardOperations
co = CardOperations()
app = Flask(__name__)
@app.route('/')
def home():
return render_template('home.html')
@app.route('/rules')
def rules():
return render_template('rules.html')
@app.route('/setup')
def setup():
retur... | from flask import Flask, render_template
from setup_cardsets import CardOperations
co = CardOperations()
app = Flask(__name__)
@app.route('/')
def home():
return render_template('home.html')
@app.route('/rules')
def rules():
return render_template('rules.html')
@app.route('/setup')
def setup():
return render_t... |
Improve error message when reloadBaj is undefined. | $(document).ready(() => {
if (typeof window.reloadBaj === 'undefined') {
console.error('Alchemists Notifier: reloadBaj is undefined, unable to continue');
return;
}
var gameId = '0';
var interval;
var reload = window.reloadBaj;
var self = document.getElementById('alc-notifier');
for (var part of window.loc... | $(document).ready(() => {
if (typeof window.reloadBaj === 'undefined') {
console.error('alchemists-boiteajeux: reloadBaj is undefined');
return;
}
var gameId = '0';
var interval;
var reload = window.reloadBaj;
var self = document.getElementById('alc-notifier');
for (var part of window.location.search.slice... |
Fix critical stupid copypaste error | from django.db import models
from django.core.exceptions import ValidationError
class OrderedModel(models.Model):
order = models.PositiveIntegerField(blank=True, unique=True)
class Meta:
abstract = True
ordering = ['order']
def save(self, swapping=False, *args, **kwargs):
if not self.id:
try... | from django.db import models
from django.core.exceptions import ValidationError
class OrderedModel(models.Model):
order = models.PositiveIntegerField(blank=True, unique=True)
class Meta:
abstract = True
ordering = ['order']
def save(self, swapping=False, *args, **kwargs):
if not self.id:
try... |
Clean up of test case | <?php
namespace Doctrine\Tests\ORM\Functional;
use Doctrine\ORM\Event\OnClearEventArgs;
use Doctrine\ORM\Events;
require_once __DIR__ . '/../../TestInit.php';
/**
* ClearEventTest
*
* @author Michael Ridgway <mcridgway@gmail.com>
*/
class ClearEventTest extends \Doctrine\Tests\OrmFunctionalTestCase
{
protec... | <?php
namespace Doctrine\Tests\ORM\Functional;
use Doctrine\Tests\Models\CMS\CmsUser;
use Doctrine\Tests\Models\CMS\CmsPhonenumber;
use Doctrine\ORM\Event\OnClearEventArgs;
use Doctrine\ORM\Events;
require_once __DIR__ . '/../../TestInit.php';
/**
* ClearEventTest
*
* @author Michael Ridgway
*/
class ClearEvent... |
Check the parameters for the Join command correctly | from twisted.plugin import IPlugin
from heufybot.moduleinterface import IBotModule
from heufybot.modules.commandinterface import BotCommand
from zope.interface import implements
class JoinCommand(BotCommand):
implements(IPlugin, IBotModule)
name = "Join"
def triggers(self):
return ["join"]
... | from twisted.plugin import IPlugin
from heufybot.moduleinterface import IBotModule
from heufybot.modules.commandinterface import BotCommand
from zope.interface import implements
class JoinCommand(BotCommand):
implements(IPlugin, IBotModule)
name = "Join"
def triggers(self):
return ["join"]
... |
Use request helper function in LayersScraper | import requests
import json
from . import Scraper
class LayersScraper:
"""A superclass for scraping Layers of the UofT Map.
Map is located at http://map.utoronto.ca
"""
host = 'http://map.utoronto.ca/'
@staticmethod
def get_layers_json(campus):
"""Retrieve the JSON structure from ho... | import requests
import json
from . import Scraper
class LayersScraper:
"""A superclass for scraping Layers of the UofT Map.
Map is located at http://map.utoronto.ca
"""
host = 'http://map.utoronto.ca/'
s = requests.Session()
@staticmethod
def get_layers_json(campus):
"""Retrieve... |
[ReactNative] Remove padding restriction on images
Summary:
@public
Padding actually works fine on images.
Test Plan: Nested text inside an image is properly positioned with padding on the image. | /**
* Copyright (c) 2015-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
* @provides... | /**
* Copyright (c) 2015-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
* @provides... |
Change solr host to internal ip. | <?php
// Setup DB
$databases = array (
'default' =>
array (
'default' =>
array (
'database' => 'uclalib',
'username' => 'uclalib',
'password' => 'uclalib',
'host' => 'localhost',
'port' => '',
'driver' => 'mysql',
'prefix' => '',
),
),
);
// Tell Drupal that... | <?php
// Setup DB
$databases = array (
'default' =>
array (
'default' =>
array (
'database' => 'uclalib',
'username' => 'uclalib',
'password' => 'uclalib',
'host' => 'localhost',
'port' => '',
'driver' => 'mysql',
'prefix' => '',
),
),
);
// Tell Drupal that... |
Make wrapper returned by `returns_blocks` decorator, understand additional `args` and `kwargs` arguments. | # -*- coding: utf-8 -*-
import os.path
from django.http import HttpResponse
from django.conf import settings
from functools import wraps
from bempy import ImmediateResponse
def returns_blocks(func):
@wraps(func)
def wrapper(request, *args, **kwargs):
page = func(request, *args, **kwargs)
try... | # -*- coding: utf-8 -*-
import os.path
from django.http import HttpResponse
from django.conf import settings
from functools import wraps
from bempy import ImmediateResponse
def returns_blocks(func):
@wraps(func)
def wrapper(request):
page = func(request)
try:
if isinstanc... |
Add rsync to appCmd taskcat | 'use strict';
var path = require('path');
var _ = require('lodash');
var PLUGIN_NAME = 'kalabox-plugin-rsync';
module.exports = function(kbox) {
var events = kbox.core.events;
var engine = kbox.engine;
var globalConfig = kbox.core.deps.lookup('globalConfig');
kbox.ifApp(function(app) {
// Grab the cli... | 'use strict';
var path = require('path');
var _ = require('lodash');
var PLUGIN_NAME = 'kalabox-plugin-rsync';
module.exports = function(kbox) {
var events = kbox.core.events;
var engine = kbox.engine;
var globalConfig = kbox.core.deps.lookup('globalConfig');
kbox.ifApp(function(app) {
// Grab the cli... |
Add return value to removeLecturerFromSubject | package at.ac.tuwien.inso.service;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.security.access.prepost.PreAuthorize;
import at.ac.tuwien.inso.entity.*;
import java.util.*;
public interface SubjectService {
@PreAuthorize("i... | package at.ac.tuwien.inso.service;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.security.access.prepost.PreAuthorize;
import at.ac.tuwien.inso.entity.*;
import java.util.*;
public interface SubjectService {
@PreAuthorize("i... |
Add size loging for vendor.js file | module.exports = function(gulp, speck) {
return gulp.task('js:vendor', function() {
var uglify = require('gulp-uglify'),
gulpif = require('gulp-if'),
insert = require('gulp-insert'),
size = require('gulp-size'),
concat = require('gulp-concat');
return gulp.src(speck.config.vendorJS)
... | module.exports = function(gulp, speck) {
return gulp.task('js:vendor', function() {
var uglify = require('gulp-uglify'),
gulpif = require('gulp-if'),
insert = require('gulp-insert'),
concat = require('gulp-concat');
return gulp.src(speck.config.vendorJS)
.pipe(gulpif(speck.build.env.o... |
Update ajax to remove overflow scrolling for embedded resume | $(document).on('ready', function() {
$.ajax({
cache: false,
url: "/partial-index.html"
}).done(function(response) {
$('.main-container').html(response);
});
// Use navigator to detect Safari and render old resume partial instead
$('nav a').on('click', function(event) {
event.preventDefault()... | $(document).on('ready', function() {
$.ajax({
cache: false,
url: "/partial-index.html"
}).done(function(response) {
$('.main-container').html(response);
});
// Use navigator to detect Safari and render old resume partial instead
$('nav a').on('click', function(event) {
event.preventDefault()... |
Fix remove-before-visit for Windows, too | // Copyright 2017 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package gps
import (
"os"
"path/filepath"
)
func stripVendor(path string, info os.FileInfo, err error) error {
if err != nil && err != filepath.SkipDir {
... | // Copyright 2017 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package gps
import (
"os"
"path/filepath"
)
func stripVendor(path string, info os.FileInfo, err error) error {
if err != nil && err != filepath.SkipDir {
... |
Mark method arguments as final.
This used to be revision r2235. | package imagej.plugin.gui.swing;
import imagej.plugin.Plugin;
import imagej.plugin.PluginModule;
import imagej.plugin.gui.AbstractInputHarvester;
import imagej.plugin.gui.InputPanel;
import imagej.plugin.process.PluginPreprocessor;
import javax.swing.JDialog;
import javax.swing.JOptionPane;
import javax.swing.JPanel;... | package imagej.plugin.gui.swing;
import imagej.plugin.Plugin;
import imagej.plugin.PluginModule;
import imagej.plugin.gui.AbstractInputHarvester;
import imagej.plugin.gui.InputPanel;
import imagej.plugin.process.PluginPreprocessor;
import javax.swing.JDialog;
import javax.swing.JOptionPane;
import javax.swing.JPanel;... |
Return new instance of filter state. | import Ember from 'ember'
import layout from '../templates/components/filter-facet'
import _ from 'lodash'
function callIfDefined (context, functionName, ...args) {
let func = context.get(functionName)
if (_.isFunction(func)) {
func(...args)
}
}
export default Ember.Component.extend({
layout,
className... | import Ember from 'ember'
import layout from '../templates/components/filter-facet'
import _ from 'lodash'
function callIfDefined (context, functionName, ...args) {
let func = context.get(functionName)
if (_.isFunction(func)) {
func(...args)
}
}
export default Ember.Component.extend({
layout,
className... |
Fix checks in session test | const graphqlTester = require('graphql-tester')
const expressGraphql = require('express-graphql')
const {expect} = require('chai')
const cookieSession = require('cookie-session')
const express = require('express')
const shortid = require('shortid')
const createExpressWrapper = require('graphql-tes... | const graphqlTester = require('graphql-tester')
const expressGraphql = require('express-graphql')
const {expect} = require('chai')
const cookieSession = require('cookie-session')
const express = require('express')
const shortid = require('shortid')
const createExpressWrapper = require('graphql-tes... |
Fix not working language switch in production environment
Fixes #64 | import Ember from "ember";
import translations from "croodle/lang/translations";
/* global Croodle */
export default Ember.View.extend({
templateName: 'language-switch',
languages: function() {
var languages = [];
for(var lang in translations) {
languages.push(lang);
}
return languages;
... | import Ember from "ember";
import translations from "croodle/lang/translations";
/* global Croodle */
export default Ember.View.extend({
templateName: 'language-switch',
languages: function() {
var languages = [];
for(var lang in translations) {
languages.push(lang);
}
return languages;
... |
Disable automatic setting of created and modified by columns | <?php
/**
* This model contains all methods for interacting with user emails.
*
* @package Nails
* @subpackage module-auth
* @category Model
* @author Nails Dev Team
*/
namespace Nails\Auth\Model\User;
use Nails\Auth\Constants;
use Nails\Common\Model\Base;
/**
* Class Email
*
* @package Nails\Aut... | <?php
/**
* This model contains all methods for interacting with user emails.
*
* @package Nails
* @subpackage module-auth
* @category Model
* @author Nails Dev Team
*/
namespace Nails\Auth\Model\User;
use Nails\Auth\Constants;
use Nails\Common\Model\Base;
/**
* Class Email
*
* @package Nails\Aut... |
Add native return type declaration (array) to Twig functions extension | <?php
/**
* User: Simon Libaud
* Date: 19/03/2017
* Email: simonlibaud@gmail.com.
*/
namespace Sil\RouteSecurityBundle\Twig;
use Sil\RouteSecurityBundle\Security\AccessControl;
use Twig\Extension\AbstractExtension;
use Twig\TwigFunction;
/**
* Class RouteSecurityExtension.
*/
class RouteSecurityExtension extend... | <?php
/**
* User: Simon Libaud
* Date: 19/03/2017
* Email: simonlibaud@gmail.com.
*/
namespace Sil\RouteSecurityBundle\Twig;
use Sil\RouteSecurityBundle\Security\AccessControl;
use Twig\Extension\AbstractExtension;
use Twig\TwigFunction;
/**
* Class RouteSecurityExtension.
*/
class RouteSecurityExtension extend... |
Reduce speed of ZigBrain accelleration & test github web interface | class WanderBrain(CritterBrain):
def on_collision(self,dir,other,senses):
pass
def on_attack(self,dir,attacker,senses):
pass
def on_tick(self,senses):
self.body.turn(uniform(-0.1,+0.1)*randrange(1,4))
Brains.register(WanderBrain)
class ZigBrain(CritterBrain):
def on_collision(s... | class WanderBrain(CritterBrain):
def on_collision(self,dir,other,senses):
pass
def on_attack(self,dir,attacker,senses):
pass
def on_tick(self,senses):
self.body.turn(uniform(-0.1,+0.1)*randrange(1,4))
Brains.register(WanderBrain)
class ZigBrain(CritterBrain):
def on_collision(s... |
Fix the documentation and codacy objection. | /*
* Copyright 2017, TeamDev Ltd. All rights reserved.
*
* Redistribution and use in source and/or binary forms, with or without
* modification, must retain the above copyright notice and the following
* disclaimer.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRES... | /*
* Copyright 2017, TeamDev Ltd. All rights reserved.
*
* Redistribution and use in source and/or binary forms, with or without
* modification, must retain the above copyright notice and the following
* disclaimer.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRES... |
Set version number to 0.9.15 | from setuptools import setup
setup(
name='slacker',
version='0.9.15',
packages=['slacker'],
description='Slack API client',
author='Oktay Sancak',
author_email='oktaysancak@gmail.com',
url='http://github.com/os/slacker/',
install_requires=['requests >= 2.2.1'],
license='http://www.... | from setuptools import setup
setup(
name='slacker',
version='0.9.10',
packages=['slacker'],
description='Slack API client',
author='Oktay Sancak',
author_email='oktaysancak@gmail.com',
url='http://github.com/os/slacker/',
install_requires=['requests >= 2.2.1'],
license='http://www.... |
Use double quote for error wraping | package vegeta
import (
"bytes"
"encoding/json"
"fmt"
)
// Dumper is an interface defining Results dumping.
type Dumper interface {
Dump(*Result) ([]byte, error)
}
// DumperFunc is an adapter to allow the use of ordinary functions as
// Dumpers. If f is a function with the appropriate signature, DumperFunc(f)
//... | package vegeta
import (
"bytes"
"encoding/json"
"fmt"
)
// Dumper is an interface defining Results dumping.
type Dumper interface {
Dump(*Result) ([]byte, error)
}
// DumperFunc is an adapter to allow the use of ordinary functions as
// Dumpers. If f is a function with the appropriate signature, DumperFunc(f)
//... |
Clear input after submit now functinal | //placing both controllers her b/c short program, otherwise would make partial
Todos.TodosController = Ember.ArrayController.extend ({
actions: {
createNewTodo: function() {
var newVal = this.get('newTodo'); // gets new todo Val
var todo = this.store.createRecord('todo' , { //Creates a new todo type
val: ... | //placing both controllers her b/c short program, otherwise would make partial
Todos.TodosController = Ember.ArrayController.extend ({
actions: {
createNewTodo: function() {
var newVal = this.get('newTodo'); // gets new todo Val
var todo = this.store.createRecord('todo' , { //Creates a new todo type
val: ... |
Convert message check to regex | <?php
declare(strict_types=1);
namespace WRS\Tests\Storage;
use PHPUnit\Framework\TestCase;
use WRS\Storage\NullStorage;
class NullStorageTest extends TestCase
{
const KEY = "test";
const VALUE = "value";
public function testSave()
{
$ns = new NullStorage();
$ns->save(self::KEY, se... | <?php
declare(strict_types=1);
namespace WRS\Tests\Storage;
use PHPUnit\Framework\TestCase;
use WRS\Storage\NullStorage;
class NullStorageTest extends TestCase
{
const KEY = "test";
const VALUE = "value";
public function testSave()
{
$ns = new NullStorage();
$ns->save(self::KEY, se... |
Use a Not Found exception | <?php
namespace Church\Controller;
use Church\Entity\User\User;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Method;
use Symfony\Component\HttpKernel\Excepti... | <?php
namespace Church\Controller;
use Church\Entity\User\User;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Method;
use Symfony\Component\HttpKernel\Excepti... |
Clarify error message when item is already locked. | /**
* Copyright (C) 2009-2013 Simonsoft Nordic AB
*
* 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 applic... | /**
* Copyright (C) 2009-2013 Simonsoft Nordic AB
*
* 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 applic... |
Remove replace urlpatterns with simple array, make compatible with Django 1.9 | try:
from django.conf.urls import patterns, url
except ImportError:
# Django < 1.4
from django.conf.urls.defaults import url
from avatar import views
urlpatterns = [
url(r'^add/$', views.add, name='avatar_add'),
url(r'^change/$', views.change, name='avatar_change'),
url(r'^delete/$', views.del... | try:
from django.conf.urls import patterns, url
except ImportError:
# Django < 1.4
from django.conf.urls.defaults import patterns, url
from avatar import views
urlpatterns = patterns('',
url(r'^add/$', views.add, name='avatar_add'),
url(r'^change/$', views.change, name='avatar_change'),
url(r'... |
Exclude test data utilities from lit. | import os
import sys
import lit.formats
import lit.util
import lit.llvm
# Configuration file for the 'lit' test runner.
lit.llvm.initialize(lit_config, config)
# name: The name of this test suite.
config.name = 'TFLITEHUB'
config.test_format = lit.formats.ShTest()
# suffixes: A list of file extensions to treat as... | import os
import sys
import lit.formats
import lit.util
import lit.llvm
# Configuration file for the 'lit' test runner.
lit.llvm.initialize(lit_config, config)
# name: The name of this test suite.
config.name = 'TFLITEHUB'
config.test_format = lit.formats.ShTest()
# suffixes: A list of file extensions to treat as... |
Remove unused imports and variables. | package org.scribe.model;
import org.scribe.utils.OAuthEncoder;
/**
* @author: Pablo Fernandez
*/
public class Parameter implements Comparable<Parameter>
{
private final String key;
private final String value;
public Parameter(String key, String value)
{
this.key = key;
this.value = value;
}
p... | package org.scribe.model;
import java.io.UnsupportedEncodingException;
import java.net.URLEncoder;
import org.scribe.exceptions.OAuthException;
import org.scribe.utils.OAuthEncoder;
/**
* @author: Pablo Fernandez
*/
public class Parameter implements Comparable<Parameter>
{
private static final String UTF = "UTF8"... |
Make config file optional by default. | // Adapted from https://github.com/tsantef/commander-starter
var fs = require('fs');
var path = require('path');
require('json5/lib/register')
module.exports = function commandLoader(program) {
'use strict';
var commands = {};
var loadPath = path.dirname(__filename);
// Loop though command files
fs.readdi... | // Adapted from https://github.com/tsantef/commander-starter
var fs = require('fs');
var path = require('path');
require('json5/lib/register')
module.exports = function commandLoader(program) {
'use strict';
var commands = {};
var loadPath = path.dirname(__filename);
// Loop though command files
fs.readdi... |
Change not to be reduced to localhost access | var ws = new WebSocket("ws://"+window.location.host+":8000/websocket");
ws.onmessage = function(evt){
myOutput.value = evt.data;
}
function sendRain(){
var msg = {
type: "message",
value: document.getElementById("RainNumber").value,
id: "Rain",
date: Date.now()
};
// Send the msg object as a... | var ws = new WebSocket("ws://localhost:8000/websocket");
ws.onmessage = function(evt){
myOutput.value = evt.data;
}
function sendRain(){
var msg = {
type: "message",
value: document.getElementById("RainNumber").value,
id: "Rain",
date: Date.now()
};
// Send the msg object as a JSON-formatted... |
Fix test error (still failing) | var chai = require('chai');
var expect = chai.expect;
/* fake api server */
var server = require('./server');
var api = server.createServer();
var clubs = [
{
id: '205',
name: 'SURTEX',
logo: 'http://121.199.38.39/hphoto/logoclub/NewClub.jpgw76_h76.jpg'
}
];
var responses = {
'clubs/': server.crea... | var chai = require('chai');
var expect = chai.expect;
/* fake api server */
var server = require('./server');
var api = server.createServer();
var clubs = [
{
id: '205',
name: 'SURTEX',
logo: 'http://121.199.38.39/hphoto/logoclub/NewClub.jpgw76_h76.jpg'
}
];
var responses = {
'clubs/': server.crea... |
Add test for find string | var Trie = require('../app/trie');
describe('Trie', function() {
var trie;
beforeEach(function() {
trie = new Trie();
});
it('should be an object', function() {
expect(trie).to.be.ok;
});
it('should have a root', function() {
expect(trie.root).to.be.ok;
});
it('should have add method', ... | var Trie = require('../app/trie');
describe('Trie', function() {
var trie;
beforeEach(function() {
trie = new Trie();
});
it('should be an object', function() {
expect(trie).to.be.ok;
});
it('should have a root', function() {
expect(trie.root).to.be.ok;
});
it('should have add method', ... |
Make sure to return the favorites count | <?php namespace App\Data;
use Eloquent;
use DiscussionPresenter;
use Laracasts\Presenter\PresentableTrait;
use Illuminate\Database\Eloquent\SoftDeletes;
class Discussion extends Eloquent
{
use SoftDeletes, PresentableTrait;
protected $fillable = ['title', 'body', 'user_id', 'topic_id'];
protected $dates = ['creat... | <?php namespace App\Data;
use Eloquent;
use DiscussionPresenter;
use Laracasts\Presenter\PresentableTrait;
use Illuminate\Database\Eloquent\SoftDeletes;
class Discussion extends Eloquent
{
use SoftDeletes, PresentableTrait;
protected $fillable = ['title', 'body', 'user_id', 'topic_id'];
protected $dates = ['creat... |
Remove unused json import in api wrapper | import os
import requests
class APIWrapper(object):
def __init__(self, base_url=None, auth_token=None):
if base_url:
self.base_url = base_url
else:
self.base_url = "http://api.football-data.org/v1"
if auth_token:
self.headers = {
'X-A... | import json
import os
import requests
class APIWrapper(object):
def __init__(self, base_url=None, auth_token=None):
if base_url:
self.base_url = base_url
else:
self.base_url = "http://api.football-data.org/v1"
if auth_token:
self.headers = {
... |
Add a test for the get_thumb function. | # -*- coding:utf-8 -*-
import os
try:
import unittest2 as unittest
except ImportError:
import unittest # NOQA
from sigal.settings import read_settings, get_thumb
class TestSettings(unittest.TestCase):
"Read a settings file and check that the configuration is well done."
def setUp(self):
"... | # -*- coding:utf-8 -*-
import os
try:
import unittest2 as unittest
except ImportError:
import unittest # NOQA
from sigal.settings import read_settings
class TestSettings(unittest.TestCase):
"Read a settings file and check that the configuration is well done."
def setUp(self):
"Read the sa... |
Migrate to new plugin api | export default function ({ Plugin, types: t }) {
const visitor = {
Property: {
exit(node) {
if (node.computed || node.key.name !== 'propTypes') {
return;
}
const parent = this.findParent((parent) => {
return parent.type === 'CallExpression';
});
... | module.exports = function ({Transformer}) {
return new Transformer('minification.removeReactPropTypes', {
Property: {
exit(node) {
if (node.computed || node.key.name !== 'propTypes') {
return;
}
const parent = this.findParent((parent) => {
return parent.type === ... |
Declare add() method in log class as package private | package org.tinylog.core.test;
import java.util.ArrayList;
import java.util.List;
import org.tinylog.core.Level;
/**
* Storage for {@link LogEntry LogEntries}.
*/
public class Log {
private Level minLevel;
private List<LogEntry> entries;
/** */
public Log() {
minLevel = Level.INFO;
entries = new ArrayLis... | package org.tinylog.core.test;
import java.util.ArrayList;
import java.util.List;
import org.tinylog.core.Level;
/**
* Storage for {@link LogEntry LogEntries}.
*/
public class Log {
private Level minLevel;
private List<LogEntry> entries;
/** */
public Log() {
minLevel = Level.INFO;
entries = new ArrayLis... |
Use Notifiable trait on user model | <?php
namespace App\Models;
use Illuminate\Notifications\Notifiable;
use Illuminate\Foundation\Auth\User as Authenticatable;
class User extends Authenticatable
{
use Notifiable;
/**
* The attributes that are mass assignable.
*
* @var array
*/
protected $fillable = [
'name', '... | <?php
namespace App\Models;
use Illuminate\Notifications\Notifiable;
use Illuminate\Foundation\Auth\User as Authenticatable;
class User extends Authenticatable
{
// use Notifiable;
/**
* The attributes that are mass assignable.
*
* @var array
*/
protected $fillable = [
'name',... |
Use xmlrpclib.escape for escaping in PangoMarkupRenderer | # vim:fileencoding=utf-8:noet
from powerline.renderer import Renderer
from powerline.colorscheme import ATTR_BOLD, ATTR_ITALIC, ATTR_UNDERLINE
from xmlrpclib import escape as _escape
class PangoMarkupRenderer(Renderer):
'''Powerline Pango markup segment renderer.'''
@staticmethod
def hlstyle(*args, **kwargs):
... | # vim:fileencoding=utf-8:noet
from powerline.renderer import Renderer
from powerline.colorscheme import ATTR_BOLD, ATTR_ITALIC, ATTR_UNDERLINE
class PangoMarkupRenderer(Renderer):
'''Powerline Pango markup segment renderer.'''
@staticmethod
def hlstyle(*args, **kwargs):
# We don't need to explicitly reset attr... |
Clear the message box once it's done. | // Defines the top-level angular functionality. This will likely be refactored
// as I go.
var pyrcApp = angular.module("pyrcApp", []);
pyrcApp.controller("ircCtrl", function($scope) {
$scope.messages = [];
$scope.msg = "";
// Define the controller method for sending an IRC message.
$scope.sendIrcMess... | // Defines the top-level angular functionality. This will likely be refactored
// as I go.
var pyrcApp = angular.module("pyrcApp", []);
pyrcApp.controller("ircCtrl", function($scope) {
$scope.messages = [];
$scope.msg = "";
// Define the controller method for sending an IRC message.
$scope.sendIrcMess... |
Fix empty properties error in misspelled properties | 'use strict';
var helpers = require('../helpers'),
yaml = require('js-yaml'),
fs = require('fs'),
path = require('path');
var properties = yaml.safeLoad(fs.readFileSync(path.join(__dirname, '../../data', 'properties.yml'), 'utf8')).split(' ');
module.exports = {
'name': 'no-misspelled-properties',
'd... | 'use strict';
var helpers = require('../helpers'),
yaml = require('js-yaml'),
fs = require('fs'),
path = require('path');
var properties = yaml.safeLoad(fs.readFileSync(path.join(__dirname, '../../data', 'properties.yml'), 'utf8')).split(' ');
module.exports = {
'name': 'no-misspelled-properties',
'd... |
Add for loop in order to get correct structure of data | <?php
namespace AppBundle\Repository;
use Doctrine\ORM\EntityRepository;
/**
* TaxonomyNodeRepository
*
* This class was generated by the PhpStorm "Php Annotations" Plugin. Add your own custom
* repository methods below.
*/
class TaxonomyNodeRepository extends EntityRepository
{
public function getDatabases... | <?php
namespace AppBundle\Repository;
use Doctrine\ORM\EntityRepository;
/**
* TaxonomyNodeRepository
*
* This class was generated by the PhpStorm "Php Annotations" Plugin. Add your own custom
* repository methods below.
*/
class TaxonomyNodeRepository extends EntityRepository
{
public function getDatabases... |
Remove captured output last line from the API
no longer needed | {
"draw": {{draw}},
"recordsTotal": {{recordsTotal}},
"recordsFiltered": {{recordsFiltered}},
"data": [
{% autoescape false %}
{%- for run in runs -%}
{
"id": {{run._id | tostr | default | tojson}},
"experiment_name": {{run.experiment.name | default | tojson}},
"stat... | {
"draw": {{draw}},
"recordsTotal": {{recordsTotal}},
"recordsFiltered": {{recordsFiltered}},
"data": [
{% autoescape false %}
{%- for run in runs -%}
{
"id": {{run._id | tostr | default | tojson}},
"experiment_name": {{run.experiment.name | default | tojson}},
"stat... |
Add type-hints to Controller-related classes | <?php
declare(strict_types=1);
namespace AlgoWeb\PODataLaravel\Controllers;
class MetadataControllerContainer
{
/** @var array[] */
private $metadata;
/**
* @param array[] $meta
*/
public function setMetadata(array $meta): void
{
$this->metadata = $meta;
}
/**
* @... | <?php
declare(strict_types=1);
namespace AlgoWeb\PODataLaravel\Controllers;
class MetadataControllerContainer
{
private $metadata;
/**
* @param array $meta
*/
public function setMetadata(array $meta)
{
$this->metadata = $meta;
}
/**
* @return array
*/
public ... |
Remove requirement on presence of config file
The NipapConfig object required the presence of a configuration file. As
it is benficial to be able to load the NipapConfig without a
configuration file (for example when building docs using Sphinx), this
requirement has been removed. | import ConfigParser
class NipapConfig(ConfigParser.SafeConfigParser):
""" Makes configuration data available.
Implemented as a class with a shared state; once an instance has been
created, new instances with the same state can be obtained by calling
the custructor again.
"""
__sh... | import ConfigParser
class NipapConfig(ConfigParser.SafeConfigParser):
""" Makes configuration data available.
Implemented as a class with a shared state; once an instance has been
created, new instances with the same state can be obtained by calling
the custructor again.
"""
__sh... |
FindUsedBlobs: Check for seen blobs before loading trees
The only effective change in behavior is that that toplevel nodes can
also be skipped. | package restic
import "context"
// FindUsedBlobs traverses the tree ID and adds all seen blobs (trees and data
// blobs) to the set blobs. Already seen tree blobs will not be visited again.
func FindUsedBlobs(ctx context.Context, repo Repository, treeID ID, blobs BlobSet) error {
h := BlobHandle{ID: treeID, Type: Tr... | package restic
import "context"
// FindUsedBlobs traverses the tree ID and adds all seen blobs (trees and data
// blobs) to the set blobs. Already seen tree blobs will not be visited again.
func FindUsedBlobs(ctx context.Context, repo Repository, treeID ID, blobs BlobSet) error {
blobs.Insert(BlobHandle{ID: treeID, ... |
Remove unneeded reference to my-component.js from main.js. | /* 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 required by applicable ... | /* 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 required by applicable ... |
Add javadoc to batch builder. | package com.novoda.downloadmanager;
/**
* Builds instances of {@link Batch} using a fluent API.
*/
public interface BatchBuilder {
/**
* Sets {@link BatchFileBuilder} to build a {@link Batch} that will download a {@link BatchFile}
* from a given networkAddress.
*
* @param networkAddress to ... | package com.novoda.downloadmanager;
/**
* Builds instances of {@link Batch} using a fluent API.
*/
public interface BatchBuilder {
/**
* Sets {@link BatchFileBuilder} to build a {@link Batch} that will download a {@link BatchFile}
* from a given networkAddress.
*
* @param networkAddress to ... |
Fix missing renaming of logout => logoutLink
During development, this was previously named `logout`. This cleans up a
remaining instance of `logout`, renaming it to the preferred
`logoutLink` to remain consistent with the rest of the codebase. | import axios from 'axios'
let links
export default async function AJAX({
url,
resource,
id,
method = 'GET',
data = {},
params = {},
headers = {},
}) {
try {
const basepath = window.basepath || ''
let response
url = `${basepath}${url}`
if (!links) {
const linksRes = (response = ... | import axios from 'axios'
let links
export default async function AJAX({
url,
resource,
id,
method = 'GET',
data = {},
params = {},
headers = {},
}) {
try {
const basepath = window.basepath || ''
let response
url = `${basepath}${url}`
if (!links) {
const linksRes = (response = ... |
Add extra check for environment variables
isWebAppBuild will not return true if either the environment variables
are set to production or WEBAPP is set. | import { REGTEST_CORE_API_ENDPOINT } from '../account/store/settings/default'
export function openInNewTab(url) {
const win = window.open(url, '_blank')
win.focus()
}
export function isWindowsBuild() {
const isWindowsBuildCompileFlag = false
return isWindowsBuildCompileFlag === true
}
export function isWebA... | import { REGTEST_CORE_API_ENDPOINT } from '../account/store/settings/default'
export function openInNewTab(url) {
const win = window.open(url, '_blank')
win.focus()
}
export function isWindowsBuild() {
const isWindowsBuildCompileFlag = false
return isWindowsBuildCompileFlag === true
}
export function isWebA... |
Make mdb2 reference actually read-only.
svn commit r5671 | <?php
require_once 'Site/SiteApplicationModule.php';
require_once 'SwatDB/exceptions/SwatDBException.php';
require_once 'MDB2.php';
/**
* Application module for database connectivity
*
* @package Site
* @copyright 2004-2006 silverorange
*/
class SiteDatabaseModule extends SiteApplicationModule
{
// {{{ pub... | <?php
require_once 'Site/SiteApplicationModule.php';
require_once 'SwatDB/exceptions/SwatDBException.php';
require_once 'MDB2.php';
/**
* Application module for database connectivity
*
* @package Site
* @copyright 2004-2006 silverorange
*/
class SiteDatabaseModule extends SiteApplicationModule
{
// {{{ pub... |
[Minor] Clean up use of deprecated method
Signed-off-by: Gregor Zurowski <5fdc67d2166bcdd1d3aa4ed45ea5a25e9b21bc20@zurowski.org> | /**
* 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... |
Check out the HAR log | <?php
set_error_handler(
function ($errno, $errstr, $errfile, $errline )
{
throw new ErrorException($errstr, $errno, 0, $errfile, $errline);
}
);
require __DIR__ . '/../vendor/autoload.php';
$driver = RemoteWebDriver::create('127.0.0.1:4444/wd/hub', DesiredCapabilities::phantomjs());
$driver->man... | <?php
set_error_handler(
function ($errno, $errstr, $errfile, $errline )
{
throw new ErrorException($errstr, $errno, 0, $errfile, $errline);
}
);
require __DIR__ . '/../vendor/autoload.php';
$driver = RemoteWebDriver::create('127.0.0.1:4444/wd/hub', DesiredCapabilities::phantomjs());
$driver->man... |
Update to image src selector | /*
for each li
color = find span color --- this.text
url = find main prod image -- this.url
category Swatch Color Button = matching color.url
end
on click
*/
var colorBtnSrc = {};
$("span:contains('Color')").parents().eq(2).find('.productAttributeValue li').each( function getColorPhotosSrcs(){
var listings ... | /*
for each li
color = find span color --- this.text
url = find main prod image -- this.url
category Swatch Color Button = matching color.url
end
on click
*/
var colorBtnSrc = {};
$("span:contains('Color')").parents().eq(2).find('.productAttributeValue li').each( function getColorPhotosSrcs(){
var listings ... |
Fix sorting of the imports. | """
The FVCOM Python toolbox (PyFVCOM)
"""
__version__ = '1.6.2'
__author__ = 'Pierre Cazenave'
__credits__ = ['Pierre Cazenave']
__license__ = 'MIT'
__maintainer__ = 'Pierre Cazenave'
__email__ = 'pica@pml.ac.uk'
import inspect
from warnings import warn
# Import everything!
from PyFVCOM import buoy_tools
from PyFV... | """
The FVCOM Python toolbox (PyFVCOM)
"""
__version__ = '1.6.2'
__author__ = 'Pierre Cazenave'
__credits__ = ['Pierre Cazenave']
__license__ = 'MIT'
__maintainer__ = 'Pierre Cazenave'
__email__ = 'pica@pml.ac.uk'
import inspect
from warnings import warn
# Import everything!
from PyFVCOM import buoy_tools
from PyFV... |
Remove required community.image in list | import React, { PropTypes } from 'react'
const ListItem = ({ onClick, community: { id, name, image } }) => (
<div className='ListItem' onClick={() => onClick(id)} style={{ cursor: 'pointer' }}>
<u
className='logo-icon nossas left'
style={{
backgroundImage: image ? `url(${image})` : undefined,... | import React, { PropTypes } from 'react'
const ListItem = ({ onClick, community: { id, name, image } }) => (
<div className='ListItem' onClick={() => onClick(id)} style={{ cursor: 'pointer' }}>
<u
className='logo-icon nossas left'
style={{
backgroundImage: image ? `url(${image})` : undefined,... |
Remove alias from service provider.
Signed-off-by: Mior Muhammad Zaki <e1a543840a942eb68427510a8a483282a7bfeddf@gmail.com> | <?php namespace Orchestra\Support;
use Illuminate\Support\ServiceProvider;
class MessagesServiceProvider extends ServiceProvider
{
/**
* Register the service provider.
*
* @return void
*/
public function register()
{
$this->app['orchestra.messages'] = $this->app->share(function... | <?php namespace Orchestra\Support;
use Illuminate\Support\ServiceProvider;
class MessagesServiceProvider extends ServiceProvider
{
/**
* Register the service provider.
*
* @return void
*/
public function register()
{
$this->app['orchestra.messages'] = $this->app->share(function... |
Fix an issue with Fiber (User.avatar) | import { RocketChat } from 'meteor/rocketchat:lib';
import property from 'lodash.property';
import schema from '../../schemas/users/User-type.graphqls';
const resolver = {
User: {
id: property('_id'),
status: ({status}) => status.toUpperCase(),
avatar: async({ _id }) => {
// XXX js-accounts/graphql#16
co... | import { RocketChat } from 'meteor/rocketchat:lib';
import property from 'lodash.property';
import schema from '../../schemas/users/User-type.graphqls';
const resolver = {
User: {
id: property('_id'),
status: ({status}) => status.toUpperCase(),
avatar: async({ _id }) => {
const avatar = RocketChat.models.Av... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.