text stringlengths 17 1.47k | positive stringlengths 673 4.43k | negative stringlengths 677 2.81k |
|---|---|---|
Set option to produce 'div's instead of 'p's
Summary:
Fixes issue with 78eb5ef0, I neglected change the setting.
Test Plan:
Open a perseus exercise, see questions are formatted with 'div's instead
of 'p's.
Auditors: alpert, jack | (function(undefined) {
var Util = require("./util.js");
var Perseus = window.Perseus = {
Util: Util
};
Perseus.init = function(options) {
_.defaults(options, {
// Pass skipMathJax: true if MathJax is already loaded and configured.
skipMathJax: false,
// A function which takes a file o... | (function(undefined) {
var Util = require("./util.js");
var Perseus = window.Perseus = {
Util: Util
};
Perseus.init = function(options) {
_.defaults(options, {
// Pass skipMathJax: true if MathJax is already loaded and configured.
skipMathJax: false,
// A function which takes a file o... |
Update view model life cycle | package com.tehmou.rxbookapp;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import com.tehmou.rxbookapp.data.DataStore;
import com.tehmou.rxbookapp.viewmodels.BookViewModel;
import com.tehmou.rxbookapp.vie... | package com.tehmou.rxbookapp;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import com.tehmou.rxbookapp.data.DataStore;
import com.tehmou.rxbookapp.viewmodels.BookViewModel;
import com.tehmou.rxbookapp.vie... |
Hide software keypad, when open registration form | package com.elpatika.stepic.view;
import android.os.Bundle;
import android.view.View;
import android.widget.RelativeLayout;
import android.widget.Toast;
import com.elpatika.stepic.R;
import com.elpatika.stepic.base.BaseFragmentActivity;
import roboguice.inject.InjectView;
public class RegisterActivity extends Base... | package com.elpatika.stepic.view;
import android.os.Bundle;
import android.view.View;
import android.widget.RelativeLayout;
import android.widget.Toast;
import com.elpatika.stepic.R;
import com.elpatika.stepic.base.BaseFragmentActivity;
import roboguice.inject.InjectView;
public class RegisterActivity extends Base... |
Reorganize tests and make them test more useful things
svn path=/trunk/; revision=738 | # -*- Mode: Python -*-
import os
import unittest
from common import gio, gobject
class TestInputStream(unittest.TestCase):
def setUp(self):
f = open("inputstream.txt", "w")
f.write("testing")
self._f = open("inputstream.txt", "r")
self.stream = gio.unix.InputStream(self._f.filen... | # -*- Mode: Python -*-
import os
import unittest
from common import gio, gobject
class TestInputStream(unittest.TestCase):
def setUp(self):
f = open("inputstream.txt", "w")
f.write("testing")
self._f = open("inputstream.txt", "r")
self.stream = gio.unix.InputStream(self._f.filen... |
Drop python 2.6 support from metadata | import codecs
import re
from os import path
from setuptools import setup
def read(*parts):
file_path = path.join(path.dirname(__file__), *parts)
return codecs.open(file_path).read()
def find_version(*parts):
version_file = read(*parts)
version_match = re.search(r"^__version__ = ['\"]([^'\"]*)['\"]",... | import codecs
import re
from os import path
from setuptools import setup
def read(*parts):
file_path = path.join(path.dirname(__file__), *parts)
return codecs.open(file_path).read()
def find_version(*parts):
version_file = read(*parts)
version_match = re.search(r"^__version__ = ['\"]([^'\"]*)['\"]",... |
Fix trade-type-picker click event leak to asset-picker | import React, { PureComponent } from 'react';
import { Label, DownArrow } from 'binary-components';
import DropDown from '../containers/DropDown';
import { actions } from '../_store';
import AssetPickerContainer from './AssetPickerContainer';
type Props = {
index: number,
selectedSymbol: string,
selectedSy... | import React, { PureComponent } from 'react';
import { Label, DownArrow } from 'binary-components';
import DropDown from '../containers/DropDown';
import { actions } from '../_store';
import AssetPickerContainer from './AssetPickerContainer';
type Props = {
index: number,
selectedSymbol: string,
selectedSy... |
Check for existing configuration in setup command | <?php
namespace Propaganistas\LaravelFakeId\Commands;
use Illuminate\Console\Command;
use Jenssegers\Optimus\Energon;
class FakeIdSetupCommand extends Command
{
/**
* The console command name.
*
* @var string
*/
protected $name = 'fakeid:setup';
/**
* The console command descrip... | <?php
namespace Propaganistas\LaravelFakeId\Commands;
use Illuminate\Console\Command;
use Jenssegers\Optimus\Energon;
class FakeIdSetupCommand extends Command
{
/**
* The console command name.
*
* @var string
*/
protected $name = 'fakeid:setup';
/**
* The console command descrip... |
Comment out narratives email menu item | Ext.define('SlateAdmin.view.progress.NavPanel', {
extend: 'SlateAdmin.view.LinksNavPanel',
xtype: 'progress-navpanel',
title: 'Student Progress',
data: true,
applyData: function(data) {
if (data !== true) {
return data;
}
return [
{
... | Ext.define('SlateAdmin.view.progress.NavPanel', {
extend: 'SlateAdmin.view.LinksNavPanel',
xtype: 'progress-navpanel',
title: 'Student Progress',
data: true,
applyData: function(data) {
if (data !== true) {
return data;
}
return [
{
... |
Remove reliance on queryset based geocoding method | from django.utils.translation import ugettext_lazy as _
from django.contrib.admin import SimpleListFilter
from .utils import bulk_geocode
class GeocodedFilter(SimpleListFilter):
"""
Admin list filter for filtering locations by whether they have
[complete] geolocation data.
"""
title = _('geocoded'... | from django.utils.translation import ugettext_lazy as _
from django.contrib.admin import SimpleListFilter
class GeocodedFilter(SimpleListFilter):
"""
Admin list filter for filtering locations by whether they have
[complete] geolocation data.
"""
title = _('geocoded')
parameter_name = 'geocoded... |
Use in-place operations in ImageNormalize | """
Normalization class for Matplotlib that can be used to produce colorbars.
"""
import numpy as np
from numpy import ma
from matplotlib.colors import Normalize
__all__ = ['ImageNormalize']
class ImageNormalize(Normalize):
def __init__(self, vmin=None, vmax=None, stretch=None, clip=True):
super(Ima... | """
Normalization class for Matplotlib that can be used to produce colorbars.
"""
import numpy as np
from numpy import ma
from matplotlib.colors import Normalize
__all__ = ['ImageNormalize']
class ImageNormalize(Normalize):
def __init__(self, vmin=None, vmax=None, stretch=None, clip=True):
super(Ima... |
Update dependencies so installation is simpler.
The pull request, and a new release of py-moneyed has occurred. | from distutils.core import setup
# Load in babel support, if available.
try:
from babel.messages import frontend as babel
cmdclass = {"compile_catalog": babel.compile_catalog,
"extract_messages": babel.extract_messages,
"init_catalog": babel.init_catalog,
"updat... | from distutils.core import setup
# Load in babel support, if available.
try:
from babel.messages import frontend as babel
cmdclass = {"compile_catalog": babel.compile_catalog,
"extract_messages": babel.extract_messages,
"init_catalog": babel.init_catalog,
"updat... |
Stop importing clearly duplicate operators (like the First Manchester operator without a name) | """
Usage:
./manage.py import_operators < NOC_db.csv
"""
from busstops.management.import_from_csv import ImportFromCSVCommand
from busstops.models import Operator
class Command(ImportFromCSVCommand):
@staticmethod
def get_region_id(region_id):
if region_id in ('ADMIN', 'Admin', ''):
... | """
Usage:
./manage.py import_operators < NOC_db.csv
"""
from busstops.management.import_from_csv import ImportFromCSVCommand
from busstops.models import Operator
class Command(ImportFromCSVCommand):
@staticmethod
def get_region_id(region_id):
if region_id in ('ADMIN', 'Admin', ''):
... |
Add css class to Opt-Out Information link | Kwf.onContentReady(function(body, param) {
if (!param.newRender) return;
// TODO: make default behaviour customizable
if (Kwf.Statistics.getDefaultOptValue() == 'out' && !Kwf.Statistics.issetUserOptValue()) {
var html = '<div class="' + Kwf.Statistics.cssClass + '">';
html += '<div class="in... | Kwf.onContentReady(function(body, param) {
if (!param.newRender) return;
// TODO: make default behaviour customizable
if (Kwf.Statistics.getDefaultOptValue() == 'out' && !Kwf.Statistics.issetUserOptValue()) {
var html = '<div class="' + Kwf.Statistics.cssClass + '">';
html += '<div class="in... |
Use global ioloop as we don't pass test ioloop to tornado redis | # -*- coding: utf-8 -*-
import json
from mock import MagicMock
from tornado.testing import AsyncHTTPTestCase
from insight_reloaded.api import application
from insight_reloaded import __version__ as VERSION
from tornado import ioloop
class InsightApiHTTPTest(AsyncHTTPTestCase):
def get_new_ioloop(self):
... | # -*- coding: utf-8 -*-
import json
from mock import MagicMock
from tornado.testing import AsyncHTTPTestCase
from insight_reloaded.api import application
from insight_reloaded import __version__ as VERSION
class InsightApiHTTPTest(AsyncHTTPTestCase):
def get_app(self):
return application
def test_api... |
Change the log level to debug for File transports | import os from 'os';
const settings = {
backend: {
enable: true,
host: 'localhost',
port: 80,
route: 'api/'
},
livereload: {
enable: false
},
cluster: {
// note. node-inspector cannot debug child (forked) process
enable: false,
maxWork... | import os from 'os';
const settings = {
backend: {
enable: true,
host: 'localhost',
port: 80,
route: 'api/'
},
livereload: {
enable: false
},
cluster: {
// note. node-inspector cannot debug child (forked) process
enable: false,
maxWork... |
Remove fields, users can just use filters | <?php
namespace App\Nova\Actions;
use Laravel\Nova\Fields\Date;
use Laravel\Nova\Actions\Action;
use Illuminate\Support\Collection;
use Laravel\Nova\Fields\ActionFields;
class ExportAttendance extends Action
{
/**
* The displayable name of the action.
*
* @var string
*/
public $name = 'Ex... | <?php
namespace App\Nova\Actions;
use Laravel\Nova\Fields\Date;
use Laravel\Nova\Actions\Action;
use Illuminate\Support\Collection;
use Laravel\Nova\Fields\ActionFields;
class ExportAttendance extends Action
{
/**
* The displayable name of the action.
*
* @var string
*/
public $name = 'Ex... |
Use facade instead of alias | <?php
/*
* This file is part of the EmailChecker package.
*
* (c) Matthieu Moquet <matthieu@moquet.net>
*
* This source file is subject to the MIT license that is bundled
* with this source code in the file LICENSE.
*/
namespace EmailChecker\Laravel;
use EmailChecker\EmailChecker;
use Illuminate\Support\Servi... | <?php
/*
* This file is part of the EmailChecker package.
*
* (c) Matthieu Moquet <matthieu@moquet.net>
*
* This source file is subject to the MIT license that is bundled
* with this source code in the file LICENSE.
*/
namespace EmailChecker\Laravel;
use EmailChecker\EmailChecker;
use Illuminate\Support\Servi... |
Remove last bits of file browser stuff | from django.conf.urls.defaults import patterns, include, url
from django.conf import settings
# Uncomment the next two lines to enable the admin:
from django.contrib import admin
admin.autodiscover()
urlpatterns = patterns('',
url('', include('uqam.cat.urls')),
# Uncomment the admin/doc line below to enable ... | from django.conf.urls.defaults import patterns, include, url
from django.conf import settings
from filebrowser.sites import site
# Uncomment the next two lines to enable the admin:
from django.contrib import admin
admin.autodiscover()
urlpatterns = patterns('',
url('', include('uqam.cat.urls')),
url(r'^admin... |
Add .ico to the allowed extension list. | #!/usr/bin/python
# -*-coding: utf8 -*-
from BaseHTTPServer import BaseHTTPRequestHandler
import mimetypes
from os import curdir, sep
import os
class HttpServerHandler(BaseHTTPRequestHandler):
allowed_extensions = ['.html', '.jpg', '.gif', '.ico', '.js', '.css', '.tff', '.woff']
def has_permission_to_reply... | #!/usr/bin/python
# -*-coding: utf8 -*-
from BaseHTTPServer import BaseHTTPRequestHandler
import mimetypes
from os import curdir, sep
import os
class HttpServerHandler(BaseHTTPRequestHandler):
allowed_extensions = ['.html', '.jpg', '.gif', '.js', '.css', '.tff', '.woff']
def has_permission_to_reply(self, f... |
[IMP] Rename state of SO according to LO and Cost Estimate | # -*- coding: utf-8 -*-
from openerp.osv import orm, fields
class sale_order(orm.Model):
_inherit = 'sale.order'
_columns = {
# override only to change the 'string' argument
# from 'Customer' to 'Requesting Entity'
'partner_id': fields.many2one(
'res.partner',
... | # -*- coding: utf-8 -*-
from openerp.osv import orm, fields
class sale_order(orm.Model):
_inherit = 'sale.order'
_columns = {
# override only to change the 'string' argument
# from 'Customer' to 'Requesting Entity'
'partner_id': fields.many2one(
'res.partner',
... |
Update default pushTo option of grunt-bump | /*global module:false*/
module.exports = function(grunt) {
// Project configuration.
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
// Task configuration.
jshint: {
options: {
curly: true,
eqeqeq: true,
immed: true,
latedef: true,
newcap: true... | /*global module:false*/
module.exports = function(grunt) {
// Project configuration.
grunt.initConfig({
// Task configuration.
jshint: {
options: {
curly: true,
eqeqeq: true,
immed: true,
latedef: true,
newcap: true,
noarg: true,
sub: true,
... |
Fix java client to accept new parameters | package io.aigar.game.models;
import com.fasterxml.jackson.annotation.JsonIgnore;
import java.util.List;
public class GameState {
private int id;
private int tick;
private boolean paused;
private boolean disabledLeaderboard;
private int multiplier;
private float timeLeft;
private List<Pla... | package io.aigar.game.models;
import com.fasterxml.jackson.annotation.JsonIgnore;
import java.util.List;
public class GameState {
private int id;
private int tick;
private boolean paused;
private int multiplier;
private float timeLeft;
private List<Player> players;
private Resources resou... |
Adjust to match modern style conventions. | # This is just a kludge so that bdist_rpm doesn't guess wrong about the
# distribution name and version, if the egg_info command is going to alter
# them, another kludge to allow you to build old-style non-egg RPMs.
from distutils.command.bdist_rpm import bdist_rpm as _bdist_rpm
class bdist_rpm(_bdist_rpm):
def ... | # This is just a kludge so that bdist_rpm doesn't guess wrong about the
# distribution name and version, if the egg_info command is going to alter
# them, another kludge to allow you to build old-style non-egg RPMs.
from distutils.command.bdist_rpm import bdist_rpm as _bdist_rpm
class bdist_rpm(_bdist_rpm):
def ... |
:new: Set websocket retry interval to 5 seconds | 'use babel'
import {CompositeDisposable, Emitter} from 'atom'
import {readFile} from './helpers'
import WebSocket from 'reconnectingwebsocket'
export default class Connection {
constructor(projectPath, manifest) {
this.subscriptions = new CompositeDisposable()
this.emitter = new Emitter()
this.projectPa... | 'use babel'
import {CompositeDisposable, Emitter} from 'atom'
import {readFile} from './helpers'
import WebSocket from 'reconnectingwebsocket'
export default class Connection {
constructor(projectPath, manifest) {
this.subscriptions = new CompositeDisposable()
this.emitter = new Emitter()
this.projectPa... |
Fix debug plugin to simulate notifications more reliably | enabled(){
this.isDebugging = false;
this.onKeyDown = (e) => {
// ==========================
// F4 key - toggle debug mode
// ==========================
if (e.keyCode === 115){
this.isDebugging = !this.isDebugging;
$(".app-title").first().css("background-color", this.isDebugging ... | enabled(){
this.isDebugging = false;
this.onKeyDown = (e) => {
// ==========================
// F4 key - toggle debug mode
// ==========================
if (e.keyCode === 115){
this.isDebugging = !this.isDebugging;
$(".app-title").first().css("background-color", this.isDebugging ... |
Use ceil() instead of floor() for midpoint calculation
This allows us to drop the if (start === length) kludge, while ensuring that
text.slice(0, end) is tested, fixing an off-by-one error that occurs when the
loop ends with (end - start) == 1. | (function($) {
$.fn.ellipsis = function(options) {
// デフォルトオプション
var defaults = {
'row' : 1, // 省略行数
'char' : '...' // 省略文字
};
options = $.extend(defaults, options);
this.each(function() {
// 現在のテキストを取得
var $this = $(this);
... | (function($) {
$.fn.ellipsis = function(options) {
// デフォルトオプション
var defaults = {
'row' : 1, // 省略行数
'char' : '...' // 省略文字
};
options = $.extend(defaults, options);
this.each(function() {
// 現在のテキストを取得
var $this = $(this);
... |
Add Link in front page | import React from 'react'
import { Link } from 'react-router-dom'
import 'isomorphic-fetch';
class FrontPage extends React.Component {
constructor() {
super();
this.state = {};
}
componentDidMount() {
fetch('https://199911.github.io/blog-data/front-page.json')
.then((res) => (res.json()))
.th... | import React from 'react'
import 'isomorphic-fetch';
class HelloMessage extends React.Component {
constructor() {
super();
this.state = {};
}
componentDidMount() {
fetch('https://199911.github.io/blog-data/front-page.json')
.then((res) => (res.json()))
.then((posts) => {
this.setState... |
Add emptyBookmark and fix bugs in history module | define(['summernote/core/range'], function (range) {
/**
* History
* @class
*/
var History = function () {
var stack = [], stackOffset = 0;
var makeSnapshot = function ($editable) {
var editable = $editable[0];
var rng = range.create();
var emptyBookmark = {s: {path: [0], offset:... | define(['summernote/core/range'], function (range) {
/**
* History
* @class
*/
var History = function () {
var stack = [], stackOffset = 0;
var makeSnapshot = function ($editable) {
var editable = $editable[0];
var rng = range.create();
return {
contents: $editable.html(... |
Add debug print of data | from __future__ import print_function
import boto3
import json
import os
import btr3baseball
jobTable = os.environ['JOB_TABLE']
jobQueue = os.environ['JOB_QUEUE']
queue = boto3.resource('sqs').get_queue_by_name(QueueName=jobQueue)
jobRepo = btr3baseball.JobRepository(jobTable)
dsRepo = btr3baseball.DatasourceReposito... | from __future__ import print_function
import boto3
import json
import os
import btr3baseball
jobTable = os.environ['JOB_TABLE']
jobQueue = os.environ['JOB_QUEUE']
queue = boto3.resource('sqs').get_queue_by_name(QueueName=jobQueue)
jobRepo = btr3baseball.JobRepository(jobTable)
dsRepo = btr3baseball.DatasourceReposito... |
Disable fuzzy output in po2json for disco | /*
* This is the default (production) config for the discovery pane app.
*/
const amoCDN = 'https://addons.cdn.mozilla.net';
const staticHost = 'https://addons-discovery.cdn.mozilla.net';
module.exports = {
// The keys listed here will be exposed on the client.
// Since by definition client-side code is public ... | /*
* This is the default (production) config for the discovery pane app.
*/
const amoCDN = 'https://addons.cdn.mozilla.net';
const staticHost = 'https://addons-discovery.cdn.mozilla.net';
module.exports = {
// The keys listed here will be exposed on the client.
// Since by definition client-side code is public ... |
Fix | Adicionando status code na validação do token | var ormDic = require('../../util/ormDic');
class OrmProxy {
constructor() {
this._orm = null;
}
setOrm(string) {
this._orm = ormDic[string];
}
add(req, res) {
if (req.headers.token === null || req.headers.token !== 'mps10') {
var response = {};
resp... | var ormDic = require('../../util/ormDic');
class OrmProxy {
constructor() {
this._orm = null;
}
setOrm(string) {
this._orm = ormDic[string];
}
add(req, res) {
if (req.headers.token === null || req.headers.token !== 'mps10') {
var response = {};
resp... |
Allow cursorColor override in config
The default cursorColor for this theme is quite low-contrast (especially when opting for `cursorShape: 'UNDERLINE'|'BEAM'`). I think allowing the user to specify their preferred cursor color would be ideal. | exports.decorateConfig = (config) => {
return Object.assign({}, config, {
foregroundColor: '#ECEFF1',
backgroundColor: '#263238',
borderColor: '#222d32',
cursorColor: config.cursorColor || 'rgba(0, 150, 136, .5)',
colors: {
black: '#263238',
red: '#FF5252',
green: '#9CCC65',
... | exports.decorateConfig = (config) => {
return Object.assign({}, config, {
foregroundColor: '#ECEFF1',
backgroundColor: '#263238',
borderColor: '#222d32',
cursorColor: 'rgba(0, 150, 136, .5)',
colors: {
black: '#263238',
red: '#FF5252',
green: '#9CCC65',
yellow: '#fee94e',
... |
TEST: Update test that relies on fragile string comparison
It is a string comparison of formulae. The new output differs from the
reference in terms of whitespace and redundant parens. | import logging
logging.basicConfig(level=logging.DEBUG)
logging.getLogger('tulip.ltl_parser_log').setLevel(logging.ERROR)
from nose.tools import raises
#from tulip.spec.parser import parse
from tulip import spec
from tulip.spec import translation as ts
from tulip.spec import form
def test_translate_ast_to_gr1c():
... | import logging
logging.basicConfig(level=logging.DEBUG)
logging.getLogger('tulip.ltl_parser_log').setLevel(logging.ERROR)
from nose.tools import raises
#from tulip.spec.parser import parse
from tulip import spec
from tulip.spec import translation as ts
from tulip.spec import form
def test_translate_ast_to_gr1c():
... |
Allow enabling OR disabling resource blocking when calling fetchPageContent | /* eslint no-console: 0 */
'use strict';
const phantom = require('phantom');
function* blockResourceLoading(page) {
yield page.property('onResourceRequested', function(requestData, request) {
var BLOCKED_RESOURCES = [
/\.gif/gi,
/\.png/gi,
/\.css/gi,
/^((?!... | /* eslint no-console: 0 */
'use strict';
const phantom = require('phantom');
function* blockResourceLoading(page) {
yield page.property('onResourceRequested', function(requestData, request) {
var BLOCKED_RESOURCES = [
/\.gif/gi,
/\.png/gi,
/\.css/gi,
/^((?!... |
Add getTime as default wit action in boilerplate | const moment = require('moment');
const weather = require('./weather');
const actions = {
getWeather: (data) => new Promise((resolve, reject) => {
const context = data.context;
const entities = data.entities;
const missingLocation = entities.location === undefined;
const location = entities.location... | const moment = require('moment');
const weather = require('./weather');
const actions = {
getWeather: (data) => new Promise((resolve, reject) => {
const context = data.context;
const entities = data.entities;
const missingLocation = entities.location === undefined;
const location = entities.location... |
Rename variable to conform to naming convention | "use strict";
var request = require('request-promise');
const baseUrl = 'https://api.yelp.com/v3/';
class Yelpv3 {
constructor(opts) {
this.api_key = opts.api_key;
}
get(resource, params) {
params = (typeof params === 'undefined') ? {} : params;
return request({
... | "use strict";
var request = require('request-promise');
const baseUrl = 'https://api.yelp.com/v3/';
class Yelpv3 {
constructor(opts) {
this.apiKey = opts.apiKey;
}
get(resource, params) {
params = (typeof params === 'undefined') ? {} : params;
return request({
u... |
Rename 'name' argument to 'filename' |
from django import template
from django.utils.safestring import mark_safe
from ..processors import AssetRegistry
register = template.Library()
class AssetsNode(template.Node):
def __init__(self, nodelist):
self.nodelist = nodelist
def render(self, context):
context.render_context['AMN'] ... |
from django import template
from django.utils.safestring import mark_safe
from ..processors import AssetRegistry
register = template.Library()
class AssetsNode(template.Node):
def __init__(self, nodelist):
self.nodelist = nodelist
def render(self, context):
context.render_context['AMN'] ... |
Change from /prev to /v1 | var Chalk = require('chalk');
var Cli = require('structured-cli');
var Open = require('opn');
module.exports = Cli.createCommand('edit', {
description: 'Edit this webtask in your browser',
plugins: [
require('./_plugins/profile'),
],
params: {
'name': {
description: 'The na... | var Chalk = require('chalk');
var Cli = require('structured-cli');
var Open = require('opn');
module.exports = Cli.createCommand('edit', {
description: 'Edit this webtask in your browser',
plugins: [
require('./_plugins/profile'),
],
params: {
'name': {
description: 'The na... |
Add dependency on having psutil available. | from __future__ import print_function
from setuptools import setup
setup_kwargs = dict(
name = 'mod_wsgi-metrics',
version = '1.1.0',
description = 'Metrics package for Apache/mod_wsgi.',
author = 'Graham Dumpleton',
author_email = 'Graham.Dumpleton@gmail.com',
maintainer = 'Graham Dumpleton',... | from __future__ import print_function
from setuptools import setup
setup_kwargs = dict(
name = 'mod_wsgi-metrics',
version = '1.1.0',
description = 'Metrics package for Apache/mod_wsgi.',
author = 'Graham Dumpleton',
author_email = 'Graham.Dumpleton@gmail.com',
maintainer = 'Graham Dumpleton',... |
Fix for missing optionalSettings in overriden googleChartApiConfig value
At present one must always include optionalSettings:{} in the overriden googleChartApiConfig even when node optional settings are needed. | /* global angular */
(function(){
angular.module('googlechart')
.factory('googleChartApiPromise', googleChartApiPromiseFactory);
googleChartApiPromiseFactory.$inject = ['$rootScope', '$q', 'googleChartApiConfig', 'googleJsapiUrl'];
function googleChartApiPromiseFactory($rootScope, ... | /* global angular */
(function(){
angular.module('googlechart')
.factory('googleChartApiPromise', googleChartApiPromiseFactory);
googleChartApiPromiseFactory.$inject = ['$rootScope', '$q', 'googleChartApiConfig', 'googleJsapiUrl'];
function googleChartApiPromiseFactory($rootScope, ... |
Add glyphicon with remove icon in case of failure | /**!
* AngularJS Ladda directive
* @author Chungsub Kim <subicura@subicura.com>
*/
/* global Ladda */
(function () {
'use strict';
angular.module('angular-ladda', []).directive(
'ladda',
[
'$compile',
function ($compile) {
return {
restrict: 'A',
link: function (... | /**!
* AngularJS Ladda directive
* @author Chungsub Kim <subicura@subicura.com>
*/
/* global Ladda */
(function () {
'use strict';
angular.module('angular-ladda', []).directive(
'ladda',
[
'$compile',
function ($compile) {
return {
restrict: 'A',
link: function (... |
Add comment on HOG calculations | """Tests for module gramcore.features.descriptors"""
import numpy
from nose.tools import assert_equal
from gramcore.features import descriptors
def test_hog_size():
"""Create a fixture and check hog result size
There are already enough tests in skimage for this, just adding so to
document how many valu... | """Tests for module gramcore.features.descriptors"""
import numpy
from nose.tools import assert_equal
from gramcore.features import descriptors
def test_hog_size():
"""Create a fixture and check hog result size
There are already enough tests in skimage for this, just adding so to
document how many valu... |
Fix invalid bitmask for release archives | var eventStream = require('event-stream'),
gulp = require('gulp'),
chmod = require('gulp-chmod'),
zip = require('gulp-zip'),
tar = require('gulp-tar'),
gzip = require('gulp-gzip'),
rename = require('gulp-rename');
gulp.task('prepare-release', function() {
var version = require('./package.js... | var eventStream = require('event-stream'),
gulp = require('gulp'),
chmod = require('gulp-chmod'),
zip = require('gulp-zip'),
tar = require('gulp-tar'),
gzip = require('gulp-gzip'),
rename = require('gulp-rename');
gulp.task('prepare-release', function() {
var version = require('./package.js... |
Hide AbstractMethod class from the docs. | #!/usr/bin/env python
# Generates the *public* API documentation.
# Remember to hide your private parts, people!
import os, re, sys
project = 'Exscript'
base_dir = os.path.join('..', 'src', project)
doc_dir = 'api'
# Create the documentation directory.
if not os.path.exists(doc_dir):
os.makedirs(doc_dir)
# Gen... | #!/usr/bin/env python
# Generates the *public* API documentation.
# Remember to hide your private parts, people!
import os, re, sys
project = 'Exscript'
base_dir = os.path.join('..', 'src', project)
doc_dir = 'api'
# Create the documentation directory.
if not os.path.exists(doc_dir):
os.makedirs(doc_dir)
# Gen... |
Fix missing return statement in getUserByIdentifier | <?php
namespace Auth0\Login\Repository;
use Auth0\Login\Auth0User;
use Auth0\Login\Auth0JWTUser;
use Auth0\Login\Contract\Auth0UserRepository as Auth0UserRepositoryContract;
use Illuminate\Contracts\Auth\Authenticatable;
class Auth0UserRepository implements Auth0UserRepositoryContract
{
/**
* @param array $... | <?php
namespace Auth0\Login\Repository;
use Auth0\Login\Auth0User;
use Auth0\Login\Auth0JWTUser;
use Auth0\Login\Contract\Auth0UserRepository as Auth0UserRepositoryContract;
use Illuminate\Contracts\Auth\Authenticatable;
class Auth0UserRepository implements Auth0UserRepositoryContract
{
/**
* @param array $... |
Add L5.1 fallback to system test provider seed | <?php
namespace Tests\System\AlgoWeb\PODataLaravel;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Support\ServiceProvider as BaseServiceProvider;
class TestServiceProvider extends BaseServiceProvider
{
protected $defer = false;
public function register()
{
require_once(__DIR__ . DIRECT... | <?php
namespace Tests\System\AlgoWeb\PODataLaravel;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Support\ServiceProvider as BaseServiceProvider;
class TestServiceProvider extends BaseServiceProvider
{
protected $defer = false;
public function register()
{
require_once(__DIR__ . DIRECT... |
Fix initial action to include a type | import {
BehaviorSubject,
ReplaySubject
} from 'rx'
export default function createDispatcher() {
const dispatcher = new ReplaySubject()
dispatcher.onNext({ type: '_INIT_' }) // Initialisation action
const identifier = Symbol()
const cache = []
const state = []
// Extend Observable with our Dispatcher... | import {
BehaviorSubject,
ReplaySubject
} from 'rx'
export default function createDispatcher() {
const dispatcher = new ReplaySubject()
dispatcher.onNext(null) // Initialisation action
const identifier = Symbol()
const cache = []
const state = []
// Extend Observable with our Dispatcher methods
con... |
Update problem 55 (stil TLE) | package leetcode;
import java.util.HashSet;
import java.util.Set;
import java.util.Stack;
public class Problem55 {
public boolean canJump(int[] nums) {
Stack<Integer> stack = new Stack<>();
Set<Integer> set = new HashSet<>();
stack.add(0);
while (!stack.isEmpty()) {
int... | package leetcode;
public class Problem55 {
public boolean canJump(int[] nums) {
if (nums.length == 1) {
return true;
}
for (int i = 0; i < nums.length; i++) {
if (canJump(nums, i)) {
return true;
}
}
return false;
}
... |
admin_programme: Add active field to form. | # -*- coding: utf-8 -*-
from django import forms
from crispy_forms.helper import FormHelper
from crispy_forms.layout import Submit, Layout, Fieldset, ButtonHolder
from Instanssi.ext_programme.models import ProgrammeEvent
class ProgrammeEventForm(forms.ModelForm):
def __init__(self, *args, **kwargs):
super... | # -*- coding: utf-8 -*-
from django import forms
from crispy_forms.helper import FormHelper
from crispy_forms.layout import Submit, Layout, Fieldset, ButtonHolder
from Instanssi.ext_programme.models import ProgrammeEvent
class ProgrammeEventForm(forms.ModelForm):
def __init__(self, *args, **kwargs):
super... |
Test incorrect creation of attributes. | describe("Species", function() {
var Human, bob;
beforeEach(function() {
Human = Species({
bringToLife: function() {
this.wings = "Yes! now I can fly"; // no you can't. defining attributes here won't work.
return function(name) {
this.name = name;
this.sayName = functi... | describe("Species;", function() {
var Human, bob;
beforeEach(function() {
Human = Species({
bringToLife: function() {
return function(name) {
this.name = name;
this.sayName = function() {
return "My name is " + this.name;
}
}
}
});
... |
Bring ZF2 error into view | define([
"intern!object",
"intern/chai!assert",
"require",
"tests/support/helper"
], function ( registerSuite, assert, require, testHelper ) {
var signIn = testHelper.getAppUrl( "admin/signin" );
var mainPage = testHelper.getAppUrl( "" );
registerSuite({
name: "Main page."... | define([
"intern!object",
"intern/chai!assert",
"require",
"tests/support/helper"
], function ( registerSuite, assert, require, testHelper ) {
var signIn = testHelper.getAppUrl( "admin/signin" );
var mainPage = testHelper.getAppUrl( "" );
registerSuite({
name: "Main page."... |
Update the admin interface and demo site generator
Update the admin interface to feature a fully responsive, fully retina, cleaned up look and feel based on Bootstrap 3. Simultaniously updated the generated demo site to be more in line with what we use as a starting point for our websites.
While this commit is squash... | <?php
namespace Kunstmaan\SeoBundle\Form;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\OptionsResolver\OptionsResolverInterface;
/**
* SeoType
*/
class SeoType extends AbstractType
{
/**
* @param FormBuilderInterface $builder
* @param... | <?php
namespace Kunstmaan\SeoBundle\Form;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\OptionsResolver\OptionsResolverInterface;
/**
* SeoType
*/
class SeoType extends AbstractType
{
/**
* @param FormBuilderInterface $builder
* @param... |
Switch to a Python3 Compataible open + read + exec vs execfile | #!/usr/bin/env python
# Support setuptools or distutils
try:
from setuptools import setup, find_packages
except ImportError:
from distutils.core import setup
# Version info -- read without importing
_locals = {}
with open('invocations/_version.py') as fp:
exec(fp.read(), None, _locals)
version = _locals['... | #!/usr/bin/env python
# Support setuptools or distutils
try:
from setuptools import setup, find_packages
except ImportError:
from distutils.core import setup
# Version info -- read without importing
_locals = {}
version_module = execfile('invocations/_version.py', _locals)
version = _locals['__version__']
se... |
Move password service to factories | <?php
namespace GoalioForgotPassword;
use Zend\Loader\StandardAutoloader;
use Zend\Loader\AutoloaderFactory;
use Zend\Mvc\ModuleRouteListener;
class Module {
public function getAutoloaderConfig() {
return array(
AutoloaderFactory::STANDARD_AUTOLOADER => array(
StandardAutoload... | <?php
namespace GoalioForgotPassword;
use Zend\Loader\StandardAutoloader;
use Zend\Loader\AutoloaderFactory;
use Zend\Mvc\ModuleRouteListener;
class Module {
public function getAutoloaderConfig() {
return array(
AutoloaderFactory::STANDARD_AUTOLOADER => array(
StandardAutoload... |
Correct the usage of title as a component
Documentation for this feature can be found [here](https://github.com/nfl/react-helmet#as-react-components) | import React from 'react'
import Helmet from 'react-helmet'
import { prefixLink } from 'gatsby-helpers'
const BUILD_TIME = new Date().getTime()
module.exports = React.createClass({
displayName: 'HTML',
propTypes: {
body: React.PropTypes.string,
},
render() {
const {body, route} = this.... | import React from 'react'
import Helmet from 'react-helmet'
import { prefixLink } from 'gatsby-helpers'
const BUILD_TIME = new Date().getTime()
module.exports = React.createClass({
displayName: 'HTML',
propTypes: {
body: React.PropTypes.string,
},
render() {
const {body, route} = this.... |
Add note in hog test doc string | """Tests for module gramcore.features.descriptors"""
import numpy
from nose.tools import assert_equal
from gramcore.features import descriptors
def test_hog_size():
"""Create a fixture and check hog result size
There are already enough tests in skimage for this, just adding so to
document how many valu... | """Tests for module gramcore.features.descriptors"""
import numpy
from nose.tools import assert_equal
from gramcore.features import descriptors
def test_hog_size():
"""Create a fixture and check hog result size
Creates a square array and inputs it to hog. For simplicity the
blocks and the cells are squ... |
Add module for start-to-finish functions | from . import pre, csr
import imageio
import tqdm
import numpy as np
from skimage import morphology
import pandas as pd
def process_images(filenames, image_format, threshold_radius,
smooth_radius, brightness_offset, scale_metadata_path):
image_format = None if image_format == 'auto' else image_... | from . import pre, csr
import imageio
import tqdm
import numpy as np
from skimage import morphology
import pandas as pd
def process_images(filenames, image_format, threshold_radius,
smooth_radius, brightness_offset, scale_metadata_path):
image_format = (None if self.image_format.get() == 'auto'... |
Make the select field type work like it's supposed to | <?php
/**
* Front End Accounts
*
* @category WordPress
* @package FrontEndAccounts
* @since 0.1
* @author Christopher Davis <http://christopherdavis.me>
* @copyright 2013 Christopher Davis
* @license http://opensource.org/licenses/MIT MIT
*/
namespace Chrisguitarguy\FrontEndAccounts\Fo... | <?php
/**
* Front End Accounts
*
* @category WordPress
* @package FrontEndAccounts
* @since 0.1
* @author Christopher Davis <http://christopherdavis.me>
* @copyright 2013 Christopher Davis
* @license http://opensource.org/licenses/MIT MIT
*/
namespace Chrisguitarguy\FrontEndAccounts\Fo... |
Remove conditional on seeding users. | <?php
use Illuminate\Database\Seeder;
use VotingApp\Models\User;
class UsersTableSeeder extends Seeder
{
public function run()
{
$faker = Faker\Factory::create();
User::truncate();
User::create([
'first_name' => 'Dave',
'email' => 'dfurnes@dosomething.org',
... | <?php
use Illuminate\Database\Seeder;
use VotingApp\Models\User;
class UsersTableSeeder extends Seeder
{
public function run()
{
$faker = Faker\Factory::create();
User::truncate();
User::create([
'first_name' => 'Dave',
'email' => 'dfurnes@dosomething.org',
... |
Remove textwrap because python 2.7 lacks indent() function | import warnings
import platform
def deprecated(func):
"""This is a decorator which can be used to mark functions
as deprecated. It will result in a warning being emmitted
when the function is used."""
def newFunc(*args, **kwargs):
warnings.warn("Call to deprecated function {}.".format(func.__n... | import warnings
import platform
def deprecated(func):
"""This is a decorator which can be used to mark functions
as deprecated. It will result in a warning being emmitted
when the function is used."""
def newFunc(*args, **kwargs):
warnings.warn("Call to deprecated function {}.".format(func.__n... |
Fix missing import for throwing timeout Exception | <?php
namespace ConnectionManager\Extra;
use React\SocketClient\ConnectorInterface;
use React\EventLoop\LoopInterface;
use React\Promise\Deferred;
use Exception;
class ConnectionManagerTimeout implements ConnectorInterface
{
private $connectionManager;
private $loop;
private $timeout;
public functio... | <?php
namespace ConnectionManager\Extra;
use React\SocketClient\ConnectorInterface;
use React\EventLoop\LoopInterface;
use React\Promise\Deferred;
class ConnectionManagerTimeout implements ConnectorInterface
{
private $connectionManager;
private $loop;
private $timeout;
public function __construct(C... |
Make code comments gender neutral
Replaces gendered references to users with a neutral 'them'. | <?php
namespace Auth0\Login;
use Auth0\Login\Contract\Auth0UserRepository;
use Illuminate\Routing\Controller;
class Auth0Controller extends Controller
{
/**
* @var Auth0UserRepository
*/
protected $userRepository;
/**
* Auth0Controller constructor.
*
* @param Auth0UserRepository... | <?php
namespace Auth0\Login;
use Auth0\Login\Contract\Auth0UserRepository;
use Illuminate\Routing\Controller;
class Auth0Controller extends Controller
{
/**
* @var Auth0UserRepository
*/
protected $userRepository;
/**
* Auth0Controller constructor.
*
* @param Auth0UserRepository... |
Remove unused statements from jobs | import React from "react";
import { connect } from "react-redux";
import { Switch, Route } from "react-router-dom";
import JobsList from "./List";
import JobDetail from "./Detail";
import JobsResources from "./Resources";
import Resources from "../../administration/components/Jobs/Resources";
import Tasks from "../../a... | import React from "react";
import { connect } from "react-redux";
import { Switch, Route } from "react-router-dom";
import { findJobs } from "../actions";
import JobsList from "./List";
import JobDetail from "./Detail";
import JobsResources from "./Resources";
import Resources from "../../administration/components/Job... |
Clean the lines in a seperate function. | #!/usr/bin/env python
import os
import setuptools
def _clean_line(line):
line = line.strip()
line = line.split("#")[0]
line = line.strip()
return line
def read_requires(base):
path = os.path.join('tools', base)
requires = []
if not os.path.isfile(path):
return requires
with ... | #!/usr/bin/env python
import os
import setuptools
def read_requires(base):
path = os.path.join('tools', base)
requires = []
if not os.path.isfile(path):
return requires
with open(path, 'rb') as h:
for line in h.read().splitlines():
line = line.strip()
if len(li... |
Kill an Unused import - thanks to @landscapeio | """
Standalone test runner for wardrounds plugin
"""
import sys
from opal.core import application
class Application(application.OpalApplication):
pass
from django.conf import settings
settings.configure(DEBUG=True,
DATABASES={
'default': {
'ENG... | """
Standalone test runner for wardrounds plugin
"""
import os
import sys
from opal.core import application
class Application(application.OpalApplication):
pass
from django.conf import settings
settings.configure(DEBUG=True,
DATABASES={
'default': {
... |
Revert "Temporary turn off the batch attachments sanitize job handler"
b51dc42a6ed78b46051f21bf086596bffa198c05 | import monitor from 'monitor-dog';
import Raven from 'raven';
import config from 'config';
import { JobManager } from '../models';
import { initHandlers as initPeriodicHandlers } from './periodic';
import { initHandlers as initUserGoneHandlers } from './user-gone';
import { initHandlers as initAttachmentsSanitizeHand... | import monitor from 'monitor-dog';
import Raven from 'raven';
import config from 'config';
import { JobManager } from '../models';
import { initHandlers as initPeriodicHandlers } from './periodic';
import { initHandlers as initUserGoneHandlers } from './user-gone';
// import { initHandlers as initAttachmentsSanitizeH... |
Add component form select on header filter | 'use strict'
import React from 'react'
import FormSelect from '../../components/form-select'
import SvgIcon from '../../components/svg-icon'
const HeaderFilter = () => (
<nav className='filter'>
<FormSelect
key='select-date'
icon={{
id: 'date',
label: 'Data'
}}
label='Esc... | 'use strict'
import React from 'react'
import SvgIcon from '../../components/svg-icon'
const HeaderFilter = () => (
<nav className='filter'>
<div className='form-select'>
<SvgIcon id='date' label='Data' />
<label className='sr-only'>Escolha um mês</label>
<select>
<... |
Fix possible undefined methods in inherited classes | <?php
/**
* Zend Framework (http://framework.zend.com/)
*
* @link http://github.com/zendframework/zf2 for the canonical source repository
* @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
... | <?php
/**
* Zend Framework (http://framework.zend.com/)
*
* @link http://github.com/zendframework/zf2 for the canonical source repository
* @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
... |
Use empty message instead None. | from django.test import TestCase
from django.core import mail
from oscar.core.compat import get_user_model
from oscar.apps.customer.utils import Dispatcher
from oscar.apps.customer.models import CommunicationEventType
from oscar.test.factories import create_order
User = get_user_model()
class TestDispatcher(TestCa... | from django.test import TestCase
from django.core import mail
from oscar.core.compat import get_user_model
from oscar.apps.customer.utils import Dispatcher
from oscar.apps.customer.models import CommunicationEventType
from oscar.test.factories import create_order
User = get_user_model()
class TestDispatcher(TestCa... |
Fix source url to cache | let doCache = false;
let CACHE_NAME = 'quickbill-cache-v1';
let urlsToCache = [
'/',
'./assets/css/styles.css',
'./assets/images/*',
'./dist/index-bundle.js'
];
self.addEventListener("activate", event => {
const cacheWhiteList = [CACHE_NAME];
event.waitUntil(
caches.keys()
.then(k... | let doCache = false;
let CACHE_NAME = 'quickbill-cache-v1';
let urlsToCache = [
'/',
'./assets/styles/css/styles.css',
'./assets/styles/images/*',
'./dist/index-bundle.js'
];
self.addEventListener("activate", event => {
const cacheWhiteList = [CACHE_NAME];
event.waitUntil(
caches.keys()
... |
Add currency's symbol to dashboard | @extends('layout')
@section('body')
<h1>Dashboard</h1>
<div class="box spacing-bottom-large">
<div class="box__section">
<span style="font-size: 18px;">Earnings</span>
</div>
<table class="box__section">
<tbody>
@foreach (Auth::user()->earnings as... | @extends('layout')
@section('body')
<h1>Dashboard</h1>
<div class="box spacing-bottom-large">
<div class="box__section">
<span style="font-size: 18px;">Earnings</span>
</div>
<table class="box__section">
<tbody>
@foreach (Auth::user()->earnings as... |
Add nose to list of test requirements. | import os
from setuptools import setup
def read(fname):
return open(os.path.join(os.path.dirname(__file__), fname)).read()
setup(
name='nova_limits',
version='0.5.2',
author='Kevin L. Mitchell',
author_email='kevin.mitchell@rackspace.com',
description="Nova-specific rate-limit class for turn... | import os
from setuptools import setup
def read(fname):
return open(os.path.join(os.path.dirname(__file__), fname)).read()
setup(
name='nova_limits',
version='0.5.2',
author='Kevin L. Mitchell',
author_email='kevin.mitchell@rackspace.com',
description="Nova-specific rate-limit class for turn... |
Fix error propagation on feed fetching. | var feedRead = require('feed-read');
var readabilitySax = require('readabilitySAX');
var _url = require('url');
function fetchFeed(url, cb) {
console.log('[.] Fetching feed: ' + url);
feedRead(url, function(err, articles) {
if (err) {
console.error('[x] Unable to fetch feed: ' + url, err... | var feedRead = require('feed-read');
var readabilitySax = require('readabilitySAX');
var _url = require('url');
function fetchFeed(url, cb) {
console.log('[.] Fetching feed: ' + url);
feedRead(url, function(err, articles) {
if (err) {
console.error('[x] Unable to fetch feed: ' + url, err... |
Add method to calculate count issues by label | <?php
namespace Bap\Bundle\IssueBundle\Entity\Repository;
use Doctrine\ORM\AbstractQuery;
use Doctrine\ORM\EntityRepository;
/**
* Class IssueRepository
* @package Bap\Bundle\IssueBundle\Entity\Repository
*/
class IssueRepository extends EntityRepository
{
public function getIssuesByStatus()
{
$it... | <?php
namespace Bap\Bundle\IssueBundle\Entity\Repository;
use Doctrine\ORM\AbstractQuery;
use Doctrine\ORM\EntityRepository;
/**
* Class IssueRepository
* @package Bap\Bundle\IssueBundle\Entity\Repository
*/
class IssueRepository extends EntityRepository
{
public function getIssuesByStatus()
{
$re... |
BAP-3749: Disable screen for maintenance mode - show popup dialog with overlay instead of red message Maintanance Mode is ON
-fix unit tests | <?php
namespace Oro\Bundle\SyncBundle\Tests\Unit\EventListener;
use Oro\Bundle\SyncBundle\EventListener\MaintenanceListener;
class MaintenanceListenerTest extends \PHPUnit_Framework_TestCase
{
/**
* @var \PHPUnit_Framework_MockObject_MockObject
*/
private $topicPublisher;
protected function set... | <?php
namespace Oro\Bundle\SyncBundle\Tests\Unit\EventListener;
use Oro\Bundle\SyncBundle\EventListener\MaintenanceListener;
class MaintenanceListenerTest extends \PHPUnit_Framework_TestCase
{
/**
* @var \PHPUnit_Framework_MockObject_MockObject
*/
private $topicPublisher;
protected function set... |
Fix integration test path to module | var gpio = require('../../rpi-gpio');
var async = require('async');
var assert = require('assert');
var sinon = require('sinon');
var message =
'Please ensure that your Raspberry Pi is set up with with physical pins ' +
'7 and 11 connected via a 1kΩ resistor (or similar) to make this test work'
console.log(mes... | var gpio = require('rpi-gpio');
var async = require('async');
var assert = require('assert');
var sinon = require('sinon');
var message =
'Please ensure that your Raspberry Pi is set up with with physical pins ' +
'7 and 11 connected via a 1kΩ resistor (or similar) to make this test work'
console.log(message)
... |
Fix array notation to support PHP 5.3 | <?php
namespace Omnipay\Stripe\Message;
use Mockery as m;
use Omnipay\Tests\TestCase;
class AbstractRequestTest extends TestCase
{
public function testSendDataSetsApiVersionIfPresent_Mockery()
{
$apiVersion = '2014-10-12';
$eventDispatcher = m::mock('\Symfony\Component\EventDispatcher\EventD... | <?php
namespace Omnipay\Stripe\Message;
use Mockery as m;
use Omnipay\Tests\TestCase;
class AbstractRequestTest extends TestCase
{
public function testSendDataSetsApiVersionIfPresent_Mockery()
{
$apiVersion = '2014-10-12';
$eventDispatcher = m::mock('\Symfony\Component\EventDispatcher\EventD... |
Revert "The login handler now returns a response"
This reverts commit 90c53eebeece07cb7e8f54b757c509a364502022. | <?php
namespace Aureka\VBBundle\Handler;
use Symfony\Component\Security\Core\Authentication\Token\TokenInterface;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\Security\Http\Authentication\AuthenticationSuccessHandlerInterface;
use Symfony\Component\HttpKernel\Event\FilterResponseEvent;
use Aur... | <?php
namespace Aureka\VBBundle\Handler;
use Symfony\Component\Security\Core\Authentication\Token\TokenInterface;
use Symfony\Component\HttpFoundation\Request,
Symfony\Component\HttpFoundation\RedirectResponse;
use Symfony\Component\Security\Http\Authentication\AuthenticationSuccessHandlerInterface;
use Symfony\C... |
Fix order sorting to prevent incorrect order number generation.
See https://github.com/Sylius/Sylius/pull/631 | <?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\Bundle\OrderBundle\Doctrine\ORM;
use Sylius\Bundle\ResourceBundle\Doctrine\ORM\Entit... | <?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\Bundle\OrderBundle\Doctrine\ORM;
use Sylius\Bundle\ResourceBundle\Doctrine\ORM\Entit... |
Fix migration for model verbose name changes | # -*- coding: utf-8 -*-
# Generated by Django 1.11.1 on 2017-05-12 08:07
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
('auth', '0001_initial'),
]
oper... | # -*- coding: utf-8 -*-
# Generated by Django 1.11.1 on 2017-05-12 08:07
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
('auth', '0001_initial'),
]
oper... |
Add support for custom serializer | <?php
namespace Bridge\HttpApi\Worker;
use Bridge\HttpApi\Serializer\PathDenormalizer;
use Symfony\Component\Serializer\Encoder\JsonEncoder;
use Symfony\Component\Serializer\Normalizer\ArrayDenormalizer;
use Symfony\Component\Serializer\Normalizer\GetSetMethodNormalizer;
use Symfony\Component\Serializer\Serializer;
u... | <?php
namespace Bridge\HttpApi\Worker;
use Bridge\HttpApi\Serializer\PathDenormalizer;
use Symfony\Component\Serializer\Encoder\JsonEncoder;
use Symfony\Component\Serializer\Normalizer\ArrayDenormalizer;
use Symfony\Component\Serializer\Normalizer\GetSetMethodNormalizer;
use Symfony\Component\Serializer\Serializer;
u... |
Add new constructor for logic manager | package seedu.jobs.logic;
import java.io.IOException;
import java.util.logging.Logger;
import javafx.collections.ObservableList;
import seedu.jobs.commons.core.ComponentManager;
import seedu.jobs.commons.core.LogsCenter;
import seedu.jobs.logic.calendar.CalendarManager;
import seedu.jobs.logic.commands.Command;
impor... | package seedu.jobs.logic;
import java.io.IOException;
import java.util.logging.Logger;
import javafx.collections.ObservableList;
import seedu.jobs.commons.core.ComponentManager;
import seedu.jobs.commons.core.LogsCenter;
import seedu.jobs.logic.calendar.CalendarManager;
import seedu.jobs.logic.commands.Command;
impor... |
[cli] Print more complete error message | #!/usr/bin/env node
var parseArgs = require('minimist');
var gonzales = require('..');
var fs = require('fs');
var path = require('path');
var options = getOptions();
process.stdin.isTTY ? processFile(options._[0]) : processSTDIN();
function getOptions() {
var parserOptions = {
boolean: ['silent'],
... | #!/usr/bin/env node
var parseArgs = require('minimist');
var gonzales = require('..');
var fs = require('fs');
var path = require('path');
var options = getOptions();
process.stdin.isTTY ? processFile(options._[0]) : processSTDIN();
function getOptions() {
var parserOptions = {
boolean: ['silent'],
... |
Allow double click zoom when map is not frozen | import React from 'react'
import PropTypes from 'prop-types'
import { Map, TileLayer, GeoJSON } from 'react-leaflet'
class CenteredMap extends React.PureComponent {
static propTypes = {
vectors: PropTypes.object.isRequired,
className: PropTypes.string,
frozen: PropTypes.bool,
lat: PropTypes.number,
... | import React from 'react'
import PropTypes from 'prop-types'
import { Map, TileLayer, GeoJSON } from 'react-leaflet'
class CenteredMap extends React.PureComponent {
static propTypes = {
vectors: PropTypes.object.isRequired,
className: PropTypes.string,
frozen: PropTypes.bool,
lat: PropTypes.number,
... |
test: Clear caches in test item teardown
Rather than relying on the user manually clearing the COFS function
cache and linear problem cache, clear them in the teardown step of each
test. | import pytest
def pytest_addoption(parser):
parser.addoption("--travis", action="store_true", default=False,
help="Only run tests marked for Travis")
def pytest_configure(config):
config.addinivalue_line("markers",
"not_travis: Mark a test that should not be ... | import pytest
def pytest_addoption(parser):
parser.addoption("--travis", action="store_true", default=False,
help="Only run tests marked for Travis")
def pytest_configure(config):
config.addinivalue_line("markers",
"not_travis: Mark a test that should not be ... |
Fix client IP on dashboard | <?php
namespace App\Controllers;
use Illuminate\Http\Request;
use App\Libs\Controller;
class DashboardController extends Controller{
/**
* Display a listing of the resource.
*
* @return \Illuminate\Http\Response
*/
public function index(){
$admin_logo = $this->request->setting... | <?php
namespace App\Controllers;
use Illuminate\Http\Request;
use App\Libs\Controller;
class DashboardController extends Controller{
/**
* Display a listing of the resource.
*
* @return \Illuminate\Http\Response
*/
public function index(){
$admin_logo = $this->request->setting... |
Add config for disabling tools links | <?php
namespace Slate\UI;
use Slate;
class Tools implements ILinksSource
{
public static $enabled = true;
public static $weight = -500;
public static $tools = [];
public static function __classLoaded()
{
// append legacy manage/web tools
if (!empty(Slate::$manageTools)) {
... | <?php
namespace Slate\UI;
use Slate;
class Tools implements ILinksSource
{
public static $weight = -500;
public static $tools = [];
public static function __classLoaded()
{
// append legacy manage/web tools
if (!empty(Slate::$manageTools)) {
static::appendtools(Slate::$ma... |
Return exception as error message | from ckan.lib import base
from ckan.common import c, _
from ckan import logic
from ckanext.requestdata import emailer
from ckan.plugins import toolkit
import ckan.model as model
import ckan.plugins as p
import json
get_action = logic.get_action
NotFound = logic.NotFound
NotAuthorized = logic.NotAuthorized
ValidationEr... | from ckan.lib import base
from ckan.common import c, _
from ckan import logic
from ckanext.requestdata import emailer
from ckan.plugins import toolkit
import ckan.model as model
import ckan.plugins as p
import json
get_action = logic.get_action
NotFound = logic.NotFound
NotAuthorized = logic.NotAuthorized
ValidationEr... |
Fix case of Django dependency. Thanks Travis Swicegood. | from os.path import join
from setuptools import setup, find_packages
long_description = (open('README.rst').read() +
open('CHANGES.rst').read() +
open('TODO.rst').read())
def get_version():
with open(join('model_utils', '__init__.py')) as f:
for line in f:
... | from os.path import join
from setuptools import setup, find_packages
long_description = (open('README.rst').read() +
open('CHANGES.rst').read() +
open('TODO.rst').read())
def get_version():
with open(join('model_utils', '__init__.py')) as f:
for line in f:
... |
Correct way to use get or create | import socket
from django.contrib.auth.models import AnonymousUser
from django.contrib.auth.models import User
class GooglebotMiddleware(object):
"""
Middleware to automatically log in the Googlebot with the user account 'googlebot'
"""
def process_request(self, request):
request.is_googlebot... | import socket
from django.contrib.auth.models import AnonymousUser
from django.contrib.auth.models import User
class GooglebotMiddleware(object):
"""
Middleware to automatically log in the Googlebot with the user account 'googlebot'
"""
def process_request(self, request):
request.is_googlebot... |
Add keyword to echo worker. | # -*- test-case-name: vumi.workers.vas2nets.test_vas2nets -*-
# -*- encoding: utf-8 -*-
from twisted.python import log
from twisted.internet.defer import inlineCallbacks, Deferred
from vumi.message import Message
from vumi.service import Worker
class EchoWorker(Worker):
@inlineCallbacks
def startWorker(sel... | # -*- test-case-name: vumi.workers.vas2nets.test_vas2nets -*-
# -*- encoding: utf-8 -*-
from twisted.python import log
from twisted.internet.defer import inlineCallbacks, Deferred
from vumi.message import Message
from vumi.service import Worker
class EchoWorker(Worker):
@inlineCallbacks
def startWorker(sel... |
Remove php 7.1 `?` operator | <?php
declare(strict_types=1);
namespace Roave\Signature;
use Roave\Signature\Encoder\EncoderInterface;
use Roave\Signature\Hasher\HasherInterface;
final class FileContentChecker implements CheckerInterface
{
/**
* @var EncoderInterface
*/
private $encoder;
/**
* @var HasherInterface
... | <?php
declare(strict_types=1);
namespace Roave\Signature;
use Roave\Signature\Encoder\EncoderInterface;
use Roave\Signature\Hasher\HasherInterface;
final class FileContentChecker implements CheckerInterface
{
/**
* @var EncoderInterface
*/
private $encoder;
/**
* @var HasherInterface
... |
Comment out file we dont need | <?php
namespace phpSmug;
//use phpSmug\Api\ApiInterface;
use phpSmug\Exception\InvalidArgumentException;
use phpSmug\Exception\BadMethodCallException;
use phpSmug\HttpClient\HttpClient;
use phpSmug\HttpClient\HttpClientInterface;
/**
* Simple yet very cool PHP SmugMug client
*
* @method Api\User user()
*
*/
cla... | <?php
namespace phpSmug;
use phpSmug\Api\ApiInterface;
use phpSmug\Exception\InvalidArgumentException;
use phpSmug\Exception\BadMethodCallException;
use phpSmug\HttpClient\HttpClient;
use phpSmug\HttpClient\HttpClientInterface;
/**
* Simple yet very cool PHP SmugMug client
*
* @method Api\User user()
*
*/
class... |
Change node build target libraryTarget from AMD to UMD | const webpack = require('webpack');
const path = require('path');
const fs = require('fs');
const webpackMerge = require('webpack-merge');
const defaultConfig = {
target: 'node',
entry: {
'bundle.node': './src/index.js',
'bundle.node.min': './src/index.js',
},
output: {
filename: '[name].js',
p... | const webpack = require('webpack');
const path = require('path');
const fs = require('fs');
const webpackMerge = require('webpack-merge');
const defaultConfig = {
target: 'node',
entry: {
'bundle.node': './src/index.js',
'bundle.node.min': './src/index.js',
},
output: {
filename: '[name].js',
p... |
Clean shitty phpstorm comment :( | <?php
namespace Nats\tests\Unit;
use Nats\ConnectionOptions;
/**
* Class ConnectionOptionsTest
*/
class ConnectionOptionsTest extends \PHPUnit_Framework_TestCase
{
/**
* Tests Connection Options getters and setters. Only necessary for code coverage.
*
* @return void
*/
public function te... | <?php
/**
* Created by PhpStorm.
* User: isselguberna
* Date: 29/9/15
* Time: 23:48
*/
namespace Nats\tests\Unit;
use Nats\ConnectionOptions;
/**
* Class ConnectionOptionsTest
*/
class ConnectionOptionsTest extends \PHPUnit_Framework_TestCase
{
/**
* Tests Connection Options getters and setters. Only... |
Update the team view when a team is joined | angular.module('reg')
.controller('TeamCtrl', [
'$scope',
'currentUser',
'settings',
'Utils',
'UserService',
'TEAM',
function($scope, currentUser, settings, Utils, UserService, TEAM){
// Get the current user's most recent data.
var Settings = settings.data;
$scope.regIsO... | angular.module('reg')
.controller('TeamCtrl', [
'$scope',
'currentUser',
'settings',
'Utils',
'UserService',
'TEAM',
function($scope, currentUser, settings, Utils, UserService, TEAM){
// Get the current user's most recent data.
var Settings = settings.data;
$scope.regIsO... |
Add a correct dir to sys.path, remove unused imports. | import os
import sys
from setuptools import setup
def read_version_string():
version = None
current_dir = os.path.abspath(os.path.dirname(__file__))
sys.path.insert(0, current_dir)
from log_formatters import __version__
version = __version__
sys.path.pop(0)
return version
setup(
nam... | import os
import sys
from os.path import join as pjoin
from setuptools import setup
from setuptools import Command
from subprocess import call
def read_version_string():
version = None
sys.path.insert(0, pjoin(os.getcwd()))
from log_formatters import __version__
version = __version__
sys.path.po... |
Fix tests for PHP 5.4 | <?php
namespace SimpleSAML\Test\Module\core\Auth;
use SimpleSAML\Module\core\Auth\UserPassOrgBase;
class UserPassOrgBaseTest extends \PHPUnit_Framework_TestCase
{
public function testRememberOrganizationEnabled()
{
$config = array(
'ldap:LDAPMulti',
'remember.organization.ena... | <?php
namespace SimpleSAML\Test\Module\core\Auth;
use SimpleSAML\Module\core\Auth\UserPassOrgBase;
class UserPassOrgBaseTest extends \PHPUnit_Framework_TestCase
{
public function testRememberOrganizationEnabled()
{
$config = array(
'ldap:LDAPMulti',
'remember.organization.ena... |
Remove BitVector import - Build fails | import sys, os
myPath = os.path.dirname(os.path.abspath(__file__))
print(myPath)
sys.path.insert(0, myPath + '/../SATSolver')
from unittest import TestCase
from individual import Individual
from bitarray import bitarray
class TestIndividual(TestCase):
"""
Testing class for Individual.
"""
def test_g... | import sys, os
myPath = os.path.dirname(os.path.abspath(__file__))
print(myPath)
sys.path.insert(0, myPath + '/../SATSolver')
from unittest import TestCase
from individual import Individual
from BitVector import BitVector
from bitarray import bitarray
class TestIndividual(TestCase):
"""
Testing class for Ind... |
Fix for Database access not allowed, use the "django_db" mark to enable it. | from django.contrib.auth import get_user_model
from rest_framework_json_api import serializers
from rest_framework_json_api.renderers import JSONRenderer
pytestmark = pytest.mark.django_db
class ResourceSerializer(serializers.ModelSerializer):
class Meta:
fields = ('username',)
model = get_user_m... | from django.contrib.auth import get_user_model
from rest_framework_json_api import serializers
from rest_framework_json_api.renderers import JSONRenderer
class ResourceSerializer(serializers.ModelSerializer):
class Meta:
fields = ('username',)
model = get_user_model()
def test_build_json_resour... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.