text stringlengths 16 4.96k | positive stringlengths 321 2.24k | negative stringlengths 310 2.21k |
|---|---|---|
Fix broken import to shaded orbitz jar
Signed-off-by: Tommy Shiou <fd59d852321c3431be8a979962d50c7894293a47@turn.com> | /*
* Copyright (C) 2016 Turn Inc. All Rights Reserved.
* Proprietary and confidential.
*/
package com.turn.edc.storage;
import com.turn.edc.exception.KeyNotFoundException;
import com.turn.edc.router.StoreRequest;
import java.io.IOException;
import java.util.concurrent.TimeoutException;
import com.google.common.e... | /*
* Copyright (C) 2016 Turn Inc. All Rights Reserved.
* Proprietary and confidential.
*/
package com.turn.edc.storage;
import com.turn.edc.exception.KeyNotFoundException;
import com.turn.edc.router.StoreRequest;
import java.io.IOException;
import java.util.concurrent.TimeoutException;
import com.google.common.e... |
Move return view to controller | <?php
/*
|--------------------------------------------------------------------------
| Web Routes
|--------------------------------------------------------------------------
|
| This file is where you may define all of the routes that are handled
| by your application. Just tell Laravel the URIs it should respond
| to... | <?php
/*
|--------------------------------------------------------------------------
| Web Routes
|--------------------------------------------------------------------------
|
| This file is where you may define all of the routes that are handled
| by your application. Just tell Laravel the URIs it should respond
| to... |
Change "best" to "the best" | 'use strict';
module.exports = defineRules;
var competitivePhrases = [
'compete', 'competition', 'competitive', 'cutting edge', 'fail', 'forefront',
'superstar', 'the best', 'top', 'win'
];
var expectationPhrases = [
'hit the ground running',
'juggle',
'tight deadline', 'tight deadlines'
];
func... | 'use strict';
module.exports = defineRules;
var competitivePhrases = [
'best', 'compete', 'competition', 'competitive', 'cutting edge', 'fail', 'forefront',
'superstar', 'top', 'win'
];
var expectationPhrases = [
'hit the ground running',
'juggle',
'tight deadline', 'tight deadlines'
];
function... |
Add macfsevents dependency on Mac OS X | from setuptools import setup, find_packages
import platform
with open('README.rst') as f:
readme = f.read()
execfile('substance/_version.py')
install_requires = ['setuptools>=1.1.3', 'PyYAML', 'tabulate', 'paramiko', 'netaddr', 'requests', 'tinydb', 'python_hosts==0.3.3', 'jinja2']
if 'Darwin' in platform.syste... | from setuptools import setup, find_packages
with open('README.rst') as f:
readme = f.read()
execfile('substance/_version.py')
install_requires = ['setuptools>=1.1.3', 'PyYAML', 'tabulate', 'paramiko', 'netaddr', 'requests', 'tinydb', 'python_hosts==0.3.3', 'jinja2']
setup(name='substance',
version=__versi... |
Fix /destroy_all_the_things endpoint, state are lower case | var express = require('express');
var kue = require('kue');
var Bot = require('../models/bot');
var router = express.Router();
/* GET home page. */
router.get('/', function(req, res, next) {
res.render('index');
});
router.post('/destroy_all_the_things', function(req, res, next) {
['queued', 'active', 'failed', ... | var express = require('express');
var kue = require('kue');
var Bot = require('../models/bot');
var router = express.Router();
/* GET home page. */
router.get('/', function(req, res, next) {
res.render('index');
});
router.post('/destroy_jobs', function(req, res, next) {
kue.Job.rangeByState('delayed', 0, 10000,... |
Fix issues with class naming | #!/usr/bin/env python
# -*- coding: utf-8
from __future__ import absolute_import
import six
from .common import ObjectMeta
from ..base import Model
from ..fields import Field, ListField
class LabelSelectorRequirement(Model):
key = Field(six.text_type)
operator = Field(six.text_type)
values = ListField(s... | #!/usr/bin/env python
# -*- coding: utf-8
from __future__ import absolute_import
import six
from .common import ObjectMeta
from ..base import Model
from ..fields import Field, ListField
class PodDisruptionBudgetMatchExpressions(Model):
key = Field(six.text_type)
operator = Field(six.text_type)
values = ... |
Add new line at the end of error message | package xhl.core;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import xhl.core.elements.CodeList;
import xhl.core.exceptions.EvaluationException;
/**
* LanguageProcessor, which reads code from the file and outputs error messages
* to the standard error output.
*
* ... | package xhl.core;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import xhl.core.elements.CodeList;
import xhl.core.exceptions.EvaluationException;
/**
* LanguageProcessor, which reads code from the file and outputs error messages
* to the standard error output.
*
* ... |
Break the parameters into multiples parameters | <?php
namespace Majora\OAuthServerBundle\DependencyInjection;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\HttpKernel\DependencyInjection\Extension;
/**
* Class MajoraOAuthServerExtension.
*
* @author Raphael De Freitas <raphael@de-freitas.net>
*/
class MajoraOAuthServerExten... | <?php
namespace Majora\OAuthServerBundle\DependencyInjection;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\HttpKernel\DependencyInjection\Extension;
/**
* Class MajoraOAuthServerExtension.
*
* @author Raphael De Freitas <raphael@de-freitas.net>
*/
class MajoraOAuthServerExten... |
Upgrade lxml package from 4.3.0 -> 4.3.4 | import os
import sys
from setuptools import setup, find_packages
os.chdir(os.path.dirname(sys.argv[0]) or ".")
import libsongtext
version = '%s.%s.%s' % libsongtext.__version__
try:
long_description = open('README.rst', 'U').read()
except IOError:
long_description = 'See https://github.com/ysim/songtext'
s... | import os
import sys
from setuptools import setup, find_packages
os.chdir(os.path.dirname(sys.argv[0]) or ".")
import libsongtext
version = '%s.%s.%s' % libsongtext.__version__
try:
long_description = open('README.rst', 'U').read()
except IOError:
long_description = 'See https://github.com/ysim/songtext'
s... |
Allow newer versions of click | from setuptools import setup
setup(
name='aws-fuzzy-finder',
version='1.0.0',
url='https://github.com/pmazurek/aws-fuzzy-finder',
description='SSH into AWS instances using fuzzy search through tags.',
download_url='https://github.com/pmazurek/aws-fuzzy-finder/tarball/v1.0.0',
author='Piotr Mazu... | from setuptools import setup
setup(
name='aws-fuzzy-finder',
version='1.0.0',
url='https://github.com/pmazurek/aws-fuzzy-finder',
description='SSH into AWS instances using fuzzy search through tags.',
download_url='https://github.com/pmazurek/aws-fuzzy-finder/tarball/v1.0.0',
author='Piotr Mazu... |
Add a comment about line endings in Stardoc files. | # 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
#
# Unless required by applicable law or agreed to in writing, ... | # 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
#
# Unless required by applicable law or agreed to in writing, ... |
Remove testing CachePath from example. | var app = module.exports = require('appjs').createApp();
app.serveFilesFrom(__dirname + '/content');
var window = app.createWindow({
width : 640,
height : 460,
icons : __dirname + '/content/icons'
});
window.on('create', function(){
console.log("Window Created");
window.frame.show();
window.frame.cente... | var app = module.exports = require('appjs').createApp({CachePath: '/Users/dbartlett/.cache1'});
app.serveFilesFrom(__dirname + '/content');
var window = app.createWindow({
width : 640,
height : 460,
icons : __dirname + '/content/icons'
});
window.on('create', function(){
console.log("Window Created");
wi... |
Fix for global package, style changes
Change-Id: I351fbcc07dcdb8080c84f55168df0eeec773c632 | #!/usr/bin/env node
/*
* Copyright (C) 2022 Google Inc. All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
* in compliance with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless r... | #!/usr/bin/env node
/*
* Copyright (C) 2022 Google Inc. All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
* in compliance with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless r... |
Fix massive SPAM of errors from QR code in the browser console. | /*global angular*/
(function () {
'use strict';
angular.module('core').directive('qrDeviceInteraction', function () {
var template = '';
template += '<a href="{{qrConfig.slideUrl}}" target="_blank" ng-if="qrConfig">';
template += ' <qr text="qrConfig.slideUrl" type-number="qrConfig.t... | /*global angular*/
(function () {
'use strict';
angular.module('core').directive('qrDeviceInteraction', function () {
var template = '';
template += '<a href="{{qrConfig.slideUrl}}" target="_blank">';
template += ' <qr text="qrConfig.slideUrl" type-number="qrConfig.typeNumber" correc... |
Fix app specific JS for adminsysconfig. | // --
// Core.Agent.Admin.SysConfig.js - provides the special module functions for the AdminSysConfig
// Copyright (C) 2001-2010 OTRS AG, http://otrs.org/\n";
// --
// $Id: Core.Agent.Admin.SysConfig.js,v 1.2 2010-06-22 11:24:49 mg Exp $
// --
// This software comes with ABSOLUTELY NO WARRANTY. For details, see
// the ... | // --
// Core.Agent.Admin.SysConfig.js - provides the special module functions for the AdminSysConfig
// Copyright (C) 2001-2010 OTRS AG, http://otrs.org/\n";
// --
// $Id: Core.Agent.Admin.SysConfig.js,v 1.1 2010-06-04 11:19:31 mn Exp $
// --
// This software comes with ABSOLUTELY NO WARRANTY. For details, see
// the ... |
Fix order by doc comment. | // DecentCMS (c) 2015 Bertrand Le Roy, under MIT. See LICENSE.txt for licensing details.
'use strict';
/**
* Builds indexes from content items and map functions.
*/
function Index(scope) {
this.scope = scope;
}
Index.service = 'index';
Index.feature = 'query';
Index.scope = 'shell';
/**
* Creates or gets an inde... | // DecentCMS (c) 2015 Bertrand Le Roy, under MIT. See LICENSE.txt for licensing details.
'use strict';
/**
* Builds indexes from content items and map functions.
*/
function Index(scope) {
this.scope = scope;
}
Index.service = 'index';
Index.feature = 'query';
Index.scope = 'shell';
/**
* Creates or gets an inde... |
Add predict path for Residual | from .model import Model
from ...api import layerize
from .affine import Affine
import cytoolz as toolz
class Residual(Model):
def __init__(self, layer):
Model.__init__(self)
self._layers.append(layer)
self.on_data_hooks.append(on_data)
def __call__(self, X):
return X + self.... | from .model import Model
from ...api import layerize
from .affine import Affine
import cytoolz as toolz
def Residual(layer):
def residual_fwd(X, drop=0.):
y, bp_y = layer.begin_update(X, drop=drop)
output = X+y
def residual_bwd(d_output, sgd=None):
return d_output + bp_y(d_out... |
Update error message for Select command (if a task is already done) | package seedu.ezdo.commons.core;
/**
* Container for user visible messages.
*/
public class Messages {
public static final String MESSAGE_UNKNOWN_COMMAND = "Unknown command";
public static final String MESSAGE_INVALID_COMMAND_FORMAT = "Invalid command format! \n%1$s";
public static final String MESSAGE_... | package seedu.ezdo.commons.core;
/**
* Container for user visible messages.
*/
public class Messages {
public static final String MESSAGE_UNKNOWN_COMMAND = "Unknown command";
public static final String MESSAGE_INVALID_COMMAND_FORMAT = "Invalid command format! \n%1$s";
public static final String MESSAGE_... |
Rename controller action delete to destroy | <?php
declare(strict_types=1);
namespace Cortex\Foundation\Transformers;
use Spatie\MediaLibrary\Models\Media;
use League\Fractal\TransformerAbstract;
class MediaTransformer extends TransformerAbstract
{
/**
* @return array
*/
public function transform(Media $media): array
{
return [
... | <?php
declare(strict_types=1);
namespace Cortex\Foundation\Transformers;
use Spatie\MediaLibrary\Models\Media;
use League\Fractal\TransformerAbstract;
class MediaTransformer extends TransformerAbstract
{
/**
* @return array
*/
public function transform(Media $media): array
{
return [
... |
Add lower version bound on `"oedialect"` dependency
For some reason readthedocs use an earlier version and fails when trying
to use it. | import os
from setuptools import setup
def read(fname):
return open(os.path.join(os.path.dirname(__file__), fname)).read()
setup(
name="feedinlib",
version="0.1.0rc1",
description="Creating time series from pv or wind power plants.",
url="http://github.com/oemof/feedinlib",
author="oemof dev... | import os
from setuptools import setup
def read(fname):
return open(os.path.join(os.path.dirname(__file__), fname)).read()
setup(
name="feedinlib",
version="0.1.0rc1",
description="Creating time series from pv or wind power plants.",
url="http://github.com/oemof/feedinlib",
author="oemof dev... |
Apply spoilers to the entire user activity stream. | (function() {
Discourse.addInitializer(function () {
var applySpoilers = function($post) {
// text
$('.spoiler:not(:has(img))', $post).removeClass('spoiler')
.spoilText();
// images
$('.spoiler:has(img)', $post).removeClass('spoiler')
... | (function() {
Discourse.addInitializer(function () {
var applySpoilers = function($post) {
// text
$('.spoiler:not(:has(img))', $post).removeClass('spoiler')
.spoilText();
// images
$('.spoiler:has(img)', $post).removeClass('spoiler')
... |
Test to see if changes are published to Github contribution graph. | package patterns;
public class Singleton {
public static void main(String[] args) {
Elvis theKing = Elvis.INSTANCE;
theKing.hasLeftTheBuilding();
AnotherElvis anotherKing = AnotherElvis.getInstance();
anotherKing.hasLeftTheBuilding();
EnumElvis enumElvis = EnumElvis.INSTANCE;
enumEl... | package patterns;
public class Singleton {
public static void main(String[] args) {
Elvis theKing = Elvis.INSTANCE;
theKing.hasLeftTheBuilding();
AnotherElvis anotherKing = AnotherElvis.getInstance();
anotherKing.hasLeftTheBuilding();
EnumElvis enumElvis = EnumElvis.INSTANCE;
enumEl... |
Fix faulty writeFileSync logic for creating a new settings.json file
JSON keys must be wrapped in double-quotes | const fs = require('fs-extra'),
Path = require('path');
var _settings = { // Private storage of settings
global: {},
local: {}
},
_currPath; // Path to the settings.json file
var Settings = {
GetGlobal: (name) => {
return _settings.global[name] || null;
//return _sett... | const fs = require('fs-extra'),
Path = require('path');
var _settings = { // Private storage of settings
global: {},
local: {}
},
_currPath; // Path to the settings.json file
var Settings = {
GetGlobal: (name) => {
return _settings.global[name] || null;
//return _sett... |
Fix `data-style` warning in examples | import React from 'react';
import {findDOMNode} from 'react-dom';
const AUTHOR_REPO = 'ericgio/react-bootstrap-typeahead';
class GitHubStarsButton extends React.Component {
componentDidMount() {
const node = findDOMNode(this);
node.dataset.size = window.innerWidth > 480 ? 'large': null;
}
render() {
... | import React from 'react';
import {findDOMNode} from 'react-dom';
const AUTHOR_REPO = 'ericgio/react-bootstrap-typeahead';
class GitHubStarsButton extends React.Component {
componentDidMount() {
const node = findDOMNode(this);
node.dataset.style = window.innerWidth > 480 ? 'mega': null;
}
render() {
... |
Check that scope is an array | var deep = require('deep-get-set');
exports.register = function(plugin, options, next) {
plugin.servers[0].ext('onPreAuth', function(request, next) {
var i, matches, result, scope, _i, _len, _ref;
if (request.route.auth.scope !== null) {
_ref = request.route.auth.scope;
if (_ref.constructor !== ... | var deep = require('deep-get-set');
exports.register = function(plugin, options, next) {
plugin.servers[0].ext('onPreAuth', function(request, next) {
var i, matches, result, scope, _i, _len, _ref;
if (request.route.auth.scope !== null) {
_ref = request.route.auth.scope;
for (i = _i = 0, _len = _r... |
Add `text` attribute to response from `chat` | from time import time
from ..core import Minette
from ..models import Message
class MinetteForTest(Minette):
def __init__(self, **kwargs):
super().__init__(**kwargs)
self.default_channel = kwargs.get("default_channel", "")
self.case_id = str(int(time() * 10000000))
def chat(self, req... | from time import time
from ..core import Minette
from ..models import Message
class MinetteForTest(Minette):
def __init__(self, **kwargs):
super().__init__(**kwargs)
self.default_channel = kwargs.get("default_channel", "")
self.case_id = str(int(time() * 10000000))
def chat(self, req... |
Sort the generated manager file by protocol name
20070831193701-4210b-ede9decef118aba3937b0291512956927333dbe6.gz | #!/usr/bin/python
import sys
import telepathy
from telepathy.interfaces import CONN_MGR_INTERFACE
if len(sys.argv) >= 2:
manager_name = sys.argv[1]
else:
manager_name = "haze"
service_name = "org.freedesktop.Telepathy.ConnectionManager.%s" % manager_name
object_path = "/org/freedesktop/Telepathy/ConnectionMana... | #!/usr/bin/python
import sys
import telepathy
from telepathy.interfaces import CONN_MGR_INTERFACE
if len(sys.argv) >= 2:
manager_name = sys.argv[1]
else:
manager_name = "haze"
service_name = "org.freedesktop.Telepathy.ConnectionManager.%s" % manager_name
object_path = "/org/freedesktop/Telepathy/ConnectionMana... |
Deal with GPys numpy dependency | from setuptools import setup
from os import path
current_dir = path.abspath(path.dirname(__file__))
with open(path.join(current_dir, 'README.md'), 'r') as f:
long_description = f.read()
with open(path.join(current_dir, 'requirements.txt'), 'r') as f:
install_requires = f.read().split('\n')
setup(
name=... | from setuptools import setup
from os import path
current_dir = path.abspath(path.dirname(__file__))
with open(path.join(current_dir, 'README.md'), 'r') as f:
long_description = f.read()
with open(path.join(current_dir, 'requirements.txt'), 'r') as f:
install_requires = f.read().split('\n')
setup(
name=... |
Fix image file path at generated html file. | 'use strict';
const fs = require('fs');
const path = require('path');
const os = require('os');
const marked = require('marked');
const ECT = require('ect');
function md2html(filePath, cb) {
fs.readFile(filePath, 'utf8', (err, mdString) => {
if (err) {
cb(err);
return;
}
const markedRenderer... | 'use strict';
const fs = require('fs');
const path = require('path');
const os = require('os');
const marked = require('marked');
const ECT = require('ect');
function md2html(filePath, cb) {
fs.readFile(filePath, 'utf8', (err, mdString) => {
if (err) {
cb(err);
return;
}
const content = mark... |
Remove debug line added by mistake | <?php
require_once("boot.php");
function cronhooks_run(&$argv, &$argc){
global $a, $db;
if(is_null($a)) {
$a = new App;
}
if(is_null($db)) {
@include(".htconfig.php");
require_once("include/dba.php");
$db = new dba($db_host, $db_user, $db_pass, $db_data);
unset($db_host, $db_user, $db_p... | <?php
require_once("boot.php");
function cronhooks_run(&$argv, &$argc){
global $a, $db;
if(is_null($a)) {
$a = new App;
}
if(is_null($db)) {
@include(".htconfig.php");
require_once("include/dba.php");
$db = new dba($db_host, $db_user, $db_pass, $db_data);
unset($db_host, $db_user, $db_p... |
Automate Transfers: Paths stored as binary to handle encodings | import os
from sqlalchemy import create_engine
from sqlalchemy import Sequence
from sqlalchemy import Column, Binary, Boolean, Integer, String
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy.orm import sessionmaker
db_path = os.path.join(os.path.dirname(__file__), 'transfers.db')
engine = crea... | import os
from sqlalchemy import create_engine
from sqlalchemy import Sequence
from sqlalchemy import Column, Boolean, Integer, String, Text
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy.orm import sessionmaker
db_path = os.path.join(os.path.dirname(__file__), 'transfers.db')
engine = create... |
Integrate webpack into gulp task | const gulp = require('gulp');
const webpack = require('webpack');
const gutil = require('gulp-util');
const eslint = require('gulp-eslint');
const webpackConfig = require('./webpack.config');
gulp.task('script', (done) => {
webpack(webpackConfig).run((err, stats) => {
if (err) {
gutil.log(gutil.colors.red(... | const gulp = require('gulp');
const eslint = require('gulp-eslint');
const sourcemaps = require('gulp-sourcemaps');
const babel = require('gulp-babel');
const concat = require('gulp-concat');
gulp.task('script', () => {
gulp.src('src/**/*.js')
.pipe(sourcemaps.init())
.pipe(babel())
.pipe(concat('details... |
Print all evaluation metrics associated with the model | #!/usr/bin/env python3
import argparse
import pickle
import tensorflow.keras as keras
import numpy as np
import sys
import cv2
parser = argparse.ArgumentParser(description='Train the network given ')
parser.add_argument('-b', '--database-path', dest='imgdb_path',
help='Path to the image database ... | #!/usr/bin/env python3
import argparse
import pickle
import tensorflow.keras as keras
import numpy as np
import sys
import cv2
parser = argparse.ArgumentParser(description='Train the network given ')
parser.add_argument('-b', '--database-path', dest='imgdb_path',
help='Path to the image database ... |
Fix plugin manager with phar | <?php
/*
* This file is part of the Automate package.
*
* (c) Julien Jacottet <jjacottet@gmail.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Automate;
use Automate\Plugin\PluginInterface;
class PluginManager
{... | <?php
/*
* This file is part of the Automate package.
*
* (c) Julien Jacottet <jjacottet@gmail.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Automate;
use Automate\Plugin\PluginInterface;
class PluginManager
{... |
Remove opacity from “What is this?” link 💋 | import React from 'react'
import Bubbles from './Bubbles'
export default class Welcome extends React.Component {
render() {
const { opacity } = this.props
const containerStyle = {
background: '#E64369',
bottom: 0,
color: 'white',
display: 'flex',
flexDirection: 'column',
... | import React from 'react'
import Bubbles from './Bubbles'
export default class Welcome extends React.Component {
render() {
const { opacity } = this.props
const containerStyle = {
background: '#E64369',
bottom: 0,
color: 'white',
display: 'flex',
flexDirection: 'column',
... |
Remove unused statement & format for python3 | #!/usr/bin/env python
# Python script to fetch interface name and their operation status
from ncclient import manager
def connect(host, port, user, password):
conn = manager.connect(host=host,
port=port,
username=user,
password=password,
timeout=10,
dev... | #!/usr/bin/env python
# Python script to fetch interface name and their operation status
from ncclient import manager
def connect(host, port, user, password):
conn = manager.connect(host=host,
port=port,
username=user,
password=password,
timeout=10,
dev... |
Use hasattr instead of try/except to call django setup. | import os
import pytest
try:
from django.conf import settings
except ImportError:
settings = None # NOQA
def is_configured():
if settings is None:
return False
return settings.configured or os.environ.get('DJANGO_SETTINGS_MODULE')
@pytest.fixture(autouse=True, scope='session')
def _django_... | import os
import pytest
try:
from django.conf import settings
except ImportError:
settings = None # NOQA
def is_configured():
if settings is None:
return False
return settings.configured or os.environ.get('DJANGO_SETTINGS_MODULE')
@pytest.fixture(autouse=True, scope='session')
def _django_... |
Fix broken redirects and serving of older websites | var express = require('express')
var vhost = require('vhost')
var app2014 = require('./2014/app')
var app2015 = require('./2015/app')
var app2016 = require('./2016/app')
var appSplash = require('./splash/app')
var redirect = express()
redirect.get('/', function (req, res) {
res.redirect(301, 'https://2016.coldfront... | var express = require('express')
var vhost = require('vhost')
var app2014 = require('./2014/app')
var app2015 = require('./2015/app')
var app2016 = require('./2016/app')
var appSplash = require('./splash/app')
//var redirect = express()
//redirect.get('/', function (req, res) {
// res.redirect(301, 'https://2016.co... |
Add default description on user model | const Sequelize = require('sequelize');
const db = require('../db.js');
const Users = db.define('users',
{
id: {
type: Sequelize.UUID,
defaultValue: Sequelize.UUIDV1,
primaryKey: true,
},
facebook_id: {
type: Sequelize.STRING,
},
first_name: {
type: Sequelize.STRING,... | const Sequelize = require('sequelize');
const db = require('../db.js');
const Users = db.define('users',
{
id: {
type: Sequelize.UUID,
defaultValue: Sequelize.UUIDV1,
primaryKey: true,
},
facebook_id: {
type: Sequelize.STRING,
},
first_name: {
type: Sequelize.STRING,... |
Add title and shorten advisory | 'use strict';
var cvss = require('cvss');
module.exports = function (err, data, pkgPath) {
if (err) {
return 'Debug output: ' + JSON.stringify(Buffer.isBuffer(data) ? data.toString() : data) + '\n' + err;
}
var pipeWrap = function (items) {
return '|' + items.join('|') + '|';
};
var header = ['Severity', '... | 'use strict';
var cvss = require('cvss');
module.exports = function (err, data, pkgPath) {
if (err) {
return 'Debug output: ' + JSON.stringify(Buffer.isBuffer(data) ? data.toString() : data) + '\n' + err;
}
var pipeWrap = function (items) {
return '|' + items.join('|') + '|';
};
var header = ['Severity', '... |
Set USE_TZ=True, django 4 raises a warning if this is not set to a value | # Minimum settings that are needed to run django test suite
import os
import secrets
import tempfile
USE_TZ = True
SECRET_KEY = secrets.token_hex()
if "postgresql" in os.getenv("TOX_ENV_NAME", "") or os.getenv("TEST_DATABASE") == "postgres":
DATABASES = {
'default': {
'ENGINE': 'django.db.back... | # Minimum settings that are needed to run django test suite
import os
import secrets
import tempfile
SECRET_KEY = secrets.token_hex()
if "postgresql" in os.getenv("TOX_ENV_NAME", "") or os.getenv("TEST_DATABASE") == "postgres":
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.postgresq... |
Change redirect to application redirect | from django.shortcuts import render
from django.http import HttpResponseRedirect
from django.core.urlresolvers import reverse
from news.models import Article, Event
from door.models import DoorStatus
from datetime import datetime
from itertools import chain
def index(request):
number_of_news = 3
# Sorts the ... | from django.shortcuts import render
from django.http import HttpResponseRedirect
from django.core.urlresolvers import reverse
from news.models import Article, Event
from door.models import DoorStatus
from datetime import datetime
from itertools import chain
def index(request):
number_of_news = 3
# Sorts the ... |
Change Jasmine import syntax to satisfy Travis | const path = require('path')
const MarkdownRenderer = require('../src/renderer').MarkdownRenderer
describe ('Renderer', () => {
var renderer
var callback
beforeEach(() => {
callback = jasmine.createSpy('callback')
renderer = new MarkdownRenderer(callback)
})
it('converts a markdown file', (done) =>... | const path = require('path')
const { MarkdownRenderer } = require('../src/renderer')
describe ('Renderer', () => {
var renderer
var callback
beforeEach(() => {
callback = jasmine.createSpy('callback')
renderer = new MarkdownRenderer(callback)
})
it('converts a markdown file', (done) => {
const ... |
Handle decompression bomb errors as well as warnings. | try:
from cStringIO import StringIO
except ImportError:
from StringIO import StringIO
from PIL import Image
from PIL.Image import DecompressionBombError as DBE
from PIL.Image import DecompressionBombWarning as DBW
from ingestors.exc import ProcessingException
class ImageSupport(object):
"""Provides helpe... | try:
from cStringIO import StringIO
except ImportError:
from StringIO import StringIO
from PIL import Image
from PIL.Image import DecompressionBombWarning
from ingestors.exc import ProcessingException
class ImageSupport(object):
"""Provides helpers for image extraction."""
def parse_image(self, data... |
Debug : unfund variable $table ->suppression | <?php
class DegustationAffectationValidator extends sfValidatorSchema {
public function __construct($obj, $fields= null, $options = array(), $messages = array()) {
$this->obj = $obj;
parent::__construct($fields, $options, $messages);
}
public function configure($options = array()... | <?php
class DegustationAffectationValidator extends sfValidatorSchema {
public function __construct($obj, $fields= null, $options = array(), $messages = array()) {
$this->obj = $obj;
parent::__construct($fields, $options, $messages);
}
public function configure($options = array()... |
Return TODO rather than None, add pkg_name property for PackageData | class PackageData(object):
def __init__(self, local_file, name, version):
self.local_file = local_file
self.name = name
self.version = version
def __getattr__(self, name):
if name in self.__dict__:
return self.__dict__[name]
return 'TODO:'
@property
... | class PackageData(object):
def __init__(self, local_file, name, version):
self.local_file = local_file
self.name = name
self.version = version
def __getattr__(self, name):
if name in self.__dict__:
return self.__dict__[name]
return None
class PypiData(Packa... |
Make sure the whole canvas is cleared. | Doc = Base.extend({
beans: true,
initialize: function(canvas) {
if (canvas) {
this.canvas = canvas;
this.ctx = this.canvas.getContext('2d');
this.size = new Size(canvas.offsetWidth, canvas.offsetHeight);
}
Paper.documents.push(this);
this.activate();
this.layers = [];
this.activeLayer = new Laye... | Doc = Base.extend({
beans: true,
initialize: function(canvas) {
if (canvas) {
this.canvas = canvas;
this.ctx = this.canvas.getContext('2d');
this.size = new Size(canvas.offsetWidth, canvas.offsetHeight);
}
Paper.documents.push(this);
this.activate();
this.layers = [];
this.activeLayer = new Laye... |
Fix chainer v4 error about type_check._argname | from chainer.backends import cuda
from chainer import function_node
from chainer import utils
from chainer.utils import type_check
class Arctanh(function_node.FunctionNode):
"""Elementwise inverse hyperbolic tangent function."""
def check_type_forward(self, in_types):
if hasattr(type_check, '_argnam... | from chainer.backends import cuda
from chainer import function_node
from chainer import utils
from chainer.utils import type_check
class Arctanh(function_node.FunctionNode):
"""Elementwise inverse hyperbolic tangent function."""
def check_type_forward(self, in_types):
type_check._argname(in_types, (... |
Fixed: Resolve the path to the RequireJS instead of hardcoding it. | /**
* Copyright (c) 2014, CKSource - Frederico Knabben. All rights reserved.
* Licensed under the terms of the MIT License (see LICENSE.md).
*/
'use strict';
var path = require( 'path' ),
_ = require( 'lodash' ),
files = [
path.join( require.resolve( 'requirejs' ), '../../require.js' ),
path.join( __dirname,... | /**
* Copyright (c) 2014, CKSource - Frederico Knabben. All rights reserved.
* Licensed under the terms of the MIT License (see LICENSE.md).
*/
'use strict';
var path = require( 'path' ),
_ = require( 'lodash' ),
files = [
path.join( __dirname, '/../node_modules/requirejs/require.js' ),
path.join( __dirname,... |
Add back check for string 'undefined'
(There was probably some case where this was happening instead of the 'null' thing) | const utils = require('../lib/utils')
const insecurity = require('../lib/insecurity')
const models = require('../models/index')
const challenges = require('../data/datacache').challenges
module.exports = function retrieveBasket () {
return (req, res, next) => {
const id = req.params.id
models.Basket.find({ w... | const utils = require('../lib/utils')
const insecurity = require('../lib/insecurity')
const models = require('../models/index')
const challenges = require('../data/datacache').challenges
module.exports = function retrieveBasket () {
return (req, res, next) => {
const id = req.params.id
models.Basket.find({ w... |
Make test asynchronous if it wants to be | /* global describe, it */
import {exec} from '../../../src/utils/util';
import assert from 'assert';
require('chai').should();
describe("Oi CLI", () => {
it("can be invoked", (done) => {
const result = exec('node dist/bin/oi.js -v');
console.log(result);
console.log(result.toString());
console.log(... | /* global describe, it */
import {exec} from '../../../src/utils/util';
import assert from 'assert';
require('chai').should();
describe("Oi CLI", () => {
it("can be invoked", () => {
const result = exec('node dist/bin/oi.js -v');
console.log(result);
console.log(result.toString());
console.log(resu... |
Add better check for being in a CMS-page request | # -*- coding: utf-8 -*-
from app_data import AppDataContainer, app_registry
from cms.apphook_pool import apphook_pool
from django.core.urlresolvers import resolve
def get_app_instance(request):
"""
Returns a tuple containing the current namespace and the AppHookConfig instance
:param request: request obj... | # -*- coding: utf-8 -*-
from app_data import AppDataContainer, app_registry
from cms.apphook_pool import apphook_pool
from django.core.urlresolvers import resolve
def get_app_instance(request):
"""
Returns a tuple containing the current namespace and the AppHookConfig instance
:param request: request obj... |
Remove paragraphs since they add unnecessary vertical padding. | var key = require('../utils/key');
var sync = require('synchronize');
var request = require('request');
var _ = require('underscore');
// The API that returns the in-email representation.
module.exports = function(req, res) {
var url = req.query.url.trim();
// Giphy image urls are in the format:
// http://giph... | var key = require('../utils/key');
var sync = require('synchronize');
var request = require('request');
var _ = require('underscore');
// The API that returns the in-email representation.
module.exports = function(req, res) {
var url = req.query.url.trim();
// Giphy image urls are in the format:
// http://giph... |
Update docker images to version 34 | /*
* 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... |
Correct path to parent dir | # Configuration file for the Sphinx documentation builder.
#
# For the full list of built-in configuration values, see the documentation:
# https://www.sphinx-doc.org/en/master/usage/configuration.html
# -- Project information -----------------------------------------------------
# https://www.sphinx-doc.org/en/master... | # Configuration file for the Sphinx documentation builder.
#
# For the full list of built-in configuration values, see the documentation:
# https://www.sphinx-doc.org/en/master/usage/configuration.html
# -- Project information -----------------------------------------------------
# https://www.sphinx-doc.org/en/master... |
Remove deprecated override on createJSModules method | package com.marcshilling.idletimer;
import com.facebook.react.ReactPackage;
import com.facebook.react.bridge.JavaScriptModule;
import com.facebook.react.bridge.NativeModule;
import com.facebook.react.bridge.ReactApplicationContext;
import com.facebook.react.uimanager.ViewManager;
import java.util.Arrays;
import java.... | package com.marcshilling.idletimer;
import com.facebook.react.ReactPackage;
import com.facebook.react.bridge.JavaScriptModule;
import com.facebook.react.bridge.NativeModule;
import com.facebook.react.bridge.ReactApplicationContext;
import com.facebook.react.uimanager.ViewManager;
import java.util.Arrays;
import java.... |
Update notification model to spit out id | <?php
namespace Kregel\Radio\Models;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Support\Facades\Redis;
use Kregel\FormModel\Traits\Formable;
use Kregel\Warden\Traits\Wardenable;
class Notification extends Model
{
use Formable;
protected $table = 'radio_notifications';
protected... | <?php
namespace Kregel\Radio\Models;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Support\Facades\Redis;
use Kregel\FormModel\Traits\Formable;
use Kregel\Warden\Traits\Wardenable;
class Notification extends Model
{
use Formable;
protected $table = 'radio_notifications';
protected... |
Revert "fix links from test page"
This reverts commit 27dd0e3170bb185e385deed11b153d86983ae0c6. | /* jshint node: true */
module.exports = function(environment) {
var ENV = {
modulePrefix: 'dummy',
environment: environment,
baseURL: '/',
// Personally, hash is nicer for test work. The browser knows not
// to do a full page refresh when you manually edit the url.
locationType: 'hash',
... | /* jshint node: true */
module.exports = function(environment) {
var ENV = {
modulePrefix: 'dummy',
environment: environment,
baseURL: '/',
// Personally, hash is nicer for test work. The browser knows not
// to do a full page refresh when you manually edit the url.
locationType: 'hash',
... |
Add verison_slug redirection back in for now. | from django.conf.urls.defaults import url, patterns
from urls import urlpatterns as main_patterns
urlpatterns = patterns('',
url(r'^projects/(?P<project_slug>[\w.-]+)/(?P<lang_slug>\w{2})/(?P<version_slug>[\w.-]+)/(?P<filename>.*)$',
'core.views.subproject_serve_docs',
name='subproject_docs_detail... | from django.conf.urls.defaults import url, patterns
from urls import urlpatterns as main_patterns
urlpatterns = patterns('',
url(r'^projects/(?P<project_slug>[\w.-]+)/(?P<lang_slug>\w{2})/(?P<version_slug>[\w.-]+)/(?P<filename>.*)$',
'core.views.subproject_serve_docs',
name='subproject_docs_detail... |
Simplify setTimeout using bind() in a useful way | function RetryOperation(timeouts) {
this._timeouts = timeouts;
this._fn = null;
this._errors = [];
}
module.exports = RetryOperation;
RetryOperation.prototype.retry = function(err) {
if (!err) {
return false;
}
this._errors.push(err);
var timeout = this._timeouts.shift();
if (timeout === undefine... | function RetryOperation(timeouts) {
this._timeouts = timeouts;
this._fn = null;
this._errors = [];
}
module.exports = RetryOperation;
RetryOperation.prototype.retry = function(err) {
if (!err) {
return false;
}
this._errors.push(err);
var timeout = this._timeouts.shift();
if (timeout === undefine... |
Use the same random alg in tokengen as pwdcrytpt | package us.kbase.auth2.cryptutils;
import java.nio.charset.StandardCharsets;
import java.security.NoSuchAlgorithmException;
import java.security.SecureRandom;
import java.util.Base64; // requires java 8
public class TokenGenerator {
//TODO ONMOVE unit tests
//TODO ONMOVE docs
//TODO ONDB don't store the token, s... | package us.kbase.auth2.cryptutils;
import java.nio.charset.StandardCharsets;
import java.security.SecureRandom;
import java.util.Base64; // requires java 8
public class TokenGenerator {
//TODO ONMOVE unit tests
//TODO ONMOVE docs
//TODO ONDB don't store the token, store a hash. For user requested tokens, associa... |
Increase the upper range for animation duration. | $(function() {
function randomInt (min, max) {
return Math.floor(Math.random() * (max - min + 1)) + min;
}
function newBubble () {
var radius = randomInt(10, 208);
var animationDuration = randomInt(4.2, 11.8);
if (event) {
var left = event.clientX;
var top = event.clientY;
}
... | $(function() {
function randomInt (min, max) {
return Math.floor(Math.random() * (max - min + 1)) + min;
}
function newBubble () {
var radius = randomInt(10, 208);
var animationDuration = randomInt(4.2, 9.8);
if (event) {
var left = event.clientX;
var top = event.clientY;
}
e... |
Indent promise chain two space | import * as React from "react";
import {BuildSnapshot} from "./BuildSnapshot";
/**
* Container Component for BuildSnapshots.
*
* @param {*} props input property containing an array of build data to be
* rendered through BuildSnapshot.
*/
export const BuildSnapshotContainer = React.memo((props) =>
{
const S... | import * as React from "react";
import {BuildSnapshot} from "./BuildSnapshot";
/**
* Container Component for BuildSnapshots.
*
* @param {*} props input property containing an array of build data to be
* rendered through BuildSnapshot.
*/
export const BuildSnapshotContainer = React.memo((props) =>
{
const S... |
Update docblock return type for search against backend | <?php
namespace Imbo\MetadataSearch\Interfaces;
/**
* Metadata search backend interface
*
* @author Kristoffer Brabrand <kristoffer@brabrand.net>
*/
interface SearchBackendInterface {
/**
* Set metadata for an image in the metadata search backend
*
* @param string $publicKey Public key the imag... | <?php
namespace Imbo\MetadataSearch\Interfaces;
/**
* Metadata search backend interface
*
* @author Kristoffer Brabrand <kristoffer@brabrand.net>
*/
interface SearchBackendInterface {
/**
* Set metadata for an image in the metadata search backend
*
* @param string $publicKey Public key the imag... |
Update test for Node 0.10 | var chai = require('chai');
var chaiAsPromised = require('chai-as-promised');
chai.use(chaiAsPromised);
var expect = chai.expect;
var rollupBabelLibBundler = require('../lib');
describe('rollup-babel-lib-bundler', function() {
it('is a function', function() {
expect(rollupBabelLibBundler).to.be.a('function');
... | var chai = require('chai');
var chaiAsPromised = require('chai-as-promised');
chai.use(chaiAsPromised);
var expect = chai.expect;
var rollupBabelLibBundler = require('../lib');
describe('rollup-babel-lib-bundler', function() {
it('is a function', function() {
expect(rollupBabelLibBundler).to.be.a('function');
... |
Improve import of spaCy, to prevent cycles | import numpy
SPACY_MODELS = {}
VECTORS = {}
def get_spacy(lang, **kwargs):
global SPACY_MODELS
import spacy
if lang not in SPACY_MODELS:
SPACY_MODELS[lang] = spacy.load(lang, **kwargs)
return SPACY_MODELS[lang]
def get_vectors(ops, lang):
global VECTORS
key = (ops.device, lang)
... | import numpy
try:
import spacy
except ImportError:
spacy = None
SPACY_MODELS = {}
VECTORS = {}
def get_spacy(lang, **kwargs):
global SPACY_MODELS
if spacy is None:
raise ImportError("Could not import spacy. Is it installed?")
if lang not in SPACY_MODELS:
SPACY_MODELS[lang] = spacy... |
Drop mention of what phase of parsing errored.
These are... implementation details that are not at all meaningful to an end-user. And also still quite distinguishable if you really care enough to ask for full stacks by setting the DEBUG var.
Signed-off-by: Eric Myhre <2346ad27d7568ba9896f1b7da6b5991251debdf2@exultan... | package def
import (
"bytes"
"github.com/go-yaml/yaml"
"github.com/ugorji/go/codec"
"polydawn.net/repeatr/lib/cereal"
)
var codecBounceHandler = &codec.CborHandle{}
func ParseYaml(ser []byte) *Formula {
// Turn tabs into spaces so that tabs are acceptable inputs.
ser = cereal.Tab2space(ser)
// Bounce the se... | package def
import (
"bytes"
"github.com/go-yaml/yaml"
"github.com/ugorji/go/codec"
"polydawn.net/repeatr/lib/cereal"
)
var codecBounceHandler = &codec.CborHandle{}
func ParseYaml(ser []byte) *Formula {
// Turn tabs into spaces so that tabs are acceptable inputs.
ser = cereal.Tab2space(ser)
// Bounce the se... |
Add BLOCK pipeline definition to the default pipelines | /*
* Copyright (c) 2015-2017 Dzikoysk
*
* 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 agre... | /*
* Copyright (c) 2015-2017 Dzikoysk
*
* 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 agre... |
Rename config method and make an immutable copy | package com.salesforce.storm.spout.sideline;
import com.salesforce.storm.spout.sideline.config.SidelineSpoutConfig;
import com.salesforce.storm.spout.sideline.handler.SidelineSpoutHandler;
import com.salesforce.storm.spout.sideline.handler.SidelineVirtualSpoutHandler;
import org.slf4j.Logger;
import org.slf4j.LoggerFa... | package com.salesforce.storm.spout.sideline;
import com.salesforce.storm.spout.sideline.config.SidelineSpoutConfig;
import com.salesforce.storm.spout.sideline.handler.SidelineSpoutHandler;
import com.salesforce.storm.spout.sideline.handler.SidelineVirtualSpoutHandler;
import org.slf4j.Logger;
import org.slf4j.LoggerFa... |
Fix up unit tests so they all pass. | import logging
class IncludePath(object):
def __init__(self, project_layout, project_services):
self.project_layout = project_layout
self.project_services = project_services
def resolveIncludePaths(self, folder_path):
logger = logging.getLogger('Archie')
logger.debug('List incl... | import logging
class IncludePath(object):
def __init__(self, project_layout, project_services):
self.project_layout = project_layout
self.project_services = project_services
def resolveIncludePaths(self, folder_path):
logger = logging.getLogger('Archie')
logger.debug('List incl... |
Test that DeployOptions sets two options | # Copyright Hybrid Logic Ltd. See LICENSE file for details.
"""
Unit tests for the implementation ``flocker-deploy``.
"""
from twisted.trial.unittest import TestCase, SynchronousTestCase
from ...testtools import FlockerScriptTestsMixin, StandardOptionsTestsMixin
from ..script import DeployScript, DeployOptions
cl... | # Copyright Hybrid Logic Ltd. See LICENSE file for details.
"""
Unit tests for the implementation ``flocker-deploy``.
"""
from twisted.trial.unittest import TestCase, SynchronousTestCase
from ...testtools import FlockerScriptTestsMixin, StandardOptionsTestsMixin
from ..script import DeployScript, DeployOptions
cl... |
chore(release): Check that RELEASE_TOKEN is set
[#96495576] | import {map} from 'event-stream';
import gulp from 'gulp';
import {addReleaseNotesToTag} from './helpers/github-service';
import {log} from 'gulp-util';
const plugins = require('gulp-load-plugins')();
gulp.task('release-zip', () => {
const tagName = process.env.TRAVIS_TAG;
if (!tagName) {
log('Skipping - bec... | import {map} from 'event-stream';
import gulp from 'gulp';
import {addReleaseNotesToTag} from './helpers/github-service';
import {log} from 'gulp-util';
const plugins = require('gulp-load-plugins')();
gulp.task('release-zip', () => {
const tagName = process.env.TRAVIS_TAG;
if (!tagName) {
log('Skipping - bec... |
:new: Add Site info to Config | 'use strict';
const path = require('path');
const cfenv = require('cfenv');
const env = cfenv.getAppEnv();
env.host = env.url.replace(`:${env.port}`, '');
module.exports = {
contentTypes: {
contentTypesHome: {
path: '/content',
title: 'Content Type ALL Landing Page',
desc: 'This is the conte... | 'use strict';
const path = require('path');
const cfenv = require('cfenv');
const env = cfenv.getAppEnv();
env.host = env.url.replace(`:${env.port}`, '');
module.exports = {
contentTypes: {
contentTypesHome: {
path: '/content',
title: 'Content Type ALL Landing Page',
desc: 'This is the conte... |
Adjust example to correct API. | package org.wildfly.swarm.example.docker;
//import lombok.extern.slf4j.Slf4j;
import org.jboss.shrinkwrap.api.ShrinkWrap;
import org.wildfly.swarm.container.Container;
import org.wildfly.swarm.jaxrs.JAXRSArchive;
import org.wildfly.swarm.logging.LoggingFraction;
import org.wildfly.swarm.config.logging.Level;
//@Slf4j... | package org.wildfly.swarm.example.docker;
//import lombok.extern.slf4j.Slf4j;
import org.jboss.shrinkwrap.api.ShrinkWrap;
import org.wildfly.swarm.container.Container;
import org.wildfly.swarm.jaxrs.JAXRSArchive;
import org.wildfly.swarm.logging.LoggingFraction;
//@Slf4j
public class SwarmMain {
public static voi... |
Remove jquery cookie from shim config. | requirejs.config({
baseUrl: 'assets/js',
paths: {
'jquery': '//ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min',
'bootstrap': '//maxcdn.bootstrapcdn.com/bootstrap/3.3.1/js/bootstrap.min',
'underscore': '//cdnjs.cloudflare.com/ajax/libs/underscore.js/1.7.0/underscore-min',
'... | requirejs.config({
baseUrl: 'assets/js',
paths: {
'jquery': '//ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min',
'bootstrap': '//maxcdn.bootstrapcdn.com/bootstrap/3.3.1/js/bootstrap.min',
'underscore': '//cdnjs.cloudflare.com/ajax/libs/underscore.js/1.7.0/underscore-min',
'... |
Use FAIL functions, not CATCH | import Ember from 'ember';
export default Ember.Component.extend({
tagName: 'form',
classNameBindings: [ 'isValid:valid:invalid' ],
cancel: 'cancel',
isValid: Ember.computed.alias('formModel.isValid'),
notify: 'notify',
save: 'save',
showButtons: true,
transitionTo: 'transitionTo',
actions: {
... | import Ember from 'ember';
export default Ember.Component.extend({
tagName: 'form',
classNameBindings: [ 'isValid:valid:invalid' ],
cancel: 'cancel',
isValid: Ember.computed.alias('formModel.isValid'),
notify: 'notify',
save: 'save',
showButtons: true,
transitionTo: 'transitionTo',
actions: {
... |
Fix group toggle not showing | import Polymer from '../polymer';
import hass from '../util/home-assistant-js-instance';
import canToggle from '../util/can-toggle';
require('../components/ha-card');
require('../components/entity/ha-entity-toggle');
require('../state-summary/state-card-content');
const { moreInfoActions } = hass;
export default new... | import Polymer from '../polymer';
import hass from '../util/home-assistant-js-instance';
import canToggle from '../util/can-toggle';
require('../components/ha-card');
require('../components/entity/ha-entity-toggle');
require('../state-summary/state-card-content');
const { moreInfoActions } = hass;
export default new... |
Use t.Errorf instead of t.Error(fmt.Sprintf | package geocoder
import (
"testing"
)
const (
city = "Seattle"
state = "WA"
postalCode = "98104"
seattleLat = 47.603561
seattleLng = -122.329437
)
func TestGeocode(t *testing.T) {
query := "Seattle WA"
lat, lng := Geocode(query)
if lat != seattleLat || lng != seattleLng {
t.Errorf("Expected %f... | package geocoder
import (
"fmt"
"testing"
)
const (
city = "Seattle"
state = "WA"
postalCode = "98104"
seattleLat = 47.603561
seattleLng = -122.329437
)
func TestGeocode(t *testing.T) {
query := "Seattle WA"
lat, lng := Geocode(query)
if lat != seattleLat || lng != seattleLng {
t.Error(fmt.Sp... |
Add logging before storing to datastore. | package org.jboss.pnc.core.builder;
import org.jboss.logging.Logger;
import org.jboss.pnc.model.ProjectBuildResult;
import org.jboss.pnc.spi.builddriver.BuildJobConfiguration;
import org.jboss.pnc.spi.builddriver.BuildJobDetails;
import org.jboss.pnc.spi.datastore.Datastore;
import javax.inject.Inject;
/**
* Create... | package org.jboss.pnc.core.builder;
import org.jboss.pnc.model.ProjectBuildResult;
import org.jboss.pnc.spi.builddriver.BuildJobConfiguration;
import org.jboss.pnc.spi.builddriver.BuildJobDetails;
import org.jboss.pnc.spi.datastore.Datastore;
import javax.inject.Inject;
/**
* Created by <a href="mailto:matejonnet@g... |
Remove dependency on Alias definitions | <?php
namespace Rap2hpoutre\LaravelLogViewer;
use Illuminate\Routing\Controller;
use Illuminate\Support\Facades\File;
use Illuminate\Support\Facades\View;
use Illuminate\Support\Facades\Input;
use Illuminate\Support\Facades\Redirect;
use Illuminate\Support\Facades\Request;
use Illuminate\Support\Facades\Response;
cl... | <?php
namespace Rap2hpoutre\LaravelLogViewer;
use Illuminate\Support\Facades\View;
class LogViewerController extends \Illuminate\Routing\Controller
{
public function index()
{
if (\Input::get('l')) {
LaravelLogViewer::setFile(base64_decode(\Input::get('l')));
}
if (\Input... |
Change comment about Exceptions in execute | package ru.nixan.android.requestloaders;
import android.content.Context;
/**
* Created by nixan on 11/26/13.
*/
public interface IRequest {
/**
* Executes the request.
*/
public void execute(Context context);
/**
* Cancel the executing request
*/
public void ca... | package ru.nixan.android.requestloaders;
import android.content.Context;
/**
* Created by nixan on 11/26/13.
*/
public interface IRequest {
/**
* Executes the request. In case of any error in implemented protocol or actual implementation
* of network stack please throw an exception.
... |
DOC: Document the reason msvc requires SSE2 on 32 bit platforms. | import os
import distutils.msvccompiler
from distutils.msvccompiler import *
from .system_info import platform_bits
class MSVCCompiler(distutils.msvccompiler.MSVCCompiler):
def __init__(self, verbose=0, dry_run=0, force=0):
distutils.msvccompiler.MSVCCompiler.__init__(self, verbose, dry_run, force)
... | import os
import distutils.msvccompiler
from distutils.msvccompiler import *
from .system_info import platform_bits
class MSVCCompiler(distutils.msvccompiler.MSVCCompiler):
def __init__(self, verbose=0, dry_run=0, force=0):
distutils.msvccompiler.MSVCCompiler.__init__(self, verbose, dry_run, force)
... |
Allow replaceItems to be edited with options
Currently cannot change the default replaceItems setting | export default function makeDefaultState (servicePath, options) {
const { idField, autoRemove, paginate, enableEvents, preferUpdate, replaceItems } = options
const state = {
ids: [],
keyedById: {},
copiesById: {},
currentId: null,
copy: null,
idField,
servicePath,
autoRemove,
ena... | export default function makeDefaultState (servicePath, options) {
const { idField, autoRemove, paginate, enableEvents, preferUpdate } = options
const state = {
ids: [],
keyedById: {},
copiesById: {},
currentId: null,
copy: null,
idField,
servicePath,
autoRemove,
enableEvents,
... |
:bug: Fix a presence check of Symbol function | import padStart from './polyfill/padStart';
const THREE_MINUTES = 3 * 60 * 1000;
const privateDateProperty = typeof Symbol === 'function' ?
Symbol('privateDateProperty') : '_privateDateProperty';
function computeEorzeaDate(date) {
const eorzeaTime = new Date();
const unixTime = Math.floor(date.getTime() * 1440 ... | import padStart from './polyfill/padStart';
const THREE_MINUTES = 3 * 60 * 1000;
const privateDateProperty = typeof Symbol !== 'function' ?
Symbol('privateDateProperty') : '_privateDateProperty';
function computeEorzeaDate(date) {
const eorzeaTime = new Date();
const unixTime = Math.floor(date.getTime() * 1440 ... |
Add custom launcher for karma | // Karma configuration file, see link for more information
// https://karma-runner.github.io/1.0/config/configuration-file.html
module.exports = function (config) {
config.set({
basePath: '',
frameworks: ['jasmine', '@angular-devkit/build-angular'],
plugins: [
require('karma-jasmine'),
requir... | // Karma configuration file, see link for more information
// https://karma-runner.github.io/1.0/config/configuration-file.html
module.exports = function (config) {
config.set({
basePath: '',
frameworks: ['jasmine', '@angular-devkit/build-angular'],
plugins: [
require('karma-jasmine'),
requir... |
Fix description in help text | package commands
import (
"fmt"
"github.com/codegangsta/cli"
"github.com/brooklyncentral/brooklyn-cli/api/application"
"github.com/brooklyncentral/brooklyn-cli/command_metadata"
"github.com/brooklyncentral/brooklyn-cli/net"
"github.com/brooklyncentral/brooklyn-cli/scope"
)
type Deploy struct {
network *net.Net... | package commands
import (
"fmt"
"github.com/codegangsta/cli"
"github.com/brooklyncentral/brooklyn-cli/api/application"
"github.com/brooklyncentral/brooklyn-cli/command_metadata"
"github.com/brooklyncentral/brooklyn-cli/net"
"github.com/brooklyncentral/brooklyn-cli/scope"
)
type Deploy struct {
network *net.Net... |
Scale app to fit screen | package com.example.nickj.test;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.webkit.WebView;
import android.content.res.AssetManager;
import java.io.IOException;
import java.io.InputStream;
import org.apache.commons.io.IOUtils;
public class MainActivity extends AppCompat... | package com.example.nickj.test;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.webkit.WebView;
import android.content.res.AssetManager;
import java.io.IOException;
import java.io.InputStream;
import org.apache.commons.io.IOUtils;
public class MainActivity extends AppCompat... |
Fix full reload on specific message. | const serverRouter = require('server-router')
const browserify = require('browserify')
const bankai = require('bankai')
const http = require('http')
const PORT = 8080
const server = http.createServer(createRouter())
server.listen(PORT, () => process.stdout.write(`listening on port ${PORT}\n`))
function createRouter ... | const serverRouter = require('server-router')
const browserify = require('browserify')
const bankai = require('bankai')
const http = require('http')
const PORT = 8080
const server = http.createServer(createRouter())
server.listen(PORT, () => process.stdout.write(`listening on port ${PORT}\n`))
function createRouter ... |
Delete the jobs in tearDown() in tests | #!/usr/bin/env python
import sys
import os
import unittest
from subprocess import Popen, PIPE
ROOT_DIR = os.path.join(os.path.dirname(__file__), "..")
sys.path.append(ROOT_DIR)
from supercron import SuperCron
class RunTests(unittest.TestCase):
"""class that tests supercron for behavior correctness"""
def setUp... | #!/usr/bin/env python
import sys
import os
import unittest
from subprocess import Popen, PIPE
ROOT_DIR = os.path.join(os.path.dirname(__file__), "..")
sys.path.append(ROOT_DIR)
from supercron import SuperCron
class RunTests(unittest.TestCase):
"""class that tests supercron for behavior correctness"""
def setUp... |
Fix bug on unterminated multi-line comment | <?php
// Doctrine (db)
$app['db.options'] = array(
'driver' => 'pdo_pgsql',
'charset' => 'utf8',
'host' => 'ec2-54-83-57-86.compute-1.amazonaws.com',
'port' => '5432',
'dbname' => 'd70b123ck17v74',
'user' => 'yasrxhlztiwpnq',
'password' => 'YT5kh8cYoPq4e9Xa2i2cWWz... | <?php
// Doctrine (db)
$app['db.options'] = array(
'driver' => 'pdo_pgsql',
'charset' => 'utf8',
'host' => 'ec2-54-83-57-86.compute-1.amazonaws.com',
'port' => '5432',
'dbname' => 'd70b123ck17v74',
'user' => 'yasrxhlztiwpnq',
'password' => 'YT5kh8cYoPq4e9Xa2i2cWWz... |
Disable New Relic's apdex metric on non-fetch_snippets views.
New Relic doesn't allow us to set different thresholds for different
pages across the site, so in order to get valuable metrics on the main
view for snippets, fetch_snippets, we need to disable apdex for the
admin interface and public snippets views, which ... | from django.core.urlresolvers import resolve
from snippets.base.views import fetch_snippets
class FetchSnippetsMiddleware(object):
"""
If the incoming request is for the fetch_snippets view, execute the view
and return it before other middleware can run.
fetch_snippets is a very very basic view that... | from django.core.urlresolvers import resolve
from snippets.base.views import fetch_snippets
class FetchSnippetsMiddleware(object):
"""
If the incoming request is for the fetch_snippets view, execute the view
and return it before other middleware can run.
fetch_snippets is a very very basic view that... |
Add ability to "fix" texture | import {
RepeatWrapping,
UVMapping,
NearestFilter,
LinearMipMapLinearFilter,
TextureLoader,
Vector2
} from 'three';
const loader = new TextureLoader();
export class TextureModule {
static load(url) {
return new TextureModule({url}).texture;
}
textures = [];
constructor(...textures) {
tex... | import {
RepeatWrapping,
UVMapping,
NearestFilter,
LinearMipMapLinearFilter,
TextureLoader,
Vector2
} from 'three';
const loader = new TextureLoader();
export class TextureModule {
static load(url) {
return new TextureModule({url}).texture;
}
textures = [];
constructor(...textures) {
tex... |
Exclude node_modules from vue loader | var path = require('path');
var ExtractTextPlugin = require("extract-text-webpack-plugin")
module.exports = {
entry: './src/index.js',
output: {
path: path.resolve(__dirname, 'dist'),
filename: 'bundle.js',
publicPath: '/dist'
},
module: {
loaders: [
{
... | var path = require('path');
var ExtractTextPlugin = require("extract-text-webpack-plugin")
module.exports = {
entry: './src/index.js',
output: {
path: path.resolve(__dirname, 'dist'),
filename: 'bundle.js',
publicPath: '/dist'
},
module: {
loaders: [
{
... |
Add boto to list of installation dependencies | import os
from setuptools import setup
INSTALL_REQUIRES = ['python_cjson', 'requests >=1.0.3', 'boto >=2.20.1']
def read(fname):
return open(os.path.join(os.path.dirname(__file__), fname)).read()
setup(
name = "qds_sdk",
version = "1.0.9_beta",
author = "Qubole",
author_email = "dev@qubole.com",
... | import os
from setuptools import setup
INSTALL_REQUIRES = ['python_cjson', 'requests >=1.0.3']
def read(fname):
return open(os.path.join(os.path.dirname(__file__), fname)).read()
setup(
name = "qds_sdk",
version = "1.0.9_beta",
author = "Qubole",
author_email = "dev@qubole.com",
description =... |
Remove not needed test from PageWrapper | import { shallow } from 'enzyme';
import React from 'react';
import Grid from 'react-bootstrap/lib/Grid';
import PageWrapper from './PageWrapper';
describe('pages/PageWrapper', () => {
const defaultProps = {
className: 'test-page',
title: 'Test title',
};
function getWrapper(extraProps) {
return sh... | import { shallow } from 'enzyme';
import React from 'react';
import Grid from 'react-bootstrap/lib/Grid';
import PageWrapper from './PageWrapper';
describe('pages/PageWrapper', () => {
const defaultProps = {
className: 'test-page',
title: 'Test title',
};
function getWrapper(extraProps) {
return sh... |
Fix a hard-coded version number | from distutils.core import setup # setuptools breaks
# Dynamically calculate the version based on knowledge.VERSION
version_tuple = __import__('rest_hooks').VERSION
version = '.'.join([str(v) for v in version_tuple])
setup(
name = 'django-rest-hooks',
description = 'A powerful mechanism for sending real time ... | from distutils.core import setup # setuptools breaks
# Dynamically calculate the version based on knowledge.VERSION
version_tuple = __import__('rest_hooks').VERSION
version = '1.0.4' #'.'.join([str(v) for v in version_tuple])
setup(
name = 'django-rest-hooks',
description = 'A powerful mechanism for sending r... |
Set the content group weight to 90 | <?php namespace Modules\Menu\Composers;
use Illuminate\Contracts\View\View;
use Maatwebsite\Sidebar\SidebarGroup;
use Maatwebsite\Sidebar\SidebarItem;
use Modules\Core\Composers\BaseSidebarViewComposer;
class SidebarViewComposer extends BaseSidebarViewComposer
{
public function compose(View $view)
{
$... | <?php namespace Modules\Menu\Composers;
use Illuminate\Contracts\View\View;
use Maatwebsite\Sidebar\SidebarGroup;
use Maatwebsite\Sidebar\SidebarItem;
use Modules\Core\Composers\BaseSidebarViewComposer;
class SidebarViewComposer extends BaseSidebarViewComposer
{
public function compose(View $view)
{
$... |
Use regex to test date condition instead | #!/usr/bin/env node
"use strict";
const moment = require("moment");
const sugar = require("sugar");
const chalk = require("chalk");
const exec = require("child_process").exec;
// Throw a fatal error
const fatal = err => {
console.error(`fatal: ${err}`);
}
process.argv.splice(0, 2);
if (process.argv.length === 0) ... | #!/usr/bin/env node
"use strict";
const moment = require("moment");
const sugar = require("sugar");
const chalk = require("chalk");
const exec = require("child_process").exec;
// Throw a fatal error
const fatal = err => {
console.error(`fatal: ${err}`);
}
process.argv.splice(0, 2);
if (process.argv.length > 0) {
... |
Update required DB version to v43 | package com.faforever.api.db;
import com.faforever.api.config.ApplicationProfile;
import org.springframework.context.annotation.Profile;
import org.springframework.core.PriorityOrdered;
import org.springframework.stereotype.Component;
import org.springframework.util.Assert;
import javax.annotation.PostConstruct;
impo... | package com.faforever.api.db;
import com.faforever.api.config.ApplicationProfile;
import org.springframework.context.annotation.Profile;
import org.springframework.core.PriorityOrdered;
import org.springframework.stereotype.Component;
import org.springframework.util.Assert;
import javax.annotation.PostConstruct;
impo... |
Fix CLOUDSTACK-2520: Invoke parent constructor to set result state to
default true to avoid attachVolume error. | /*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you ... | /*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.