text stringlengths 16 4.96k | positive stringlengths 321 2.24k | negative stringlengths 310 2.21k |
|---|---|---|
Revert "Changing our ``coverage`` test dependency to ``django-coverage``."
This reverts commit 68e8555cd2e07c4352ea06121ab262b19b3c2413.
Conflicts:
setup.py | from os.path import abspath, dirname, join, normpath
from setuptools import find_packages, setup
setup(
# Basic package information:
name = 'django-twilio',
version = '0.1',
packages = find_packages(),
# Packaging options:
zip_safe = False,
include_package_data = True,
# Package de... | from os.path import abspath, dirname, join, normpath
from setuptools import find_packages, setup
setup(
# Basic package information:
name = 'django-twilio',
version = '0.1',
packages = find_packages(),
# Packaging options:
zip_safe = False,
include_package_data = True,
# Package de... |
Support for any type of geometry in fit_source. | requirejs(["mapboxgl"], function(mapboxgl) {
var map = window.__jm_maps["{{uuid}}"];
var findBounds = function(bounds, coordinates) {
if (coordinates[0] instanceof Array) {
coordinates.forEach(function(c) {
bounds = findBounds(bounds, c);
});
} else {
... | requirejs(["mapboxgl"], function(mapboxgl) {
var map = window.__jm_maps["{{uuid}}"];
var run = function() {
var source = map.getSource("{{source_uuid}}");
var geojson = source._data;
var coordinates = geojson.features[0].geometry.coordinates[0];
if (coordinates[0] instanceof Arr... |
Change add to return the vector itself, for method chaining | /**
* Creates a new 2 dimensional Vector.
*
* @constructor
* @this {Circle}
* @param {number} x The x value of the new vector.
* @param {number} y The y value of the new vector.
*/
function Vector2(x, y) {
if (typeof x === 'undefined') {
x = 0;
}
if (typeof y === 'undefined') {
y = 0... | /**
* Creates a new 2 dimensional Vector.
*
* @constructor
* @this {Circle}
* @param {number} x The x value of the new vector.
* @param {number} y The y value of the new vector.
*/
function Vector2(x, y) {
if (typeof x === 'undefined') {
x = 0;
}
if (typeof y === 'undefined') {
y = 0... |
Fix CSP error caused by nyc instrumentation
This had been fixed earlier, however the regular expression no longer matched | 'use strict';
const {Transform} = require('stream');
const {createInstrumenter} = require('istanbul-lib-instrument');
const instrumenter = createInstrumenter({
coverageVariable: '__runner_coverage__',
preserveComments: true,
compact: false,
esModules: false,
autoWrap: false,
produceSourceMap: f... | 'use strict';
const {Transform} = require('stream');
const {createInstrumenter} = require('istanbul-lib-instrument');
const instrumenter = createInstrumenter({
coverageVariable: '__runner_coverage__',
preserveComments: true,
compact: false,
esModules: false,
autoWrap: false,
produceSourceMap: f... |
Change the Export label to match style directives | package com.codenvy.ide.ext.datasource.client.sqllauncher;
import com.google.gwt.i18n.client.LocalizableResource.DefaultLocale;
import com.google.gwt.i18n.client.Messages;
@DefaultLocale("en")
public interface SqlRequestLauncherConstants extends Messages {
@DefaultMessage("Open SQL editor")
String menuEntryO... | package com.codenvy.ide.ext.datasource.client.sqllauncher;
import com.google.gwt.i18n.client.LocalizableResource.DefaultLocale;
import com.google.gwt.i18n.client.Messages;
@DefaultLocale("en")
public interface SqlRequestLauncherConstants extends Messages {
@DefaultMessage("Open SQL editor")
String menuEntryO... |
Fix failing test and make lint | import flask
from donut.modules.groups import helpers as groups
def has_permission(user_id, permission_id):
'''
Returns True if [user_id] holds a position that directly
or indirectly (through a position relation) grants
them [permission_id]. Otherwise returns False.
'''
if not (isinstance(u... | import flask
from donut.modules.groups import helpers as groups
def has_permission(user_id, permission_id):
'''
Returns True if [user_id] holds a position that directly
or indirectly (through a position relation) grants
them [permission_id]. Otherwise returns False.
'''
if not (isinstance(u... |
Allow max 20MB file chunks | # Goal: Store settings which can be over-ruled
# using environment variables.
#
# @authors:
# Andrei Sura <sura.andrei@gmail.com>
# Ruchi Vivek Desai <ruchivdesai@gmail.com>
# Sanath Pasumarthy <sanath@ufl.edu>
#
# @TODO: add code to check for valid paths
import os
# Limit the max ... | # Goal: Store settings which can be over-ruled
# using environment variables.
#
# @authors:
# Andrei Sura <sura.andrei@gmail.com>
# Ruchi Vivek Desai <ruchivdesai@gmail.com>
# Sanath Pasumarthy <sanath@ufl.edu>
#
# @TODO: add code to check for valid paths
import os
DB_USER = os.get... |
Improve the GAPI mocks for local development. | // GAPI Hangouts Mocks
var gapi = function(gapi){
// Create the Hangout API
gapi.hangout = function(hangout){
hangout.localParticipant = {
id: '123456',
displayIndex: 0,
person: {
id: '123456',
displayName: 'Test'
}
};
// OnApiReady Mocks
hangout.onApiReady... | // GAPI Hangouts Mocks
var gapi = function(gapi){
// Create the Hangout API
gapi.hangout = function(hangout){
hangout.localParticipant = {
id: '123456',
displayIndex: 0,
person: {
id: '123456',
displayName: 'Test'
}
};
// OnApiReady Mocks
hangout.onApiReady... |
Add forgotten prop check on test | /* global request, describe, it, before */
import '../../setup'
import { app } from '../../../src/lib/app'
const url = 'http://localhost:8181/api/'
describe('app', () => {
before(() => {
// Start app
app({
port: 8181,
lambdas: './test/lambdas'
})
})
it('responds with the correct operat... | /* global request, describe, it, before */
import '../../setup'
import { app } from '../../../src/lib/app'
const url = 'http://localhost:8181/api/'
describe('app', () => {
before(() => {
// Start app
app({
port: 8181,
lambdas: './test/lambdas'
})
})
it('responds with the correct operat... |
Add test for alternate version of cast credit | import wikiquote
import unittest
class QuotesTest(unittest.TestCase):
"""
Test wikiquote.quotes()
"""
def test_disambiguation(self):
self.assertRaises(wikiquote.DisambiguationPageException,
wikiquote.quotes,
'Matrix')
def test_no_such_pa... | import wikiquote
import unittest
class QuotesTest(unittest.TestCase):
"""
Test wikiquote.quotes()
"""
def test_disambiguation(self):
self.assertRaises(wikiquote.DisambiguationPageException,
wikiquote.quotes,
'Matrix')
def test_no_such_pa... |
Allow 'scenario-name' to be null if it does not exist | from flask_restplus import Namespace, Resource, fields, abort
import cea.config
import cea.plots.cache
api = Namespace('Dashboard', description='Dashboard plots')
LAYOUTS = ['row', 'grid', 'map']
CATEGORIES = {c.name: {'label': c.label, 'plots': [{'id': p.id(), 'name': p.name} for p in c.plots]}
for c... | from flask_restplus import Namespace, Resource, fields, abort
import cea.config
import cea.plots.cache
api = Namespace('Dashboard', description='Dashboard plots')
LAYOUTS = ['row', 'grid', 'map']
CATEGORIES = {c.name: {'label': c.label, 'plots': [{'id': p.id(), 'name': p.name} for p in c.plots]}
for c... |
Remove typescript, as it is not compiled by rnpm | /**
* Copyright (c) 2015-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
* @flow
*/... | /**
* Copyright (c) 2015-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
* @flow
*/... |
Check that engine fight files are deleted before test | #!/usr/bin/python
import subprocess, os, sys
if len(sys.argv) < 2:
print('Must specify file names of 2 chess engines')
for i in range(len(sys.argv)):
print(str(i) + ': ' + sys.argv[i])
sys.exit(1)
generator = './' + sys.argv[-2]
checker = './' + sys.argv[-1]
game_file = 'game.pgn'
count = 0
whil... | #!/usr/bin/python
import subprocess, os, sys
if len(sys.argv) < 2:
print('Must specify file names of 2 chess engines')
for i in range(len(sys.argv)):
print(str(i) + ': ' + sys.argv[i])
sys.exit(1)
generator = './' + sys.argv[-2]
checker = './' + sys.argv[-1]
game_file = 'game.pgn'
count = 0
whil... |
Fix detecting css output folder in different jasy versions | # Little helper to allow python modules in current jasylibrarys path
import sys, os.path, inspect
filename = inspect.getframeinfo(inspect.currentframe()).filename
path = os.path.dirname(os.path.abspath(filename))
sys.path.append(path)
import konstrukteur.Konstrukteur
import jasy.asset.Manager
@share
def build(profil... | # Little helper to allow python modules in current jasylibrarys path
import sys, os.path, inspect
filename = inspect.getframeinfo(inspect.currentframe()).filename
path = os.path.dirname(os.path.abspath(filename))
sys.path.append(path)
import konstrukteur.Konstrukteur
import jasy.asset.Manager
@share
def build(profil... |
Update to support new module API
https://github.com/facebook/react-native/commit/bc28a35bda0e358a8296a7b53eb7315b736c6e4b
- modules are no longer plain objects
- `isPolyfill` is now a function
- `id` is now retrieved asynchronously with `getName` | 'use strict';
var path = require('path');
/**
* Extract the React Native module paths
*
* @return {Promise<Object>} A promise which resolves with
* a webpack 'externals' configuration object
*/
function getReactNativeExternals() {
var reactNativeRoot = path.dirname(require.resolve('r... | 'use strict';
var path = require('path');
/**
* Extract the React Native module paths
*
* @return {Promise<Object>} A promise which resolves with
* a webpack 'externals' configuration object
*/
function getReactNativeExternals() {
var reactNativeRoot = path.dirname(require.resolve('r... |
Clear localStorage order variables when order is complete | SpreeStore.module('Checkout',function(Checkout, SpreeStore, Backbone,Marionette,$,_){
Checkout.Controller = {
show: function(state) {
SpreeStore.noSidebar()
order = new SpreeStore.Models.Order({ number: SpreeStore.current_order_id })
order.fetch({
data: $.param({ order_token: SpreeStore.... | SpreeStore.module('Checkout',function(Checkout, SpreeStore, Backbone,Marionette,$,_){
Checkout.Controller = {
show: function(state) {
SpreeStore.noSidebar()
order = new SpreeStore.Models.Order({ number: SpreeStore.current_order_id })
order.fetch({
data: $.param({ order_token: SpreeStore.... |
[PLAT-3891] Exit with -1 status if server failed to start up | /**
* Copyright (C) 2011 - present by OpenGamma Inc. and the OpenGamma group of companies
*
* Please see distribution for license.
*/
package com.opengamma.integration.timeseries.snapshot;
import com.opengamma.component.OpenGammaComponentServer;
/**
* Historical timeseries snapshotter.
*/
public class Historica... | /**
* Copyright (C) 2011 - present by OpenGamma Inc. and the OpenGamma group of companies
*
* Please see distribution for license.
*/
package com.opengamma.integration.timeseries.snapshot;
import com.opengamma.component.OpenGammaComponentServer;
/**
* Historical timeseries snapshotter.
*/
public class Historica... |
Fix getting size into options form | editor.registerElementHandler('spacer', new function() {
Element.apply(this, arguments);
this.editor;
this.getName = function() {
return 'spacer';
};
this.getIcon = function() {
return "fa-arrows-v";
};
this.defaultOptions = { 'size': '25' };
this.getToolbarButtons = function() {
let han... | editor.registerElementHandler('spacer', new function() {
Element.apply(this, arguments);
this.editor;
this.getName = function() {
return 'spacer';
};
this.getIcon = function() {
return "fa-arrows-v";
};
this.defaultOptions = { 'size': '25' };
this.getToolbarButtons = function() {
let han... |
Fix slugify for use without validator | import codecs
from django.core import exceptions
from django.utils import text
import translitcodec
def no_validator(arg):
pass
def slugify(model, field, value, validator=no_validator):
orig_slug = slug = text.slugify(codecs.encode(value, 'translit/long'))[:45]
i = 0
while True:
try:
... | import codecs
from django.core import exceptions
from django.utils import text
import translitcodec
def slugify(model, field, value, validator):
orig_slug = slug = text.slugify(codecs.encode(value, 'translit/long'))[:45]
i = 0
while True:
try:
try:
validator(slug)
... |
Use `_.extend` instead of `Object.assign` in Node code
…to support environments without ES2015 support | module.exports = function bindSassMiddleware (keystone, app) {
// the sass option can be a single path, or array of paths
// when set, we configure the node-sass middleware
var sassPaths = keystone.get('sass');
var sassOptions = keystone.get('sass options') || {};
var debug = require('debug')('keystone:core:bindS... | module.exports = function bindSassMiddleware (keystone, app) {
// the sass option can be a single path, or array of paths
// when set, we configure the node-sass middleware
var sassPaths = keystone.get('sass');
var sassOptions = keystone.get('sass options') || {};
var debug = require('debug')('keystone:core:bindS... |
Include AllValuesQuantizer in external APIs
PiperOrigin-RevId: 320104499 | # Copyright 2019 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | # Copyright 2019 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... |
Fix typo in database migration script. | # Generated by Django 2.2.13 on 2020-11-23 13:44
from django.db import migrations, models
def fill_new_geo_fields(apps, schema_editor):
Offering = apps.get_model('marketplace', 'Offering')
for offering in Offering.objects.all():
if offering.geolocations:
geolocation = offering.geolocation... | # Generated by Django 2.2.13 on 2020-11-23 13:44
from django.db import migrations, models
def fill_new_geo_fields(apps, schema_editor):
Offering = apps.get_model('marketplace', 'Offering')
for offering in Offering.objects.all():
if not offering.geolocations:
geolocation = offering.geoloca... |
Fix small incompatibility with Python 3.2 | from __future__ import absolute_import
import sys
from ast import *
from .version_info import PY2
if PY2 or sys.version_info[1] <= 2:
Try = TryExcept
else:
TryFinally = ()
if PY2:
def argument_names(node):
return [isinstance(arg, Name) and arg.id or None for arg in node.args.args]
def kw_on... | from __future__ import absolute_import
from ast import *
from .version_info import PY2
if PY2:
Try = TryExcept
def argument_names(node):
return [isinstance(arg, Name) and arg.id or None for arg in node.args.args]
def kw_only_argument_names(node):
return []
def kw_only_default_count... |
Disable csrf checks for voting | from django.conf.urls import patterns, url
from django.views.decorators.csrf import csrf_exempt
# for voting
from voting.views import vote_on_object
from bookmarks.models import Bookmark
urlpatterns = patterns('',
url(r'^$', 'bookmarks.views.bookmarks', name="all_bookmarks"),
url(r'^your_bookmarks/$', 'bookma... | from django.conf.urls import patterns, url
# for voting
from voting.views import vote_on_object
from bookmarks.models import Bookmark
urlpatterns = patterns('',
url(r'^$', 'bookmarks.views.bookmarks', name="all_bookmarks"),
url(r'^your_bookmarks/$', 'bookmarks.views.your_bookmarks', name="your_bookmarks"),
... |
Remove duplicate labels from Date fields. | package todomore.android.metawidget;
import java.util.Map;
import org.metawidget.android.widget.AndroidMetawidget;
import org.metawidget.widgetbuilder.iface.WidgetBuilder;
import android.content.Context;
import android.util.Log;
import android.view.View;
import android.widget.EditText;
import android.widget.TextView... | package todomore.android.metawidget;
import java.util.Map;
import org.metawidget.android.widget.AndroidMetawidget;
import org.metawidget.widgetbuilder.iface.WidgetBuilder;
import android.content.Context;
import android.util.Log;
import android.view.View;
import android.widget.EditText;
import android.widget.TextView... |
Fix potential unicode issues with Like.__unicode__() | from django.conf import settings
from django.db import models
from django.utils import timezone
from django.contrib.contenttypes.models import ContentType
from django.contrib.contenttypes import generic
# Compatibility with custom user models, while keeping backwards-compatibility with <1.5
AUTH_USER_MODEL = getattr(... | from django.conf import settings
from django.db import models
from django.utils import timezone
from django.contrib.contenttypes.models import ContentType
from django.contrib.contenttypes import generic
# Compatibility with custom user models, while keeping backwards-compatibility with <1.5
AUTH_USER_MODEL = getattr(... |
Fix pylint errors that snuck into 2015.2 | # -*- coding: utf-8 -*-
'''
A Runner module interface on top of the salt-ssh Python API.
This allows for programmatic use from salt-api, the Reactor, Orchestrate, etc.
'''
# Import Python Libs
from __future__ import absolute_import
# Import Salt Libs
import salt.client.ssh.client
def cmd(
tgt,
fun,... | # utf-8
'''
A Runner module interface on top of the salt-ssh Python API
This allows for programmatic use from salt-api, the Reactor, Orchestrate, etc.
'''
import salt.client.ssh.client
def cmd(
tgt,
fun,
arg=(),
timeout=None,
expr_form='glob',
kwarg=None):
'''
E... |
Add cidata to the list of restricted projects | RESTRICTED_PROJECTS = [
'cidata',
'dubtestproject',
'meson',
'meson-ci',
'mesonbuild.github.io',
'mesonwrap',
'wrapdb',
'wrapdevtools',
'wrapweb',
]
ISSUE_TRACKER = 'wrapdb'
class Inventory:
def __init__(self, organization):
self.organization = organization
sel... | RESTRICTED_PROJECTS = [
'dubtestproject',
'meson',
'meson-ci',
'mesonbuild.github.io',
'mesonwrap',
'wrapdb',
'wrapdevtools',
'wrapweb',
]
ISSUE_TRACKER = 'wrapdb'
class Inventory:
def __init__(self, organization):
self.organization = organization
self.restricted_p... |
Remove SSL warning on CC image | <?php
/**
* The template for displaying the footer
*
* Contains footer content and the closing of the #main and #page div elements.
*
* @package WordPress
* @subpackage Twenty_Fourteen
* @since Twenty Fourteen 1.0
*/
?>
</div><!-- #main -->
<footer id="colophon" class="site-footer" role="contentinfo">
... | <?php
/**
* The template for displaying the footer
*
* Contains footer content and the closing of the #main and #page div elements.
*
* @package WordPress
* @subpackage Twenty_Fourteen
* @since Twenty Fourteen 1.0
*/
?>
</div><!-- #main -->
<footer id="colophon" class="site-footer" role="contentinfo">
... |
Fix assertInternalType deprecation in phpunit 9 | <?php
/*
* This file is part of the Symfony package.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Component\HttpClient\Tests;
use Symfony\Bridge\PhpUnit\ForwardC... | <?php
/*
* This file is part of the Symfony package.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Component\HttpClient\Tests;
use Symfony\Contracts\HttpClient\Te... |
Fix hash tag linking entities | from django import template
from django.contrib.auth.models import User
from django.utils.safestring import mark_safe
import re
import urllib
register = template.Library()
username_re = re.compile('@[0-9a-zA-Z]+')
hashtag_re = re.compile('\b#[^\s]+')
@register.filter
def buglise(s):
s = unicode(s)
usern... | from django import template
from django.contrib.auth.models import User
from django.utils.safestring import mark_safe
import re
import urllib
register = template.Library()
username_re = re.compile('@[0-9a-zA-Z]+')
hashtag_re = re.compile('#[^\s]+')
@register.filter
def buglise(s):
s = unicode(s)
usernam... |
Support ES5
Added isEmptyObject method | var _ = require('underscore');
_.mixin({
offset: function (arr, offset, length) {
var newArr = [];
for (var i = offset; i < offset + length; i++) {
if (!arr[i]) break;
newArr.push(arr[i]);
}
return newArr;
},
iintersection: function (array) {
... | import _ from 'underscore'
_.mixin({
offset: function (arr, offset, length) {
let newArr = [];
for (let i = offset; i < offset + length; i++) {
if (!arr[i]) break;
newArr.push(arr[i]);
}
return newArr;
},
iintersection: function (array, ...rest) {... |
Allow setting the templateCache exported filename | // CI: Angular - Template Cache.js
// ---
// Create a template cache for AngularJS Projects
var gulp = require("gulp");
var gUtil = require("gulp-util");
var templateCache = require("gulp-angular-templatecache");
// Load the build configuration
var config = require("./../config/config.json");
gulp.task("angular:temp... | // CI: Angular - Template Cache.js
// ---
// Create a template cache for AngularJS Projects
var gulp = require("gulp");
var gUtil = require("gulp-util");
var templateCache = require("gulp-angular-templatecache");
// Load the build configuration
var config = require("./../config/config.json");
gulp.task("angular:temp... |
Use route name instead of route path | import Ember from 'ember';
var inject = Ember.inject;
export default Ember.Route.extend({
searchQuery: inject.service(),
history: inject.service(),
beforeModel: function(transition) {
// capture the first page load
this.get('history').capture(transition);
},
actions: {
willTransition: function(... | import Ember from 'ember';
var inject = Ember.inject;
export default Ember.Route.extend({
searchQuery: inject.service(),
history: inject.service(),
beforeModel: function(transition) {
// capture the first page load
this.get('history').capture(transition);
},
actions: {
willTransition: function(... |
Return back separator for Morden since wrong forked peers are still there | package org.ethereum.config.net;
import org.apache.commons.lang3.tuple.Pair;
import org.ethereum.config.blockchain.Eip150HFConfig;
import org.ethereum.config.blockchain.Eip160HFConfig;
import org.ethereum.config.blockchain.MordenConfig;
import org.spongycastle.util.encoders.Hex;
import java.util.Collections;
import j... | package org.ethereum.config.net;
import org.apache.commons.lang3.tuple.Pair;
import org.ethereum.config.blockchain.DaoHFConfig;
import org.ethereum.config.blockchain.Eip150HFConfig;
import org.ethereum.config.blockchain.Eip160HFConfig;
import org.ethereum.config.blockchain.MordenConfig;
import org.spongycastle.util.en... |
Fix was_published_recently reporting polls from the future | from django.db import models
from django.utils import timezone
from datetime import timedelta
class Poll(models.Model):
text = models.CharField(max_length=200)
created_ts = models.DateTimeField()
updated_ts = models.DateTimeField(null=True, default=None)
is_published = models.BooleanField(default=Fals... | from django.db import models
from django.utils import timezone
from datetime import timedelta
class Poll(models.Model):
text = models.CharField(max_length=200)
created_ts = models.DateTimeField()
updated_ts = models.DateTimeField(null=True, default=None)
is_published = models.BooleanField(default=Fals... |
Fix Bin2hex: the length has to include the trailing \0 | package sodium
import "fmt"
import "unsafe"
// #include <stdio.h>
// #include <sodium.h>
import "C"
func MemZero(buff1 []byte) {
if len(buff1) > 0 {
C.sodium_memzero(unsafe.Pointer(&buff1[0]), C.size_t(len(buff1)))
}
}
func MemCmp(buff1, buff2 []byte, length int) int {
if length >= len(buff1) || length >= len(... | package sodium
import "fmt"
import "unsafe"
// #include <stdio.h>
// #include <sodium.h>
import "C"
func MemZero(buff1 []byte) {
if len(buff1) > 0 {
C.sodium_memzero(unsafe.Pointer(&buff1[0]), C.size_t(len(buff1)))
}
}
func MemCmp(buff1, buff2 []byte, length int) int {
if length >= len(buff1) || length >= len(... |
Add generic full board display message method
Currently used successfully by high score win | var DisplayLeaderboard = require('./display-leaderboard');
const templates = require('./message-templates');
const $ = require('jquery');
function DisplayMessage(){
this.element = $('#post-game');
}
DisplayMessage.prototype.showBoardMessage = function(template) {
var div = this.element;
div.empty()
.show()... | var DisplayLeaderboard = require('./display-leaderboard');
const $ = require('jquery');
function DisplayMessage(){
this.element = $('#post-game');
}
DisplayMessage.prototype.showWinMessage = function(){
var div = this.element;
div.empty()
.show()
.append(`<h1>You Win!</h1>
<p>Click to pl... |
Adjust migrate console controller to use a new migration template view file. | <?php
$params = array_merge(
require(__DIR__ . '/../../common/config/params.php'),
require(__DIR__ . '/../../common/config/params-local.php'),
require(__DIR__ . '/params.php'),
require(__DIR__ . '/params-local.php')
);
return [
'id' => 'app-console',
'basePath' => dirname(__DIR__),
'bootstr... | <?php
$params = array_merge(
require(__DIR__ . '/../../common/config/params.php'),
require(__DIR__ . '/../../common/config/params-local.php'),
require(__DIR__ . '/params.php'),
require(__DIR__ . '/params-local.php')
);
return [
'id' => 'app-console',
'basePath' => dirname(__DIR__),
'bootstr... |
Test that the registry's root has a null parent | # Pytest will pick up this module automatically when running just "pytest".
#
# Each test_*() function gets passed test fixtures, which are defined
# in conftest.py. So, a function "def test_foo(bar)" will get a bar()
# fixture created for it.
PROPERTIES_IFACE = 'org.freedesktop.DBus.Properties'
ACCESSIBLE_IFACE = 'o... | # Pytest will pick up this module automatically when running just "pytest".
#
# Each test_*() function gets passed test fixtures, which are defined
# in conftest.py. So, a function "def test_foo(bar)" will get a bar()
# fixture created for it.
PROPERTIES_IFACE = 'org.freedesktop.DBus.Properties'
ACCESSIBLE_IFACE = 'o... |
Fix reset password for MyGFW | import { createThunkAction } from 'utils/redux';
import { FORM_ERROR } from 'final-form';
import { login, register, resetPassword } from 'services/user';
import { getUserProfile } from 'providers/mygfw-provider/actions';
export const loginUser = createThunkAction('logUserIn', data => dispatch =>
login(data)
.th... | import { createThunkAction } from 'utils/redux';
import { FORM_ERROR } from 'final-form';
import { login, register, resetPassword } from 'services/user';
import { getUserProfile } from 'providers/mygfw-provider/actions';
export const loginUser = createThunkAction('logUserIn', data => dispatch =>
login(data)
.th... |
Add model for certificate signing request (CSR)
Clean out view/db_init code from scaffold.
Replace routes from scaffold.
Add pyOpenSSL dependancy to setup.py. | import os
from setuptools import setup, find_packages
here = os.path.abspath(os.path.dirname(__file__))
README = open(os.path.join(here, "README.txt")).read()
CHANGES = open(os.path.join(here, "CHANGES.txt")).read()
requires = [
"pyramid",
"SQLAlchemy",
"transaction",
"pyramid_tm",
"pyramid_debug... | import os
from setuptools import setup, find_packages
here = os.path.abspath(os.path.dirname(__file__))
README = open(os.path.join(here, "README.txt")).read()
CHANGES = open(os.path.join(here, "CHANGES.txt")).read()
requires = [
"pyramid",
"SQLAlchemy",
"transaction",
"pyramid_tm",
"pyramid_debug... |
Update internal version variable to 0.1.2 | function Rye (selector, context) {
if (!(this instanceof Rye)){
return new Rye(selector, context)
}
if (selector instanceof Rye){
return selector
}
var util = Rye.require('Util')
if (typeof selector === 'string') {
this.selector = selector
this.elements = this.... | function Rye (selector, context) {
if (!(this instanceof Rye)){
return new Rye(selector, context)
}
if (selector instanceof Rye){
return selector
}
var util = Rye.require('Util')
if (typeof selector === 'string') {
this.selector = selector
this.elements = this.... |
Change Runable function to RunableB | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package org.lomatek.jslint;
import java.awt.event.ActionListener;
import java.awt.event.ActionEvent;
import org.openide.loaders.DataObject;
import org.openide.awt.ActionRegistration;
import org.openide.awt.ActionRefere... | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package org.lomatek.jslint;
import java.awt.event.ActionListener;
import java.awt.event.ActionEvent;
import org.openide.loaders.DataObject;
import org.openide.awt.ActionRegistration;
import org.openide.awt.ActionRefere... |
Make use of yii::t() on buttons text | <?php
use yii\helpers\Url;
/* @var $this yii\web\View */
$this->title = 'Articles';
?>
<h2>
<a href=<?= Url::to(['article/view', 'id' => $model->id]) ?>><?= $model->title ?></a>
</h2>
<p class="time"><span class="glyphicon glyphicon-time"></span>
<?= Yii::t('app','Published on').' '.date... | <?php
use yii\helpers\Url;
/* @var $this yii\web\View */
$this->title = 'Articles';
?>
<h2>
<a href=<?= Url::to(['article/view', 'id' => $model->id]) ?>><?= $model->title ?></a>
</h2>
<p class="time"><span class="glyphicon glyphicon-time"></span>
Published on <?= date('F j, Y, g:i a', $m... |
Remove print. Tag should be made before publish. | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
import sys
import os
from setuptools import setup
from pathlib import Path
this_dir = Path(__file__).absolute().parent
if sys.argv[-1].startswith('publish'):
if os.system("pip list | grep wheel"):
print("wheel not installed.\nUse `pip install wheel`.\nExiting.... | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
import sys
import os
from setuptools import setup
from pathlib import Path
this_dir = Path(__file__).absolute().parent
if sys.argv[-1].startswith('publish'):
if os.system("pip list | grep wheel"):
print("wheel not installed.\nUse `pip install wheel`.\nExiting.... |
: Create documentation of DataSource Settings
Task-Url: | ######
# Check ExId (GUID) by Email through JDBC
#
# Author: Christoph Stoettner
# Mail: christoph.stoettner@stoeps.de
# Documentation: http://scripting101.stoeps.de
#
# Version: 2.0
# Date: 2014-06-04
#
# License: Apache 2.0
#
# Check ExId of a User in all Connections Appli... | ######
# Check ExId (GUID) by Email through JDBC
#
# Author: Christoph Stoettner
# Mail: christoph.stoettner@stoeps.de
# Documentation: http://scripting101.stoeps.de
#
# Version: 2.0
# Date: 2014-06-04
#
# License: Apache 2.0
#
# Check ExId of a User in all Connections Appli... |
Apply suggested changes on date | from datetime import date, datetime, timedelta
from django.core.exceptions import ValidationError
def validate_approximatedate(date):
if date.month == 0:
raise ValidationError(
'Event date can\'t be a year only. '
'Please, provide at least a month and a year.'
)
def vali... | from datetime import datetime, timedelta
from django.core.exceptions import ValidationError
def validate_approximatedate(date):
if date.month == 0:
raise ValidationError(
'Event date can\'t be a year only. '
'Please, provide at least a month and a year.'
)
def validate_e... |
Add accessory model to accessories | @extends('layouts/edit-form', [
'createText' => trans('admin/accessories/general.create') ,
'updateText' => trans('admin/accessories/general.update'),
'helpTitle' => trans('admin/accessories/general.about_accessories_title'),
'helpText' => trans('admin/accessories/general.about_accessories_text')
])
{... | @extends('layouts/edit-form', [
'createText' => trans('admin/accessories/general.create') ,
'updateText' => trans('admin/accessories/general.update'),
'helpTitle' => trans('admin/accessories/general.about_accessories_title'),
'helpText' => trans('admin/accessories/general.about_accessories_text')
])
{... |
Use .forEach() instead of a for loop for image handling. | var chat = require('../lib/server'),
router = require("../lib/router");
// create chat server and a single channel
var chatServer = chat.createServer();
chatServer.listen(8001);
chatServer.addChannel({ basePath: "/chat" });
// chat app
chatServer.passThru("/", router.staticHandler("index.html"));
// CSS
chatServer.... | var chat = require('../lib/server'),
router = require("../lib/router");
var chatServer = chat.createServer();
chatServer.listen(8001);
chatServer.addChannel({ basePath: "/chat" });
chatServer.passThru("/", router.staticHandler("index.html"));
// CSS
chatServer.passThru("/css/layout.css", router.staticHandler("css/la... |
chore(pins): Update dictionary to same pin as API for Horton
- Update dictionary to the same pin as the API uses | from setuptools import setup, find_packages
setup(
name='gdcdatamodel',
packages=find_packages(),
install_requires=[
'pytz==2016.4',
'graphviz==0.4.2',
'jsonschema==2.5.1',
'psqlgraph',
'gdcdictionary',
'cdisutils',
'python-dateutil==2.4.2',
],
... | from setuptools import setup, find_packages
setup(
name='gdcdatamodel',
packages=find_packages(),
install_requires=[
'pytz==2016.4',
'graphviz==0.4.2',
'jsonschema==2.5.1',
'psqlgraph',
'gdcdictionary',
'cdisutils',
'python-dateutil==2.4.2',
],
... |
Make sure that tray items is a list
This fixes an exception when tray['items'] is None. The same conditional check is added for response['tray']. | from InstagramAPI.src.http.Response.Objects.Item import Item
from InstagramAPI.src.http.Response.Objects.Tray import Tray
from .Response import Response
class ReelsTrayFeedResponse(Response):
def __init__(self, response):
self.trays = None
if self.STATUS_OK == response['status']:
tra... | from InstagramAPI.src.http.Response.Objects.Item import Item
from InstagramAPI.src.http.Response.Objects.Tray import Tray
from .Response import Response
class ReelsTrayFeedResponse(Response):
def __init__(self, response):
self.trays = None
if self.STATUS_OK == response['status']:
tra... |
Fix filter bug on nits | exercism.views.SelectFilter = Backbone.View.extend({
el: $('#pending-submissions'),
events: {
"click #filter-nits": "nitHandler",
"click #filter-opinions": "opinionHandler",
},
initialize: function(options) {
this.listenTo(this.model, "change", this.render);
},
filterNits: function () {
i... | exercism.views.SelectFilter = Backbone.View.extend({
el: $('#pending-submissions'),
events: {
"click #filter-nits": "nitHandler",
"click #filter-opinions": "opinionHandler",
},
initialize: function(options) {
this.listenTo(this.model, "change", this.render);
},
filterNits: function () {
t... |
Add debian endpoint as comment to file. | # This file is part of fedmsg.
# Copyright (C) 2012 Red Hat, Inc.
#
# fedmsg is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.1 of the License, or (at your option) any later version.
#... | # This file is part of fedmsg.
# Copyright (C) 2012 Red Hat, Inc.
#
# fedmsg is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.1 of the License, or (at your option) any later version.
#... |
Add alert message reducer format | import _ from 'lodash';
import {
OPEN_ALERT_MESSAGE,
CLOSE_ALERT_MESSAGE,
} from '../actions/actionTypes';
const initialState = {
show: false,
title: {
th: '',
en: ''
},
messages: {
th: '',
en: '',
},
technical: {
message: '',
code: '',
},
};
const getInitialState = () => ({
... | import _ from 'lodash';
import {
OPEN_ALERT_MESSAGE,
CLOSE_ALERT_MESSAGE,
} from '../actions/actionTypes';
const initialState = {
show: false,
messages: {
th: '',
en: '',
},
technical: {
message: '',
code: '',
},
};
const getInitialState = () => ({
...initialState,
});
export default ... |
Add a test to check the right number of days in 400 year cycles. | from datetime import date as vanilla_date
from calendar_testing import CalendarTest
from calexicon.calendars.other import JulianDayNumber
class TestJulianDayNumber(CalendarTest):
def setUp(self):
self.calendar = JulianDayNumber()
def test_make_date(self):
vd = vanilla_date(2010, 8, 1)
... | from datetime import date as vanilla_date
from calendar_testing import CalendarTest
from calexicon.calendars.other import JulianDayNumber
class TestJulianDayNumber(CalendarTest):
def setUp(self):
self.calendar = JulianDayNumber()
def test_make_date(self):
vd = vanilla_date(2010, 8, 1)
... |
chore(Collective): Add event and events to blacklisted slugs | export const collectiveSlugBlacklist = [
'about',
'admin',
'applications',
'become-a-sponsor',
'chapters',
'collective',
'contact',
'contribute',
'create',
'create-account',
'discover',
'donate',
'edit',
'expenses',
'event',
'events',
'faq',
'gift-card',
'gift-cards',
'gift-cards... | export const collectiveSlugBlacklist = [
'about',
'admin',
'applications',
'become-a-sponsor',
'chapters',
'collective',
'contact',
'contribute',
'create',
'create-account',
'discover',
'donate',
'edit',
'expenses',
'faq',
'gift-card',
'gift-cards',
'gift-cards-next',
'gift-of-givi... |
Update asset loading to be loaded in footer.
Signed-off-by: crynobone <e1a543840a942eb68427510a8a483282a7bfeddf@gmail.com> | <?php namespace Cello;
use \Asset,
\Event,
Orchestra\Acl,
Orchestra\Core as O;
class Core {
/**
* Start your engine.
*
* @static
* @access public
* @return void
*/
public static function start()
{
Acl::make('cello')->attach(O::memory());
// Append all Cello required assets for Orchestra Admin... | <?php namespace Cello;
use \Asset,
\Event,
Orchestra\Acl,
Orchestra\Core as O;
class Core {
/**
* Start your engine.
*
* @static
* @access public
* @return void
*/
public static function start()
{
Acl::make('cello')->attach(O::memory());
// Append all Cello required assets for Orchestra Admin... |
Move main method to top of class | package net.zephyrizing.http_server;
public class HttpServer {
public static void main(String[] args) {
int portNumber;
if (args.length == 1) {
portNumber = Integer.parseInt(args[0]);
} else {
portNumber = 5000;
}
System.err.format("Starting server o... | package net.zephyrizing.http_server;
public class HttpServer {
private HttpServerSocket serveSocket;
private int port;
public HttpServer(HttpServerSocket serveSocket, int port) {
this.serveSocket = serveSocket;
this.port = port;
}
public void listen() {
serveSocket.bind(p... |
Modify example to calculate leaf position | """
Steam and Leaf Plot
-------------------
This example shows how to make a steam and leaf plot.
"""
import altair as alt
import pandas as pd
import numpy as np
np.random.seed(42)
# Generating random data
original_data = pd.DataFrame({'samples':np.array(np.random.normal(50, 15, 100), dtype=np.int)})
# Splitting st... | """
Steam and Leaf Plot
-------------------
This example shows how to make a steam and leaf plot.
"""
import altair as alt
import pandas as pd
import numpy as np
np.random.seed(42)
# Generating Random Data
original_data = pd.DataFrame({'samples':np.array(np.random.normal(50, 15, 100), dtype=np.int)})
# Splitting St... |
Test Jump Search: Test coverage improved to 94.12 | /* eslint-env mocha */
const jumpsearch = require('../../../src').algorithms.Searching.jumpsearch;
const assert = require('assert');
describe('Jump Search', () => {
it('should return -1 for empty array', () => {
const index = jumpsearch([], 1);
assert.equal(index, -1);
});
it('should return -1 for no e... | /* eslint-env mocha */
const jumpsearch = require('../../../src').algorithms.Searching.jumpsearch;
const assert = require('assert');
describe('Jump Search', () => {
it('should return -1 for empty array', () => {
const index = jumpsearch([], 1);
assert.equal(index, -1);
});
it('should return -1 for no e... |
Add support for click and drag position adjustment | /**
* @file Holds all RoboPaint manual/auto painting mode specific code
*/
// Initialize the RoboPaint canvas Paper.js extensions & layer management.
rpRequire('paper_utils')(paper);
rpRequire('paper_hershey')(paper);
// Init defaults & settings
paper.settings.handleSize = 10;
// Animation frame callback
function ... | /**
* @file Holds all RoboPaint manual/auto painting mode specific code
*/
// Initialize the RoboPaint canvas Paper.js extensions & layer management.
rpRequire('paper_utils')(paper);
rpRequire('paper_hershey')(paper);
// Init defaults & settings
paper.settings.handleSize = 10;
// Animation frame callback
function ... |
Fix some component imports that were broken when refactoring them for component splitting | import { importComponent } from 'meteor/vulcan:lib';
importComponent("FieldErrors", () => require('../../components/vulcan-forms/FieldErrors'));
importComponent("FormErrors", () => require('../../components/vulcan-forms/FormErrors'));
importComponent("FormError", () => require('../../components/vulcan-forms/FormError'... | import { importComponent } from 'meteor/vulcan:lib';
importComponent("FieldErrors", () => require('../../components/vulcan-forms/FieldErrors'));
importComponent("FormErrors", () => require('../../components/vulcan-forms/FormErrors'));
importComponent("FormError", () => require('../../components/vulcan-forms/FormError'... |
Remove unused set*(Collection) methods on models | <?php
/*
* This file is part of the Sylius package.
*
* (c) Paweł Jędrzejewski
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Sylius\Component\Channel\Model;
use Doctrine\Common\Collections\Collection;
/**
* Interfa... | <?php
/*
* This file is part of the Sylius package.
*
* (c) Paweł Jędrzejewski
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Sylius\Component\Channel\Model;
use Doctrine\Common\Collections\Collection;
/**
* Interfa... |
Remove unnecessary call to isoWeekday | import moment from "moment";
function initLocale(name, config) {
try {
moment.locale(name, config);
} catch (error) {
throw new Error(
"Locale prop is not in the correct format. \n Locale has to be in form of object, with keys of name and config. " +
error.message
);
}
}
function initM... | import moment from "moment";
function initLocale(name, config) {
try {
moment.locale(name, config);
} catch (error) {
throw new Error(
"Locale prop is not in the correct format. \n Locale has to be in form of object, with keys of name and config. " +
error.message
);
}
}
function initM... |
Update the USER command to take advantage of core capabilities as well | from twisted.words.protocols import irc
from txircd.modbase import Command
class UserCommand(Command):
def onUse(self, user, data):
if not user.username:
user.registered -= 1
user.username = data["ident"]
user.realname = data["gecos"]
if user.registered == 0:
user.register()
def processParams(self, u... | from twisted.words.protocols import irc
from txircd.modbase import Command
class UserCommand(Command):
def onUse(self, user, params):
if user.registered == 0:
self.sendMessage(irc.ERR_ALREADYREGISTRED, ":Unauthorized command (already registered)")
return
if params and len(params) < 4:
user.sendMessage(ir... |
Update default settings to development. | """
WSGI config for job_runner project.
This module contains the WSGI application used by Django's development server
and any production WSGI deployments. It should expose a module-level variable
named ``application``. Django's ``runserver`` and ``runfcgi`` commands discover
this application via the ``WSGI_APPLICATION... | """
WSGI config for job_runner project.
This module contains the WSGI application used by Django's development server
and any production WSGI deployments. It should expose a module-level variable
named ``application``. Django's ``runserver`` and ``runfcgi`` commands discover
this application via the ``WSGI_APPLICATION... |
Refactor out a bare except: statement
It now catches `Redirect.DoesNotExist`, returning the normal 404 page if
no redirect is found. Any other exception should not be caught here. | from django import http
from wagtail.wagtailredirects import models
# Originally pinched from: https://github.com/django/django/blob/master/django/contrib/redirects/middleware.py
class RedirectMiddleware(object):
def process_response(self, request, response):
# No need to check for a redirect for non-404... | from django import http
from wagtail.wagtailredirects import models
# Originally pinched from: https://github.com/django/django/blob/master/django/contrib/redirects/middleware.py
class RedirectMiddleware(object):
def process_response(self, request, response):
# No need to check for a redirect for non-404... |
Use safe load for yaml. | """
This file contains the code needed for dealing with some of the mappings. Usually a map is just a
dictionary that needs to be loaded inside a variable.
This file carries the function to parse the files and the variables containing the dictionaries
themselves.
"""
import yaml
def load_mapping(filename):
"""
... | """
This file contains the code needed for dealing with some of the mappings. Usually a map is just a
dictionary that needs to be loaded inside a variable.
This file carries the function to parse the files and the variables containing the dictionaries
themselves.
"""
import yaml
def load_mapping(filename):
"""
... |
Fix PHP notice from the wrong type hint | <?php
namespace WP_CLI;
use \Composer\DependencyResolver\Rule;
use \Composer\EventDispatcher\Event;
use \Composer\EventDispatcher\EventSubscriberInterface;
use \Composer\Installer\PackageEvent;
use \Composer\Script\ScriptEvents;
use \WP_CLI;
/**
* A Composer Event subscriber so we can keep track of what's happening... | <?php
namespace WP_CLI;
use \Composer\DependencyResolver\Rule;
use \Composer\EventDispatcher\Event;
use \Composer\EventDispatcher\EventSubscriberInterface;
use \Composer\Script\PackageEvent;
use \Composer\Script\ScriptEvents;
use \WP_CLI;
/**
* A Composer Event subscriber so we can keep track of what's happening in... |
Exit the program when the Node.js version is incompatible with The Lounge | #!/usr/bin/env node
"use strict";
process.chdir(__dirname);
// Perform node version check before loading any other files or modules
// Doing this check as soon as possible allows us to avoid ES6 parser errors or
// other issues
// Try to display messages nicely, but gracefully degrade if anything goes wrong
var pkg ... | #!/usr/bin/env node
"use strict";
process.chdir(__dirname);
// Perform node version check before loading any other files or modules
// Doing this check as soon as possible allows us to avoid ES6 parser errors or
// other issues
// Try to display warnings nicely, but gracefully degrade if anything goes wrong
var pkg ... |
Check for articles to convert to speech and upload to amazon every 15 minutes. | <?php namespace App\Console;
use Illuminate\Console\Scheduling\Schedule;
use Illuminate\Foundation\Console\Kernel as ConsoleKernel;
class Kernel extends ConsoleKernel {
/**
* The Artisan commands provided by your application.
*
* @var array
*/
protected $commands = [
'App\Console\Commands\ConvertTo... | <?php namespace App\Console;
use Illuminate\Console\Scheduling\Schedule;
use Illuminate\Foundation\Console\Kernel as ConsoleKernel;
class Kernel extends ConsoleKernel {
/**
* The Artisan commands provided by your application.
*
* @var array
*/
protected $commands = [
'App\Console\Commands\ConvertTo... |
Remove actions from each lemma | "use strict";
import h from "yasmf-h";
import el from "$LIB/templates/el";
import L from "$APP/localization/localization";
import glyph from "$WIDGETS/glyph";
import list from "$WIDGETS/list";
import listItem from "$WIDGETS/listItem";
import listItemContents from "$WIDGETS/listItemContents";
import listItemActions fr... | "use strict";
import h from "yasmf-h";
import el from "$LIB/templates/el";
import L from "$APP/localization/localization";
import glyph from "$WIDGETS/glyph";
import list from "$WIDGETS/list";
import listItem from "$WIDGETS/listItem";
import listItemContents from "$WIDGETS/listItemContents";
import listItemActions fr... |
Use wildcard to also accept e.g. list of `RootElement`s | package de.retest.recheck.ui.descriptors;
import java.util.ArrayList;
import java.util.List;
public class ElementUtil {
private ElementUtil() {}
public static List<Element> flattenAllElements( final List<? extends Element> elements ) {
final List<Element> flattened = new ArrayList<>();
for ( final Element el... | package de.retest.recheck.ui.descriptors;
import java.util.ArrayList;
import java.util.List;
public class ElementUtil {
private ElementUtil() {}
public static List<Element> flattenAllElements( final List<Element> elements ) {
final List<Element> flattened = new ArrayList<>();
for ( final Element element : el... |
[FEATURE] Add new task for generating vhosts | <?php
namespace Deployer;
set('vhost_template', '<VirtualHost *:80>
ServerAdmin webmaster@localhost
DocumentRoot "{{deploy_path}}/current"
<Directory "{{deploy_path}}/current">
Options -Indexes
Options FollowSymLinks MultiViews
AllowOverride all
Order allow,deny
... | <?php
namespace Deployer;
set('vhost_template', '<VirtualHost *:80>
ServerAdmin webmaster@localhost
DocumentRoot "{{deploy_path}}/current"
<Directory "{{deploy_path}}/current">
Options -Indexes FollowSymLinks MultiViews
AllowOverride all
Order allow,deny
Allow from all
... |
Add call static helper method to service context | <?php
/**
*
*/
namespace Mvc5\Service;
use Mvc5\Exception;
final class Context
{
/**
* @var Service
*/
protected static $service;
/**
* @param Service|null $service
*/
function __construct(Service $service = null)
{
$service && $this->bind($service);
}
/**
... | <?php
/**
*
*/
namespace Mvc5\Service;
use Mvc5\Exception;
final class Context
{
/**
* @var Service
*/
protected static $service;
/**
* @param Service|null $service
*/
function __construct(Service $service = null)
{
$service && $this->bind($service);
}
/**
... |
lxd/shutdown: Fix typo in error handling
Signed-off-by: Stéphane Graber <089afc6d81f66f1168a9849e15660feae286e024@ubuntu.com> | package main
import (
"fmt"
"strings"
"time"
"github.com/lxc/lxd/client"
)
func cmdShutdown(args *Args) error {
connArgs := &lxd.ConnectionArgs{
SkipGetServer: true,
}
c, err := lxd.ConnectLXDUnix("", connArgs)
if err != nil {
return err
}
_, _, err = c.RawQuery("PUT", "/internal/shutdown", nil, "")
... | package main
import (
"fmt"
"strings"
"time"
"github.com/lxc/lxd/client"
)
func cmdShutdown(args *Args) error {
connArgs := &lxd.ConnectionArgs{
SkipGetServer: true,
}
c, err := lxd.ConnectLXDUnix("", connArgs)
if err != nil {
return err
}
_, _, err = c.RawQuery("PUT", "/internal/shutdown", nil, "")
... |
Add slug field to Dataset model. Using slugs for API looks better than pk. | from django.db import models
from django.contrib.auth.models import User
class DatasetLicence(models.Model):
title = models.CharField(max_length=255)
short_title = models.CharField(max_length=30)
url = models.URLField()
summary = models.TextField()
updated = models.DateTimeField(auto_now=True)
... | from django.db import models
from django.contrib.auth.models import User
class DatasetLicence(models.Model):
title = models.CharField(max_length=255)
short_title = models.CharField(max_length=30)
url = models.URLField()
summary = models.TextField()
updated = models.DateTimeField(auto_now=True)
... |
Add reconnect/disconnect events to fallback connection. | function build_url(host, command, node = "") {
if( node == "local" ){
return 'http://' + host + '/api/' + encodeURI(command).replace(/#/g, '%23');
} else {
return 'http://' + host + '/api/' + encodeURI(node) + "/" + encodeURI(command).replace(/#/g, '%23');
}
}
class WobserverApiFallback {
constructor(h... | function build_url(host, command, node = "") {
if( node == "local" ){
return 'http://' + host + '/api/' + encodeURI(command).replace(/#/g, '%23');
} else {
return 'http://' + host + '/api/' + encodeURI(node) + "/" + encodeURI(command).replace(/#/g, '%23');
}
}
class WobserverApiFallback {
constructor(h... |
Prepare to supply fixtures from DOM elements | package pl.minidmnv.apple.source.fixture.repository;
import java.util.ArrayList;
import java.util.List;
import java.util.Optional;
import java.util.stream.Collectors;
import org.jsoup.nodes.Document;
import org.jsoup.nodes.Element;
import org.jsoup.select.Elements;
import pl.minidmnv.apple.source.fixture.data.Fixtur... | package pl.minidmnv.apple.source.fixture.repository;
import java.util.ArrayList;
import java.util.List;
import java.util.Optional;
import org.jsoup.nodes.Document;
import org.jsoup.select.Elements;
import pl.minidmnv.apple.source.fixture.data.Fixture;
import pl.minidmnv.apple.source.fixture.repository.picker.FSFixtu... |
Set echo to false; testing to true | 'use strict';
/*
* Copyright 2014 Next Century Corporation
* 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 appl... | 'use strict';
/*
* Copyright 2014 Next Century Corporation
* 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 appl... |
Change the colours of the 'A' and 'G' to make them slightly darker and them more consistent with the colours of the genotypes on the website | // $Revision$
Ensembl.Panel.PopulationGraph = Ensembl.Panel.Piechart.extend({
init: function () {
// Allele colours
this.graphColours = {
'A' : '#00A000',
'T' : '#FF0000',
'G' : '#FFCC00',
'C' : '#0000FF',
'-' : '#000000',
'default' : [ '#0080... | // $Revision$
Ensembl.Panel.PopulationGraph = Ensembl.Panel.Piechart.extend({
init: function () {
// Allele colours
this.graphColours = {
'A' : '#00BB00',
'T' : '#FF0000',
'G' : '#FFD700',
'C' : '#0000FF',
'default' : [ '#222222', '#FF00FF', '#008080', '#... |
Add some debug when playing | #!/usr/bin/env python
import os
import sys
import requests
import re
from bot import RandomBot
SERVER_HOST = 'http://localhost:9000'
trainingState = requests.post(SERVER_HOST + '/api/training/alone').json()
state = trainingState
bot = RandomBot()
def move(url, direction):
r = requests.post(url, {'dir': directi... | #!/usr/bin/env python
import os
import sys
import requests
import re
from bot import RandomBot
SERVER_HOST = 'http://localhost:9000'
trainingState = requests.post(SERVER_HOST + '/api/training/alone').json()
state = trainingState
bot = RandomBot()
def move(url, direction):
r = requests.post(url, {'dir': directi... |
Add lang to global export list. | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright 2011-2014, Nigel Small
#
# 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... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright 2011-2014, Nigel Small
#
# 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... |
Fix for cluster creation dialog | casper.start().loadPage('#clusters');
casper.then(function() {
this.test.comment('Testing cluster list page');
this.test.assertExists('.cluster-list', 'Cluster container exists');
this.test.assertExists('.create-cluster', 'Cluster creation control exists');
});
casper.then(function() {
this.test.comme... | casper.start().loadPage('#clusters');
casper.then(function() {
this.test.comment('Testing cluster list page');
this.test.assertExists('.cluster-list', 'Cluster container exists');
this.test.assertExists('.create-cluster', 'Cluster creation control exists');
});
casper.then(function() {
this.test.comme... |
Fix settings; tests now passing | from . import model
from . import routes
from . import views
MODELS = [model.DropboxUserSettings]
USER_SETTINGS_MODEL = model.DropboxUserSettings
#NODE_SETTINGS_MODEL = model.AddonDropboxNodeSettings
ROUTES = [routes.settings_routes, routes.nonapi_routes, routes.api_routes]
SHORT_NAME = 'dropbox'
FULL_NAME = 'Dropbo... | from . import model
from . import routes
from . import views
MODELS = [model.AddonDropboxUserSettings] # TODO Other models needed? , model.AddonDropboxNodeSettings, model.DropboxGuidFile]
USER_SETTINGS_MODEL = model.AddonDropboxNodeSettings
#NODE_SETTINGS_MODEL = model.AddonDropboxNodeSettings
ROUTES = [routes.setti... |
Add class for competitor info |
// 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... |
// 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... |
Rename extension option to format in view factory | <?php
namespace Perfumer\MVC\View;
use Perfumer\MVC\Bundler\Bundler;
class ViewFactory
{
protected $templating;
/**
* @var Bundler
*/
protected $bundler;
protected $options = [];
public function __construct($templating, Bundler $bundler, $options = [])
{
... | <?php
namespace Perfumer\MVC\View;
use Perfumer\MVC\Bundler\Bundler;
class ViewFactory
{
protected $templating;
/**
* @var Bundler
*/
protected $bundler;
protected $options = [];
public function __construct($templating, Bundler $bundler, $options = [])
{
... |
Check if Xdebug is loaded | <?php
if (!extension_loaded('xdebug')) {
die('The Xdebug extension is not loaded. No code coverage will be generated.');
}
if (!file_exists($strInputFile = $argv[1])) {
throw new InvalidArgumentException('Invalid input file provided');
}
if (!($fltPercentage = min(100,max(0,(int)$argv[2])))) {
throw new I... | <?php
if (!file_exists($strInputFile = $argv[1])) {
throw new InvalidArgumentException('Invalid input file provided');
}
if (!($fltPercentage = min(100,max(0,(int)$argv[2])))) {
throw new InvalidArgumentException('An integer checked percentage must be given as second parameter');
}
$objXml = new SimpleXMLEle... |
Convert dockerd to use cobra and pflag
Signed-off-by: Daniel Nephin <6347c07ae509164cffebfb1e2a0d6ed64958db19@docker.com> | package opts
import (
"fmt"
"net"
)
// IPOpt holds an IP. It is used to store values from CLI flags.
type IPOpt struct {
*net.IP
}
// NewIPOpt creates a new IPOpt from a reference net.IP and a
// string representation of an IP. If the string is not a valid
// IP it will fallback to the specified reference.
func N... | package opts
import (
"fmt"
"net"
)
// IPOpt holds an IP. It is used to store values from CLI flags.
type IPOpt struct {
*net.IP
}
// NewIPOpt creates a new IPOpt from a reference net.IP and a
// string representation of an IP. If the string is not a valid
// IP it will fallback to the specified reference.
func N... |
Fix request_parser services priority compiler pass | <?php
/*
* This file is part of the PostmanGeneratorBundle package.
*
* (c) Vincent Chalamon <vincentchalamon@gmail.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace PostmanGeneratorBundle\DependencyInjection\Compile... | <?php
/*
* This file is part of the PostmanGeneratorBundle package.
*
* (c) Vincent Chalamon <vincentchalamon@gmail.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace PostmanGeneratorBundle\DependencyInjection\Compile... |
Disable timestamps on city model | <?php namespace Octommerce\Octommerce\Models;
use Model;
/**
* City Model
*/
class City extends Model
{
/**
* @var string The database table used by the model.
*/
public $table = 'octommerce_octommerce_cities';
public $timestamps = false;
/**
* @var array Guarded fields
*/
... | <?php namespace Octommerce\Octommerce\Models;
use Model;
/**
* City Model
*/
class City extends Model
{
/**
* @var string The database table used by the model.
*/
public $table = 'octommerce_octommerce_cities';
/**
* @var array Guarded fields
*/
protected $guarded = ['*'];
... |
Fix host and port for Heroku | import os
from flask import Flask
from flask.ext.sqlalchemy import SQLAlchemy
from flask.ext.script import Manager, Server
from flask.ext.migrate import Migrate, MigrateCommand
from flask.ext.heroku import Heroku
# Initialize Application
app = Flask(__name__)
manager = Manager(app)
manager.add_command("runserver", Se... | import os
from flask import Flask
from flask.ext.sqlalchemy import SQLAlchemy
from flask.ext.script import Manager, Server
from flask.ext.migrate import Migrate, MigrateCommand
from flask.ext.heroku import Heroku
# Initialize Application
app = Flask(__name__)
manager = Manager(app)
manager.add_command("runserver", Se... |
Use property function to define buffer | import Em from 'ember';
var get = Em.get;
var copy = Em.copy;
var ArrayPauser = Em.ArrayProxy.extend({
isPaused: false,
buffer: function () {
return Em.A();
}.property(),
addToBuffer: function (idx, removedCount, added) {
var buffer = get(this, 'buffer');
buffer.pushObject([idx, removedCount, added]);
},
... | import Em from 'ember';
var get = Em.get;
var copy = Em.copy;
var ArrayPauser = Em.ArrayProxy.extend({
isPaused: false,
buffer: Em.A(),
addToBuffer: function (idx, removedCount, added) {
var buffer = get(this, 'buffer');
buffer.pushObject([idx, removedCount, added]);
},
clearBuffer: function () {
var buf... |
Make pino output to stderr. | 'use strict';
const Promise = require('bluebird');
const pino = require('pino');
const forIn = require('lodash/forIn');
const Big = require('bignumber.js');
// Configure bluebird
// ----------------------------------------------------
// Make bluebird global
global.Promise = Promise;
// Improve debugging by enablin... | 'use strict';
const Promise = require('bluebird');
const pino = require('pino');
const isPlainObject = require('lodash/isPlainObject');
const wrap = require('lodash/wrap');
const forIn = require('lodash/forIn');
const Big = require('bignumber.js');
// Configure bluebird
// --------------------------------------------... |
[aeolus] Fix search results link issue | /**
* VIEW: Document Summary
*
*/
var template = require('./templates/documentHighlight.tpl');
module.exports = Backbone.Marionette.ItemView.extend({
//--------------------------------------
//+ PUBLIC PROPERTIES / CONSTANTS
//--------------------------------------
tagName: "li",
className: "clearfix"... | /**
* VIEW: Document Summary
*
*/
var template = require('./templates/documentHighlight.tpl');
module.exports = Backbone.Marionette.ItemView.extend({
//--------------------------------------
//+ PUBLIC PROPERTIES / CONSTANTS
//--------------------------------------
tagName: "li",
className: "clearfix"... |
Add space to legend text | export default {
lossLayer: {
// if we want to add this disclaimer (with the hover) to a widget in the legend,
// - type must be 'lossLayer' in the 'legend' section of the layer, OR
// - the layer has to have 'isLossLayer=true' in the metadata.
// For the second case (isLossLayer), type is being overw... | export default {
lossLayer: {
// if we want to add this disclaimer (with the hover) to a widget in the legend,
// - type must be 'lossLayer' in the 'legend' section of the layer, OR
// - the layer has to have 'isLossLayer=true' in the metadata.
// For the second case (isLossLayer), type is being overw... |
Print version on `-v | --version`
Closes #6 | var readJson = require('read-package-json');
var minimist = require('minimist');
var path = require('path');
var url = require('url');
var shields = require('../');
var argv = minimist(process.argv.slice(2), {
alias: {
v: 'version'
}
});
if (argv.version) {
console.log(require('../package.json').version);
... | var readJson = require('read-package-json');
var minimist = require('minimist');
var path = require('path');
var url = require('url');
var shields = require('../');
var argv = minimist(process.argv.slice(2));
// no args
if (!argv._.length) {
var usage = [
'Shield generator for your current project.',
'',
... |
Fix bug so that if the user fails to press change room the app does not break | //handles message function
var SubmitView = Backbone.View.extend({
events: {
'submit' : 'handleSubmit',
'change #lang' : 'changeLanguage',
'click #roomButton' : 'changeRoom'
},
initialize: function(){
this.currRoom = $("#room").val();
},
handleSubmit: function(e){
e.preventDefault();
... | //handles message function
var SubmitView = Backbone.View.extend({
events: {
'submit' : 'handleSubmit',
'change #lang' : 'changeLanguage',
'click #roomButton' : 'changeRoom'
},
initialize: function(){},
handleSubmit: function(e){
e.preventDefault();
var message = {
text: $('#chatInp... |
Debug control flow and exit on errors | #! /usr/bin/python2
from os.path import expanduser,isfile
import sys
from urllib import urlopen
location_path="~/.location"
def location_from_homedir():
if isfile(expanduser(location_path)):
with open(expanduser(location_path)) as f:
return "&".join(f.read().split("\n"))
else:
pri... | #! /usr/bin/python2
from os.path import expanduser,isfile
from sys import argv
from urllib import urlopen
location_path="~/.location"
def location_from_homedir():
if isfile(expanduser(location_path)):
with open(expanduser(location_path)) as f:
return "&".join(f.read().split("\n"))
else:
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.