text stringlengths 17 1.47k | positive stringlengths 673 4.43k | negative stringlengths 677 2.81k |
|---|---|---|
Add line wrap to RTE code editor | (function () {
"use strict";
function CodeEditorController($scope, localizationService) {
var vm = this;
vm.submit = submit;
vm.close = close;
vm.aceOption = {};
vm.aceOption = {
mode: "razor",
theme: "chrome",
showPrintMargin: false... | (function () {
"use strict";
function CodeEditorController($scope, localizationService) {
var vm = this;
vm.submit = submit;
vm.close = close;
vm.aceOption = {};
vm.aceOption = {
mode: "razor",
theme: "chrome",
showPrintMargin: false... |
Move function out of the scope | "use strict";
function isFilesArg (arg) {
return Array.isArray(arg) || typeof arg === "string";
}
/**
* Handle arguments for backwards compatibility
* @param {Object} args
* @returns {{config: {}, cb: *}}
*/
module.exports = function (args) {
var config = {};
var cb;
switch (args.length) {
... | "use strict";
/**
* Handle arguments for backwards compatibility
* @param {Object} args
* @returns {{config: {}, cb: *}}
*/
module.exports = function (args) {
var config = {};
var cb;
switch (args.length) {
case 1 :
if (isFilesArg(args[0])) {
config.files = args... |
Fix compilation error from previous checkin. | package com.atlassian.pageobjects.elements.test.pageobjects.page;
import com.atlassian.pageobjects.Page;
import com.atlassian.pageobjects.elements.Element;
import com.atlassian.pageobjects.elements.ElementBy;
import com.atlassian.pageobjects.elements.ElementFinder;
import javax.inject.Inject;
import static ... | package com.atlassian.pageobjects.elements.test.pageobjects.page;
import com.atlassian.pageobjects.Page;
import com.atlassian.pageobjects.elements.Element;
import com.atlassian.pageobjects.elements.ElementBy;
import com.atlassian.pageobjects.elements.ElementFinder;
import javax.inject.Inject;
import static ... |
Use global CartConst, ignore local require. | 'use strict';
/* global $, CartConst */
module.exports = function($scope, $location, $routeSegment, footerService) {
console.log('CartMainCtrl');
$scope.segment = $routeSegment;
$scope.location = $location;
$scope.rootPath = $location.path().split('/')[1];
$scope.indexPaths = ['', 'new', 'update',... | 'use strict';
/* global $ */
var CartConst = require('../const/const.js');
module.exports = function($scope, $location, $routeSegment, footerService) {
console.log('CartMainCtrl');
$scope.segment = $routeSegment;
$scope.location = $location;
$scope.rootPath = $location.path().split('/')[1];
$scop... |
Put AutoFocus focus holder in a portal.
This prevent it from affecting layouts. | import {compose} from 'compose'
import PropTypes from 'prop-types'
import React from 'react'
import withForwardedRef from 'ref'
import Portal from 'widget/portal'
class AutoFocus extends React.Component {
focusHolderRef = React.createRef()
state = {completed: false}
render() {
const {completed} = ... | import {compose} from 'compose'
import PropTypes from 'prop-types'
import React from 'react'
import withForwardedRef from 'ref'
class AutoFocus extends React.Component {
focusHolderRef = React.createRef()
state = {completed: false}
render() {
const {completed} = this.state
return completed... |
Improve batch form return data structure. | from django import forms
import csv
from io import StringIO
class BatchMoonScanForm(forms.Form):
data = forms.CharField(
widget=forms.Textarea(attrs={'class':'form-control monospace'}),
)
def clean(self):
cleaned_data = super(BatchMoonScanForm, self).clean()
raw = StringIO(cleaned... | from django import forms
import csv
from io import StringIO
class BatchMoonScanForm(forms.Form):
data = forms.CharField(
widget=forms.Textarea(attrs={'class':'form-control monospace'}),
)
def clean(self):
cleaned_data = super(BatchMoonScanForm, self).clean()
raw = StringIO(cleaned... |
feat: Add error handler to file templater | "use strict";
var fs = require('fs');
var path = require('path');
var extend = require('extend');
var template = require('lodash/template');
var errorHandler = require('./errorHandler');
var _fileNumber = 1;
var _config = {
onEachFile: function() {},
onCompleted: function() {}
};
module.exports = function()... | "use strict";
var fs = require('fs');
var path = require('path');
var extend = require('extend');
var template = require('lodash/template');
var _fileNumber = 1;
var _config = {
onEachFile: function() {},
onCompleted: function() {}
};
module.exports = function() {
return {
run: run,
setC... |
Fix "My Data" page JS views | //The loading screen view
define(['backbone', 'underscore', 'spin'], function(Backbone, _, Spinner) {
'use strict';
var LoadScreenView = Backbone.View.extend({
className: 'spinner-container',
defaultOptions: {
lines: 11, // The number of lines to draw
length: 24, // The... | //The loading screen view
define(['backbone', 'underscore', 'spin'], function(Backbone, _, Spinner) {
'use strict';
var LoadScreenView = Backbone.View.extend({
className: 'spinner-container',
defaultOptions: {
lines: 11, // The number of lines to draw
length: 24, // The... |
Make sentenceList scrollable at all times | "use strict";
angular.module('arethusa.core').directive('sentenceList', [
'$compile',
'navigator',
function($compile, navigator) {
return {
restrict: 'A',
scope: true,
link: function(scope, element, attrs) {
scope.n = navigator;
function createList() {
// We want ... | "use strict";
angular.module('arethusa.core').directive('sentenceList', [
'$compile',
'navigator',
function($compile, navigator) {
return {
restrict: 'A',
scope: true,
link: function(scope, element, attrs) {
scope.n = navigator;
function createList() {
// We want ... |
Fix onChange propType in Switch component | import React from 'react';
import { Strings } from '../../constants';
export default React.createClass({
propTypes: {
field : React.PropTypes.string,
onClick : React.PropTypes.func,
valueOn : React.PropTypes.string,
valueOff : React.PropTypes.string,
checked : React.PropTy... | import React from 'react';
import { Strings } from '../../constants';
export default React.createClass({
propTypes: {
field : React.PropTypes.string,
onClick : React.PropTypes.func,
valueOn : React.PropTypes.string,
valueOff : React.PropTypes.string,
checked : React.PropTy... |
Extend import statement to support Python 3 | import os as _os
import dash as _dash
import sys as _sys
from .version import __version__
_current_path = _os.path.dirname(_os.path.abspath(__file__))
_components = _dash.development.component_loader.load_components(
_os.path.join(_current_path, 'metadata.json'),
'dash_core_components'
)
_this_module = _sys.... | import os as _os
import dash as _dash
import sys as _sys
from version import __version__
_current_path = _os.path.dirname(_os.path.abspath(__file__))
_components = _dash.development.component_loader.load_components(
_os.path.join(_current_path, 'metadata.json'),
'dash_core_components'
)
_this_module = _sys.m... |
Fix divide by zero when no reg estimate | <?php
namespace CodeDay\Clear\Controllers\Manage;
use \CodeDay\Clear\Models;
class DashboardController extends \Controller {
public function getIndex()
{
return \View::make('dashboard');
}
public function getChangeBatch()
{
if (\Input::get('id')) {
Models\Batch::find(... | <?php
namespace CodeDay\Clear\Controllers\Manage;
use \CodeDay\Clear\Models;
class DashboardController extends \Controller {
public function getIndex()
{
return \View::make('dashboard');
}
public function getChangeBatch()
{
if (\Input::get('id')) {
Models\Batch::find(... |
Use hass.config.api instead of hass.http | """
This module exposes Home Assistant via Zeroconf.
Zeroconf is also known as Bonjour, Avahi or Multicast DNS (mDNS).
For more details about Zeroconf, please refer to the documentation at
https://home-assistant.io/components/zeroconf/
"""
import logging
import socket
from homeassistant.const import (EVENT_HOMEASSIS... | """
This module exposes Home Assistant via Zeroconf.
Zeroconf is also known as Bonjour, Avahi or Multicast DNS (mDNS).
For more details about Zeroconf, please refer to the documentation at
https://home-assistant.io/components/zeroconf/
"""
import logging
import socket
from homeassistant.const import (EVENT_HOMEASSIS... |
Fix error in unit test | <?php
/**
* phpDocumentor
*
* PHP Version 5.3
*
* @copyright 2010-2013 Mike van Riel / Naenius (http://www.naenius.com)
* @license http://www.opensource.org/licenses/mit-license.php MIT
* @link http://phpdoc.org
*/
namespace phpDocumentor\Descriptor;
use \Mockery as m;
/**
* Tests the functionality f... | <?php
/**
* phpDocumentor
*
* PHP Version 5.3
*
* @copyright 2010-2013 Mike van Riel / Naenius (http://www.naenius.com)
* @license http://www.opensource.org/licenses/mit-license.php MIT
* @link http://phpdoc.org
*/
namespace phpDocumentor\Descriptor;
use \Mockery as m;
/**
* Tests the functionality f... |
Add LIMIT 1 to speed up query | from typing import List
from mediawords.db.handler import DatabaseHandler
from mediawords.util.log import create_logger
from mediawords.util.perl import decode_object_from_bytes_if_needed
l = create_logger(__name__)
class McPostgresRegexMatch(Exception):
"""postgres_regex_match() exception."""
pass
def po... | from typing import List
from mediawords.db.handler import DatabaseHandler
from mediawords.util.log import create_logger
from mediawords.util.perl import decode_object_from_bytes_if_needed
l = create_logger(__name__)
class McPostgresRegexMatch(Exception):
"""postgres_regex_match() exception."""
pass
def po... |
Use 1-indexed counting for game IDs | """
This module is for generating fake game data for use with the API.
An example of some game data::
{
"id": 1,
"logURL": "http://derp.nope/",
"updates": [
{
"status": "complete",
"time": "today"
}
],
"players": [
... | """
This module is for generating fake game data for use with the API.
An example of some game data::
{
"id": 1,
"logURL": "http://derp.nope/",
"updates": [
{
"status": "complete",
"time": "today"
}
],
"players": [
... |
Set TimeStamp field to jTime type. Run go fmt | package bittrex
type Order struct {
OrderUuid string `json:"OrderUuid"`
Exchange string `json:"Exchange"`
TimeStamp jTime `json:"TimeStamp"`
OrderType string `json:"OrderType"`
Limit float64 `json:"Limit"`
Quantity float64 `json:"Quantity"`
QuantityRema... | package bittrex
type Order struct {
OrderUuid string `json:"OrderUuid"`
Exchange string `json:"Exchange"`
TimeStamp string `json:"TimeStamp"`
OrderType string `json:"OrderType"`
Limit float64 `json:"Limit"`
Quantity float64 `json:"Quantity"`
QuantityRema... |
Synchronize DateFormat usages due to it being thread unsafe (Sonar S2885) | package ru.taximaxim.pgsqlblocks.utils;
import org.apache.log4j.Logger;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;
public final class DateUtils {
private static final Logger LOG = Logger.getLogger(DateUtils.class);
private final SimpleDateFormat dateFormat = ... | package ru.taximaxim.pgsqlblocks.utils;
import org.apache.log4j.Logger;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;
public final class DateUtils {
private static final Logger LOG = Logger.getLogger(DateUtils.class);
private static final SimpleDateFormat dateFo... |
Improve the project form a bit | from django.contrib.auth.models import User
from django import forms
from crispy_forms.helper import FormHelper
from crispy_forms.layout import Submit
import models
class BaseModelForm(forms.ModelForm):
helper = FormHelper()
helper.form_class = 'form-horizontal'
helper.add_input(Submit('submit', 'Submit'))... | from django.contrib.auth.models import User
from django import forms
from crispy_forms.helper import FormHelper
from crispy_forms.layout import Submit
import models
class BaseModelForm(forms.ModelForm):
helper = FormHelper()
helper.form_class = 'form-horizontal'
helper.add_input(Submit('submit', 'Submit'))... |
Add the jQuery object to vui and reference that inside controls.
Gives us a central point for maintaining a well-defined jQuery object | /*jslint browser: true*/
( function( vui, $ ) {
$ = vui.$;
$.widget( 'vui.vui_list', {
_create: function() {
var $node = $( this.element );
var updateListSelection = function() {
$node.find( 'li.vui-checkbox > label > input, li.vui-radio > label > input' ).each(
function ( index... | /*jslint browser: true*/
( function( $, vui ) {
$.widget( 'vui.vui_list', {
_create: function() {
var $node = $( this.element );
var updateListSelection = function() {
$node.find( 'li.vui-checkbox > label > input, li.vui-radio > label > input' ).each(
function ( index, inputNode ) {... |
Use strings instead of numerals for "0" in rules | #!/usr/bin/env Python
# -*- coding: utf-8 -*-
from __future__ import (print_function, unicode_literals, absolute_import)
import glob
import re
import io
import unicodecsv
def build_rule(fields):
try:
a, b, X, Y = fields
b = "0" if not b else b
a = "0" if not a else a
return '{} ... | #!/usr/bin/env Python
# -*- coding: utf-8 -*-
from __future__ import (print_function, unicode_literals, absolute_import)
import glob
import re
import io
import unicodecsv
def build_rule(fields):
try:
a, b, X, Y = fields
b = 0 if not b else b
a = 0 if not a else a
return '{} -> {... |
[NCL-702] Check for null product version when triggering a configuration | package org.jboss.pnc.rest.trigger;
import com.google.common.base.Preconditions;
import org.jboss.pnc.core.builder.BuildCoordinator;
import org.jboss.pnc.core.exception.CoreException;
import org.jboss.pnc.datastore.repositories.BuildConfigurationRepository;
import org.jboss.pnc.model.BuildRecordSet;
import org.jboss.p... | package org.jboss.pnc.rest.trigger;
import com.google.common.base.Preconditions;
import org.jboss.pnc.core.builder.BuildCoordinator;
import org.jboss.pnc.core.exception.CoreException;
import org.jboss.pnc.datastore.repositories.BuildConfigurationRepository;
import org.jboss.pnc.model.BuildRecordSet;
import org.jboss.p... |
Fix filter_ method calling parent method bug | import numpy as np
import cv2
from core import KpFilter
class Ransac(KpFilter):
def __init__(self, data):
KpFilter.__init__(self, data)
def __good_pts(self, kps, mps):
rr = [kps[m].pt for m in mps]
return np.float32(rr).reshape(-1, 1, 2)
def __compute(self, good, skp, vkp, min_ma... | import numpy as np
import cv2
from core import KpFilter
class Ransac(KpFilter):
def __init__(self, data):
KpFilter.__init__(self, data)
def __good_pts(self, kps, mps):
rr = [kps[m].pt for m in mps]
return np.float32(rr).reshape(-1, 1, 2)
def __compute(self, good, skp, vkp, min_ma... |
Change passenger schema to have a single ticket
- instead of multiple tickets | exports.up = function(knex, Promise) {
return knex.schema.createTable('passengers', table => {
table.increments('id')
.unsigned()
.primary()
table.string('name')
table.integer('ticket')
.unsigned()
table.integer('station')
.unsigned()
})
.createTable('stations', table => {
t... | exports.up = function(knex, Promise) {
return knex.schema.createTable('passengers', table => {
table.increments('id')
.unsigned()
.primary()
table.string('name')
table.specificType('tickets', 'integer[]')
.unsigned()
table.integer('station')
.unsigned()
})
.createTable('stations... |
Move readmode to root scope
Prevents incorrect angular scope inheritance behaviour (calling $scope.readmode()
would set the "read" variable on the calling scope, not in the readMode controller
scope). | 'use strict';
angular.module('theLawFactory')
.directive('readMode', ['$location', function($location) {
return {
restrict: 'A',
controller: function($rootScope, $scope) {
$rootScope.read = $location.search()['read'] === '1';
$rootScope.readmode = function () {
... | 'use strict';
angular.module('theLawFactory')
.directive('readMode', ['$location', function($location) {
return {
restrict: 'A',
controller: function($scope) {
$scope.read = $location.search()['read'] === '1';
$scope.readmode = function () {
$("#sidebar").ad... |
Remove deferred as not needed | /**
* Date: 1/9/15
* Author: Shirish Goyal
*/
(function () {
'use strict';
angular
.module('crowdsource.interceptor', [])
.factory('AuthHttpResponseInterceptor', AuthHttpResponseInterceptor);
AuthHttpResponseInterceptor.$inject = ['$location', '$log', '$injector', '$q'];
function AuthHttpResponseInterc... | /**
* Date: 1/9/15
* Author: Shirish Goyal
*/
(function () {
'use strict';
angular
.module('crowdsource.interceptor', [])
.factory('AuthHttpResponseInterceptor', AuthHttpResponseInterceptor);
AuthHttpResponseInterceptor.$inject = ['$location', '$log', '$injector', '$q'];
function AuthHttpResponseInterc... |
Increase time range and id filtering | var spark = require('textspark');
var generateMetricParams = function(namespace, metric, unit, instance_id, dimension, period) {
var endDate = new Date();
var startDate = new Date(endDate);
var durationMinutes = 120;
return {
EndTime: endDate,
MetricName: metric,
Namesp... | var spark = require('textspark');
var generateMetricParams = function(namespace, metric, unit, instance_id, dimension, period) {
var endDate = new Date();
var startDate = new Date(endDate);
var durationMinutes = 60;
return {
EndTime: endDate,
MetricName: metric,
Namespa... |
Fix user creation with unique username | from django.contrib.auth.models import User
from django.db import models
from django.utils import simplejson as json
from .signals import post_associate
class IdentityManager(models.Manager):
def from_loginza_data(self, loginza_data):
data = json.dumps(loginza_data)
identity, created = self.get_... | from django.contrib.auth.models import User
from django.db import models
from django.utils import simplejson as json
from .signals import post_associate
class IdentityManager(models.Manager):
def from_loginza_data(self, loginza_data):
data = json.dumps(loginza_data)
identity, created = self.get_... |
Add emails to auth details | from flask import session
from zeus import auth
from zeus.models import Email, Identity, User
from .base import Resource
from ..schemas import EmailSchema, IdentitySchema, UserSchema
emails_schema = EmailSchema(many=True, strict=True)
identities_schema = IdentitySchema(many=True, strict=True)
user_schema = UserSchem... | from flask import session
from zeus import auth
from zeus.models import Identity, User
from .base import Resource
from ..schemas import IdentitySchema, UserSchema
user_schema = UserSchema(strict=True)
identities_schema = IdentitySchema(many=True, strict=True)
class AuthIndexResource(Resource):
auth_required = ... |
Make factory random names a bit more random to avoid clashes | import factory
from django.utils.timezone import utc, now
from thefederation.models import Node, Platform, Protocol, Stat
class PlatformFactory(factory.DjangoModelFactory):
name = factory.Faker('pystr')
class Meta:
model = Platform
class ProtocolFactory(factory.DjangoModelFactory):
name = fact... | import factory
from django.utils.timezone import utc, now
from thefederation.models import Node, Platform, Protocol, Stat
class PlatformFactory(factory.DjangoModelFactory):
name = factory.Faker('word')
class Meta:
model = Platform
class ProtocolFactory(factory.DjangoModelFactory):
name = facto... |
Fix empty table not showing up | (function(angular, $, RepeaterUtilities) {
'use strict';
var module = angular.module('table.empty-table', []);
module.directive('tableEmptyMessage', function($timeout, $log) {
return {
link: function(scope, el, attrs) {
var msg = (attrs.tableEmptyMessage !== '')... | (function(angular, $, RepeaterUtilities) {
'use strict';
var module = angular.module('table.empty-table', []);
module.directive('tableEmptyMessage', function($timeout, $log) {
return {
link: function(scope, el, attrs) {
var msg = (attrs.tableEmptyMessage !== '')... |
Reorder preferred mimetypes to prefer HTML over JSON | from __future__ import unicode_literals
from flask import Request
class AcceptRequest(Request):
_json_mimetypes = ['application/json',]
_html_mimetypes = ['text/html', 'application/xhtml+xml']
_xml_mimetypes = ['application/xml', 'text/xml']
_rss_mimetypes = ['application/rss+xml', 'application/rd... | from __future__ import unicode_literals
from flask import Request
class AcceptRequest(Request):
_json_mimetypes = ['application/json',]
_html_mimetypes = ['text/html', 'application/xhtml+xml']
_xml_mimetypes = ['application/xml', 'text/xml']
_rss_mimetypes = ['application/rss+xml', 'application/rd... |
Add {table} placeholder for path. | <?php
namespace Josegonzalez\Upload\File\Path\Basepath;
use Cake\Utility\Hash;
use LogicException;
trait DefaultTrait
{
/**
* Returns the basepath for the current field/data combination.
* If a `path` is specified in settings, then that will be used as
* the replacement pattern
*
* @retur... | <?php
namespace Josegonzalez\Upload\File\Path\Basepath;
use Cake\Utility\Hash;
use LogicException;
trait DefaultTrait
{
/**
* Returns the basepath for the current field/data combination.
* If a `path` is specified in settings, then that will be used as
* the replacement pattern
*
* @retur... |
Make Rfam help url relative | var rfam = {
bindings: {
upi: '<',
rna: '<',
rfamHits: '<',
toggleGoModal: '&'
},
controller: ['$http', '$interpolate', 'routes', function($http, $interpolate, routes) {
var ctrl = this;
ctrl.$onInit = function() {
ctrl.help = "/help/rfam-annotat... | var rfam = {
bindings: {
upi: '<',
rna: '<',
rfamHits: '<',
toggleGoModal: '&'
},
controller: ['$http', '$interpolate', 'routes', function($http, $interpolate, routes) {
var ctrl = this;
ctrl.$onInit = function() {
ctrl.help = "https://rnacentral... |
Remove date placeholder too, we need better UX for this later | <?php
namespace Intracto\SecretSantaBundle\Form;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\OptionsResolver\OptionsResolverInterface;
use Intracto\SecretSantaBundle\Form\EntryType;
class PoolType extends AbstractType
{
public function buildForm... | <?php
namespace Intracto\SecretSantaBundle\Form;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\OptionsResolver\OptionsResolverInterface;
use Intracto\SecretSantaBundle\Form\EntryType;
class PoolType extends AbstractType
{
public function buildForm... |
Add an empty array as default to prevent breakage when no filters are passed | <?php
namespace CrudJsonApi\Listener;
use Cake\Event\Event;
use Cake\ORM\Table;
use Crud\Listener\BaseListener;
use RuntimeException;
class SearchListener extends BaseListener
{
/**
* Settings
*
* @var array
*/
protected $_defaultConfig = [
'enabled' => [
'Crud.beforeL... | <?php
namespace CrudJsonApi\Listener;
use Cake\Event\Event;
use Cake\ORM\Table;
use Crud\Listener\BaseListener;
use RuntimeException;
class SearchListener extends BaseListener
{
/**
* Settings
*
* @var array
*/
protected $_defaultConfig = [
'enabled' => [
'Crud.beforeL... |
Modify sms format in sms receiving event
SMS parsing logic uses wildcard to ignore institute name. | package in.testpress.testpress.events;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.telephony.SmsMessage;
import in.testpress.testpress.authenticator.CodeVerificationActivity.Timer;
public class SmsReceivingEvent ext... | package in.testpress.testpress.events;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.telephony.SmsMessage;
import in.testpress.testpress.R;
import in.testpress.testpress.authenticator.CodeVerificationActivity.Timer;
im... |
Validate author_id and return 404 for missing data | from __future__ import absolute_import, division, unicode_literals
from sqlalchemy.orm import joinedload
from uuid import UUID
from changes.api.base import APIView
from changes.api.auth import get_current_user
from changes.models import Author, Build
class AuthorBuildIndexAPIView(APIView):
def _get_author(self,... | from __future__ import absolute_import, division, unicode_literals
from sqlalchemy.orm import joinedload
from changes.api.base import APIView
from changes.api.auth import get_current_user
from changes.models import Author, Build
class AuthorBuildIndexAPIView(APIView):
def _get_author(self, author_id):
i... |
Add url in debug errors | const { Readable } = require('stream')
const convertSDataError = require('./convertSDataError.js')
class FindStream extends Readable {
constructor(request, startUrl, limit = 0) {
super({objectMode: true})
this.request = request
this.startUrl = startUrl
this.limit = limit
this.numRetrieved = 0
}... | const { Readable } = require('stream')
const convertSDataError = require('./convertSDataError.js')
class FindStream extends Readable {
constructor(request, startUrl, limit = 0) {
super({objectMode: true})
this.request = request
this.startUrl = startUrl
this.limit = limit
this.numRetrieved = 0
}... |
msys2-installer: Fix a comparison so only 32-bit executables are rebased
Signed-off-by: Sebastian Schuberth <77397652b38ec60b50e56236b813774ce842bcdf@gmail.com> | function Component()
{
// constructor
}
Component.prototype.isDefault = function()
{
// select the component by default
return true;
}
function createShortcuts()
{
var windir = installer.environmentVariable("WINDIR");
if (windir === "") {
QMessageBox["warning"]( "Error" , "Error", "Could n... | function Component()
{
// constructor
}
Component.prototype.isDefault = function()
{
// select the component by default
return true;
}
function createShortcuts()
{
var windir = installer.environmentVariable("WINDIR");
if (windir === "") {
QMessageBox["warning"]( "Error" , "Error", "Could n... |
Add "requires" entry to .jshintrc entry in blueprint (overlooked in previous commit) | /* globals module */
var EOL = require('os').EOL;
module.exports = {
description: 'Register test helpers',
afterInstall: function( options ) {
// Import statement
var firstFile = 'tests/helpers/start-app.js',
firstText = "import slregisterTestHelpers from './... | /* globals module */
var EOL = require('os').EOL;
module.exports = {
description: 'Register test helpers',
afterInstall: function( options ) {
// Import statement
var firstFile = 'tests/helpers/start-app.js',
firstText = "import slregisterTestHelpers from './... |
Remove .close if the server error'd... older versions of Node.js throw hard errors if the server is not 'listening'. | 'use strict';
var NET = require('net');
var PORTS = {};
function CreateServer(
port,
callback
){
if(
(typeof port === 'number')
){
port = parseFloat(port);
if(
(PORTS[port.toString()])
){
process.nextTick(CreateServer,port,callback);
... | 'use strict';
var NET = require('net');
var PORTS = {};
function CreateServer(
port,
callback
){
if(
(typeof port === 'number')
){
port = parseFloat(port);
if(
(PORTS[port.toString()])
){
process.nextTick(CreateServer,port,callback);
... |
Implement selecting template by quick panel | import sublime
import sublime_plugin
class ProjectTemplateCommand(sublime_plugin.WindowCommand):
SETTINGS_FILE_NAME = 'ProjectTemplate.sublime-settings'
TEMPLATES_KEY = 'templates'
def run(self):
# Check whether the folder is open only one in the current window.
folders = self.window.fol... | import sublime
import sublime_plugin
class ProjectTemplateCommand(sublime_plugin.WindowCommand):
SETTINGS_FILE_NAME = 'ProjectTemplate.sublime-settings'
TEMPLATES_KEY = 'templates'
def run(self):
# Check whether the folder is open only one in the current window.
folders = self.window.fol... |
CA-40618: Change path to the supplemental pack
Signed-off-by: Javier Alvarez-Valle <cf4c8668a0b4c5e013f594a6940d05b3d4d9ddcf@citrix.com> | import subprocess, sys, os.path
class DRAC_NO_SUPP_PACK(Exception):
"""Base Exception class for all transfer plugin errors."""
def __init__(self, *args):
Exception.__init__(self, *args)
class DRAC_POWERON_FAILED(Exception):
"""Base Exception class for all transfer plugin errors."""
def... | import subprocess, sys, os.path
class DRAC_NO_SUPP_PACK(Exception):
"""Base Exception class for all transfer plugin errors."""
def __init__(self, *args):
Exception.__init__(self, *args)
class DRAC_POWERON_FAILED(Exception):
"""Base Exception class for all transfer plugin errors."""
def... |
Tweak some config with no real rhyme or reason | 'use strict';
var plusOrMinusMax = function (value) {
return (Math.random() * value * 2) - value;
}
var Config = {
Brain: {
MinHiddenLayers: 1,
MaxHiddenLayers: 1,
MinNodesPerHiddenLayer: 3,
MaxAdditionalNodesPerHiddenLayer: 3,
},
ChanceOf: {
ActivationFunctionC... | 'use strict';
var coinFlip = function () {
return Math.random() < 0.5;
}
var plusOrMinus = function (value) {
return coinFlip() ? value : -value;
}
var plusOrMinusMax = function (value) {
return (Math.random() * value * 2) - value;
}
var Config = {
Brain: {
MinHiddenLayers: 1,
MaxHid... |
Set isFinished to true when timed out, end on interrupt | package org.robockets.stronghold.robot.intake;
import org.robockets.stronghold.robot.Robot;
import edu.wpi.first.wpilibj.command.Command;
/**
* A Command to spin the intake motor forward or backward
*/
public class ManualVerticalIntake extends Command {
public Direction direction; //Object for the Direction enu... | package org.robockets.stronghold.robot.intake;
import org.robockets.stronghold.robot.Robot;
import edu.wpi.first.wpilibj.command.Command;
/**
* A Command to spin the intake motor forward or backward
*/
public class ManualVerticalIntake extends Command {
public Direction direction; //Object for the Direction enu... |
Remove any existing DKIM signature and set the Sender: header before sending. | from __future__ import print_function
from ses import email_message_from_s3_bucket, event_msg_is_to_command, msg_get_header, recipient_destination_overlap
from cnc import handle_command
import boto3
ses = boto3.client('ses')
from config import email_bucket
from listcfg import ListConfiguration
def lambda_handler(... | from __future__ import print_function
from ses import email_message_from_s3_bucket, event_msg_is_to_command, recipient_destination_overlap
from cnc import handle_command
import boto3
ses = boto3.client('ses')
from config import email_bucket
from listcfg import ListConfiguration
def lambda_handler(event, context):... |
Use CC0 and Public Domain for license | from setuptools import setup, find_packages
import os
from subprocess import call
from setuptools import Command
from distutils.command.build_ext import build_ext as _build_ext
from setuptools.command.bdist_egg import bdist_egg as _bdist_egg
class build_frontend(Command):
""" A command class to run `frontendbuil... | from setuptools import setup, find_packages
import os
from subprocess import call
from setuptools import Command
from distutils.command.build_ext import build_ext as _build_ext
from setuptools.command.bdist_egg import bdist_egg as _bdist_egg
class build_frontend(Command):
""" A command class to run `frontendbuil... |
Update to pass Travis build | /* eslint-env browser */
;(function() {
try {
const onMessage = ({ data }) => {
if (!data.wappalyzer) {
return
}
const { technologies } = data.wappalyzer || {}
removeEventListener('message', onMessage)
postMessage({
wappalyzer: {
js: technologies.reduce(... | /* eslint-env browser */
;(function() {
try {
const onMessage = ({ data }) => {
if (!data.wappalyzer) {
return
}
const { technologies } = data.wappalyzer || {}
removeEventListener('message', onMessage)
postMessage({
wappalyzer: {
js: technologies.reduce(... |
Fix wrong namespace in new test | <?php
declare(strict_types=1);
namespace Snc\RedisBundle\Tests\Client\Predis\Connection;
use PHPUnit\Framework\MockObject\MockObject;
use PHPUnit\Framework\TestCase;
use Predis\Command\KeyScan;
use Predis\Connection\NodeConnectionInterface;
use Predis\Connection\Parameters;
use Psr\Log\LoggerInterface;
use Snc\Redis... | <?php
declare(strict_types=1);
namespace Client\Predis\Connection;
use PHPUnit\Framework\MockObject\MockObject;
use PHPUnit\Framework\TestCase;
use Predis\Command\KeyScan;
use Predis\Connection\NodeConnectionInterface;
use Predis\Connection\Parameters;
use Psr\Log\LoggerInterface;
use Snc\RedisBundle\Client\Predis\C... |
Change to create connection from using default connection | var mongoose = require('mongoose');
var _ = require('lodash');
var Const = require('../const.js');
var DatabaseManager = {
messageModel:null,
userModel:null,
fileModel:null,
init: function(options){
var self = this;
// Connection to our chat database
console.log("Conne... | var mongoose = require('mongoose');
var _ = require('lodash');
var Const = require('../const.js');
var DatabaseManager = {
messageModel:null,
userModel:null,
fileModel:null,
init: function(options){
var self = this;
// Connection to our chat database
console.log("Conne... |
Mark filter headers in My Library for translation | from django.utils.translation import gettext as _
from .models import Language, Partner
from .helpers import get_tag_choices
import django_filters
class PartnerFilter(django_filters.FilterSet):
tags = django_filters.ChoiceFilter(
# Translators: On the MyLibrary page (https://wikipedialibrary.wmflabs.or... | import django_filters
from .models import Language, Partner
from .helpers import get_tag_choices
class PartnerFilter(django_filters.FilterSet):
tags = django_filters.ChoiceFilter(
label="Tags", choices=get_tag_choices(), method="tags_filter"
)
languages = django_filters.ModelChoiceFilter(queryset... |
Fix module call and refactor | /*!
* Wef
* Copyright (c) 2011 Pablo Escalada
* MIT Licensed
*/
/**
* wef module
*/
(function () {
var wef = function () {
return new wef.prototype.init();
};
wef.prototype = {
constructor:wef,
version:"0.0.1",
init:function () {
return this;
}
... | /*!
* Wef
* Copyright (c) 2011 Pablo Escalada
* MIT Licensed
*/
/**
* wef module
*/
(function(global) {
var wef = function() {
return new wef.prototype.init();
};
wef.prototype = {
constructor:wef,
version: "0.0.1",
init: function() {
return this;
}... |
Tweak the JSON we export | #!/usr/bin/env python
# -*- encoding: utf-8 -*-
import json
import os
import subprocess
import sys
def find_json_files():
for root, _, filenames in os.walk('.'):
if any(
d in root
for d in ['/WIP', '/.terraform', '/target']
):
continue
for f in filenam... | #!/usr/bin/env python
# -*- encoding: utf-8 -*-
import json
import os
import subprocess
import sys
def find_json_files():
for root, _, filenames in os.walk('.'):
if any(
d in root
for d in ['/WIP', '/.terraform', '/target']
):
continue
for f in filenam... |
Fix locations of web resources from relative paths to absolute | var webpack = require("webpack");
var path = require("path");
var APP_DIR = path.resolve(__dirname, "src/main/web");
var BUILD_DIR = path.resolve(__dirname, "build/web/bundle");
var config = {
entry: { app: [ APP_DIR + "/index.js" ] },
output: { path: BUILD_DIR, filename: "bundle.js", publicPath: "/webjars/genie-... | var webpack = require("webpack");
var path = require("path");
var APP_DIR = path.resolve(__dirname, "src/main/web");
var BUILD_DIR = path.resolve(__dirname, "build/web/bundle");
var config = {
entry: { app: [ APP_DIR + "/index.js" ] },
output: { path: BUILD_DIR, filename: "bundle.js", publicPath: "webjars/genie-u... |
Implement missing halt callback method and rename actions | package router.client.api2;
import java.util.List;
import java.util.Objects;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
public final class OnChangeCallbackChain
{
@Nonnull
private final List<RouteEntry<OnChangeCallbackAsync>> _chain;
public OnChangeCallbackChain( @Nonnull final List<Rou... | package router.client.api2;
import java.util.List;
import java.util.Objects;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
public final class OnChangeCallbackChain
{
@Nonnull
private final List<RouteEntry<OnChangeCallbackAsync>> _chain;
public OnChangeCallbackChain( @Nonnull final List<Rou... |
Use django rest framework > 3.1 | from setuptools import setup, find_packages
__version__ = "0.0.13"
setup(
# package name in pypi
name='django-oscar-api',
# extract version from module.
version=__version__,
description="REST API module for django-oscar",
long_description=open('README.rst').read(),
classifiers=[
... | from setuptools import setup, find_packages
__version__ = "0.0.13"
setup(
# package name in pypi
name='django-oscar-api',
# extract version from module.
version=__version__,
description="REST API module for django-oscar",
long_description=open('README.rst').read(),
classifiers=[
... |
Update contact on form submitted | window.ContactManager = {
Models: {},
Collections: {},
Views: {},
start: function(data) {
var contacts = new ContactManager.Collections.Contacts(data.contacts),
router = new ContactManager.Router();
router.on('route:home', function() {
router.navigate('contacts', {
trigger: true,... | window.ContactManager = {
Models: {},
Collections: {},
Views: {},
start: function(data) {
var contacts = new ContactManager.Collections.Contacts(data.contacts),
router = new ContactManager.Router();
router.on('route:home', function() {
router.navigate('contacts', {
trigger: true,... |
Add product_number and serial_number identifiers | """
So this is where all the SQL commands live
"""
CREATE_SQL = """
CREATE TABLE component_type (
id INT PRIMARY KEY AUTO_INCREMENT,
type VARCHAR(255) UNIQUE
);
CREATE TABLE components (
id INT PRIMARY KEY AUTO_INCREMENT,
serial_number VARCHAR(255),
sku TEXT,
type INT,
status INT,
FOR... | """
So this is where all the SQL commands live
"""
CREATE_SQL = """
CREATE TABLE component_type (
id INT PRIMARY KEY AUTO_INCREMENT,
type VARCHAR(255) UNIQUE
);
CREATE TABLE components (
id INT PRIMARY KEY AUTO_INCREMENT,
sku TEXT,
type INT,
status INT,
FOREIGN KEY (type) REFERENCES compo... |
Add header type for geojson | var Layer = require('../models/Layer');
var getJSON = function(type, req, res) {
var ops = {
id: parseFloat(req.param("id")),
pid: parseFloat(req.param("pid")),
z: parseFloat(req.param("z"))
},
box = req.param("bbox");
if (box) box = box.replace(... | var Layer = require('../models/Layer');
var getJSON = function(type, req, res) {
var ops = {
id: parseFloat(req.param("id")),
pid: parseFloat(req.param("pid")),
z: parseFloat(req.param("z"))
},
box = req.param("bbox");
if (box) box = box.replace(... |
Fix : forgot to make the actual method call when reversing an IP. | import urllib
import json
class Geoloc(object):
"""
Geoloc class definition.
Given an IP adress, this object will try to reverse identify the IP using
a geolocalisation API.
On the return, it will spit back a list with :
* IP adress,
* Longitude,
* Latitude,
* Country,
* Coun... | import urllib
import json
class Geoloc(object):
"""
Geoloc class definition.
Given an IP adress, this object will try to reverse identify the IP using
a geolocalisation API.
On the return, it will spit back a list with :
* IP adress,
* Longitude,
* Latitude,
* Country,
* Coun... |
Fix json parsing for Python 3 | import json
from ffmpy import FF
class FFprobe(FF):
"""
Wrapper for `ffprobe <https://www.ffmpeg.org/ffprobe.html>`_.
Utilizes ffmpeg `pipe protocol <https://www.ffmpeg.org/ffmpeg-protocols.html#pipe>`_. Input data
(as a byte string) is passed to ffprobe on standard input. Result is presented in JSO... | import json
from ffmpy import FF
class FFprobe(FF):
"""
Wrapper for `ffprobe <https://www.ffmpeg.org/ffprobe.html>`_.
Utilizes ffmpeg `pipe protocol <https://www.ffmpeg.org/ffmpeg-protocols.html#pipe>`_. Input data
(as a byte string) is passed to ffprobe on standard input. Result is presented in JSO... |
Add missing MySQL 8.0 keywords | <?php
namespace Doctrine\DBAL\Platforms\Keywords;
use function array_merge;
/**
* MySQL 8.0 reserved keywords list.
*/
class MySQL80Keywords extends MySQL57Keywords
{
/**
* {@inheritdoc}
*/
public function getName()
{
return 'MySQL80';
}
/**
* {@inheritdoc}
*
*... | <?php
namespace Doctrine\DBAL\Platforms\Keywords;
use function array_merge;
/**
* MySQL 8.0 reserved keywords list.
*/
class MySQL80Keywords extends MySQL57Keywords
{
/**
* {@inheritdoc}
*/
public function getName()
{
return 'MySQL80';
}
/**
* {@inheritdoc}
*
*... |
Change the way we get a clean, blank line before rendering letter bank | from terminaltables import SingleTable
def render(object, **kw):
if object == 'gallows':
render_gallows(**kw)
if object == 'bank':
render_bank(**kw)
if object == 'game_state':
render_game_state(**kw)
def render_gallows(parts=0, **kw):
print("""
______
| |
... | from terminaltables import SingleTable
def render(object, **kw):
if object == 'gallows':
render_gallows(**kw)
if object == 'bank':
render_bank(**kw)
if object == 'game_state':
render_game_state(**kw)
def render_gallows(parts=0, **kw):
print("""
______
| |
... |
Add override settings for CI without local settings. | from django.test import override_settings
from mock import patch
from sms.tests.test_sms import GarfieldTwilioTestCase
from sms.tests.test_sms import GarfieldTwilioTestClient
@override_settings(TWILIO_PHONE_NUMBER="+15558675309")
class GarfieldTestSimSmsCaseNewJohn(GarfieldTwilioTestCase):
@patch('sms.tasks.sav... | from mock import patch
from sms.tests.test_sms import GarfieldTwilioTestCase
from sms.tests.test_sms import GarfieldTwilioTestClient
class GarfieldTestSimSmsCaseNewJohn(GarfieldTwilioTestCase):
@patch('sms.tasks.save_sms_message.apply_async')
def test_sim_receive_sms(self, mock_save_sms_message):
res... |
Allow the user to set the working directory. | 'use strict';
const { exec } = require('child_process');
const branchName = (option) => {
const config = Object.assign({}, option);
return new Promise((resolve, reject) => {
exec('git symbolic-ref --short HEAD', { cwd : config.cwd }, (err, stdout, stderr) => {
if (err) {
er... | 'use strict';
const { exec } = require('child_process');
const get = () => {
return new Promise((resolve, reject) => {
exec('git symbolic-ref --short HEAD', (err, stdout, stderr) => {
if (err) {
err.stderr = stderr;
reject(err);
return;
... |
Fix bug in config test | import unittest
import yaml
import keepaneyeon.config
from keepaneyeon.http import HttpDownloader
class TestConfig(unittest.TestCase):
def test_register(self):
# custom type we want to load from YAML
class A():
def __init__(self, **opts):
self.opts = opts
# YAML... | import unittest
import yaml
import keepaneyeon.config
from keepaneyeon.http import HttpDownloader
class TestConfig(unittest.TestCase):
def test_register(self):
# custom type we want to load from YAML
class A():
def __init__(self, **opts):
self.opts = opts
# YAML... |
Print the URL that erred out, along with the other info | import asyncio
import aiohttp
import logging
log = logging.getLogger(__name__)
@asyncio.coroutine
def http_get_auth_request(auth_string,
url,
content_type="application/json",
auth_method="Token",
payload={}):
h... | import asyncio
import aiohttp
import logging
log = logging.getLogger(__name__)
@asyncio.coroutine
def http_get_auth_request(auth_string,
url,
content_type="application/json",
auth_method="Token",
payload={}):
h... |
Add button that toggles `<Pic>` to make it easier to develop for unmount | 'use strict';
import React, { Component } from 'react';
import Pic from '../lib/index.js';
export default class Playground extends Component {
constructor(props) {
super(props);
this.state = {
show: true
};
this.clickHandler = this.clickHandler.bind(this);
}
clickHandler() {
this.setS... | 'use strict';
import React, { Component } from 'react';
import Pic from '../lib/index.js';
export default class Playground extends Component {
render() {
return (
<html>
<head>
<meta charSet='UTF-8' />
<title>react-pic</title>
</head>
<body>
<div id="r... |
Add a double requestAnimationFrame to count paint performance | import {PureComponent} from 'react';
import parseDiff from 'parse-diff';
import File from './File';
import './App.css';
/* eslint-disable no-console */
export default class App extends PureComponent {
state = {
diff: null,
viewType: 'split'
};
async componentDidMount() {
const re... | import {PureComponent} from 'react';
import parseDiff from 'parse-diff';
import File from './File';
import './App.css';
/* eslint-disable no-console */
export default class App extends PureComponent {
state = {
diff: null,
viewType: 'split'
};
async componentDidMount() {
const re... |
Fix duplicate cookie issue and header parsing | import time
import requests
import bs4
import cgi
from databot.recursive import call
class DownloadErrror(Exception):
pass
def dump_response(response):
return {
'headers': dict(response.headers),
'cookies': response.cookies.get_dict(),
'status_code': response.status_code,
'e... | import time
import requests
import bs4
from databot.recursive import call
class DownloadErrror(Exception):
pass
def dump_response(response):
return {
'headers': dict(response.headers),
'cookies': dict(response.cookies),
'status_code': response.status_code,
'encoding': respon... |
Add Value Link Prop To Textarea Component
Add value link prop to textarea component in order to use with ReactLink
Addon. | let React = require("react")
let {errorList, sizeClassNames, formGroupCx, label} = require("../util.js")
let {div, textarea} = React.DOM
let cx = require("classnames")
export default class extends React.Component {
static displayName = "Frig.friggingBootstrap.Text"
static defaultProps = Object.assign(require("..... | let React = require("react")
let {errorList, sizeClassNames, formGroupCx, label} = require("../util.js")
let {div, textarea} = React.DOM
let cx = require("classnames")
export default class extends React.Component {
static displayName = "Frig.friggingBootstrap.Text"
static defaultProps = Object.assign(require("..... |
Add a getter to scheduled task's time field | const { PhoneNumberUtil } = require('google-libphonenumber');
const scheduledTasksSchemaFunc = require('./schemas/scheduled-tasks-schema');
const phoneUtil = PhoneNumberUtil.getInstance();
const validatePhoneNumber = (number) => {
const parsedNumber = phoneUtil.parseAndKeepRawInput(number, 'KE');
return phoneUtil.... | const { PhoneNumberUtil } = require('google-libphonenumber');
const scheduledTasksSchemaFunc = require('./schemas/scheduled-tasks-schema');
const phoneUtil = PhoneNumberUtil.getInstance();
const validatePhoneNumber = (number) => {
const parsedNumber = phoneUtil.parseAndKeepRawInput(number, 'KE');
return phoneUtil.... |
Update trove to remove Python 3.2, add Python 3.5 | from distutils.core import setup
import skyfield # safe, because __init__.py contains no import statements
setup(
name='skyfield',
version=skyfield.__version__,
description=skyfield.__doc__.split('\n', 1)[0],
long_description=open('README.rst').read(),
license='MIT',
author='Brandon Rhodes',
... | from distutils.core import setup
import skyfield # safe, because __init__.py contains no import statements
setup(
name='skyfield',
version=skyfield.__version__,
description=skyfield.__doc__.split('\n', 1)[0],
long_description=open('README.rst').read(),
license='MIT',
author='Brandon Rhodes',
... |
Split html with newlines for easier debugging | define([
'common/views/govuk',
'stache!common/templates/dashboard'
],
function (GovUkView, contentTemplate) {
var DashboardView = GovUkView.extend({
contentTemplate: contentTemplate,
initialize: function () {
GovUkView.prototype.initialize.apply(this, arguments);
this.dashboardType = this.m... | define([
'common/views/govuk',
'stache!common/templates/dashboard'
],
function (GovUkView, contentTemplate) {
var DashboardView = GovUkView.extend({
contentTemplate: contentTemplate,
initialize: function () {
GovUkView.prototype.initialize.apply(this, arguments);
this.dashboardType = this.m... |
Add React to include JSX in schema | /* eslint-disable no-unused-vars */
import React from 'react';
/* eslint-enable no-unused-vars */
let SERVICE_SCHEMA = {
type: 'object',
properties: {
General: {
description: 'Configure your container',
type: 'object',
properties: {
id: {
default: '/service',
title... | let SERVICE_SCHEMA = {
type: 'object',
properties: {
General: {
description: 'Configure your container',
type: 'object',
properties: {
id: {
default: '/service',
title: 'ID',
description: 'The id for the service',
type: 'string'
},
... |
Fix trade signs on Bitfinex
* Trades from all other exchanges are presented with positive amounts (with the trade type indicating direction). On Bitfinex, sells were arriving negative and buys positive. | package info.bitrich.xchangestream.bitfinex.dto;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.knowm.xchange.bitfinex.v1.dto.marketdata.BitfinexTrade;
import java.math.BigDecimal;
/**
* Created by Lukas Zaoralek on 7.11.17.
*/
@JsonFormat(shape = JsonFormat.Shape.ARRAY)
public class BitfinexWebSoc... | package info.bitrich.xchangestream.bitfinex.dto;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.knowm.xchange.bitfinex.v1.dto.marketdata.BitfinexTrade;
import java.math.BigDecimal;
/**
* Created by Lukas Zaoralek on 7.11.17.
*/
@JsonFormat(shape = JsonFormat.Shape.ARRAY)
public class BitfinexWebSoc... |
fix(identify): Make setUp method compatible with PHPUnit TestCase | <?php
namespace Unicodeveloper\Identify\Test;
use Mockery as m;
use PHPUnit\Framework\TestCase;
use Unicodeveloper\Identify\{ Identify, IdentifyServiceProvider };
class IdentifyServiceProviderTest extends TestCase
{
/**
* @var MockInterface
*/
protected $mockApp;
/**
* @var IdentifyServi... | <?php
namespace Unicodeveloper\Identify\Test;
use Mockery as m;
use PHPUnit\Framework\TestCase;
use Unicodeveloper\Identify\{ Identify, IdentifyServiceProvider };
class IdentifyServiceProviderTest extends TestCase
{
/**
* @var MockInterface
*/
protected $mockApp;
/**
* @var IdentifyServi... |
Use JSON.stringify to stringify Array | class OutletsReceivable {
static transform(modified, ...names) {
modified.outlets = names;
modified._argsTransformFns.push(this.filterOutlets.bind(null, modified));
}
static filterOutlets(modified, opts, ...args) {
let names = modified.outlets;
let outlets = opts.outlets || ... | class OutletsReceivable {
static transform(modified, ...names) {
modified.outlets = names;
modified._argsTransformFns.push(this.filterOutlets.bind(null, modified));
}
static filterOutlets(modified, opts, ...args) {
let names = modified.outlets;
let outlets = opts.outlets || ... |
Add json files to subfolder | import re
from setuptools import setup
from io import open
__version__, = re.findall('__version__ = "(.*)"',
open('mappyfile/__init__.py').read())
def readme():
with open('README.rst', "r", encoding="utf-8") as f:
return f.read()
setup(name='mappyfile',
version=__version_... | import re
from setuptools import setup
from io import open
__version__, = re.findall('__version__ = "(.*)"',
open('mappyfile/__init__.py').read())
def readme():
with open('README.rst', "r", encoding="utf-8") as f:
return f.read()
setup(name='mappyfile',
version=__version_... |
Call "checkAccessible()" before rendering any page templates
To prevent that we render for example "title.tpl" which might access $viewer, for whose existance we chek in checkAccessible | <?php
class CM_RenderAdapter_Page extends CM_RenderAdapter_Component {
protected function _prepareViewResponse(CM_Frontend_ViewResponse $viewResponse) {
$viewResponse->set('pageTitle', $this->fetchTitle());
}
/**
* @return string|null
*/
public function fetchDescription() {
... | <?php
class CM_RenderAdapter_Page extends CM_RenderAdapter_Component {
protected function _prepareViewResponse(CM_Frontend_ViewResponse $viewResponse) {
$viewResponse->set('pageTitle', $this->fetchTitle());
}
/**
* @return string|null
*/
public function fetchDescription() {
... |
Add example for url prefix in config | module.exports = {
server: {
host: 'localhost',
port: 3000
},
router: {
// e.g. api/v2/
urlPrefix: ''
},
database: {
host: 'localhost',
user: 'root',
password: 'root',
database: 'dominion'
},
media: {
urlPath:... | module.exports = {
server: {
host: 'localhost',
port: 3000
},
router: {
urlPrefix: ''
},
database: {
host: 'localhost',
user: 'root',
password: 'root',
database: 'dominion'
},
media: {
urlPath: '/media',
saveD... |
Disable node/no-deprecated-api for Buffer constructor
The use is deprecated since Node 6 but we still support Node 4 so we can't replace it yet. | 'use strict';
const got = require('got');
class Request {
constructor (options) {
options = options || {};
this.baseUrl = 'https://api.glesys.com';
this.userAgent = 'https://github.com/jwilsson/glesys-api';
this.apiKey = options.apiKey;
this.apiUser = options.apiUser;
... | 'use strict';
const got = require('got');
class Request {
constructor (options) {
options = options || {};
this.baseUrl = 'https://api.glesys.com';
this.userAgent = 'https://github.com/jwilsson/glesys-api';
this.apiKey = options.apiKey;
this.apiUser = options.apiUser;
... |
Update the list of regexps for BLOCKING resource loading on page. | /* 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,
/^((?!... |
Change Java client to expose exceptions. | import java.awt.Color;
import com.allsparkcube.CubeClient;
public class HelloWorld {
public static void main(String[] args) {
try {
// final String HOST = "localhost";
final String HOST = "cube.ac";
final int PORT = 12345;
CubeClient client = new ... | import java.awt.Color;
import com.allsparkcube.CubeClient;
public class HelloWorld {
public static void main(String[] args) {
try {
// final String HOST = "localhost";
final String HOST = "cube.ac";
final int PORT = 12345;
CubeClient client = new ... |
Fix IO Properties decode error | <?php
namespace Uro\TeltonikaFmParser\Codec;
use Uro\TeltonikaFmParser\Model\IoValue;
use Uro\TeltonikaFmParser\Model\IoElement;
use Uro\TeltonikaFmParser\Model\IoProperty;
class Codec8Extended extends BaseCodec
{
public function decodeIoElement(): IoElement
{
return (new IoElement(
$th... | <?php
namespace Uro\TeltonikaFmParser\Codec;
use Uro\TeltonikaFmParser\Model\IoValue;
use Uro\TeltonikaFmParser\Model\IoElement;
use Uro\TeltonikaFmParser\Model\IoProperty;
class Codec8Extended extends BaseCodec
{
public function decodeIoElement(): IoElement
{
return (new IoElement(
$th... |
Fix star image from advanced search in javascript | define('app/views/image_list_item', [
'text!app/templates/image_list_item.html','ember'],
/**
*
* Image List Item View
*
* @returns Class
*/
function(image_list_item_html) {
return Ember.View.extend({
tagName:'li',
starImage: ... | define('app/views/image_list_item', [
'text!app/templates/image_list_item.html','ember'],
/**
*
* Image List Item View
*
* @returns Class
*/
function(image_list_item_html) {
return Ember.View.extend({
tagName:'li',
starImage: ... |
Fix ServiceWorker https protocol check | (function() {
function install(options, callback, errback) {
callback || (callback = function() {});
errback || (errback = function() {});
<% if (ServiceWorker) { %>
if (
'serviceWorker' in navigator &&
(window.fetch || 'imageRendering' in document.documentElement.style) &&
... | (function() {
function install(options, callback, errback) {
callback || (callback = function() {});
errback || (errback = function() {});
<% if (ServiceWorker) { %>
if (
'serviceWorker' in navigator &&
(window.fetch || 'imageRendering' in document.documentElement.style) &&
... |
Fix docstring, return the settlement | from .base import Base
class Capture(Base):
@classmethod
def get_resource_class(cls, client):
from ..resources.captures import Captures
return Captures(client)
@property
def id(self):
return self._get_property('id')
@property
def mode(self):
return self._get_p... | from .base import Base
class Capture(Base):
@classmethod
def get_resource_class(cls, client):
from ..resources.captures import Captures
return Captures(client)
@property
def id(self):
return self._get_property('id')
@property
def mode(self):
return self._get_p... |
Use correct m2m join table name in LatestCommentsFeed
--HG--
extra : convert_revision : svn%3Abcc190cf-cafb-0310-a4f2-bffc1f526a37/django/trunk%409089 | from django.conf import settings
from django.contrib.syndication.feeds import Feed
from django.contrib.sites.models import Site
from django.contrib import comments
class LatestCommentFeed(Feed):
"""Feed of latest comments on the current site."""
def title(self):
if not hasattr(self, '_site'):
... | from django.conf import settings
from django.contrib.syndication.feeds import Feed
from django.contrib.sites.models import Site
from django.contrib import comments
class LatestCommentFeed(Feed):
"""Feed of latest comments on the current site."""
def title(self):
if not hasattr(self, '_site'):
... |
Revert "Freeze mozlog version because of proposed API changes."
This reverts commit 932b9d0b8e432ec1a7ff175c8716c8948b0beddd. | # This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this file,
# You can obtain one at http://mozilla.org/MPL/2.0/.
from setuptools import setup
PACKAGE_VERSION = '0.1'
deps = ['fxos-appgen>=0.2.10',
'marionette_client>=0.7.1.1... | # This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this file,
# You can obtain one at http://mozilla.org/MPL/2.0/.
from setuptools import setup
PACKAGE_VERSION = '0.1'
deps = ['fxos-appgen>=0.2.10',
'marionette_client>=0.7.1.1... |
Use test container when available | <?php
/*
* This file is part of the `liip/LiipImagineBundle` project.
*
* (c) https://github.com/liip/LiipImagineBundle/graphs/contributors
*
* For the full copyright and license information, please view the LICENSE.md
* file that was distributed with this source code.
*/
namespace Liip\ImagineBundle\Tests\Fun... | <?php
/*
* This file is part of the `liip/LiipImagineBundle` project.
*
* (c) https://github.com/liip/LiipImagineBundle/graphs/contributors
*
* For the full copyright and license information, please view the LICENSE.md
* file that was distributed with this source code.
*/
namespace Liip\ImagineBundle\Tests\Fun... |
Fix URL argument to wasmFolder to be string, not array
Fixes https://github.com/magjac/d3-graphviz/issues/154
For some reason this incorrectness was working in @hpcc-js/wasm
version 0.3.11 and before, but with the changes in
https://github.com/hpcc-systems/hpcc-js-wasm/commit/1e4f67e26a94f9de6f6b1a7b9ceed85bceed3007
... | /* This file is excluded from coverage because the intrumented code
* translates "self" which gives a reference error.
*/
/* istanbul ignore next */
export function workerCode() {
self.document = {}; // Workaround for "ReferenceError: document is not defined" in hpccWasm
var hpccWasm;
self.onmessage = ... | /* This file is excluded from coverage because the intrumented code
* translates "self" which gives a reference error.
*/
/* istanbul ignore next */
export function workerCode() {
self.document = {}; // Workaround for "ReferenceError: document is not defined" in hpccWasm
var hpccWasm;
self.onmessage = ... |
Truncate imports table on seed | <?php
use App\Models\Setting;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Seeder;
class DatabaseSeeder extends Seeder
{
/**
* Run the database seeds.
*
* @return void
*/
public function run()
{
Model::unguard();
$this->call(CompanySeeder::class);
... | <?php
use App\Models\Setting;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Seeder;
class DatabaseSeeder extends Seeder
{
/**
* Run the database seeds.
*
* @return void
*/
public function run()
{
Model::unguard();
$this->call(CompanySeeder::class);
... |
Set signal high to give IA priority | (function (env) {
"use strict";
env.ddg_spice_wikinews = function(api_result){
if (api_result.error) {
return Spice.failed('wikinews');
}
DDG.require('moment.js', function(){
Spice.add({
id: "wikinews",
name: "Wikinews",
... | (function (env) {
"use strict";
env.ddg_spice_wikinews = function(api_result){
if (api_result.error) {
return Spice.failed('wikinews');
}
DDG.require('moment.js', function(){
Spice.add({
id: "wikinews",
name: "Wikinews",
... |
Add debugtools as a dependency. | #!/usr/bin/env python3
# encoding: utf-8
try:
from setuptools import setup
except ImportError:
from distutils.core import setup
import re
with open('glooey/__init__.py') as file:
version_pattern = re.compile("__version__ = '(.*)'")
version = version_pattern.search(file.read()).group(1)
with open('REA... | #!/usr/bin/env python3
# encoding: utf-8
try:
from setuptools import setup
except ImportError:
from distutils.core import setup
import re
with open('glooey/__init__.py') as file:
version_pattern = re.compile("__version__ = '(.*)'")
version = version_pattern.search(file.read()).group(1)
with open('REA... |
Remove steps data from query in list of queries | import React, { Component } from 'react';
import {graphql, gql} from 'react-apollo';
import RecipeCard from './card';
class RecipesIndex extends Component {
renderRecipes(){
return (
this.props.data.allRecipes.map(recipe => (
<div className="col-xs-12 col-sm-6 col-md-4 col-lg-3 ... | import React, { Component } from 'react';
import {graphql, gql} from 'react-apollo';
import RecipeCard from './card';
class RecipesIndex extends Component {
renderRecipes(){
return (
this.props.data.allRecipes.map(recipe => (
<div className="col-xs-12 col-sm-6 col-md-4 col-lg-3 ... |
Add columns to src packages. | #!/usr/bin/env python
from setuptools import setup
import sys
install_requires = [
'six==1.6.1',
'python-dateutil>=2.2',
'pytimeparse>=1.1.5'
]
if sys.version_info == (2, 6):
install_requires.append('ordereddict>=1.1')
setup(
name='agate',
version='0.6.0',
description='',
long_descri... | #!/usr/bin/env python
from setuptools import setup
import sys
install_requires = [
'six==1.6.1',
'python-dateutil>=2.2',
'pytimeparse>=1.1.5'
]
if sys.version_info == (2, 6):
install_requires.append('ordereddict>=1.1')
setup(
name='agate',
version='0.6.0',
description='',
long_descri... |
Add filter to show button only if selected role tutor | from datetime import datetime
from django import template
from wye.base.constants import WorkshopStatus
register = template.Library()
def show_draft_button(workshop, user):
if (workshop.status in [WorkshopStatus.REQUESTED,
WorkshopStatus.ACCEPTED,
Workshop... | from django import template
from datetime import datetime
from wye.base.constants import WorkshopStatus
register = template.Library()
def show_draft_button(workshop, user):
if (workshop.status in [WorkshopStatus.REQUESTED,
WorkshopStatus.ACCEPTED,
WorkshopSt... |
Fix wrong testcase this types correctly resolved to /issue/issue/* but should be /issue/* | <?php
/**
* test_classes_issue.php
*
* @category
* @author Johannes Brinksmeier <johannes.brinksmeier@googlemail.com>
* @version $Id: $
*/
namespace issue {
interface Class_With_Underscores {
}
class SomeClass implements Class_With_Underscores {
}
class ClassWithDependencyToClassWithUnde... | <?php
/**
* test_classes_issue.php
*
* @category
* @author Johannes Brinksmeier <johannes.brinksmeier@googlemail.com>
* @version $Id: $
*/
namespace issue {
interface Class_With_Underscores {
}
class SomeClass implements Class_With_Underscores {
}
class ClassWithDependencyToClassWithUnde... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.