text stringlengths 16 4.96k | positive stringlengths 321 2.24k | negative stringlengths 310 2.21k |
|---|---|---|
Update CT Transit feed fetcher
CT Transit has changed their URLs. | """Fetch CT Transit (Connecticut) feeds."""
import logging
from FeedSource import FeedSource
LOG = logging.getLogger(__name__)
BASE_URL = 'http://www.cttransit.com/sites/default/files/gtfs/googlect_transit.zip'
SHORELINE_EAST_URL = 'http://www.shorelineeast.com/google_transit.zip'
HARTFORD_URL = 'http://www.hartford... | """Fetch CT Transit (Connecticut) feeds."""
import logging
from FeedSource import FeedSource
LOG = logging.getLogger(__name__)
BASE_URL = 'http://www.cttransit.com/uploads_GTFS/'
SHORELINE_EAST_URL = 'http://www.shorelineeast.com/google_transit.zip'
class CTTransit(FeedSource):
"""Fetch PATH feed."""
def _... |
Remove depency to removed database.php | <?php
$config = require 'app/config.php';
require 'app/services/net-usage-monitor.php';
$pdo = new PDO('mysql:host=' . $config['db']['host'] . ';dbname=' . $config['db']['database'], $config['db']['username'], $config['db']['password']);
$netUsageMonitor = new NetUsageMonitor($pdo);
foreach ($config['routers'] AS $ro... | <?php
$config = require 'app/config.php';
require 'app/models/database.php';
require 'app/services/net-usage-monitor.php';
$pdo = new PDO('mysql:host=' . $config['db']['host'] . ';dbname=' . $config['db']['database'], $config['db']['username'], $config['db']['password']);
$netUsageMonitor = new NetUsageMonitor($pdo);
... |
Remove stray print debug message
Signed-off-by: Steven Dake <8638f3fce5db0278cfbc239bd581dfc00c29ec9d@redhat.com> | class LazyPluggable(object):
"""A pluggable backend loaded lazily based on some value."""
def __init__(self, pivot, **backends):
self.__backends = backends
self.__pivot = pivot
self.__backend = None
def __get_backend(self):
if not self.__backend:
backend_name = ... | class LazyPluggable(object):
"""A pluggable backend loaded lazily based on some value."""
def __init__(self, pivot, **backends):
self.__backends = backends
self.__pivot = pivot
self.__backend = None
def __get_backend(self):
if not self.__backend:
print self.__ba... |
Add entryCssClasses functionality to referenced list field. | export default function maReferencedListColumn(NgAdminConfiguration) {
return {
scope: {
'field': '&',
'datastore': '&'
},
restrict: 'E',
link: {
pre: function(scope) {
scope.field = scope.field();
var targetEntity =... | export default function maReferencedListColumn(NgAdminConfiguration) {
return {
scope: {
'field': '&',
'datastore': '&'
},
restrict: 'E',
link: {
pre: function(scope) {
scope.field = scope.field();
var targetEntity =... |
Allow for static contents served over CDN | import json
import stripe
import os
import flask
from flask import g
from flask.ext.sqlalchemy import SQLAlchemy
from flask.ext.login import LoginManager, current_user
from flask.ext.cdn import CDN
from formspree import log
from flask_redis import Redis
import settings
DB = SQLAlchemy()
redis_store = Redis()
stripe.a... | import json
import stripe
import flask
from flask import g
from flask.ext.sqlalchemy import SQLAlchemy
from flask.ext.login import LoginManager, current_user
from flask_redis import Redis
import settings
DB = SQLAlchemy()
redis_store = Redis()
stripe.api_key = settings.STRIPE_SECRET_KEY
import routes
from users.mode... |
Fix one more assertion call | <?php
/**
* validate field mapper
*/
namespace Graviton\GeneratorBundle\Tests\Generator\ResourceGenerator;
use Graviton\GeneratorBundle\Generator\ResourceGenerator\FieldMapper;
/**
* @author List of contributors <https://github.com/libgraviton/graviton/graphs/contributors>
* @license http://opensource.org/lic... | <?php
/**
* validate field mapper
*/
namespace Graviton\GeneratorBundle\Tests\Generator\ResourceGenerator;
use Graviton\GeneratorBundle\Generator\ResourceGenerator\FieldMapper;
/**
* @author List of contributors <https://github.com/libgraviton/graviton/graphs/contributors>
* @license http://opensource.org/lic... |
Adjust entry_points to fix autoscan | # -*- coding: utf-8 -*-
from setuptools import setup, find_packages
name = 'morepath_cerebral_todomvc'
description = (
'Morepath example of using React & Cerebral'
)
version = '0.1.0'
setup(
name=name,
version=version,
description=description,
author='Henri Hulski',
author_email='henri.hulski... | # -*- coding: utf-8 -*-
from setuptools import setup, find_packages
name = 'morepath_cerebral_todomvc'
description = (
'Morepath example of using React & Cerebral'
)
version = '0.1.0'
setup(
name=name,
version=version,
description=description,
author='Henri Hulski',
author_email='henri.hulsk... |
Sort the queues by name, so that they are deterministic across instances of `django_rq`. | from django.conf import settings
from django.core.exceptions import ImproperlyConfigured
from .queues import get_unique_connection_configs
SHOW_ADMIN_LINK = getattr(settings, 'RQ_SHOW_ADMIN_LINK', False)
QUEUES = getattr(settings, 'RQ_QUEUES', None)
if QUEUES is None:
raise ImproperlyConfigured("You have to defi... | from django.conf import settings
from django.core.exceptions import ImproperlyConfigured
from .queues import get_unique_connection_configs
SHOW_ADMIN_LINK = getattr(settings, 'RQ_SHOW_ADMIN_LINK', False)
QUEUES = getattr(settings, 'RQ_QUEUES', None)
if QUEUES is None:
raise ImproperlyConfigured("You have to defi... |
Add ImplicitClawSolver1D to base namespace | # =====================================================================
# Package: petclaw
# File: __init__.py
# Authors: Amal Alghamdi
# David Ketcheson
# Aron Ahmadia
# ======================================================================
"""Main petclaw package"""
im... | # =====================================================================
# Package: petclaw
# File: __init__.py
# Authors: Amal Alghamdi
# David Ketcheson
# Aron Ahmadia
# ======================================================================
"""Main petclaw package"""
im... |
Fix read max-data-per-node correctly in memory connector config | /*
* 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
* distribut... | /*
* 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
* distribut... |
Make incrementing tests check the cache was actually used, too | <?php
class IncrementingTest extends RememberTestCase
{
public function testIncrementingModelsPopsCache()
{
$group = Group::create(['id' => static::ID, 'name' => 'counter test', 'counter' => 0]);
$cached = Group::find(static::ID);
$group->increment('counter');
$new = Group::f... | <?php
class IncrementingTest extends RememberTestCase
{
public function testIncrementingModelsPopsCache()
{
$group = Group::create(['id' => static::ID, 'name' => 'counter test', 'counter' => 0]);
$cached = Group::find(static::ID);
$group->increment('counter');
$new = Group::f... |
Add the ability to pass in the an aws.Config object when creating a NewSQSClient | package worker
import (
"fmt"
"github.com/aws/aws-sdk-go/aws"
"github.com/aws/aws-sdk-go/aws/session"
"github.com/aws/aws-sdk-go/service/sqs"
)
// NewSQSClient returns a SQS Client and a Queue URL for you you to connect to
func NewSQSClient(queueName string, cfgs ...*aws.Config) (*sqs.SQS, string) {
sess, err :... | package worker
import (
"fmt"
"github.com/aws/aws-sdk-go/aws"
"github.com/aws/aws-sdk-go/aws/session"
"github.com/aws/aws-sdk-go/service/sqs"
)
// NewSQSClient returns a SQS Client and a Queue URL for you you to connect to
func NewSQSClient(queueName string) (*sqs.SQS, string) {
sess, err := session.NewSession(... |
HOTFIX: Fix cloudfoundry using wrong node version | var locationGraph = require('../assets/data/demo-picker-data-1.json')
function isCanonicalNode (node) {
return node.meta.canonical
}
function presentableName (node, locale) {
var requestedName = node['names'][locale]
var fallback = Object.keys(node['names']).map(k => node['names'][k])[0]
return requestedName ... | var locationGraph = require('../assets/data/demo-picker-data-1.json')
function isCanonicalNode (node) {
return node.meta.canonical
}
function presentableName (node, locale) {
var requestedName = node['names'][locale]
var fallback = Object.values(node['names'])[0]
return requestedName || fallback
}
var locati... |
Remove intentional unused import to clean branch | from django.conf.urls import patterns, url, include
urlpatterns = patterns('',
url(r'', include(patterns('',
url(r'^$', include('serrano.resources')),
url(r'^fields/', include('serrano.resources.field')),
url(r'^concepts/', include('serrano.resources.concept')),
url(r'^contexts/', ... | import time
from django.conf.urls import patterns, url, include
urlpatterns = patterns('',
url(r'', include(patterns('',
url(r'^$', include('serrano.resources')),
url(r'^fields/', include('serrano.resources.field')),
url(r'^concepts/', include('serrano.resources.concept')),
url(r'^... |
Update displayName of wrapped component to include HoC name | import React, { Component } from 'react'
import PropTypes from 'prop-types'
export const getContextualizer = (propTypes, targetProp) => {
class ContextProps extends Component {
getChildContext () {
const props = Object.keys(this.props).reduce((x, key) => {
if (key !== 'children') {
x[key]... | import React, { Component } from 'react'
import PropTypes from 'prop-types'
export const getContextualizer = (propTypes, targetProp) => {
class ContextProps extends Component {
getChildContext () {
const props = Object.keys(this.props).reduce((x, key) => {
if (key !== 'children') {
x[key]... |
Set UI as best on OS | package ru.faulab.attendence;
import com.google.inject.Guice;
import com.google.inject.Injector;
import ru.faulab.attendence.module.MainModule;
import ru.faulab.attendence.ui.MainFrame;
import javax.swing.*;
public class Runner {
/*
* 1. Статистика
* */
public static void main(String[]... | package ru.faulab.attendence;
import com.google.inject.Guice;
import com.google.inject.Injector;
import ru.faulab.attendence.module.MainModule;
import ru.faulab.attendence.ui.MainFrame;
public class Runner {
/*
* 1. Статистика
* */
public static void main(String[] args) throws Exception {... |
Add pyscopg2 to list of dependencies
Former-commit-id: afed58eea17319b11e3fafc1ef45c7cdf590fac0
Former-commit-id: 257ed272462ca52cc15bae9040296ace91e15843 [formerly 19b9a870795fb176a9fb49b427a00b70fc6e2b35] [formerly 5b2ece2b396282c63c2902d6128e3a1f2c982708 [formerly 1a662bf08f6e4b81939fe16c4422c7201c9394f5]]
Former-... | #!/usr/bin/evn python2
from setuptools import setup, find_packages
setup(name='pprof',
version='0.9.6',
packages=find_packages(),
install_requires=["SQLAlchemy==1.0.4", "cloud==2.8.5", "plumbum==1.4.2",
"regex==2015.5.28", "wheel==0.24.0", "parse==1.6.6",
... | #!/usr/bin/evn python2
from setuptools import setup, find_packages
setup(name='pprof',
version='0.9.6',
packages=find_packages(),
install_requires=["SQLAlchemy==1.0.4", "cloud==2.8.5", "plumbum==1.4.2",
"regex==2015.5.28", "wheel==0.24.0", "parse==1.6.6",
... |
Add tested python version in classifiers | from setuptools import setup
import generate
generate.run()
setup(
name='nnpy',
version='0.1',
url='https://github.com/nanomsg/nnpy',
license='MIT',
author='Dirkjan Ochtman',
author_email='dirkjan@ochtman.nl',
description='cffi-based Python bindings for nanomsg',
long_description=open(... | from setuptools import setup
import generate
generate.run()
setup(
name='nnpy',
version='0.1',
url='https://github.com/nanomsg/nnpy',
license='MIT',
author='Dirkjan Ochtman',
author_email='dirkjan@ochtman.nl',
description='cffi-based Python bindings for nanomsg',
long_description=open(... |
Add method createLEDMatrixBuffer. Fix bug in writeLEDS. Add example of using createLEDMatrixBuffer | /**
* To run example
*
* cd <project directory
* npm install
* ./node_modules/.bin/babel-node ./examples/cycle-leds.js
*/
import withNuimo from "../src";
import images from './led-images';
console.log('Looking for Nuimo device...');
withNuimo().then(nuimo => {
var ledImages = [];
var currentIndex = 0;
... | /**
* To run example
*
* cd <project directory
* npm install
* ./node_modules/.bin/babel-node ./examples/cycle-leds.js
*/
import withNuimo from "../src";
import {ClickUpdate} from "../src/update"
import images from './led-images';
console.log('Looking for Nuimo device...');
withNuimo().then(nuimo => {
var le... |
Remove gutter to match the output | import React, { PropTypes } from 'react'
import styled from 'styled-components'
import AceEditor from 'react-ace'
const PreviewContainer = styled.div`
align-self: center;
padding: 28px;
width: 100%;
height: 400px;
background-color: white;
border: 1px solid rgba(0, 0, 0, 0.35);
box-shadow: 0 2px 16px 2px ... | import React, { PropTypes } from 'react'
import styled from 'styled-components'
import AceEditor from 'react-ace'
const PreviewContainer = styled.div`
align-self: center;
padding: 28px;
width: 100%;
height: 400px;
background-color: white;
border: 1px solid rgba(0, 0, 0, 0.35);
box-shadow: 0 2px 16px 2px ... |
Add a sanity check per @bbangert | import os
from nose import SkipTest
from sys import platform
from kazoo.testing import KazooTestCase
class KazooInterruptTests(KazooTestCase):
def test_interrupted_systemcall(self):
'''
Make sure interrupted system calls don't break the world, since we can't
control what all signals our c... | import os
from nose import SkipTest
from sys import platform
from kazoo.testing import KazooTestCase
class KazooInterruptTests(KazooTestCase):
def test_interrupted_systemcall(self):
'''
Make sure interrupted system calls don't break the world, since we can't
control what all signals our c... |
Revert "do not test the dst for palmer (do not understand php behaviour for this one)"
This reverts commit a830d15881d2aafb11357c4591568ea53c60a22b. | <?php
declare(strict_types = 1);
namespace Tests\Innmind\TimeContinuum\Timezone\Earth\Antarctica;
use Innmind\TimeContinuum\{
Timezone\Earth\Antarctica\Palmer,
TimezoneInterface
};
class PalmerTest extends \PHPUnit_Framework_TestCase
{
public function testInterface()
{
$zone = new Palmer;
... | <?php
declare(strict_types = 1);
namespace Tests\Innmind\TimeContinuum\Timezone\Earth\Antarctica;
use Innmind\TimeContinuum\{
Timezone\Earth\Antarctica\Palmer,
TimezoneInterface
};
class PalmerTest extends \PHPUnit_Framework_TestCase
{
public function testInterface()
{
$zone = new Palmer;
... |
fix(date): Update date for new study year | package com.ssu.schedule.model;
public class Day {
private String start = "01.09.2017";
private String end = "01.07.2018";
private int weekday;
private int week = 0;
public void setWeekday(int weekday) {
this.weekday = weekday;
}
public void setWeek(int week) {
this.week ... | package com.ssu.schedule.model;
public class Day {
private String start = "01.09.2016";
private String end = "01.07.2017";
private int weekday;
private int week = 0;
public void setWeekday(int weekday) {
this.weekday = weekday;
}
public void setWeek(int week) {
this.week ... |
Move parser object into port open | /* eslint-disable node/no-missing-require */
'use strict';
const SerialPort = require('../../');
const ByteLength = SerialPort.parsers.ByteLength;
const exec = require('child_process').exec;
// Serial receiver device
const port = process.env.TEST_PORT_RX;
// Expected number of bytes to receive (should make `size` in ... | /* eslint-disable node/no-missing-require */
'use strict';
const SerialPort = require('../../');
const exec = require('child_process').exec;
// Serial receiver device
const port = process.env.TEST_PORT_RX;
// Expected number of bytes to receive (should make `size` in drain.js)
const expected = 512;
const ByteLength =... |
Add method for creating keypair with default size | // Copyright 2018 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
package com.yahoo.vespa.athenz.tls;
import java.security.GeneralSecurityException;
import java.security.KeyPair;
import java.security.KeyPairGenerator;
/**
* @author bjorncs
*/
public class KeyUtil... | // Copyright 2018 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
package com.yahoo.vespa.athenz.tls;
import java.security.GeneralSecurityException;
import java.security.KeyPair;
import java.security.KeyPairGenerator;
/**
* @author bjorncs
*/
public class KeyUtil... |
Print the JSON dump, so it's prettier. | # Here's an example of stuff to copy and paste into an interactive Python
# interpreter to get a connection loaded.
# Or you can load it with 'python -i interactive_mode.py'.
# Set some variables.
bmrc = "~/.bmrc"
site = "www"
bmutilspath = "./lib"
# Import everything, make a connection, and try to log in.
import j... | # Here's an example of stuff to copy and paste into an interactive Python interpreter to get a connection loaded.
# Or you can load it with 'python -i interactive-mode.py'.
# Set some variables.
bmrc = "~/.bmrc"
site = "www"
bmutilspath = "./lib"
# Import everything, make a connection, and try to log in.
import jso... |
Add PyPI classifiers for Python 3.4, 3.5 and 3.6
Since the tests pass on Python 3. | from setuptools import setup
setup(
name = "wsgi-sslify",
description = "WSGI middleware to force HTTPS.",
version = "1.0.1",
author = "Jacob Kaplan-Moss",
author_email = "jacob@jacobian.org",
url = "https://github.com/jacobian/wsgi-sslify",
py_modules = ['wsgi_sslify'],
install_require... | from setuptools import setup
setup(
name = "wsgi-sslify",
description = "WSGI middleware to force HTTPS.",
version = "1.0.1",
author = "Jacob Kaplan-Moss",
author_email = "jacob@jacobian.org",
url = "https://github.com/jacobian/wsgi-sslify",
py_modules = ['wsgi_sslify'],
install_require... |
sql: Change Ip => IP for idiomatic Go | package sql
import "github.com/jen20/riviera/azure"
type CreateOrUpdateFirewallRuleResponse struct {
ID *string `mapstructure:"id"`
Name *string `mapstructure:"name"`
Location *string `mapstructure:"location"`
StartIPAddress *string `json:"startIpAddress,omitempty"`
EndIPAddress *st... | package sql
import "github.com/jen20/riviera/azure"
type CreateOrUpdateFirewallRuleResponse struct {
ID *string `mapstructure:"id"`
Name *string `mapstructure:"name"`
Location *string `mapstructure:"location"`
StartIpAddress *string `json:"startIpAddress,omitempty"`
EndIpAddress *st... |
Change route file to be used later | var artistController = require('../controllers/artist-controller');
var genreController = require('../controllers/genre-controller');
module.exports = function(app, passport) {
app.get('/auth/facebook', passport.authenticate('facebook', { scope : 'email' }));
app.get('/auth/facebook/callback',
passport.authenti... | var artistController = require('../controllers/artist-controller');
var genreController = require('../controllers/genre-controller');
module.exports = function(app, passport) {
app.get('/auth/facebook', passport.authenticate('facebook', { scope : 'email' }));
app.get('/auth/facebook/callback',
passport.authenti... |
Fix issue on match vm title | import Ember from 'ember';
export default Ember.Component.extend({
isShowingHover: false,
commitTitle: function() {
if (this.get('vm.commit.title') && this.get('vm.commit.title').match(/^Merge/)) {
return this.get('vm.commit.title').replace(/ of.*/g,'').replace(/ into.*/g,'');
}
return this.get... | import Ember from 'ember';
export default Ember.Component.extend({
isShowingHover: false,
commitTitle: function() {
if (this.get('vm.commit.title').match(/^Merge/)) {
return this.get('vm.commit.title').replace(/ of.*/g,'').replace(/ into.*/g,'');
}
return this.get('vm.commit.title');
}.proper... |
Use built-in IP address functionality to unmap IPv4 addresses | from twisted.internet.protocol import ClientFactory, Factory
from txircd.server import IRCServer
from txircd.user import IRCUser
from ipaddress import ip_address
from typing import Union
def unmapIPv4(ip: str) -> Union["IPv4Address", "IPv6Address"]:
"""
Converts an IPv6-mapped IPv4 address to a bare IPv4 address.
"... | from twisted.internet.protocol import ClientFactory, Factory
from txircd.server import IRCServer
from txircd.user import IRCUser
from ipaddress import ip_address
import re
ipv4MappedAddr = re.compile("::ffff:(\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3})")
def unmapIPv4(ip: str) -> str:
"""
Converts an IPv6-mapped IPv4 addres... |
Enable strict types in menu item group class. | <?php declare(strict_types=1);
/**
* @author Igor Nikolaev <igor.sv.n@gmail.com>
* @copyright Copyright (c) 2015, Darvin Studio
* @link https://www.darvin-studio.ru
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace... | <?php
/**
* @author Igor Nikolaev <igor.sv.n@gmail.com>
* @copyright Copyright (c) 2015, Darvin Studio
* @link https://www.darvin-studio.ru
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Darvin\AdminBundle\Menu;... |
Add angles to ball close decision | import math
from dynamic_stack_decider.abstract_decision_element import AbstractDecisionElement
class BallClose(AbstractDecisionElement):
def __init__(self, blackboard, dsd, parameters=None):
super(BallClose, self).__init__(blackboard, dsd, parameters)
self.ball_close_distance = parameters.get("di... | from dynamic_stack_decider.abstract_decision_element import AbstractDecisionElement
class BallClose(AbstractDecisionElement):
def __init__(self, blackboard, dsd, parameters=None):
super(BallClose, self).__init__(blackboard, dsd, parameters)
self.ball_close_distance = parameters.get("distance", sel... |
Send the restaurant name when creating sitting | <?php
require_once 'dbHandler.php';
if(isset($_POST['action']) && !empty($_POST['action'])) {
$dbHandler = new DatabaseHandler();
$action = $_POST['action'];
switch($action) {
case 'addSitting' : addSitting($dbHandler);break;
case 'removeSitting' : removeSitting($dbHandler);break;
... | <?php
require_once 'dbHandler.php';
if(isset($_POST['action']) && !empty($_POST['action'])) {
$dbHandler = new DatabaseHandler();
$action = $_POST['action'];
switch($action) {
case 'addSitting' : addSitting($dbHandler);break;
case 'removeSitting' : removeSitting($dbHandler);break;
... |
Hide error pages in page link dropdowns | /*
* Do not display error pages in SiteTree or file selector
* loaded only when !Permission::check('SITETREE_REORGANISE')
*/
(function($){
$.entwine('ss', function($){
/* Hide error pages in SiteTree */
$('li[data-pagetype="ErrorPage"]').entwine({
onmatch: function(){
this.hide();
}
});
/*... | /*
* Do not display error pages in SiteTree or file selector
* loaded only when !Permission::check('SITETREE_REORGANISE')
*/
(function($){
$.entwine('ss', function($){
/* Hide error pages in SiteTree */
$('li[data-pagetype="ErrorPage"]').entwine({
onmatch: function(){
this.hide();
}
});
/* Hide ... |
Store latest etag in db | const request = require('superagent');
import * as requests from './requestFactory';
import * as data from '../../persistence';
module.exports = function (req, res) {
const { type, project } = req.body;
const filename = type === 'keywords' ? type + '.txt' : type + '.md';
const saveRepoFile = () => {
request... | const request = require('superagent');
import * as requests from './requestFactory';
import * as data from '../../persistence';
module.exports = function (req, res) {
const { type, project } = req.body;
const filename = type === 'keywords' ? type + '.txt' : type + '.md';
const saveRepoFile = () => {
request... |
Fix router name generation at CollerGenerator
* Replace hardcoded text DefaultController with passed argumnet
{{name}}Controller when rendering routing yml file | <?php
namespace Drupal\AppConsole\Generator;
use Symfony\Component\DependencyInjection\Container;
class ControllerGenerator extends Generator {
private $filesystem;
public function __construct() {}
public function generate($module, $name, $controller, $services) {
$path = DRUPAL_ROOT . '/' . drupal_get_... | <?php
namespace Drupal\AppConsole\Generator;
use Symfony\Component\DependencyInjection\Container;
class ControllerGenerator extends Generator {
private $filesystem;
public function __construct() {}
public function generate($module, $name, $controller, $services ) {
$path = DRUPAL_ROOT . '/' . drupal_get... |
Fix removal of chat plugin | from spock.plugins.core import auth, event, net, ticker, timer
from spock.plugins.helpers import chat, clientinfo, entities, interact, \
inventory, keepalive, movement, physics, respawn, start, world
from spock.plugins.base import PluginBase # noqa
core_plugins = [
('auth', auth.AuthPlugin),
('event', ev... | from spock.plugins.core import auth, event, net, ticker, timer
from spock.plugins.helpers import clientinfo, entities, interact, inventory,\
keepalive, movement, physics, respawn, start, world
from spock.plugins.base import PluginBase # noqa
core_plugins = [
('auth', auth.AuthPlugin),
('event', event.Ev... |
Remove trailing slash for default configuration | <?php
namespace EventStore\Bundle\ClientBundle\DependencyInjection;
use Symfony\Component\Config\Definition\Builder\TreeBuilder;
use Symfony\Component\Config\Definition\ConfigurationInterface;
/**
* This is the class that validates and merges configuration from your app/config files
*
* To learn more see {@link ht... | <?php
namespace EventStore\Bundle\ClientBundle\DependencyInjection;
use Symfony\Component\Config\Definition\Builder\TreeBuilder;
use Symfony\Component\Config\Definition\ConfigurationInterface;
/**
* This is the class that validates and merges configuration from your app/config files
*
* To learn more see {@link ht... |
Order the tickets correctly in the API. | # -*- coding: utf-8 -*-
from django.shortcuts import get_object_or_404
from rest_framework import viewsets
from rest_framework.response import Response
from apps.broadcasts.models import Broadcast, Host, Raid, Series
from apps.games.models import Game
from apps.subscribers.models import Ticket
from .serializers impo... | # -*- coding: utf-8 -*-
from django.shortcuts import get_object_or_404
from rest_framework import viewsets
from rest_framework.response import Response
from apps.broadcasts.models import Broadcast, Host, Raid, Series
from apps.games.models import Game
from apps.subscribers.models import Ticket
from .serializers impo... |
Fix Linux build by removing unused import | package taptun
import (
"os"
"syscall"
"unsafe"
)
type ifreq struct {
name [syscall.IFNAMSIZ]byte // c string
flags uint16 // c short
_pad [24 - unsafe.Sizeof(uint16(0))]byte
}
func createInterface(flags uint16) (string, *os.File, error) {
f, err := os.OpenFile("/dev/net/tun", os.O_RDWR, 060... | package taptun
import (
"bytes"
"os"
"syscall"
"unsafe"
)
type ifreq struct {
name [syscall.IFNAMSIZ]byte // c string
flags uint16 // c short
_pad [24 - unsafe.Sizeof(uint16(0))]byte
}
func createInterface(flags uint16) (string, *os.File, error) {
f, err := os.OpenFile("/dev/net/tun", os.O_... |
Make `switch` command a bit more helpful | # -*- coding: utf-8 -*-
# Gitless - a version control system built on top of Git.
# Licensed under GNU GPL v2.
"""gl switch - Switch branches."""
from __future__ import unicode_literals
from . import pprint
def parser(subparsers, _):
"""Adds the switch parser to the given subparsers object."""
desc = 'switch ... | # -*- coding: utf-8 -*-
# Gitless - a version control system built on top of Git.
# Licensed under GNU GPL v2.
"""gl switch - Switch branches."""
from __future__ import unicode_literals
from . import pprint
def parser(subparsers, _):
"""Adds the switch parser to the given subparsers object."""
desc = 'switch ... |
Fix not opening watchlist entries in browser | angular.module('proxtop').service('open', ['ipc', 'settings', '$state', function(ipc, settings, $state) {
const self = this;
['Anime', 'Manga'].forEach(function(name) {
const lower = name.toLowerCase();
self['open' + name] = function(id, ep, sub) {
const actualSettings = settings.get... | angular.module('proxtop').service('open', ['ipc', 'settings', '$state', function(ipc, settings, $state) {
const self = this;
['Anime', 'Manga'].forEach(function(name) {
const lower = name.toLowerCase();
self['open' + name] = function(id, ep, sub) {
const actualSettings = settings.get... |
Replace Preconditions.checkNonNull() from Guava with Java sdks Objects.requireNonNull() | package com.veyndan.redditclient.api.reddit.network.interceptor;
import java.io.IOException;
import java.util.Objects;
import okhttp3.Interceptor;
import okhttp3.Request;
import okhttp3.Response;
public final class UserAgentInterceptor implements Interceptor {
private static final String USER_AGENT_HEADER_NAME =... | package com.veyndan.redditclient.api.reddit.network.interceptor;
import com.google.common.base.Preconditions;
import java.io.IOException;
import okhttp3.Interceptor;
import okhttp3.Request;
import okhttp3.Response;
public final class UserAgentInterceptor implements Interceptor {
private static final String USER... |
Comment devtool evals in Webpack (Source maps weren't working) | var path = require('path');
var ExtractTextPlugin = require('extract-text-webpack-plugin');
module.exports = {
// devtool: 'eval',
// debug: true,
entry: {
main: path.resolve(__dirname, 'src/main.js'),
style: path.resolve(__dirname, 'src/main.less')
},
output: {
path: path.resolve(__... | var path = require('path');
var ExtractTextPlugin = require('extract-text-webpack-plugin');
module.exports = {
devtool: 'eval',
debug: true,
entry: {
main: path.resolve(__dirname, 'src/main.js'),
style: path.resolve(__dirname, 'src/main.less')
},
output: {
path: path.resolve(__dirnam... |
Fix wrong pdb parser invocation | from peptide import PeptideBuilder
import Bio.PDB
def write_pdb(aa_sequence, fragment_angles, gap_length, filepath):
"""
Generate pdb file with results
:param aa_sequence: Amino acid sequence
:param fragment_angles: Backbone torsion angles
:param gap_length: Length of the gap at the sequence star... | from peptide import PeptideBuilder
import Bio.PDB
def write_pdb(aa_sequence, fragment_angles, gap_length, filepath):
"""
Generate pdb file with results
:param aa_sequence: Amino acid sequence
:param fragment_angles: Backbone torsion angles
:param gap_length: Length of the gap at the sequence star... |
calvinlib: Fix erroneous schema naming & others | # -*- coding: utf-8 -*-
# Copyright (c) 2017 Ericsson 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 applicable ... | # -*- coding: utf-8 -*-
# Copyright (c) 2017 Ericsson 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 applicable ... |
Fix JS string extraction for ngettext
The definition for ngettext in extract-translatable-strings had incorrect argument positions, and as a result strings translated with ngettext were missed from the .po file. | const { GettextExtractor, JsExtractors } = require('gettext-extractor');
const extractor = new GettextExtractor();
extractor
.createJsParser([
JsExtractors.callExpression('gettext', {
arguments: {
text: 0,
context: 1,
},
}),
JsExtractors.callExpression('gettext_noop', {
... | const { GettextExtractor, JsExtractors } = require('gettext-extractor');
const extractor = new GettextExtractor();
extractor
.createJsParser([
JsExtractors.callExpression('gettext', {
arguments: {
text: 0,
context: 1,
},
}),
JsExtractors.callExpression('gettext_noop', {
... |
Add language switcher to guestarea & memberarea | <?php
declare(strict_types=1);
use Spatie\Menu\Laravel\Link;
use Cortex\Foundation\Models\Menu as MenuModel;
if (config('cortex.foundation.route.locale_prefix')) {
$langSwitcherHeader = Link::to('#', '<span class="fa fa-globe"></span> '.app('laravellocalization')->getCurrentLocaleNative().' <span class="caret"><... | <?php
declare(strict_types=1);
use Spatie\Menu\Laravel\Link;
use Cortex\Foundation\Models\Menu as MenuModel;
if (config('cortex.foundation.route.locale_prefix')) {
$langSwitcherHeader = Link::to('#', '<span class="fa fa-globe"></span> '.app('laravellocalization')->getCurrentLocaleNative().' <span class="caret"><... |
Fix exclusions for command queuer | package net.buycraft.plugin.execution.strategy;
import lombok.EqualsAndHashCode;
import lombok.Value;
import net.buycraft.plugin.IBuycraftPlatform;
import net.buycraft.plugin.data.QueuedCommand;
import net.buycraft.plugin.data.QueuedPlayer;
import java.util.concurrent.TimeUnit;
@Value
@EqualsAndHashCode(exclude = {"... | package net.buycraft.plugin.execution.strategy;
import lombok.Value;
import net.buycraft.plugin.IBuycraftPlatform;
import net.buycraft.plugin.data.QueuedCommand;
import net.buycraft.plugin.data.QueuedPlayer;
import java.util.concurrent.TimeUnit;
@Value
public class ToRunQueuedCommand {
private final QueuedPlayer... |
Use Georgia for more legibility | var Hexo = require('hexo');
var hexo = new Hexo(process.cwd(), {});
/**
* russophile tag
*
* Syntax:
* {% russophile [style] %}
* text string
* {% endrussophile %}
*
* Acceptable styles:
* sb - serif bold
* sp - serif plain
* rsb - red serif bold
* ... | var Hexo = require('hexo');
var hexo = new Hexo(process.cwd(), {});
/**
* russophile tag
*
* Syntax:
* {% russophile [style] %}
* text string
* {% endrussophile %}
*
* Acceptable styles:
* sb - serif bold
* sp - serif plain
* rsb - red serif bold
* ... |
Update download url to newer version. | #!/usr/bin/env python
# setup.py
"""pyftpdlib installer.
To install pyftpdlib just open a command shell and run:
> python setup.py install
"""
from distutils.core import setup
long_descr = """\
Python FTP server library, based on asyncore framework, provides
an high-level portable interface to easily write asynchro... | #!/usr/bin/env python
# setup.py
"""pyftpdlib installer.
To install pyftpdlib just open a command shell and run:
> python setup.py install
"""
from distutils.core import setup
long_descr = """\
Python FTP server library, based on asyncore framework, provides
an high-level portable interface to easily write asynchro... |
Reorganize the SurveyModel using Prototype instead of closure. | var Survey = function() {
this.surveys = [];
}
Survey.prototype = {
fetch : function() {
var url = Ti.App.Properties.getString('server_url') + '/api/mobile/surveys';
var that = this;
var client = Ti.Network.createHTTPClient({
// function called when the response data is available
onload : function(e) {... | var Survey = function() {
var surveys = [];
return {
fetch : function() {
var url = Ti.App.Properties.getString('server_url') + '/api/mobile/surveys';
var client = Ti.Network.createHTTPClient({
// function called when the response data is available
onload : function(e) {
Ti.API.info("Received tex... |
Fix graphql-php 0.11 breaking change | <?php
namespace GraphQLGen\Generator\Interpreters\Main;
use GraphQL\Language\AST\InterfaceTypeDefinitionNode;
use GraphQLGen\Generator\InterpretedTypes\Main\InterfaceDeclarationInterpretedType;
use GraphQLGen\Generator\InterpretedTypes\Nested\FieldInterpretedType;
use GraphQLGen\Generator\Interpreters\Nested\FieldI... | <?php
namespace GraphQLGen\Generator\Interpreters\Main;
use GraphQL\Language\AST\InterfaceTypeDefinitionNode;
use GraphQLGen\Generator\InterpretedTypes\Main\InterfaceDeclarationInterpretedType;
use GraphQLGen\Generator\InterpretedTypes\Nested\FieldInterpretedType;
use GraphQLGen\Generator\Interpreters\Nested\FieldI... |
Update enabledFeatures to use a Set.
This also fixes a bug where enabled features could be mutated via the global value as it was not dereferenced before. | /**
* Feature flags.
*
* Site Kit by Google, Copyright 2021 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unles... | /**
* Feature flags.
*
* Site Kit by Google, Copyright 2021 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unles... |
Change return type on empty arguments | VideoStream.utils.loadFileFromURL = function(file, dir = '.'){
if(!file){
return new Promise(function(resolve){resolve(null);});
}
var path = file;
if(file.startsWith('/') == false && file.startsWith(/http(s):\/\/|file:\/\//) == false){
path = dir.endsWith('/') ? dir + file : dir + '/' + file;
}
re... | VideoStream.utils.loadFileFromURL = function(file, dir = '.'){
if(!file){
return new Promise(function(resolve){resolve('');});
}
var path = file;
if(file.startsWith('/') == false && file.startsWith(/http(s):\/\/|file:\/\//) == false){
path = dir.endsWith('/') ? dir + file : dir + '/' + file;
}
retu... |
Add input field to control volume | import React from 'react'
import {compose, withState} from 'recompose'
import {clickable} from '../style.css'
import {Audio, View, Text, TextInput} from '../components'
let Player = compose(
withState('volume', 'setVolume', 0.1)
)(({volume, setVolume, time, URL}) => (
<View>
<Audio volume={volume} src={`${URL... | import React from 'react'
import {compose, withState} from 'recompose'
import {clickable} from '../style.css'
import {Audio, View, Text} from '../components'
let Player = compose(
withState('volume', 'setVolume', 0.1)
)(({volume, setVolume, time, URL}) => (
<View>
<Audio volume={volume} src={`${URL}${time}.mp... |
Increment that pip package version to 1.3.1
I incremented the last value as I am suggesting that not requiring certain pip dependencies put the project into a bad state... Some may consider that a bug. Either way :) | from distutils.core import setup
setup(
name="simple_slack_bot",
packages=["simple_slack_bot"], # this must be the same as the name above
version="1.3.1",
description="Simple Slack Bot makes writing your next Slack bot incredibly easy",
long_description="Simple Slack Bot makes writing your next Sl... | from distutils.core import setup
setup(
name="simple_slack_bot",
packages=["simple_slack_bot"], # this must be the same as the name above
version="1.3.0",
description="Simple Slack Bot makes writing your next Slack bot incredibly easy",
long_description="Simple Slack Bot makes writing your next Sl... |
Comment to say using logging.CRITICAL is faster | import time
import logging
from pythonjsonlogger import jsonlogger
from flumine import FlumineBacktest, clients
from strategies.lowestlayer import LowestLayer
logger = logging.getLogger()
custom_format = "%(asctime) %(levelname) %(message)"
log_handler = logging.StreamHandler()
formatter = jsonlogger.JsonFormatter(c... | import time
import logging
from pythonjsonlogger import jsonlogger
from flumine import FlumineBacktest, clients
from strategies.lowestlayer import LowestLayer
logger = logging.getLogger()
custom_format = "%(asctime) %(levelname) %(message)"
log_handler = logging.StreamHandler()
formatter = jsonlogger.JsonFormatter(c... |
Address review comment: Better documentation. | # Copyright Hybrid Logic Ltd. See LICENSE file for details.
"""
This module defines the Eliot log events emitted by the API implementation.
"""
__all__ = [
"JSON_REQUEST",
"REQUEST",
]
from eliot import Field, ActionType
LOG_SYSTEM = u"api"
METHOD = Field(u"method", lambda method: method,
... | # Copyright Hybrid Logic Ltd. See LICENSE file for details.
"""
This module defines the Eliot log events emitted by the API implementation.
"""
__all__ = [
"JSON_REQUEST",
"REQUEST",
]
from eliot import Field, ActionType
LOG_SYSTEM = u"api"
METHOD = Field(u"method", lambda method: method,
... |
Fix linting errors on server | 'use strict';
const cookieParser = require('cookie-parser');
const csrf = require('csurf');
module.exports = function(server) {
let secure = true;
if (process.env.NODE_ENV === 'development') {
secure = false;
}
server.use(cookieParser());
server.use(csrf({cookie: {
key: 'XSRF-SECRET',
... | 'use strict';
const cookieParser = require('cookie-parser');
const csrf = require('csurf');
module.exports = function(server) {
let secure = true;
if (process.env.NODE_ENV === 'development') {
secure = false;
}
server.use(cookieParser());
server.use(csrf({cookie: {
key: 'XSRF-SECRET',
... |
Add example to code doc | import requests
import json
class MatrixClient:
"""
A minimal client for Mapzen Time-Distance Matrix Service
Example:
client = MatrixClient('your_api_key')
locations = [{"lat":40.744014,"lon":-73.990508},{"lat":40.739735,"lon":-73.979713},{"lat":40.752522,"lon":-73.985015},{"lat":40.750117,"lon"... | import requests
import json
class MatrixClient:
ONE_TO_MANY_URL = 'https://matrix.mapzen.com/one_to_many'
def __init__(self, matrix_key):
self._matrix_key = matrix_key
"""Get distances and times to a set of locations.
See https://mapzen.com/documentation/matrix/api-reference/
Args:
... |
Tests: Fix typo in test log. | module.exports.test = function(uiTestCtx) {
describe('Module test: instances:stub', function() {
const { config, helpers: { login, openApp, logout }, meta: { testVersion } } = uiTestCtx;
const nightmare = new Nightmare(config.nightmare);
this.timeout(Number(config.test_timeout));
describe('Login > ... | module.exports.test = function(uiTestCtx) {
describe('Module test: checkout:stub', function() {
const { config, helpers: { login, openApp, logout }, meta: { testVersion } } = uiTestCtx;
const nightmare = new Nightmare(config.nightmare);
this.timeout(Number(config.test_timeout));
describe('Login > O... |
Test chmod of directory created by LocalStream | <?php
namespace Gaufrette\Functional\FileStream;
use Gaufrette\Filesystem;
use Gaufrette\Adapter\Local as LocalAdapter;
use Gaufrette\Functional\LocalDirectoryDeletor;
class LocalTest extends FunctionalTestCase
{
protected $directory;
public function setUp()
{
$this->directory = __DIR__.DIRECTOR... | <?php
namespace Gaufrette\Functional\FileStream;
use Gaufrette\Filesystem;
use Gaufrette\Adapter\Local as LocalAdapter;
use Gaufrette\Functional\LocalDirectoryDeletor;
class LocalTest extends FunctionalTestCase
{
protected $directory;
public function setUp()
{
$this->directory = __DIR__.DIRECTOR... |
Add moon phase tooltip detail
Added moon phase detail to tooltip (you can see the numeric value of the
moon phase now) | import {Component} from 'react';
class MoonPhaseIcon extends Component{
render() {
// Set the default icon:
var iconClass = "wi-moon-waning-gibbous-3";
if (this.props.phase < .09) { iconClass = "wi-moon-new"; } else
if (this.props.phase < .18) { iconClass = "wi-moon-waxing-crescent-4"; } else... | import {Component} from 'react';
class MoonPhaseIcon extends Component{
render() {
// Yahoo numeric codes are here: https://developer.yahoo.com/weather/documentation.html
// Forecast.io icon codes are here: https://developer.forecast.io/docs/v2#forecast_call
// Set the default icon:
var ico... |
Change mozlog use to ip from id | const assert = require("assert");
const csrf = require("csurf");
const mozlog = require("../logging").mozlog("csrf-middleware");
const { captureRavenException } = require("../ravenclient");
const { simpleResponse } = require("../responses");
const config = require("../config").getProperties();
const useSecureCsrfCook... | const assert = require("assert");
const csrf = require("csurf");
const mozlog = require("../logging").mozlog("csrf-middleware");
const { captureRavenException } = require("../ravenclient");
const { simpleResponse } = require("../responses");
const config = require("../config").getProperties();
const useSecureCsrfCook... |
Add outputBufferingActive property to clean up output buffer automatically | <?php
namespace CLIFramework\Testing;
use PHPUnit_Framework_TestCase;
abstract class CommandTestCase extends PHPUnit_Framework_TestCase
{
public $app;
public $outputBufferingActive = true;
abstract public function setupApplication();
public function getApplication()
{
return $this->app;
... | <?php
namespace CLIFramework\Testing;
use PHPUnit_Framework_TestCase;
abstract class CommandTestCase extends PHPUnit_Framework_TestCase
{
public $app;
abstract public function setupApplication();
public function getApplication()
{
return $this->app;
}
public function setUp()
{
... |
Change to firefox for tests | 'use strict';
var http = require('http'),
ecstatic = require('ecstatic');
var server = http.createServer(ecstatic({ root: __dirname + '/../dist' }));
exports.config = {
jasmineNodeOpts: {
isVerbose: true,
showColors: true,
defaultTimeoutInterval: 30000
},
specs: [
'e2... | 'use strict';
var http = require('http'),
ecstatic = require('ecstatic');
var server = http.createServer(ecstatic({ root: __dirname + '/../dist' }));
exports.config = {
jasmineNodeOpts: {
isVerbose: true,
showColors: true,
defaultTimeoutInterval: 30000
},
specs: [
'e2... |
Extend params in correct order | var _ = require('lodash'),
request = require('request'),
savePage = require('./save').page;
function getPageFromServer(params, pageResult) {
request.get(params, function (error, response, body) {
pageResult(error || (response.statusCode !== 200 || !body), arguments);
});
}
function getMain(params, ca... | var _ = require('lodash'),
request = require('request'),
savePage = require('./save').page;
function getPageFromServer(params, pageResult) {
request.get(params, function (error, response, body) {
pageResult(error || (response.statusCode !== 200 || !body), arguments);
});
}
function getMain(params, ca... |
Change object name to more explicit name | <?php
/**
* @author Pierre-Henry Soria <ph7software@gmail.com>
* @copyright (c) 2014-2017, Pierre-Henry Soria. All Rights Reserved.
* @license GNU General Public License; See PH7.LICENSE.txt and PH7.COPYRIGHT.txt in the root directory.
* @package PH7 / App / System / Module / Admin / From... | <?php
/**
* @author Pierre-Henry Soria <ph7software@gmail.com>
* @copyright (c) 2014-2017, Pierre-Henry Soria. All Rights Reserved.
* @license GNU General Public License; See PH7.LICENSE.txt and PH7.COPYRIGHT.txt in the root directory.
* @package PH7 / App / System / Module / Admin / From... |
Add Salt specific exit code | # -*- coding: utf-8 -*-
'''
Classification of Salt exit codes. These are intended to augment
universal exit codes (found in Python's `os` module with the `EX_`
prefix or in `sysexits.h`).
'''
# Too many situations use "exit 1" - try not to use it when something
# else is more appropriate.
EX_GENERIC = 1
# Salt SSH "... | # -*- coding: utf-8 -*-
'''
Classification of Salt exit codes. These are intended to augment
universal exit codes (found in Python's `os` module with the `EX_`
prefix or in `sysexits.h`).
'''
# Too many situations use "exit 1" - try not to use it when something
# else is more appropriate.
EX_GENERIC = 1
# Salt SSH "... |
Set compilation adhesion on the command line. | <?php
use Illuminate\Console\Command;
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Input\InputArgument;
use Repositories\RepositoryInterface;
class CataclysmCache extends Command {
/**
* The console command name.
*
* @var string
*/
protected $name = 'cataclysm:rebuild';
... | <?php
use Illuminate\Console\Command;
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Input\InputArgument;
use Repositories\RepositoryInterface;
class CataclysmCache extends Command {
/**
* The console command name.
*
* @var string
*/
protected $name = 'cataclysm:rebuild';
... |
Fix socket location with Docker 1.11.1 | 'use strict';
var fs = require('fs');
var userHome = require('user-home');
var read = require('read-yaml');
var Docker = require('dockerode');
var fileExists = require('file-exists');
module.exports = (function () {
var configFile = `${userHome}/.docker-indicator.yaml`;
if (fileExists(configFile)) {
... | 'use strict';
var fs = require('fs');
var userHome = require('user-home');
var read = require('read-yaml');
var Docker = require('dockerode');
var fileExists = require('file-exists');
module.exports = (function () {
var configFile = `${userHome}/.docker-indicator.yaml`;
if (fileExists(configFile)) {
... |
Add headers to minified version. | /*
---
description: Provides a fallback for the placeholder property on input elements for older browsers.
license:
- MIT-style license
authors:
- Matthias Schmidt (http://www.m-schmidt.eu)
requires:
core/1.2.5: '*'
provides:
- Form.Placeholder
...
*/
(function(){if(!this.Form){this.Form={}}var a=("placeho... | (function(){if(!this.Form){this.Form={}}var a=("placeholder" in document.createElement("input"));if(!("supportsPlaceholder" in this)&&this.supportsPlaceholder!==false&&a){return}this.Form.Placeholder=new Class({Implements:Options,options:{color:"#A9A9A9"},initialize:function(c,b){this.setOptions(b);this.element=$(c);th... |
Create test for plot_zipcode to compare generated graphs. | """
Name: Paul Briant
Date: 12/11/16
Class: Introduction to Python
Assignment: Final Project
Description:
Tests for Final Project
"""
import clean_data as cd
import matplotlib.pyplot as plt
import pandas
import pytest
def get_data():
"""
Retrieve data from csv file to test.
"""
data = pandas.read_cs... | """
Name: Paul Briant
Date: 12/11/16
Class: Introduction to Python
Assignment: Final Project
Description:
Tests for Final Project
"""
import clean_data as cd
import pandas
def get_data():
"""
Retrieve data from csv file to test.
"""
data = pandas.read_csv("data/Residential_Water_Usage_Zip_Code_on_To... |
Change wording in utils test | const { expect } = require('chai');
const { generateTitle } = require('../lib/utils');
describe('utils', function() {
describe('.generateTitle()', function() {
it('generates valid title', function () {
const result = generateTitle('Base', 'First', 'Second');
expect(result).to.equal('Base | First | S... | const { expect } = require('chai');
const { generateTitle } = require('../lib/utils');
describe('utils', function() {
describe('.generateTitle()', function() {
it('should generate a valid title', function () {
const result = generateTitle('Base', 'First', 'Second');
expect(result).to.equal('Base | F... |
Call Filter constructor in UglifyJSFilter
This allows passing in options like targetExtension when using this
filter in a Brocfile. | var Filter = require('broccoli-filter')
var UglifyJS = require('uglify-js')
module.exports = UglifyJSFilter
UglifyJSFilter.prototype = Object.create(Filter.prototype)
UglifyJSFilter.prototype.constructor = UglifyJSFilter
function UglifyJSFilter (inputTree, options) {
if (!(this instanceof UglifyJSFilter)) return new... | var Filter = require('broccoli-filter')
var UglifyJS = require('uglify-js')
module.exports = UglifyJSFilter
UglifyJSFilter.prototype = Object.create(Filter.prototype)
UglifyJSFilter.prototype.constructor = UglifyJSFilter
function UglifyJSFilter (inputTree, options) {
if (!(this instanceof UglifyJSFilter)) return new... |
Set svn:eol-style on new files | /******************************************************************************
* This program and the accompanying materials are made available under
* the terms of the Common Public License v1.0 which accompanies this
* distribution, and is available at the following URL:
* http://www.eclipse.org/legal/cpl-v10.ht... | /******************************************************************************
* This program and the accompanying materials are made available under
* the terms of the Common Public License v1.0 which accompanies this
* distribution, and is available at the following URL:
* http://www.eclipse.org/legal/cpl-v1... |
Change URL pattern for contacts | from django.conf.urls import url
from django.views.generic import TemplateView
from . import views
urlpatterns = [
url(r'^$', views.home, name='home'),
url(r'^about/$', views.about, name='about'),
url(r'^contact/$', TemplateView.as_view(template_name="contact.html"), name='contact'),
# url(r'^contact/$... | from django.conf.urls import url
from . import views
urlpatterns = [
url(r'^$', views.home, name='home'),
url(r'^about/$', views.about, name='about'),
url(r'^contact/$', views.contact, name='contact'),
url(r'^projects/$', views.projects, name='projects'),
url(r'^tribute/$', views.tribute, name='tri... |
Use original value in toString() | <?php declare(strict_types=1);
/*
* This file is part of PHPUnit.
*
* (c) Sebastian Bergmann <sebastian@phpunit.de>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace PHPUnit\Framework\MockObject;
use PHPUnit\Framework\Cons... | <?php declare(strict_types=1);
/*
* This file is part of PHPUnit.
*
* (c) Sebastian Bergmann <sebastian@phpunit.de>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace PHPUnit\Framework\MockObject;
use PHPUnit\Framework\Cons... |
Fix WebUI crash when a toot with a playing video gets deleted
Signed-off-by: Claire <82b964c50e9d1d222e48cf5046e6484a966a7b07@sitedethib.com> | // @ts-check
export const PICTURE_IN_PICTURE_DEPLOY = 'PICTURE_IN_PICTURE_DEPLOY';
export const PICTURE_IN_PICTURE_REMOVE = 'PICTURE_IN_PICTURE_REMOVE';
/**
* @typedef MediaProps
* @property {string} src
* @property {boolean} muted
* @property {number} volume
* @property {number} currentTime
* @property {string... | // @ts-check
export const PICTURE_IN_PICTURE_DEPLOY = 'PICTURE_IN_PICTURE_DEPLOY';
export const PICTURE_IN_PICTURE_REMOVE = 'PICTURE_IN_PICTURE_REMOVE';
/**
* @typedef MediaProps
* @property {string} src
* @property {boolean} muted
* @property {number} volume
* @property {number} currentTime
* @property {string... |
Extend test for empty weights | package org.lodder.subtools.multisubdownloader.lib.control.subtitles.sorting.replacers;
import java.util.HashMap;
import org.junit.Before;
import org.junit.Test;
import org.lodder.subtools.sublibrary.model.Release;
import static org.junit.Assert.*;
import static org.mockito.Mockito.mock;
import static org.mockito.Mo... | package org.lodder.subtools.multisubdownloader.lib.control.subtitles.sorting.replacers;
import java.util.HashMap;
import org.junit.Before;
import org.junit.Test;
import org.lodder.subtools.sublibrary.model.Release;
import static org.junit.Assert.*;
import static org.mockito.Mockito.mock;
import static org.mockito.Mo... |
Allow custom domain in custom config example | <?php
require __DIR__ . "/_bootstrap.php";
use Amp\Dns;
use Amp\Loop;
use Amp\Promise;
$customConfigLoader = new class implements Dns\ConfigLoader {
public function loadConfig(): Promise
{
return Amp\call(function () {
$hosts = yield (new Dns\HostLoader)->loadHosts();
return ... | <?php
require __DIR__ . "/_bootstrap.php";
use Amp\Dns;
use Amp\Loop;
use Amp\Promise;
$customConfigLoader = new class implements Dns\ConfigLoader {
public function loadConfig(): Promise
{
return Amp\call(function () {
$hosts = yield (new Dns\HostLoader)->loadHosts();
return ... |
Add doc comment for top-down Merge sort. | package com.varunvats.practice.sorting;
public class MergeTopDown extends MergeBase {
/**
* Sorts an array in-place using the top-down merge-sort algorithm.
*
* @param a The array to be sorted.
*/
public static <T extends Comparable<T>> void sort(T[] a) {
final int N = a.length;
... | package com.varunvats.practice.sorting;
public class MergeTopDown extends MergeBase {
public static <T extends Comparable<T>> void sort(T[] a) {
final int N = a.length;
aux = new Comparable[N];
sort(a, 0, N - 1);
}
private static <T extends Comparable<T>> void sort(T[] a, int low,... |
:bug: Fix `port of undefined` error | import http from 'http';
import express from 'express';
import bodyParser from 'body-parser';
import cors from 'cors';
import { makeExecutableSchema } from 'graphql-tools';
import { graphqlExpress } from 'apollo-server-express';
import graphqlPlayground from 'graphql-playground-middleware-express';
import checkEnv from... | import http from 'http';
import express from 'express';
import bodyParser from 'body-parser';
import cors from 'cors';
import { makeExecutableSchema } from 'graphql-tools';
import { graphqlExpress } from 'apollo-server-express';
import graphqlPlayground from 'graphql-playground-middleware-express';
import checkEnv from... |
Check that .env file was generate as part of install | <?php
namespace Tests\Unit;
use \Dotenv;
/**
* Dotenv Test
*
* @author Leonid Mamchenkov <l.mamchenkov@qobo.biz>
*/
class DotenvTest extends \PHPUnit_Framework_TestCase {
/**
* Provide .env file locations
*/
public function dotEnvFilesProvider() {
return array(
'.env.example' => array(__DIR__ . DIRECT... | <?php
namespace Tests\Unit;
use \Dotenv;
/**
* Dotenv Test
*
* @author Leonid Mamchenkov <l.mamchenkov@qobo.biz>
*/
class DotenvTest extends \PHPUnit_Framework_TestCase {
protected $folder;
protected $file;
protected function setUp() {
$this->folder = __DIR__ . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARA... |
Stop propagation for clicks (since a click on model view can toggle more information. | var app = require('ridge');
module.exports = require('ridge/view').extend({
events: {
'click button,select,input': function(e) {
e.stopPropagation();
},
'click button': function(e) {
e.preventDefault();
},
'click button[data-command="publish"]': 'publish',
'click button[data-command="unpublish"]': '... | var app = require('ridge');
module.exports = require('ridge/view').extend({
events: {
'click button': function(e) {
e.preventDefault();
e.stopPropagation();
},
'click button[data-command="publish"]': 'publish',
'click button[data-command="unpublish"]': 'unpublish',
'click button[data-command="delete"]... |
Clone Merit data as late as possible
It's not necessary to clone the entire (original) data - especially
since the MeritTransformator isn't reused - but instead we can
shallow-clone each series, and replace the values with those sliced up
or downsampled by the Transformator. | /*globals Downsampler,LoadSlicer*/
var MeritTransformator = (function () {
'use strict';
function transformSerieValues(serie) {
if (this.scope.dateSelect.val() > 0) {
return LoadSlicer.slice(serie, this.scope.dateSelect.val());
} else {
return Downsampler.downsample(ser... | /*globals Downsampler,LoadSlicer*/
var MeritTransformator = (function () {
'use strict';
function transformSerieValues(serie) {
if (this.scope.dateSelect.val() > 0) {
return LoadSlicer.slice(serie, this.scope.dateSelect.val());
} else {
return Downsampler.downsample(ser... |
Fix the codes in the tests | import unittest
import sys
try:
from StringIO import StringIO
except ImportError:
from io import StringIO # NOQA
from flake8.mccabe import get_code_complexity
_GLOBAL = """\
for i in range(10):
pass
def a():
def b():
def c():
pass
c()
b()
"""
class McCabeTest(... | import unittest
import sys
try:
from StringIO import StringIO
except ImportError:
from io import StringIO # NOQA
from flake8.mccabe import get_code_complexity
_GLOBAL = """\
for i in range(10):
pass
def a():
def b():
def c():
pass
c()
b()
"""
class McCabeTest(... |
Fix parameter name in `IAutoCompleteFormField` | <?php
namespace wcf\system\form\builder\field;
/**
* Represents a form field that supports the `autocomplete` attribute.
*
* @author Matthias Schmidt
* @copyright 2001-2020 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package WoltL... | <?php
namespace wcf\system\form\builder\field;
/**
* Represents a form field that supports the `autocomplete` attribute.
*
* @author Matthias Schmidt
* @copyright 2001-2020 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package WoltL... |
Refactor para funfar via linha de comando | # -*- coding: utf-8 -*-
from os import path
import sys
project_dir = path.dirname(__file__)
project_dir = path.join('..')
sys.path.append(project_dir)
from atores import PassaroAmarelo, PassaroVermelho, Obstaculo, Porco
from fase import Fase
from placa_grafica_tkinter import rodar_fase
if __name__ == '__main__':
... | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from atores import PassaroAmarelo, PassaroVermelho, Obstaculo, Porco
from fase import Fase
from placa_grafica_tkinter import rodar_fase
if __name__=='__main__':
fase = Fase(intervalo_de_colisao=10)
# Adicionar Pássaros Vermelhos
for i in ra... |
Replace use of com.sun ObservableSetWrapper with FXCollections | package de.prob2.ui.states;
import com.google.inject.Inject;
import com.google.inject.Singleton;
import de.prob.model.representation.AbstractElement;
import javafx.collections.FXCollections;
import javafx.collections.ObservableSet;
@Singleton
public final class ClassBlacklist {
private final ObservableSet<Class<? ex... | package de.prob2.ui.states;
import java.util.HashSet;
import com.google.inject.Inject;
import com.google.inject.Singleton;
import com.sun.javafx.collections.ObservableSetWrapper;
import de.prob.model.representation.AbstractElement;
import javafx.collections.ObservableSet;
@Singleton
public class ClassBlacklist {
p... |
Fix model relationship and ready to set online | <?php
namespace App;
use Illuminate\Database\Eloquent\Model;
class Node extends Model
{
// Properties
protected $dateFormat = 'U';
// Relationships
/**
* Link to nodeGroup
*
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo
*/
public function nodeGroup()
{
return $this->belongsTo(NodeGrou... | <?php
namespace App;
use Illuminate\Database\Eloquent\Model;
class Node extends Model
{
// Properties
protected $dateFormat = 'U';
// Relationships
/**
* Link to nodeGroup
*
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo
*/
public function nodeGroup()
{
return $this->belongsTo(NodeGrou... |
Add dots to pale things | import inspect
import types
from . import adapters
from . import arguments
from . import config
from . import context
from .endpoint import Endpoint
from .resource import NoContentResource, Resource, ResourceList
ImplementationModule = "_pale__api_implementation"
def is_pale_module(obj):
is_it = isinstance(obj, ... | import inspect
import types
import adapters
import arguments
import config
import context
from endpoint import Endpoint
from resource import NoContentResource, Resource, ResourceList
ImplementationModule = "_pale__api_implementation"
def is_pale_module(obj):
is_it = isinstance(obj, types.ModuleType) and \
... |
Set premailer version to 3.1.1 | #! /usr/bin/env python
import os
from setuptools import setup, find_packages
def read(fname):
try:
return open(os.path.join(os.path.dirname(__file__), fname)).read()
except IOError:
return ''
setup(
name='djpl-emailing',
version='0.1',
description='a django-productline feature to i... | #! /usr/bin/env python
import os
from setuptools import setup, find_packages
def read(fname):
try:
return open(os.path.join(os.path.dirname(__file__), fname)).read()
except IOError:
return ''
setup(
name='djpl-emailing',
version='0.1',
description='a django-productline feature to i... |
Check for sys.platform == linux, not linux2 | import os
import sys
import json
def main():
prefix = os.environ['PREFIX']
info_file = os.path.join(prefix, 'conda-meta',
'always_include_files_regex-0.1-0.json')
with open(info_file, 'r') as fh:
info = json.load(fh)
if sys.platform == 'darwin':
assert sor... | import os
import sys
import json
def main():
prefix = os.environ['PREFIX']
info_file = os.path.join(prefix, 'conda-meta',
'always_include_files_regex-0.1-0.json')
with open(info_file, 'r') as fh:
info = json.load(fh)
if sys.platform == 'darwin':
assert sor... |
Fix build failure for mac/ubuntu, which relies on an old version for keras-preprocessing.
PiperOrigin-RevId: 273405152 | # Copyright 2016 The TensorFlow Authors. 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 applica... | # Copyright 2016 The TensorFlow Authors. 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 applica... |
Put back set error (now in correct place) | <?php
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the GNU Affero General Public License v3.0.
// See the LICENCE file in the repository root for full licence text.
namespace App\Http\Controllers;
class FallbackController extends Controller
{
public function __construct()
{
if (is_ap... | <?php
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the GNU Affero General Public License v3.0.
// See the LICENCE file in the repository root for full licence text.
namespace App\Http\Controllers;
class FallbackController extends Controller
{
public function __construct()
{
if (is_ap... |
Update user schema for application merge | const mongoose = require('mongoose');
const Schema = mongoose.Schema;
const userSchema = new Schema({
_id: { type: Number },
profileImageName: { type: String, default: 'default.png' },
email: { type: String, unique: true },
age: { type: Number, min: 10, max: 100 },
grade: { type: Number, min: 8, ma... | const mongoose = require('mongoose');
const Schema = mongoose.Schema;
const userSchema = new Schema({
_id: { type: Number },
profileImageName: { type: String, default: 'default.png' },
email: { type: String, unique: true },
phoneNumber: { type: String },
name: {
first: { type: String, trim:... |
Use pprint instead of json for formatting
json.dumps fails to print anything for an object. I would prefer to show
a representation of the object rather than filter it out so rely on
pprint instead. | # 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
# distributed under t... | # 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
# distributed under t... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.