text stringlengths 16 4.96k | positive stringlengths 321 2.24k | negative stringlengths 310 2.21k |
|---|---|---|
Rename `get_user` to `get_or_create_user` and add a new `get_user` | from django.contrib.auth.models import User
from nightreads.posts.models import Tag
from .models import (Subscription, SubscriptionActivation,
UnsubscriptionActivation)
def update_user_tags(user, tags):
tags_objs = Tag.objects.filter(name__in=tags)
if tags_objs:
user.subscription... | from django.contrib.auth.models import User
from nightreads.posts.models import Tag
from .models import (Subscription, SubscriptionActivation,
UnsubscriptionActivation)
def update_user_tags(user, tags):
tags_objs = Tag.objects.filter(name__in=tags)
if tags_objs:
user.subscription... |
Call setter even if object isn't writable. | "use strict";
/* @flow */
const Value = require('../Value');
let serial = 0;
//TODO: We should call this a PropertyDescriptor, not a variable.
class PropertyDescriptor {
constructor(value) {
this.value = value;
this.serial = serial++;
this.configurable = true;
this.enumerable = true;
this.writeable = tru... | "use strict";
/* @flow */
const Value = require('../Value');
let serial = 0;
//TODO: We should call this a PropertyDescriptor, not a variable.
class PropertyDescriptor {
constructor(value) {
this.value = value;
this.serial = serial++;
this.configurable = true;
this.enumerable = true;
this.writeable = tru... |
Remove console.log call for debugging | 'use strict'
const mongoose = require('mongoose')
const api = require('./api')
const trends = require('./twitter/trends')
const config = require('./config')
const mainUtils = require('./utils/main-utils')
const TweetStream = require('./twitter/tweet-stream')
mongoose.Promise = global.Promise
// Connect to the db, the... | 'use strict'
const mongoose = require('mongoose')
const api = require('./api')
const trends = require('./twitter/trends')
const config = require('./config')
const mainUtils = require('./utils/main-utils')
const TweetStream = require('./twitter/tweet-stream')
mongoose.Promise = global.Promise
// Connect to the db, the... |
Add default checked = false state to models | /**
* Collection for interfacing with localStorage.
*/
'use strict';
var Backbone = require('backbone');
var _ = require('lodash');
module.exports = Backbone.Collection.extend({
model: Backbone.Model,
initialize: function() {
this.localStorage = window.localStorage;
},
fetch: function() {
... | /**
* Collection for interfacing with localStorage.
*/
'use strict';
var Backbone = require('backbone');
var _ = require('lodash');
module.exports = Backbone.Collection.extend({
model: Backbone.Model,
initialize: function() {
this.localStorage = window.localStorage;
},
fetch: function() {
... |
Make trac related tasks available in fab | """
Collection of utilities to automate the administration of Twisted's
infrastructure. Use this utility to install, update and start/stop/restart
services running on twistedmatrix.com.
"""
"""
This file is a simple entry point, nothing is final about it!
Just experimenting for now.
"""
from fabric.api import task, s... | """
Collection of utilities to automate the administration of Twisted's
infrastructure. Use this utility to install, update and start/stop/restart
services running on twistedmatrix.com.
"""
"""
This file is a simple entry point, nothing is final about it!
Just experimenting for now.
"""
from fabric.api import task, s... |
:bug: Fix inline query handler creation | const { inline, roll, full, random, help, deprecated } = require('./query');
const { createOptions, createInlineOptions } = require('./options');
const { error } = require('./text');
/*
More event type are described in official API of `node-telegram-bot-api`
https://github.com/yagop/node-telegram-bot-api/blob/master/d... | const { inline, roll, full, random, help, deprecated } = require('./query');
const { createOptions, createInlineOptions } = require('./options');
const { error } = require('./text');
function createHandler(bot, query) {
const { regexp, reply } = query;
bot.onText(regexp, (msg, match) => {
try {
const { ... |
Remove unused NoScoreIdx methods from index interface | <?php
namespace Ehann\RediSearch;
use Ehann\RediSearch\Document\BuilderInterface as DocumentBuilderInterface;
use Ehann\RediSearch\Document\Document;
use Ehann\RediSearch\Query\BuilderInterface as QueryBuilderInterface;
use Ehann\RediSearch\Redis\RedisClient;
interface IndexInterface extends DocumentBuilderInterface... | <?php
namespace Ehann\RediSearch;
use Ehann\RediSearch\Document\BuilderInterface as DocumentBuilderInterface;
use Ehann\RediSearch\Document\Document;
use Ehann\RediSearch\Query\BuilderInterface as QueryBuilderInterface;
use Ehann\RediSearch\Redis\RedisClient;
interface IndexInterface extends DocumentBuilderInterface... |
Move stdout/stderr null warning out | 'use strict'
const path = require('path')
const {spawnSync} = require('child_process')
const {
env: {
STANDARDJS_EXECUTABLE,
STANDARDJS_ARGV,
SKIP_CODE_STYLE_CHECKING
}
} = require('process')
const wdir = path.resolve(__dirname, '..')
test('JavaScript Code Style: StandardJS', () => {
if (SKIP_CODE_S... | 'use strict'
const path = require('path')
const {spawnSync} = require('child_process')
const {
env: {
STANDARDJS_EXECUTABLE,
STANDARDJS_ARGV,
SKIP_CODE_STYLE_CHECKING
}
} = require('process')
const wdir = path.resolve(__dirname, '..')
test('JavaScript Code Style: StandardJS', () => {
if (SKIP_CODE_S... |
Add ValueLink To On Change For Timepicker | let React = require("react")
let cx = require("classnames")
let {errorList, sizeClassNames, formGroupCx, label} = require("../util.js")
let {div, input} = React.DOM
export default class extends React.Component {
static displayName = "Frig.friggingBootstrap.TimePicker"
static defaultProps = Object.assign(require(... | let React = require("react")
let cx = require("classnames")
let {errorList, sizeClassNames, formGroupCx, label} = require("../util.js")
let {div, input} = React.DOM
export default class extends React.Component {
static displayName = "Frig.friggingBootstrap.TimePicker"
static defaultProps = Object.assign(require(... |
Use np.genfromtext to handle missing values | #!/usr/bin/env python
# encoding: utf-8
"""
Reader for XVISTA .prof tables.
"""
import numpy as np
from astropy.table import Table
from astropy.io import registry
def xvista_table_reader(filename):
dt = [('R', np.float), ('SB', np.float), ('SB_err', np.float),
('ELL', np.float), ('PA', np.float), ('EMA... | #!/usr/bin/env python
# encoding: utf-8
"""
Reader for XVISTA .prof tables.
"""
import numpy as np
from astropy.table import Table
from astropy.io import registry
def xvista_table_reader(filename):
dt = [('R', np.float), ('SB', np.float), ('SB_err', np.float),
('ELL', np.float), ('PA', np.float), ('E... |
Set class process site map | # -*- coding: utf-8 -*-
from django.utils.translation import ugettext_lazy as _
from django.conf import settings
trans_app_label = _('Opps')
settings.INSTALLED_APPS += (
'opps.article',
'opps.image',
'opps.channel',
'opps.source',
'django.contrib.redirects',
'django_thumbor',
'googl',
... | # -*- coding: utf-8 -*-
from django.utils.translation import ugettext_lazy as _
from django.conf import settings
trans_app_label = _('Opps')
settings.INSTALLED_APPS += (
'opps.article',
'opps.image',
'opps.channel',
'opps.source',
'django.contrib.redirects',
'django_thumbor',
'googl',
... |
Support for external plugin js script added. | <?php
namespace App\Libs;
use Illuminate\Foundation\Bus\DispatchesJobs;
use Illuminate\Routing\Controller as BaseController;
use Illuminate\Foundation\Validation\ValidatesRequests;
use Illuminate\Foundation\Auth\Access\AuthorizesRequests;
use App\Libs\ViewResolver;
use Illuminate\Http\Request;
abstract class Control... | <?php
namespace App\Libs;
use Illuminate\Foundation\Bus\DispatchesJobs;
use Illuminate\Routing\Controller as BaseController;
use Illuminate\Foundation\Validation\ValidatesRequests;
use Illuminate\Foundation\Auth\Access\AuthorizesRequests;
use App\Libs\ViewResolver;
use Illuminate\Http\Request;
abstract class Control... |
Add origin address to build-index configuration
Summary:
Somehow this never got populated. We now validate that the origin address is non-empty on
startup, so this was causing build-index to crash.
Reviewers: #kraken, yiran, evelynl
Reviewed By: #kraken, yiran, evelynl
Subscribers: jenkins
Differential Revision: h... | package tagreplication
import (
"fmt"
"io/ioutil"
"os"
"path/filepath"
"code.uber.internal/infra/kraken/core"
"code.uber.internal/infra/kraken/utils/randutil"
"code.uber.internal/infra/kraken/utils/testutil"
)
// StoreFixture creates a fixture of tagreplication.Store.
func StoreFixture(rv RemoteValidator) (*S... | package tagreplication
import (
"fmt"
"io/ioutil"
"os"
"path/filepath"
"code.uber.internal/infra/kraken/core"
"code.uber.internal/infra/kraken/utils/randutil"
"code.uber.internal/infra/kraken/utils/testutil"
)
// StoreFixture creates a fixture of tagreplication.Store.
func StoreFixture(rv RemoteValidator) (*S... |
Remove the comments from the generated UMD files | // @ts-check
import typescript from 'rollup-plugin-typescript2';
import uglify from 'rollup-plugin-uglify';
import gzip from 'rollup-plugin-gzip';
import filesize from 'rollup-plugin-filesize';
const __PROD__ = process.env.NODE_ENV === 'production';
function outputFileName() {
let fileName = `react-form-with-const... | // @ts-check
import typescript from 'rollup-plugin-typescript2';
import uglify from 'rollup-plugin-uglify';
import gzip from 'rollup-plugin-gzip';
import filesize from 'rollup-plugin-filesize';
const __PROD__ = process.env.NODE_ENV === 'production';
function outputFileName() {
let fileName = `react-form-with-const... |
Remove debugging code from controller | <?php namespace Watson\Autologin;
use Auth, Redirect;
use Illuminate\Routing\Controller;
use Watson\Autologin\Interfaces\AutologinInterface;
class AutologinController extends Controller {
/**
* AutologinInterface provider instance.
*
* @var \Studious\Autologin\Interfaces\AutologinInterface
*/
protected $p... | <?php namespace Watson\Autologin;
use Auth, Redirect;
use Illuminate\Routing\Controller;
use Watson\Autologin\Interfaces\AutologinInterface;
class AutologinController extends Controller {
/**
* AutologinInterface provider instance.
*
* @var \Studious\Autologin\Interfaces\AutologinInterface
*/
protected $p... |
Allow Authorization header in CORS. | package info.agrueneberg.fhir.filters;
import java.io.IOException;
import javax.servlet.Filter;
import javax.servlet.FilterChain;
import javax.servlet.FilterConfig;
import javax.servlet.ServletException;
import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;
import javax.servlet.http.HttpServletRes... | package info.agrueneberg.fhir.filters;
import java.io.IOException;
import javax.servlet.Filter;
import javax.servlet.FilterChain;
import javax.servlet.FilterConfig;
import javax.servlet.ServletException;
import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;
import javax.servlet.http.HttpServletRes... |
Resolve database for indication unique | <?php
namespace App\Http\Controllers;
use App\User;
use Illuminate\Http\Request;
use App\Http\Requests;
use App\Http\Controllers\Controller;
use Illuminate\Support\Facades\Input;
class RegisterController extends Controller
{
public function getRegister()
{
return view('register');
}
public fun... | <?php
namespace App\Http\Controllers;
use App\User;
use Illuminate\Http\Request;
use App\Http\Requests;
use App\Http\Controllers\Controller;
use Illuminate\Support\Facades\Input;
class RegisterController extends Controller
{
public function getRegister()
{
return view('register');
}
public fun... |
Enable Javascript syntax highlighting in some cmds | /**
* Development commands plugin
*
* This houses the bot's development commands.
* These commands should only be used if the operator knows what their doing.
*
* @license MIT license
*/
'use strict';
exports.commands = {
js: 'eval',
eval: function (target, room, user, cmd) {
if (!target) return Chat.send(... | /**
* Development commands plugin
*
* This houses the bot's development commands.
* These commands should only be used if the operator knows what their doing.
*
* @license MIT license
*/
'use strict';
exports.commands = {
js: 'eval',
eval: function (target, room, user, cmd) {
if (!target) return Chat.send(... |
Fix a demo mode bug | <?php
namespace Controller\Page;
class PrivatePage extends \Controller\AbstractPageController
{
public function get()
{
if (PUBLIC_PAGE) {
$this->response->redirect('/');
}
$parameters['path'] = $this->router->path();
$parameters['template'] = $this->template-... | <?php
namespace Controller\Page;
class PrivatePage extends \Controller\AbstractPageController
{
public function get()
{
if (PUBLIC_PAGE) {
$this->response->redirect('/');
}
$parameters['path'] = $this->router->path();
$parameters['template'] = $this->template-... |
Remove duplicate association test script | """
Copyright 2020 Ronald J. Nowling
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, softw... | """
Copyright 2020 Ronald J. Nowling
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, softw... |
Add support to old module.exports (webpack has issue with it) | import R from 'ramda';
import And from './and';
import Or from './or';
import Conjunction from './conjunction';
/**
* Check if the given object is an object-like `And` conjunction.
* @param {Object} obj
* @param {String} obj.type
* @returns {Boolean}
*/
const objectIsAndConjunction = R.compose(
R.equals(And.typ... | import R from 'ramda';
import And from './and';
import Or from './or';
import Conjunction from './conjunction';
/**
* Check if the given object is an object-like `And` conjunction.
* @param {Object} obj
* @param {String} obj.type
* @returns {Boolean}
*/
const objectIsAndConjunction = R.compose(
R.equals(And.typ... |
Allow doctest runner to keep going after failures
It will still return an error code, but there is little need to halt the
running of the three different doctest modules if an early one fails,
which may in fact mask the real reason for failure in an IPy internal
method.
Signed-off-by: Dan McGee <a6e5737275ff1276377ee... | #!/usr/bin/env python
import doctest
import sys
if hasattr(doctest, "testfile"):
total_failures, total_tests = (0, 0)
print("=== Test file: README ===")
failure, tests = doctest.testfile('README', optionflags=doctest.ELLIPSIS)
total_failures += failure
total_tests += tests
print("=== Test file... | #!/usr/bin/env python
import doctest
import sys
if hasattr(doctest, "testfile"):
print("=== Test file: README ===")
failure, tests = doctest.testfile('README', optionflags=doctest.ELLIPSIS)
if failure:
sys.exit(1)
print("=== Test file: test.rst ===")
failure, tests = doctest.testfile('test/... |
Set an explicit value because Default value of 'RedirectView.permanent' will change from True to False in Django 1.9. | from django.conf.urls import patterns, url
from django.views.generic import RedirectView
from django_messages.views import *
urlpatterns = patterns('',
url(r'^$', RedirectView.as_view(permanent=True, url='inbox/'), name='messages_redirect'),
url(r'^inbox/$', inbox, name='messages_inbox'),
url(r'^outbox/$'... | from django.conf.urls import patterns, url
from django.views.generic import RedirectView
from django_messages.views import *
urlpatterns = patterns('',
url(r'^$', RedirectView.as_view(url='inbox/'), name='messages_redirect'),
url(r'^inbox/$', inbox, name='messages_inbox'),
url(r'^outbox/$', outbox, name='... |
Remove debug code from migration | <?php
use Phinx\Migration\AbstractMigration;
class AddSpriteHashToAppearances extends AbstractMigration {
public function up() {
$this->table('appearances')
->addColumn('sprite_hash', 'string', ['length' => 32, 'null' => true])
->update();
foreach (new DirectoryIterator(SPRITE_PATH) as $file_info){
if ... | <?php
use Phinx\Migration\AbstractMigration;
class AddSpriteHashToAppearances extends AbstractMigration {
public function up() {
$this->table('appearances')
->addColumn('sprite_hash', 'string', ['length' => 32, 'null' => true])
->update();
foreach (new DirectoryIterator(SPRITE_PATH) as $file_info){
ech... |
Add new twig extension function | <?php
/**
* Twig extension for barcodes
*
* @author Philipp A. Mohrenweiser<phiamo@googlemail.com>
* @copyright 2011 Philipp Mohrenweiser
* @license http://www.apache.org/licenses/LICENSE-2.0.html
*/
namespace Mopa\BarcodeBundle\Twig\Extension;
use Mopa\BarcodeBundle\Model\BarcodeService;
class BarcodeRenderE... | <?php
/**
* Twig extension for barcodes
*
* @author Philipp A. Mohrenweiser<phiamo@googlemail.com>
* @copyright 2011 Philipp Mohrenweiser
* @license http://www.apache.org/licenses/LICENSE-2.0.html
*/
namespace Mopa\BarcodeBundle\Twig\Extension;
use Mopa\BarcodeBundle\Model\BarcodeService;
class BarcodeRenderE... |
Update namespaces for beta 8
Refs flarum/core#1235. | <?php
/*
* This file is part of Flarum.
*
* (c) Toby Zerner <toby.zerner@gmail.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Flarum\Markdown\Listener;
use Flarum\Formatter\Event\Configuring;
use Illuminate\Contr... | <?php
/*
* This file is part of Flarum.
*
* (c) Toby Zerner <toby.zerner@gmail.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Flarum\Markdown\Listener;
use Flarum\Event\ConfigureFormatter;
use Illuminate\Contract... |
Change was necessary to allow modifyAccount calls in storeAccounts to
return. We don't really use the webOS stored credentials anyway... no
idea how to read them. | var onCredentialsChangedAssistant = function (future) {};
onCredentialsChangedAssistant.prototype.run = function (outerFuture) {
log("============== onCredentialsChangedAssistant");
log("Params: " + JSON.stringify(this.controller.args)); //may contain password.
log("Future: " + JSON.stringify(outerFuture.re... | var onCredentialsChangedAssistant = function (future) {};
onCredentialsChangedAssistant.prototype.run = function (outerFuture) {
log("============== onCredentialsChangedAssistant");
log("Params: " + JSON.stringify(this.controller.args)); //may contain password.
log("Future: " + JSON.stringify(outerFuture.re... |
Store + Shipping + Menus
* Using new Store feature from Elcodi
* Added Store management in Admin
* Changed all definitions that was depending on such implementation
* Removed under construction logic and tests
* Removed menu fixtures
* Defined them as dynamic content. Some of them are generated dinamically, and
som... | <?php
/*
* This file is part of the Elcodi package.
*
* Copyright (c) 2014-2015 Elcodi.com
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*
* Feel free to edit as you please, and have fun.
*
* @author Marc Morera <yuhu@mmoreram.c... | <?php
/*
* This file is part of the Elcodi package.
*
* Copyright (c) 2014-2015 Elcodi.com
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*
* Feel free to edit as you please, and have fun.
*
* @author Marc Morera <yuhu@mmoreram.c... |
Index: Fix pathing in the first include of dependencies. | <?php
require_once realpath(__DIR__.'/../').'/vendor/autoload.php'; // Auto loads the dependencies, e.g. the whole of silex
// Instantiate the app
$app = new Silex\Application();
// The standard simple hello world example
$app->get('/hello/{name}', function ($name) use ($app) {
return 'Hello '.$app->escape($name);... | <?php
require_once __DIR__.'/../vendor/autoload.php'; // Auto loads the dependencies, e.g. the whole of silex
// Instantiate the app
$app = new Silex\Application();
// The standard simple hello world example
$app->get('/hello/{name}', function ($name) use ($app) {
return 'Hello '.$app->escape($name);
});
// An ev... |
Test code and buy properties | import { expect } from 'chai';
import NBG from '../src/banks/NBG';
import CreditAgricole from '../src/banks/CreditAgricole';
import CBE from '../src/banks/CBE';
const { describe, it } = global;
const banks = [
NBG,
CreditAgricole,
CBE,
];
describe('Banks', () => {
banks.forEach((Bank) => {
const bank = ... | import { expect } from 'chai';
import NBG from '../src/banks/NBG';
import CreditAgricole from '../src/banks/CreditAgricole';
import CBE from '../src/banks/CBE';
const { describe, it } = global;
const banks = [
NBG,
CreditAgricole,
CBE,
];
describe('Banks', () => {
banks.forEach((Bank) => {
const bank = ... |
Update integration test: docs, add more checks, rename | # -*- coding: utf-8 -*-
'''
tests for host state
'''
# Import Python libs
from __future__ import absolute_import, unicode_literals
# Import Salt Testing libs
from tests.support.case import ModuleCase
class HandleErrorTest(ModuleCase):
'''
Validate that ordering works correctly
'''
def test_function_... | # -*- coding: utf-8 -*-
'''
tests for host state
'''
# Import Python libs
from __future__ import absolute_import
# Import Salt Testing libs
from tests.support.case import ModuleCase
class HandleErrorTest(ModuleCase):
'''
Validate that ordering works correctly
'''
def test_handle_error(self):
... |
Use client_id as url identifier. | from django.contrib.auth.decorators import login_required
from django.utils.decorators import method_decorator
from django.views import generic
from django.core.urlresolvers import reverse
from . import models, forms
class ClientMixin(object):
"""
A mixin that describes Client model.
"""
model = mode... | from django.contrib.auth.decorators import login_required
from django.utils.decorators import method_decorator
from django.views import generic
from django.core.urlresolvers import reverse
from . import models, forms
class ClientMixin(object):
"""
A mixin that describes Client model.
"""
model = mode... |
Rename + add long_description + update keywords | from distutils.core import setup
setup(
name='a_john_shots',
version="1.0.0",
description='Python module/library for saving Security Hash Algorithms into JSON format.',
long_description=open('README').read(),
author='funilrys',
author_email='contact@funilrys.com',
license='GPL-3.0 https://o... | from distutils.core import setup
setup(
name='aJohnShots',
version="1.0.0",
description='Python module/library for saving Security Hash Algorithms into JSON format.',
author='funilrys',
author_email='contact@funilrys.com',
license='GPL-3.0 https://opensource.org/licenses/GPL-3.0',
url='http... |
Remove berniebuilders, callforbernie, and bernie2016states | export const slacks = {
// afam4bernie: {
// title: 'African Americans For Bernie',
// description: 'A community of African American activists and allies'
// },
// bernie2016states: {
// title: 'Bernie 2016 States',
// description: 'Interface with volunteers and staff in each... | export const slacks = {
// afam4bernie: {
// title: 'African Americans For Bernie',
// description: 'A community of African American activists and allies'
// },
bernie2016states: {
title: 'Bernie 2016 States',
description: 'Interface with volunteers and staff in each state',
... |
Update to new `defaults` configuration | #
# linter.py
# Linter for SublimeLinter3, a code checking framework for Sublime Text 3
#
# Written by Hardy Jones
# Copyright (c) 2013
#
# License: MIT
#
"""This module exports the Hlint plugin class."""
from SublimeLinter.lint import Linter
class Hlint(Linter):
"""Provides an interface to hlint."""
defau... | #
# linter.py
# Linter for SublimeLinter3, a code checking framework for Sublime Text 3
#
# Written by Hardy Jones
# Copyright (c) 2013
#
# License: MIT
#
"""This module exports the Hlint plugin class."""
from SublimeLinter.lint import Linter
class Hlint(Linter):
"""Provides an interface to hlint."""
synta... |
Rename stream to buffer (oxy stream lib update) + move circuit breaker in the middleware chain | package server
import (
"github.com/vulcand/oxy/forward"
"github.com/vulcand/oxy/roundrobin"
"github.com/vulcand/oxy/buffer"
"github.com/vulcand/oxy/cbreaker"
"net/http"
"net/url"
)
type ReverseProxy struct {
handler http.Handler
}
func NewReverseProxy(backends []string) *ReverseProxy {
fwd, _ := forward.New... | package server
import (
"github.com/vulcand/oxy/forward"
"github.com/vulcand/oxy/roundrobin"
"github.com/vulcand/oxy/stream"
"github.com/vulcand/oxy/cbreaker"
"net/http"
"net/url"
)
type ReverseProxy struct {
stream *stream.Streamer
}
func NewReverseProxy(backends []string) *ReverseProxy {
fwd, _ := forward.... |
Throw friendly exception on unparseable JSON files
PHP 7 has become a little more picky about JSON parsing,
which made me stumble into a bug.
Some old file was somewhat-incorrectly encoded
(contained some long-space character or something),
which made PHP 7's JSON parser break.
The failure was silently ignored and t... | <?php
namespace Devture\Bundle\LocalizationBundle\Translation;
use Symfony\Component\Translation\Loader\ArrayLoader;
use Symfony\Component\Translation\Loader\LoaderInterface;
use Symfony\Component\Config\Resource\FileResource;
class JsonFileLoader extends ArrayLoader implements LoaderInterface {
public function loa... | <?php
namespace Devture\Bundle\LocalizationBundle\Translation;
use Symfony\Component\Translation\Loader\ArrayLoader;
use Symfony\Component\Translation\Loader\LoaderInterface;
use Symfony\Component\Config\Resource\FileResource;
class JsonFileLoader extends ArrayLoader implements LoaderInterface {
public function loa... |
Remove task for updating data
Not sure if this is the best method to have it.
Since for now is not needed, droping it from the codebase. | import json
import logging
import os
import subprocess
from celery import Celery
from celery.schedules import crontab
from .targets.facebook_messenger import Post as MessengerPost
from .targets.twitter import Post as TwitterPost
import whistleblower.queue
HOUR = 3600
ENABLED_TARGETS = [
TwitterPost,
Messenge... | import json
import logging
import os
import subprocess
from celery import Celery
from celery.schedules import crontab
from .targets.facebook_messenger import Post as MessengerPost
from .targets.twitter import Post as TwitterPost
import whistleblower.queue
HOUR = 3600
ENABLED_TARGETS = [
TwitterPost,
Messenge... |
Change CheckTrigger action to be retriggerable | package com.elmakers.mine.bukkit.action.builtin;
import java.util.Collection;
import org.bukkit.configuration.ConfigurationSection;
import com.elmakers.mine.bukkit.action.CheckAction;
import com.elmakers.mine.bukkit.api.action.CastContext;
import com.elmakers.mine.bukkit.api.spell.Spell;
public class CheckTriggerAc... | package com.elmakers.mine.bukkit.action.builtin;
import java.util.Collection;
import org.bukkit.configuration.ConfigurationSection;
import com.elmakers.mine.bukkit.action.CheckAction;
import com.elmakers.mine.bukkit.api.action.CastContext;
import com.elmakers.mine.bukkit.api.spell.Spell;
public class CheckTriggerAc... |
Update bin scripts to function when installed through composer as well. | <?php
/**
* @file
* Sample script for launching Wind as a REST server.
*
* This script launches a sample Wind server and stores all log request
* to a file called log.log. This script requires the Monolog library.
*
* (c) Wouter Admiraal <wad@wadmiraal.net>
*
* For the full copyright and license information,... | <?php
/**
* @file
* Sample script for launching Wind as a REST server.
*
* This script launches a sample Wind server and stores all log request
* to a file called log.log. This script requires the Monolog library.
*
* (c) Wouter Admiraal <wad@wadmiraal.net>
*
* For the full copyright and license information,... |
Prepare release notes for v1.6.0-beta.4
Signed-off-by: Derek McGowan <e1c79a582b6629e6b39e9679f4bb964d25db4aa8@mcg.dev> | /*
Copyright The containerd Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to... | /*
Copyright The containerd Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to... |
Fix cookie keys to be 'sagebio' not 'sagbio' | package org.sagebionetworks.web.client.cookie;
/**
* The cookie key master. Don't tell the cookie monster!
*
* @author jmhill
*
*/
public class CookieKeys {
/**
* Key for the selected columns shown in the datasets table.
*/
public static String SELECTED_DATASETS_COLUMNS = "org.sagebionetworks.datasets.sel... | package org.sagebionetworks.web.client.cookie;
/**
* The cookie key master. Don't tell the cookie monster!
*
* @author jmhill
*
*/
public class CookieKeys {
/**
* Key for the selected columns shown in the datasets table.
*/
public static String SELECTED_DATASETS_COLUMNS = "org.sagebionetworks.datasets.sel... |
Remove lower str and improve supported unicodes | <?php
namespace USlugify;
/**
* USlugify
*
* @author Florent Denis <dflorent.pokap@gmail.com>
*/
class USlugify implements USlugifyInterface
{
/**
* {@inheritdoc}
*/
public function slugify($text, $separator = '-')
{
$reservedChars = $this->getReservedChars();
$text = str_re... | <?php
namespace USlugify;
/**
* USlugify
*
* @author Florent Denis <dflorent.pokap@gmail.com>
*/
class USlugify implements USlugifyInterface
{
/**
* {@inheritdoc}
*/
public function slugify($text)
{
$reservedChars = $this->getReservedChars();
$text = str_replace($reservedCha... |
Fix the order of parameters to hasAccess, which broke all topic changing when +t was set | from twisted.words.protocols import irc
from txircd.modbase import Mode
class TopiclockMode(Mode):
def checkPermission(self, user, cmd, data):
if cmd != "TOPIC":
return data
if "topic" not in data:
return data
targetChannel = data["targetchan"]
if "t" in targetChannel.mode and not user.hasAccess(targetC... | from twisted.words.protocols import irc
from txircd.modbase import Mode
class TopiclockMode(Mode):
def checkPermission(self, user, cmd, data):
if cmd != "TOPIC":
return data
if "topic" not in data:
return data
targetChannel = data["targetchan"]
if "t" in targetChannel.mode and not user.hasAccess(self.ir... |
Remove --dev from composer install.
--dev is the default. | #!/usr/bin/env php
<?php
chdir(__DIR__);
$returnStatus = null;
passthru('composer install', $returnStatus);
if ($returnStatus !== 0) {
exit(1);
}
require 'vendor/autoload.php';
$phpcsCLI = new PHP_CodeSniffer_CLI();
$phpcsArguments = array('standard' => array('PSR1'), 'files' => array('src', 'tests', 'build.php'... | #!/usr/bin/env php
<?php
chdir(__DIR__);
$returnStatus = null;
passthru('composer install --dev', $returnStatus);
if ($returnStatus !== 0) {
exit(1);
}
require 'vendor/autoload.php';
$phpcsCLI = new PHP_CodeSniffer_CLI();
$phpcsArguments = array('standard' => array('PSR1'), 'files' => array('src', 'tests', 'buil... |
Update to latest Cerebral, React. Removed deprecated warnings | var rules = require('./helpers/rules.js');
module.exports = function (options) {
options = options || {};
if (options.rules) {
Object.keys(options.rules).forEach(function (key) {
rules[key] = options.rules[key];
});
}
return function (module, controller) {
module.alias('cerebral-module-fo... | var rules = require('./helpers/rules.js');
module.exports = function (options) {
options = options || {};
if (options.rules) {
Object.keys(options.rules).forEach(function (key) {
rules[key] = options.rules[key];
});
}
return function (module, controller) {
module.alias('cerebral-module-fo... |
Raise error upon dataflow cycle detection. | import {error} from 'vega-util';
/**
* Assigns a rank to an operator. Ranks are assigned in increasing order
* by incrementing an internal rank counter.
* @param {Operator} op - The operator to assign a rank.
*/
export function rank(op) {
op.rank = ++this._rank;
}
/**
* Re-ranks an operator and all downstream ... | /**
* Assigns a rank to an operator. Ranks are assigned in increasing order
* by incrementing an internal rank counter.
* @param {Operator} op - The operator to assign a rank.
*/
export function rank(op) {
op.rank = ++this._rank;
}
/**
* Re-ranks an operator and all downstream target dependencies. This
* is ne... |
Fix template name in view | from django.template import RequestContext
from django.template.response import TemplateResponse
from pyconcz_2016.speakers.models import Speaker, Slot
def speakers_list(request, type):
speakers = (Speaker.objects.all()
.exclude(**{type: None})
.prefetch_related(type)
... | from django.template import RequestContext
from django.template.response import TemplateResponse
from pyconcz_2016.speakers.models import Speaker, Slot
def speakers_list(request, type):
speakers = (Speaker.objects.all()
.exclude(**{type: None})
.prefetch_related(type)
... |
Remove Rx.config.longStackSupport flag, which was left in unintentionally.
Fixes #1. | 'use strict';
const Rx = require('rx');
require('isomorphic-fetch');
module.exports = function (url, options) {
return Rx.Observable.fromPromise(fetch(url, options))
.flatMapLatest((response) => {
return Rx.Observable.fromPromise(response.text())
.map((body) => {
return {
... | 'use strict';
const Rx = require('rx');
require('isomorphic-fetch');
Rx.config.longStackSupport = true;
module.exports = function (url, options) {
return Rx.Observable.fromPromise(fetch(url, options))
.flatMapLatest((response) => {
return Rx.Observable.fromPromise(response.text())
.map((body) =... |
Update mailer timeout to 5 seconds | import logging
import requests
from requests.exceptions import ConnectionError, Timeout
log = logging.getLogger(__name__)
class MailNotifier(object):
url = None
api_key = None
sender = None
@classmethod
def send_message(cls, subject, to, message):
data = {'from': cls.sender, 'to': to, '... | import logging
import requests
from requests.exceptions import ConnectionError, Timeout
log = logging.getLogger(__name__)
class MailNotifier(object):
url = None
api_key = None
sender = None
@classmethod
def send_message(cls, subject, to, message):
data = {'from': cls.sender, 'to': to, '... |
Remove slash after baseUrl and make sure entire url is not removed | const serve = require('serve/lib/server')
const relativePaths = require('./relative-paths')
// taken from serve cli!
process.env.ASSET_DIR = '/' + Math.random().toString(36).substr(2, 10)
module.exports = (cookieName) => {
const baseURL = process.env.PUBLIC_URL || ''
const uiPath = process.env.REACT_APP_BUILD
c... | const serve = require('serve/lib/server')
const relativePaths = require('./relative-paths')
// taken from serve cli!
process.env.ASSET_DIR = '/' + Math.random().toString(36).substr(2, 10)
module.exports = (cookieName) => {
const baseURL = process.env.PUBLIC_URL || ''
const uiPath = process.env.REACT_APP_BUILD
c... |
Fix Tinymce editor not showing Bootstrap components correctly by adding container-fluid class to body. | <script src="{{ URL::to('vendor/redooor/redminportal/js/tinymce/tinymce.min.js') }}"></script>
<script>
!function ($) {
$(function(){
tinymce.init({
skin: 'redooor',
selector:'textarea',
menubar:false,
plugins: "link image code",
... | <script src="{{ URL::to('vendor/redooor/redminportal/js/tinymce/tinymce.min.js') }}"></script>
<script>
!function ($) {
$(function(){
tinymce.init({
skin: 'redooor',
selector:'textarea',
menubar:false,
plugins: "link image code",
... |
Add message to tell if there were errors or not | <?php
namespace Lighwand\Validate;
use Lighwand\Validate\Loader\VideoLoader;
use Lighwand\Validate\Video\VideoValidator;
use Zend\ServiceManager\Config;
use Zend\ServiceManager\ServiceManager;
try {
require_once __DIR__ . '/vendor/autoload.php';
$config = include __DIR__ . '/validate/config.php';
$servi... | <?php
namespace Lighwand\Validate;
use Lighwand\Validate\Loader\VideoLoader;
use Lighwand\Validate\Video\VideoValidator;
use Zend\ServiceManager\Config;
use Zend\ServiceManager\ServiceManager;
try {
require_once __DIR__ . '/vendor/autoload.php';
$config = include __DIR__ . '/validate/config.php';
$servi... |
Use document instance to invert change. | import last from '../util/last'
export default class SimpleChangeHistory {
constructor (editorSession) {
this._editorSession = editorSession
this._done = []
this._undone = []
}
canUndo () {
return this._done.length > 0
}
canRedo () {
return this._undone.length > 0
}
getChanges () {... | import last from '../util/last'
export default class SimpleChangeHistory {
constructor (editorSession) {
this._editorSession = editorSession
this._done = []
this._undone = []
}
canUndo () {
return this._done.length > 0
}
canRedo () {
return this._undone.length > 0
}
getChanges () {... |
Add install for junit report generator | package main
var defaultTemplate = `
[vars]
ignoreDirs = [".git", "Godeps", "vendor"]
stopLoadingParent = [".git"]
buildFlags = ["."]
artifactsEnv = "CIRCLE_ARTIFACTS"
testReportEnv = "CIRCLE_TEST_REPORTS"
[gotestcoverage]
timeout = "10s"
cpu = "4"
parallel = 8
race = true
covermode = "atomic"
[i... | package main
var defaultTemplate = `
[vars]
ignoreDirs = [".git", "Godeps", "vendor"]
stopLoadingParent = [".git"]
buildFlags = ["."]
artifactsEnv = "CIRCLE_ARTIFACTS"
testReportEnv = "CIRCLE_TEST_REPORTS"
[gotestcoverage]
timeout = "10s"
cpu = "4"
parallel = 8
race = true
covermode = "atomic"
[i... |
Fix host and path validation. | "use strict";
var fs = require("fs"),
main = require("./main"),
config = require("./config");
function evaluate(params) {
var cmd = params.command || "",
filename = params.filename || "",
entrypoint = params.entrypoint || "",
options = params;
if (!cmd && !filename && !entrypo... | "use strict";
var fs = require("fs"),
main = require("./main"),
config = require("./config");
function evaluate(params) {
var cmd = params.command || "",
filename = params.filename || "",
entrypoint = params.entrypoint || "",
host = params.host || "127.0.0.1",
path = params... |
Fix bug option, reader and writer parameters was not being apply if value is set. | <?php
namespace Tpg\ExtjsBundle\Annotation;
use Doctrine\ORM\Mapping\Annotation;
/**
* @Annotation
* @Target("CLASS")
*/
final class ModelProxy implements Annotation {
public $name = 'memory';
public $option = array();
public $reader = array();
public $writer = array();
public function __const... | <?php
namespace Tpg\ExtjsBundle\Annotation;
use Doctrine\ORM\Mapping\Annotation;
/**
* @Annotation
* @Target("CLASS")
*/
final class ModelProxy implements Annotation {
public $name = 'memory';
public $option = array();
public $reader = array();
public $writer = array();
public function __const... |
Change tested model name to VendorProduct | from django.test import TestCase
from django.conf import settings
from phonenumber_field.modelfields import PhoneNumberField
from whats_fresh.models import *
from django.contrib.gis.db import models
class VendorProductJoinTestCase(TestCase):
def setUp(self):
self.expected_fields = {
'vendor_i... | from django.test import TestCase
from django.conf import settings
from phonenumber_field.modelfields import PhoneNumberField
from whats_fresh.models import *
from django.contrib.gis.db import models
class VendorProductJoinTestCase(TestCase):
def setUp(self):
self.expected_fields = {
'vendor_i... |
Add missing new line at the end of file.
git-svn-id: b819289d3a0e8888cd070d2ae628b7cf730b797f@420071 13f79535-47bb-0310-9956-ffa450edef68 | /*
* Copyright 2000-2005 The Apache Software Foundation
*
* 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 r... | /*
* Copyright 2000-2005 The Apache Software Foundation
*
* 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 r... |
Remove closure for 5.2 and 5.3 support | <?php
class RequestsTest_Transport_fsockopen extends RequestsTest_Transport_Base {
protected $transport = 'Requests_Transport_fsockopen';
public function testHTTPS() {
// If OpenSSL isn't loaded, this should fail
if (!defined('OPENSSL_VERSION_NUMBER')) {
$this->setExpectedException('Requests_Exception');
}... | <?php
class RequestsTest_Transport_fsockopen extends RequestsTest_Transport_Base {
protected $transport = 'Requests_Transport_fsockopen';
public function testHTTPS() {
// If OpenSSL isn't loaded, this should fail
if (!defined('OPENSSL_VERSION_NUMBER')) {
$this->setExpectedException('Requests_Exception');
}... |
Remove mandrill as a default configuration since it's fallen out of popularity. | <?php
return [
/*
|--------------------------------------------------------------------------
| Third Party Services
|--------------------------------------------------------------------------
|
| This file is for storing the credentials for third party services such
| as Stripe, Mailgun, ... | <?php
return [
/*
|--------------------------------------------------------------------------
| Third Party Services
|--------------------------------------------------------------------------
|
| This file is for storing the credentials for third party services such
| as Stripe, Mailgun, ... |
Use max limit allowed by Spotify. | import ActionFactory from '../utils/actionFactory';
import ConstantFactory from '../utils/constantFactory';
export const USER_PLAYLIST_CONSTANTS = ConstantFactory.buildAsyncFor('USER_PLAYLISTS');
export const PLAYLIST_TRACKS_CONSTANTS = ConstantFactory.buildAsyncFor('PLAYLIST_TRACKS');
export function fetchUserPlayli... | import ActionFactory from '../utils/actionFactory';
import ConstantFactory from '../utils/constantFactory';
export const USER_PLAYLIST_CONSTANTS = ConstantFactory.buildAsyncFor('USER_PLAYLISTS');
export const PLAYLIST_TRACKS_CONSTANTS = ConstantFactory.buildAsyncFor('PLAYLIST_TRACKS');
export function fetchUserPlayli... |
Add a method to get the previous GUI. | package io.musician101.musicianlibrary.java.minecraft.gui.chest;
import java.util.List;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
public abstract class ChestGUI<C, G extends ChestGUI<C, G, I, J, P, S>, I, J, P, S> {
@Nonnull
protected final List<GUIButton<C, G, I, J, P, S>> buttons;
... | package io.musician101.musicianlibrary.java.minecraft.gui.chest;
import java.util.List;
public abstract class ChestGUI<C, G extends ChestGUI<C, G, I, J, P, S>, I, J, P, S> {
protected final List<GUIButton<C, G, I, J, P, S>> buttons;
protected final I inventory;
protected final int page;
protected fin... |
Add deletion of result after build | # -*- coding: utf8 -*-
import json
import threading
import time
import logging
from frigg.worker import config
from frigg.worker.jobs import Build
logger = logging.getLogger(__name__)
def fetcher():
redis = config.redis_client()
while redis:
task = redis.rpop('frigg:queue')
if task:
... | # -*- coding: utf8 -*-
import json
import threading
import time
import logging
from frigg.worker import config
from frigg.worker.jobs import Build
logger = logging.getLogger(__name__)
def fetcher():
redis = config.redis_client()
while redis:
task = redis.rpop('frigg:queue')
if task:
... |
Support running the callback immediately | import { timer as d3Timer } from 'd3-timer';
export default function PeriodicJS(opts) {
const { duration, displaySelector, callback, runImmediately } = opts;
let timer;
function displayTimeLeft(time) {
// find the current displayed time
let element = document.querySelector(displaySelector);
const currentDi... | import { timer as d3Timer } from 'd3-timer';
export default function PeriodicJS(opts) {
const { duration, displaySelector, callback } = opts;
let timer;
function displayTimeLeft(time) {
// find the current displayed time
let element = document.querySelector(displaySelector);
const currentDisplayedTime = el... |
Stop setting up the listener on an error. | package admin
import (
"net"
"net/http"
"strings"
"github.com/rakyll/statik/fs"
_ "github.com/influxdb/influxdb/statik"
)
type HttpServer struct {
port string
listener net.Listener
closed bool
}
// port should be a string that looks like ":8083" or whatever port to serve on.
func NewHttpServer(port s... | package admin
import (
"net"
"net/http"
"strings"
"github.com/rakyll/statik/fs"
_ "github.com/influxdb/influxdb/statik"
)
type HttpServer struct {
port string
listener net.Listener
closed bool
}
// port should be a string that looks like ":8083" or whatever port to serve on.
func NewHttpServer(port s... |
Improve split regex to include \r | /**
* Generate a blob link.
* @param {string} file - File name
* @param {string} contents - Contents of the file
* @param {string} title - The title of the new issue
* @param {string} sha - Commit where this todo was introduced
* @param {object} config - Config object
* @returns {string} - GitHub blob link
*/
m... | /**
* Generate a blob link.
* @param {string} file - File name
* @param {string} contents - Contents of the file
* @param {string} title - The title of the new issue
* @param {string} sha - Commit where this todo was introduced
* @param {object} config - Config object
* @returns {string} - GitHub blob link
*/
m... |
Allow access to symphony dev front controller from the vagrant host | <?php
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\Debug\Debug;
// If you don't want to setup permissions the proper way, just uncomment the following PHP line
// read http://symfony.com/doc/current/book/installation.html#configuration-and-setup for more information
//umask(0000);
// This chec... | <?php
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\Debug\Debug;
// If you don't want to setup permissions the proper way, just uncomment the following PHP line
// read http://symfony.com/doc/current/book/installation.html#configuration-and-setup for more information
//umask(0000);
// This chec... |
Check entire string for bad words | var detector = (function(){
function Filter(){
this.list = require('./lang.json').words;
}
Filter.prototype.isProfane = function isProfane(string){
var foundProfane = false;
for(var i = 0; i < this.list.length; i++) {
var words = string.split(" ");
for (var j = 0; j < words.length; j++) {
if (words[... | var detector = (function(){
function Filter(){
this.list = require('./lang.json').words;
}
Filter.prototype.isProfane = function isProfane(string){
for(var i = 0; i < this.list.length; i++)
if(string.toLowerCase() == this.list[i].toLowerCase())
return true;
return false;
};
Filter.prototype.replace... |
Write each byte at a time in protocol | import serial
import time
import binascii
import struct
def establishConnection():
# Define Constants
SERIAL_DEVICE = "/dev/ttyACM0"
# Establish Connection
ser = serial.Serial(SERIAL_DEVICE, 9600)
time.sleep(2)
print("Connection Established")
return ser
# Each motor speed is a float from -1.0 to 1.0
d... | import serial
import time
import binascii
import struct
def establishConnection():
# Define Constants
SERIAL_DEVICE = "/dev/ttyACM0"
# Establish Connection
ser = serial.Serial(SERIAL_DEVICE, 9600)
time.sleep(2)
print("Connection Established")
return ser
# Each motor speed is a float from -1.0 to 1.0
d... |
Make sure npm dependencies are also requiring React 0.14-rc. | var webpack = require("webpack");
var path = require("path");
module.exports = {
target: "web",
cache: false,
context: __dirname,
devtool: false,
entry: ["./src/example"],
output: {
path: path.join(__dirname, "static/dist"),
filename: "client.js",
chunkFilename: "[name].[id].js",
publ... | var webpack = require("webpack");
var path = require("path");
module.exports = {
target: "web",
cache: false,
context: __dirname,
devtool: false,
entry: ["./src/example"],
output: {
path: path.join(__dirname, "static/dist"),
filename: "client.js",
chunkFilename: "[name].[id].js",
publ... |
Reduce size of console window on app startup | var Proxy = require('./proxy');
console.log('Background page initialised');
var config = {
tcp: {
address: '127.0.0.1',
port: 9009
},
consoleType: 'basic' // 'advanced' or 'basic'
};
var proxy;
chrome.app.runtime.onLaunched.addListener(function() {
console.log('App launched.');
startProxy(config.t... | var Proxy = require('./proxy');
console.log('Background page initialised');
var config = {
tcp: {
address: '127.0.0.1',
port: 9009
},
consoleType: 'basic' // 'advanced' or 'basic'
};
var proxy;
chrome.app.runtime.onLaunched.addListener(function() {
console.log('App launched.');
startProxy(config.t... |
Support multiple concurrent test sessions | const net = require('net')
const readline = require('readline')
const { app, BrowserWindow } = require('electron')
app.commandLine.appendSwitch('--disable-http-cache')
require('electron-reload')(
`${__dirname}/renderer`,
{ electron: `${__dirname}/node_modules/.bin/electron` }
)
const Options = require('./cli/opt... | const net = require('net')
const readline = require('readline')
const { app, BrowserWindow } = require('electron')
app.commandLine.appendSwitch('--disable-http-cache')
require('electron-reload')(
`${__dirname}/renderer`,
{ electron: `${__dirname}/node_modules/.bin/electron` }
)
const Options = require('./cli/opti... |
Add option to Ignore Comments | 'use babel'
/*global atom*/
import { lint } from 'mixedindentlint'
import LinterHelpers from 'atom-linter'
export default {
config: {
ignoreComments: {
type: 'boolean',
default: false,
title: 'Ignore Comments',
description: 'Ignore comments entirely in code. Otherwise comment indentation will be scanne... | 'use babel'
import { lint } from 'mixedindentlint'
import LinterHelpers from 'atom-linter'
export default {
config: {},
activate() {
},
deactivate() {
},
scanFile( textEditor ) {
const text = textEditor.getText()
const linesToDecorate = lint( text )
return linesToDecorate.map( line => {
return {
... |
Replace bytes by strings in zilencer/migrations. | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('zerver', '0001_initial'),
]
operations = [
migrations.CreateModel(
name='Deployment',
fields=[
... | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('zerver', '0001_initial'),
]
operations = [
migrations.CreateModel(
name='Deployment',
fields=[
... |
Fix up path to runtime library directory. | from . import tokenizer, ast, codegen
import sys, os, subprocess
BASE = os.path.dirname(__path__[0])
RT_DIR = os.path.join(BASE, 'rt')
TRIPLES = {
'darwin': 'x86_64-apple-darwin11.0.0',
'linux2': 'x86_64-pc-linux-gnu',
}
def llir(fn, full=True):
src = codegen.source(ast.parse(tokenizer.tokenize(open(fn))))
if ... | from . import tokenizer, ast, codegen
import sys, os, subprocess
TRIPLES = {
'darwin': 'x86_64-apple-darwin11.0.0',
'linux2': 'x86_64-pc-linux-gnu',
}
def llir(fn, full=True):
src = codegen.source(ast.parse(tokenizer.tokenize(open(fn))))
if not full:
return src
std = []
for fn in sorted(os.listdir('rt')):... |
Update new repository for gcfg | package config
import (
"gopkg.in/gcfg.v1"
"path/filepath"
)
type Config struct {
RabbitMq struct {
Host string
Username string
Password string
Port string
Vhost string
Queue string
Compression bool
}
Prefetch struct {
Count int
Global bool
}
Exchange st... | package config
import (
"code.google.com/p/gcfg"
"path/filepath"
)
type Config struct {
RabbitMq struct {
Host string
Username string
Password string
Port string
Vhost string
Queue string
Compression bool
}
Prefetch struct {
Count int
Global bool
}
Excha... |
Fix Python 2.5 support in tests | from __future__ import with_statement
from gears.asset_handler import AssetHandlerError, ExecMixin
from mock import patch, Mock
from unittest2 import TestCase
class Exec(ExecMixin):
executable = 'program'
class ExecMixinTests(TestCase):
@patch('gears.asset_handler.Popen')
def test_returns_stdout_on_suc... | from gears.asset_handler import AssetHandlerError, ExecMixin
from mock import patch, Mock
from unittest2 import TestCase
class Exec(ExecMixin):
executable = 'program'
class ExecMixinTests(TestCase):
@patch('gears.asset_handler.Popen')
def test_returns_stdout_on_success(self, Popen):
result = Mo... |
Make sure the limit is an int | from flask import Flask
from flask import jsonify
from red_api import get_suspect_mentions, get_tweet_count, get_suspect_tweets
from jsonp_flask import support_jsonp
app = Flask(__name__)
@app.route('/api/tweets/suspects/count', methods=['GET'])
@support_jsonp
def get_mentions():
return jsonify(results=get_suspec... | from flask import Flask
from flask import jsonify
from red_api import get_suspect_mentions, get_tweet_count, get_suspect_tweets
from jsonp_flask import support_jsonp
app = Flask(__name__)
@app.route('/api/tweets/suspects/count', methods=['GET'])
@support_jsonp
def get_mentions():
return jsonify(results=get_suspec... |
Add placeholder abilities route callback. | module.exports = function(app, settings) {
app.get('/status.json', function(req, res) {
res.send({ status: 'true' });
});
/**
* @TODO expose available fonts (and other 'abilities').
*/
app.get('/abilities.json', function(req, res) {
res.send({ fonts: [] });
});
/**
... | module.exports = function(app, settings) {
app.get('/status.json', function(req, res) {
res.send({ status: 'true' });
});
/**
* Inspect fields
*/
app.get('/:mapfile_64/fields.json', function(req, res) {
});
/**
* Inspect data
*/
app.get('/:mapfile_64/data.json',... |
Set redirect and alias config before starting app | import Vue from 'vue';
import VueRouter from 'vue-router';
import VueForm from 'vue-form';
import { sync } from 'vuex-router-sync';
import store from './vuex/store.js';
import * as actions from './vuex/actions.js';
import App from './app.vue';
import FeatureList from './components/featurelist.vue';
import FeatureForm... | import Vue from 'vue';
import VueRouter from 'vue-router';
import VueForm from 'vue-form';
import { sync } from 'vuex-router-sync';
import store from './vuex/store.js';
import * as actions from './vuex/actions.js';
import App from './app.vue';
import FeatureList from './components/featurelist.vue';
import FeatureForm... |
Add support for unexpected fields and improved out of order. | /*
* Copyright 2016 higherfrequencytrading.com
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable la... | /*
* Copyright 2016 higherfrequencytrading.com
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable la... |
Add missing `await` to outer iterator `next` call.
Closes #46. | module.exports = function (paginator, twiddle) {
const outer = paginator[Symbol.asyncIterator]()
return {
[Symbol.asyncIterator]: function () {
return this
},
next: async function () {
const inner = await outer.next()
if (inner.done) {
... | module.exports = function (paginator, twiddle) {
const outer = paginator[Symbol.asyncIterator]()
return {
[Symbol.asyncIterator]: function () {
return this
},
next: async function () {
const inner = outer.next()
if (inner.done) {
return... |
Fix keyword arg in deallocate cascade. | #----------------------------------------------------------------------
# Copyright (c) 2011 Raytheon BBN Technologies
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and/or hardware specification (the "Work") to
# deal in the Work without restriction, including witho... | #----------------------------------------------------------------------
# Copyright (c) 2011 Raytheon BBN Technologies
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and/or hardware specification (the "Work") to
# deal in the Work without restriction, including witho... |
Replace default transport for logging, remove file logging | const winston = require('winston');
module.exports = ({
level,
transports: transports = [
{
type: 'Console',
options: {
timestamp: true,
colorize: process.env.NODE_ENV !== 'production',
prettyPrint: process.env.NODE_ENV !== 'production',
json: process.env.NODE_ENV ==... | const winston = require('winston');
module.exports = ({
filename,
level,
transports: transports = [{ type: 'Console', options: { level: 'debug' } }],
}) => {
if (filename) {
transports.push({
type: 'File',
options: { filename, level: 'debug' },
});
}
if (level) {
for (const transpor... |
Use camel case yaml naming strategy instead of lower camel case | <?php
/*
* This file is part of the FixtureDumper library.
*
* (c) Martin Parsiegla <martin.parsiegla@gmail.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Sp\FixtureDumper\Generator\Alice;
use Symfony\Component\Y... | <?php
/*
* This file is part of the FixtureDumper library.
*
* (c) Martin Parsiegla <martin.parsiegla@gmail.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Sp\FixtureDumper\Generator\Alice;
use Symfony\Component\Y... |
Fix packaging (again) - 1.0b9 | from setuptools import setup, find_packages
setup(
name = "django-waitinglist",
version = "1.0b9",
author = "Brian Rosner",
author_email = "brosner@gmail.com",
description = "a Django waiting list app for running a private beta with cohorts support",
long_description = open("README.rst").read(... | from setuptools import setup, find_packages
setup(
name = "django-waitinglist",
version = "1.0b8",
author = "Brian Rosner",
author_email = "brosner@gmail.com",
description = "a Django waiting list app for running a private beta with cohorts support",
long_description = open("README.rst").read(... |
Modify test for approximate equality
A change in Node 12 means that the test value we were previously using differs from the new result by `2.7755575615628914e-17`. | var chai = require('chai');
var assert = chai.assert;
var TestData = require('../TestData');
// Setup
var spectralKurtosis = require('../../dist/node/extractors/spectralKurtosis');
describe('spectralKurtosis', function () {
it('should return correct Spectral Kurtosis value', function (done) {
var en = spectralK... | var chai = require('chai');
var assert = chai.assert;
var TestData = require('../TestData');
// Setup
var spectralKurtosis = require('../../dist/node/extractors/spectralKurtosis');
describe('spectralKurtosis', function () {
it('should return correct Spectral Kurtosis value', function (done) {
var en = spectralK... |
Introduce type for parsing jsonb | package psql
import (
"errors"
"database/sql/driver"
"encoding/json"
_ "github.com/GoogleCloudPlatform/cloudsql-proxy/proxy/dialers/postgres"
"github.com/jinzhu/gorm"
_ "github.com/jinzhu/gorm/dialects/postgres"
"github.com/spf13/cobra"
"github.com/spf13/viper"
)
var (
DB *gorm.DB
DBError error
)
fun... | package psql
import (
"errors"
_ "github.com/GoogleCloudPlatform/cloudsql-proxy/proxy/dialers/postgres"
"github.com/jinzhu/gorm"
_ "github.com/jinzhu/gorm/dialects/postgres"
"github.com/spf13/cobra"
"github.com/spf13/viper"
)
var (
DB *gorm.DB
DBError error
)
func init() {
cobra.OnInitialize(ConnectDB... |
Fix broken newsflow on launch | <?
defined('C5_EXECUTE') or die("Access Denied.");
$this->inc('elements/header.php', array('enableEditing' => true));
?>
<div class="ccm-ui">
<div class="newsflow" id="newsflow-main">
<? $this->inc('elements/header_newsflow.php'); ?>
<table class="newsflow-layout">
<tr>
<td class="newsflow-em1" style="width: 66%" ro... | <?
defined('C5_EXECUTE') or die("Access Denied.");
$this->inc('elements/header.php', array('enableEditing' => true));
?>
<div class="ccm-ui">
<div class="newsflow" id="newsflow-main">
<? $this->inc('elements/header_newsflow.php'); ?>
<table class="newsflow-layout">
<tr>
<td class="newsflow-em1" style="width: 66%" co... |
Fix unused title in profiles controller | (function () {
'use strict';
/* ngInject */
function ProfilesController(NavbarConfig, ProfileService) {
var ctl = this;
initialize();
function initialize() {
ProfileService.createProfile('Donald');
ProfileService.createProfile('Mickey');
ProfileS... | (function () {
'use strict';
/* ngInject */
function ProfilesController(NavbarConfig, ProfileService) {
var ctl = this;
initialize();
function initialize() {
ProfileService.createProfile('Donald');
ProfileService.createProfile('Mickey');
ProfileS... |
Add discrete uniform variance to namespace | 'use strict';
/*
* When adding modules to the namespace, ensure that they are added in alphabetical order according to module name.
*/
// MODULES //
var setReadOnly = require( '@stdlib/utils/define-read-only-property' );
// MAIN //
/**
* Top-level namespace.
*
* @namespace discreteUniform
*/
var discreteUniform =... | 'use strict';
/*
* When adding modules to the namespace, ensure that they are added in alphabetical order according to module name.
*/
// MODULES //
var setReadOnly = require( '@stdlib/utils/define-read-only-property' );
// MAIN //
/**
* Top-level namespace.
*
* @namespace discreteUniform
*/
var discreteUniform =... |
Fix wide button accessibility labels |
import React, { PropTypes } from 'react';
import {
View,
TouchableOpacity,
StyleSheet,
Text,
} from 'react-native';
import { globalStyles } from '../../styles';
const styles = StyleSheet.create({
wideButton: {
flexDirection: 'row',
alignItems: 'center',
marginVertical: 10,
paddingHorizonta... |
import React, { PropTypes } from 'react';
import {
View,
TouchableOpacity,
StyleSheet,
Text,
} from 'react-native';
import { globalStyles } from '../../styles';
const styles = StyleSheet.create({
wideButton: {
flexDirection: 'row',
alignItems: 'center',
marginVertical: 10,
paddingHorizonta... |
Remove all relative imports. We have always been at war with relative imports.
git-svn-id: 4f9f921b081c523744c7bf24d959a0db39629563@17009 bcc190cf-cafb-0310-a4f2-bffc1f526a37 | """
JP-specific Form helpers
"""
from __future__ import absolute_import
from django.contrib.localflavor.jp.jp_prefectures import JP_PREFECTURES
from django.forms.fields import RegexField, Select
from django.utils.translation import ugettext_lazy as _
class JPPostalCodeField(RegexField):
"""
A form field tha... | """
JP-specific Form helpers
"""
from django.utils.translation import ugettext_lazy as _
from django.forms.fields import RegexField, Select
class JPPostalCodeField(RegexField):
"""
A form field that validates its input is a Japanese postcode.
Accepts 7 digits, with or without a hyphen.
"""
defaul... |
Add translate=True on academic title name | # -*- coding: utf-8 -*-
##############################################################################
#
# This file is part of partner_academic_title,
# an Odoo module.
#
# Copyright (c) 2015 ACSONE SA/NV (<http://acsone.eu>)
#
# partner_academic_title is free software:
# you can redistribute it an... | # -*- coding: utf-8 -*-
##############################################################################
#
# This file is part of partner_academic_title,
# an Odoo module.
#
# Copyright (c) 2015 ACSONE SA/NV (<http://acsone.eu>)
#
# partner_academic_title is free software:
# you can redistribute it an... |
Simplify done call as per PR review | import ExecutorAbstract from '../ExecutorAbstract';
import {sleep} from '../util/function';
class SleepExecutor extends ExecutorAbstract {
//-----------------------------------
// Constructor
//-----------------------------------
/**
* Constructor for a new SleepExecutor, which will wait `milliseconds` befo... | import ExecutorAbstract from '../ExecutorAbstract';
import {sleep} from '../util/function';
class SleepExecutor extends ExecutorAbstract {
//-----------------------------------
// Constructor
//-----------------------------------
/**
* Constructor for a new SleepExecutor, which will wait `milliseconds` befo... |
Make the _array_api submodule install correctly | #!/usr/bin/env python3
def configuration(parent_package='',top_path=None):
from numpy.distutils.misc_util import Configuration
config = Configuration('numpy', parent_package, top_path)
config.add_subpackage('_array_api')
config.add_subpackage('compat')
config.add_subpackage('core')
config.add_... | #!/usr/bin/env python3
def configuration(parent_package='',top_path=None):
from numpy.distutils.misc_util import Configuration
config = Configuration('numpy', parent_package, top_path)
config.add_subpackage('compat')
config.add_subpackage('core')
config.add_subpackage('distutils')
config.add_s... |
Fix url rewrites in nginx | <?php
/* GNU FM -- a free network service for sharing your music listening habits
Copyright (C) 2009 Free Software Foundation, Inc
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
the Free Software Foundation,... | <?php
/* GNU FM -- a free network service for sharing your music listening habits
Copyright (C) 2009 Free Software Foundation, Inc
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
the Free Software Foundation,... |
Add roles to user for game | Meteor.methods({
"createGame": function(gameName, lobbyName, password) {
if(!GAME_DEFINITIONS.hasOwnProperty(gameName)) {
throw new Meteor.Error("unrecognized-game", "A game of the specified type is not defined.");
}
if(Games.findOne({"lobbbyData.lobbyName": lobbyName})) {
throw new Meteor.Error("lobby-nam... | Meteor.methods({
"createGame": function(gameName, lobbyName, password) {
if(!GAME_DEFINITIONS.hasOwnProperty(gameName)) {
throw new Meteor.Error("unrecognized-game", "A game of the specified type is not defined.");
}
if(Games.findOne({"lobbbyData.lobbyName": lobbyName})) {
throw new Meteor.Error("lobby-nam... |
Add name and promotion to Card. | from django.contrib.auth.models import User
from django.db import models
from promotions.models import Promotion
from wrestlers.models import WrestlingEntity
class Review(models.Model):
reviewed_by = models.ForeignKey(User)
reviewed_at = models.DateTimeField()
class Meta:
abstract = True
clas... | from django.contrib.auth.models import User
from django.db import models
from wrestlers.models import WrestlingEntity
class Review(models.Model):
reviewed_by = models.ForeignKey(User)
reviewed_at = models.DateTimeField()
class Meta:
abstract = True
class Card(models.Model):
date = models... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.