text stringlengths 16 4.96k | positive stringlengths 321 2.24k | negative stringlengths 310 2.21k |
|---|---|---|
Change maintainer to Blanc Ltd | #!/usr/bin/env python
from setuptools import setup, find_packages
# Use latest_tweets.VERSION for version numbers
version_tuple = __import__('latest_tweets').VERSION
version = '.'.join([str(v) for v in version_tuple])
setup(
name='django-latest-tweets',
version=version,
description='Latest Tweets for Djan... | #!/usr/bin/env python
from setuptools import setup, find_packages
# Use latest_tweets.VERSION for version numbers
version_tuple = __import__('latest_tweets').VERSION
version = '.'.join([str(v) for v in version_tuple])
setup(
name='django-latest-tweets',
version=version,
description='Latest Tweets for Djan... |
Add serial adaptor and error handling. | package gorduino
import (
"github.com/tarm/goserial"
"github.com/yanzay/go-firmata"
)
type Gorduino struct {
pins map[byte]bool
client *firmata.FirmataClient
work func()
}
func NewGorduino(port string, pins ...byte) (*Gorduino, error) {
g := new(Gorduino)
g.pins = make(map[byte]bool)
c := &serial.Config... | package gorduino
import (
"github.com/kraman/go-firmata"
)
type Gorduino struct {
pins map[byte]bool
client *firmata.FirmataClient
work func()
}
func NewGorduino(port string, pins ...byte) *Gorduino {
g := new(Gorduino)
g.pins = make(map[byte]bool)
g.client, _ = firmata.NewClient(port, 57600)
for _, pin ... |
Add refresh for each reply | // // Place all the behaviors and hooks related to the matching controller here.
// // All this logic will automatically be available in application.js.
var ready = function() {
$(".reply-button").hide();
$(".reply-content").focus(function() {
$(this).siblings(".reply-button").fadeIn("fast");
var container... | // // Place all the behaviors and hooks related to the matching controller here.
// // All this logic will automatically be available in application.js.
var ready = function() {
$(".reply-button").hide();
$(".reply-content").focus(function() {
$(this).siblings(".reply-button").fadeIn("fast");
var container... |
Use call instead of bind to prevent phantomjs failures | import ActiveModelAdapter from 'active-model-adapter';
import ActiveModelSerializer from 'active-model-adapter/active-model-serializer';
export default {
name: 'active-model-adapter',
initialize: function(applicationOrRegistry) {
var register;
if (applicationOrRegistry.register) {
// initializeStoreS... | import ActiveModelAdapter from 'active-model-adapter';
import ActiveModelSerializer from 'active-model-adapter/active-model-serializer';
export default {
name: 'active-model-adapter',
initialize: function(applicationOrRegistry) {
var register;
if (applicationOrRegistry.register) {
// initializeStoreS... |
Switch to humanize from underscore instead of writing our own implementation. | Handlebars.registerHelper('select_box', function(field, options) {
var html_options,
_this = this;
if (!field) {
return;
}
if (options.hash.optionValues && options.hash.optionValues.length > 0) {
optionsValues = options.hash.optionValues
} else {
optionsValues = _this["" + field + "Options"]();... | Handlebars.registerHelper('select_box', function(field, options) {
var html_options,
_this = this;
if (!field) {
return;
}
if (options.hash.optionValues && options.hash.optionValues.length > 0) {
optionsValues = options.hash.optionValues
} else {
optionsValues = _this["" + field + "Options"]();... |
Make XHR compatible with new Kitt implementation | var Q = require("../vendor/q/q");
exports.post = function (url, data) {
console.log('posting to', url);
var defer = Q.defer();
var xhr = new XMLHttpRequest();
xhr.onerror = function(err) {
console.log('XMLHttpRequest error: ' + err);
defer.reject(err);
};
xhr.onreadystatechange = function () {
... | var Q = require("../vendor/q/q");
exports.post = function (url, data) {
console.log('posting to', url);
var defer = Q.defer();
var xhr = new XMLHttpRequest();
xhr.onerror = function(err) {
console.log('XMLHttpRequest error: ' + err);
defer.reject(err);
};
xhr.onreadystatechange = function () {
... |
Make safe_qualname more permissive (getting syntax errors on travis in 2.6) | import traceback
from qualname import qualname
def safe_qualname(cls):
# type: (type) -> str
result = _safe_qualname_cache.get(cls)
if not result:
try:
result = qualname(cls)
except (AttributeError, IOError, SyntaxError):
result = cls.__name__
if '<locals>'... | import traceback
from qualname import qualname
def safe_qualname(cls):
# type: (type) -> str
result = _safe_qualname_cache.get(cls)
if not result:
try:
result = qualname(cls)
except (AttributeError, IOError):
result = cls.__name__
if '<locals>' not in resul... |
Allow SiteOption to load into the JS | import random
import json
from django import template
from django.conf import settings
from radio.models import SiteOption
register = template.Library()
# Build json value to pass as js config
@register.simple_tag()
def trunkplayer_js_config(user):
js_settings = getattr(settings, 'JS_SETTINGS', None)
js_jso... | import random
import json
from django import template
from django.conf import settings
register = template.Library()
# Build json value to pass as js config
@register.simple_tag()
def trunkplayer_js_config(user):
js_settings = getattr(settings, 'JS_SETTINGS', None)
js_json = {}
if js_settings:
fo... |
Exclude <Route>, <Switch>, etc. from UMD build
There has to be a better way... | import babel from "rollup-plugin-babel";
import uglify from "rollup-plugin-uglify";
import replace from "rollup-plugin-replace";
import commonjs from "rollup-plugin-commonjs";
import resolve from "rollup-plugin-node-resolve";
const config = {
output: {
format: "umd",
name: "ReactRouterConfig",
globals: {... | import babel from "rollup-plugin-babel";
import uglify from "rollup-plugin-uglify";
import replace from "rollup-plugin-replace";
import commonjs from "rollup-plugin-commonjs";
import resolve from "rollup-plugin-node-resolve";
const config = {
output: {
format: "umd",
name: "ReactRouterConfig",
globals: {... |
Include private organization memberships for logged in user.
Closes #256. | package com.gh4a.loader;
import java.io.IOException;
import java.util.List;
import org.eclipse.egit.github.core.User;
import org.eclipse.egit.github.core.service.OrganizationService;
import android.content.Context;
import com.gh4a.Gh4Application;
public class OrganizationListLoader extends BaseLoader<List<User>> {... | package com.gh4a.loader;
import java.io.IOException;
import java.util.List;
import org.eclipse.egit.github.core.User;
import org.eclipse.egit.github.core.service.OrganizationService;
import android.content.Context;
import com.gh4a.Gh4Application;
public class OrganizationListLoader extends BaseLoader<List<User>> {... |
Fix the response content type | package split
import (
"bytes"
"mime"
"mime/multipart"
"net/http"
"net/textproto"
)
// WriteResponses serialize the responses passed as argument into the ResponseWriter
func WriteResponses(w http.ResponseWriter, responses []*http.Response) error {
var buf bytes.Buffer
multipartWriter := multipart.NewWriter(&bu... | package split
import (
"bytes"
"mime"
"mime/multipart"
"net/http"
"net/textproto"
)
// WriteResponses serialize the responses passed as argument into the ResponseWriter
func WriteResponses(w http.ResponseWriter, responses []*http.Response) error {
var buf bytes.Buffer
multipartWriter := multipart.NewWriter(&bu... |
Fix the postcode form so that it's actually validating the input | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django import forms
from django.core.exceptions import ValidationError
from candidates.mapit import BaseMapItException
from popolo.models import Area
from compat import text_type
from .mapit import get_areas_from_postcode
class PostcodeForm(form... | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django import forms
from django.core.exceptions import ValidationError
from candidates.mapit import BaseMapItException
from popolo.models import Area
from compat import text_type
from .mapit import get_areas_from_postcode
class PostcodeForm(form... |
Add missing dots at the end of exception messages | <?php
/*
* This file is part of the Symfony package.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Bridge\ProxyManager\LazyProxy\PhpDumper;
use ProxyManager\Proxy... | <?php
/*
* This file is part of the Symfony package.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Bridge\ProxyManager\LazyProxy\PhpDumper;
use ProxyManager\Proxy... |
Allow `-` in process names | package main
import (
"bufio"
"os"
"regexp"
)
type procfileEntry struct {
Name string
Command string
Port int
}
func parseProcfile(path string, portBase, portStep int) (entries []procfileEntry) {
re, _ := regexp.Compile(`^([\w-]+):\s+(.+)$`)
f, err := os.Open(path)
fatalOnErr(err)
port := portBase
... | package main
import (
"bufio"
"os"
"regexp"
)
type procfileEntry struct {
Name string
Command string
Port int
}
func parseProcfile(path string, portBase, portStep int) (entries []procfileEntry) {
re, _ := regexp.Compile("^(\\w+):\\s+(.+)$")
f, err := os.Open(path)
fatalOnErr(err)
port := portBase
... |
Add security_group_rule to objects registry
This adds the security_group_rule module to the objects registry,
which allows a service to make sure that all of its objects are
registered before any could be received over RPC.
We don't really have a test for any of these because of the nature
of how they're imported. Re... | # Copyright 2013 IBM Corp.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agree... | # Copyright 2013 IBM Corp.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agree... |
Set default conversation time to 30 minutes | package org.gluu.jsf2.service;
import java.io.Serializable;
import javax.enterprise.context.Conversation;
import javax.enterprise.context.ConversationScoped;
import javax.faces.context.FacesContext;
import javax.inject.Inject;
import javax.inject.Named;
@Named
@ConversationScoped
public class Conversatio... | package org.gluu.jsf2.service;
import java.io.Serializable;
import javax.enterprise.context.Conversation;
import javax.enterprise.context.ConversationScoped;
import javax.faces.context.FacesContext;
import javax.inject.Inject;
import javax.inject.Named;
@Named
@ConversationScoped
public class Conversatio... |
Fix tests to respect removal of magic arg | var test = require('tape');
var loader = require('../primus-loader');
var qsa = require('fdom/qsa');
var async = require('async');
test('can load primus', function(t) {
t.plan(2);
loader(location.origin, function(err, p) {
t.ifError(err);
t.ok(p === Primus, 'primus loaded, p is a valid Primus reference');
... | var test = require('tape');
var loader = require('../primus-loader');
var qsa = require('fdom/qsa');
var async = require('async');
test('can load primus', function(t) {
t.plan(2);
loader(location.origin, function(err, p) {
t.ifError(err);
t.ok(p === Primus, 'primus loaded, p is a valid Primus reference');
... |
Add a settings key to ensure index at start | from pyramid.settings import asbool
from .client import ElasticClient
def client_from_config(settings, prefix='elastic.'):
"""
Instantiate and configure an Elasticsearch from settings.
In typical Pyramid usage, you shouldn't use this directly: instead, just
include ``pyramid_es`` and use the :py:fun... | from pyramid.settings import asbool
from .client import ElasticClient
def client_from_config(settings, prefix='elastic.'):
"""
Instantiate and configure an Elasticsearch from settings.
In typical Pyramid usage, you shouldn't use this directly: instead, just
include ``pyramid_es`` and use the :py:fun... |
Replace placeholder countries with real service call | 'use strict';
mldsApp.factory('CountryService', ['$http', '$log', '$q', function($http, $log, $q){
var countriesListQ = $http.get('/app/rest/countries')
.then(function(d){return d.data;});
var service = {};
service.countries = [];
service.countriesByCode = {};
service.getCountries = function getCo... | 'use strict';
mldsApp.factory('CountryService', ['$http', '$log', '$q', function($http, $log, $q){
return {
getCountries: function() {
return $q.when([
{
isoCode2: 'DK',
isoCode3: 'DNK',
commonName: 'Denmark'
},
{
isoCode2: 'FR',
isoCode3: 'FRA',
commonName: ... |
Update click requirement from <6.8,>=6.7 to >=6.7,<7.1
Updates the requirements on [click](https://github.com/pallets/click) to permit the latest version.
- [Release notes](https://github.com/pallets/click/releases)
- [Changelog](https://github.com/pallets/click/blob/master/docs/changelog.rst)
- [Commits](https://gith... | from setuptools import setup, find_packages
setup(
name='panoptescli',
version='1.1-pre',
url='https://github.com/zooniverse/panoptes-cli',
author='Adam McMaster',
author_email='adam@zooniverse.org',
description=(
'A command-line client for Panoptes, the API behind the Zooniverse'
)... | from setuptools import setup, find_packages
setup(
name='panoptescli',
version='1.1-pre',
url='https://github.com/zooniverse/panoptes-cli',
author='Adam McMaster',
author_email='adam@zooniverse.org',
description=(
'A command-line client for Panoptes, the API behind the Zooniverse'
)... |
Clean up date guessing benchmarking code
* Remove unused imports
* use sys.exit(message) instead of exit()
* Use Pythonic way to call main function (if __name__ == '__main__')
* Reformat code
* Avoid encoding / decoding things to / from UTF-8 | #!/usr/bin/env python3
import os
import sys
from mediawords.tm.guess_date import guess_date
def benchmark_date_guessing():
"""Benchmark Python date guessing code."""
if len(sys.argv) < 2:
sys.exit("Usage: %s <directory of html files>" % sys.argv[0])
directory = sys.argv[1]
for file in os.l... | #!/usr/bin/env python
import os
import pytest
import sys
from mediawords.tm.guess_date import guess_date, McGuessDateException
def main():
if (len(sys.argv) < 2):
sys.stderr.write('usage: ' + sys.argv[0] + ' <directory of html files>')
exit()
directory = os.fsencode(sys.argv[1]).decode("utf-... |
Add Header to Produit page | <!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Nos Bonbons</title>
</head>
<body>
<?php
include "Reference.php";
?>
<?php include("header.php"); ?>
<?php //include("footer.php"); ?>
<article class="card" style="width: 20rem;">
<figure class="imageBonbon">
<img class="... | <!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Nos Bonbons</title>
</head>
<body>
<?php
include "Reference.php";
?>
<?php //include("header.php"); ?>
<?php //include("footer.php"); ?>
<article class="card" style="width: 20rem;">
<figure class="imageBonbon">
<img class... |
Write compact json when using built-in json.dumps | # -*- coding: utf-8 -*-
from __future__ import absolute_import
import ast
import sys
import struct
import functools
try:
import ujson as json
json_dumps = json.dumps
except ImportError:
import json
json_dumps = functools.partial(json.dumps, separators=',:')
PY3 = sys.version_info[0] == 3
if PY3:
... | # -*- coding: utf-8 -*-
from __future__ import absolute_import
import ast
import sys
import struct
try:
import ujson as json
except ImportError:
import json
PY3 = sys.version_info[0] == 3
if PY3:
string_types = str,
else:
string_types = basestring,
def flatten_dtype(dtype):
dtype = str(dtype)... |
Add test case related to devide numbers. | package study.hard.javalib.nativelib;
import static org.junit.Assert.*;
import org.junit.Before;
import org.junit.Test;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
public class MathTest {
private static Logger logger = LoggerFactory.getLogger(MathTest.class);
private Double amount;
private Double r... | package study.hard.javalib.nativelib;
import static org.junit.Assert.*;
import org.junit.Before;
import org.junit.Test;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
public class MathTest {
private static Logger logger = LoggerFactory.getLogger(MathTest.class);
private Double amount;
private Double r... |
Make cloud check evaluate greater than or equals | from pyowm.owm import OWM
from datetime import datetime, timedelta
class WeatherManager:
def __init__(self, key, lat, lon):
owm = OWM(key)
self.mgr = owm.weather_manager()
self.lat = lat
self.lon = lon
self.last_updated = None
def load_data(self):
self.data = se... | from pyowm.owm import OWM
from datetime import datetime, timedelta
class WeatherManager:
def __init__(self, key, lat, lon):
owm = OWM(key)
self.mgr = owm.weather_manager()
self.lat = lat
self.lon = lon
self.last_updated = None
def load_data(self):
self.data = se... |
Fix native reference so that it does not violate circularity rules between $impl and header files.
PiperOrigin-RevId: 168731186 | /*
* Copyright 2017 Google Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to... | /*
* Copyright 2017 Google Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to... |
Use `navigator.userAgentData` for platform detection when available | function uaDetect(platform, re) {
if (navigator.userAgentData) {
return platform === navigator.userAgentData.platform;
}
return re.test(navigator.userAgent);
}
var IS_MAC = uaDetect("macOS", /Mac/);
var KEY_A = 65;
var KEY_COMMA = 188;
var KEY_RETURN = 13;
var KEY_ESC = 27;
var ... | var IS_MAC = /Mac/.test(navigator.userAgent);
var KEY_A = 65;
var KEY_COMMA = 188;
var KEY_RETURN = 13;
var KEY_ESC = 27;
var KEY_LEFT = 37;
var KEY_UP = 38;
var KEY_P = 80;
var KEY_RIGHT = 39;
var KEY_DOWN = 40;
var KEY_N = 78;
var KEY_BACKSPACE = 8;
va... |
Change HTTP error for fallback: did not match standards. | package net.chibidevteam.apiversioning.controller;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.http.HttpStatus;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotati... | package net.chibidevteam.apiversioning.controller;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.http.HttpStatus;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotati... |
Disable "no-negated-condition" for if condition | 'use strict';
const os = require('os');
const path = require('path');
const alfy = require('alfy');
const dotenv = require('dotenv');
const imgur = require('imgur');
const clipboardy = require('clipboardy');
// Load config from ~/.alfred-imgur
dotenv.config({path: path.join(os.homedir(), '.alfred-imgur.conf')});
// C... | 'use strict';
const os = require('os');
const path = require('path');
const alfy = require('alfy');
const dotenv = require('dotenv');
const imgur = require('imgur');
const clipboardy = require('clipboardy');
// Load config from ~/.alfred-imgur
dotenv.config({path: path.join(os.homedir(), '.alfred-imgur.conf')});
// C... |
Refactor bubble legend compatibility rules with styles for clarity | var _ = require('underscore');
var LegendTypes = require('builder/editor/layers/layer-content-views/legend/legend-types');
var styleHelper = require('builder/helpers/style');
module.exports = [
{
value: LegendTypes.NONE,
tooltipTranslationKey: 'editor.legend.tooltips.style.none',
legendIcon: require('bui... | var _ = require('underscore');
var LegendTypes = require('builder/editor/layers/layer-content-views/legend/legend-types');
module.exports = [
{
value: LegendTypes.NONE,
tooltipTranslationKey: 'editor.legend.tooltips.style.none',
legendIcon: require('builder/editor/layers/layer-content-views/legend/carous... |
Remove support for versions before 5.3 | <?php
namespace Ferret\Detector;
use \Ferret\Detector\DetectorInterface;
use \Ferret\Detector\Exception\DetectorException;
class Fileinfo extends DetectorAbstract
{
protected $magic_filepath = null;
public function __construct()
{
if (!class_exists('finfo'))
{
throw new DetectorException('Fil... | <?php
namespace Ferret\Detector;
use \Ferret\Detector\DetectorInterface;
use \Ferret\Detector\Exception\DetectorException;
class Fileinfo extends DetectorAbstract
{
protected $magic_filepath = null;
public function __construct()
{
if (!class_exists('finfo'))
{
throw new DetectorException('Fil... |
Add italic and inverse ansi codes to definition | // ANSI color code outputs for strings
var ANSI_CODES = {
"off": 0,
"bold": 1,
"italic": 3,
"underline": 4,
"blink": 5,
"inverse": 7,
"hidden": 8,
"black": 30,
"red": 31,
"green": 32,
"yellow": 33,
"blue": 34,
"magenta": 35,
"cyan": 36,
"white": 37,
"black_bg": 40,
"red_bg": 41,
"gr... | // ANSI color code outputs for strings
var ANSI_CODES = {
"off": 0,
"bold": 1,
"underline": 4,
"blink": 5,
"hidden": 8,
"black": 30,
"red": 31,
"green": 32,
"yellow": 33,
"blue": 34,
"magenta": 35,
"cyan": 36,
"white": 37,
"black_bg": 40,
"red_bg": 41,
"green_bg": 42,
"yellow_bg": 43,... |
Fix the potential issue of variable shadowing | 'use strict';
var document = require('global/document');
var window = require('global/window');
var createCustomEvent;
if (window && window.CustomEvent && typeof window.CustomEvent === 'function') {
createCustomEvent = function createCustomEventDefault(type, eventInitDict) {
return new window.CustomEvent(type, e... | 'use strict';
var document = require('global/document');
var window = require('global/window');
var createCustomEvent;
if (window && window.CustomEvent && typeof window.CustomEvent === 'function') {
createCustomEvent = function createCustomEvent(type, eventInitDict) {
return new window.CustomEvent(type, eventIni... |
LUCENE-1769: Add also the opposite assert statement
git-svn-id: 4c5078813df38efa56971a28e09a55254294f104@891907 13f79535-47bb-0310-9956-ffa450edef68 | package org.apache.lucene;
/**
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0... | package org.apache.lucene;
/**
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0... |
Fix Job error on shutdown | /*******************************************************************************
* Copyright 2013 Friedrich Schiller University Jena
* stephan.druskat@uni-jena.de
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtai... | /*******************************************************************************
* Copyright 2013 Friedrich Schiller University Jena
* stephan.druskat@uni-jena.de
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtai... |
Switch out 'createModel' for 'extend' | var Arrow = require('arrow');
var Base = Arrow.Model.extend('base', {
connector: 'appc.redis',
fields: { },
expire: function expire(seconds, callback){
return this.getConnector().expire(this.getModel(), this, seconds, callback);
},
expireAt: function expireAt(date, callback){
re... | var Arrow = require('arrow');
module.exports = Arrow.createModel('base', {
connector: 'appc.redis',
fields: { },
expire: function expire(seconds, callback){
return this.getConnector().expire(this.getModel(), this, seconds, callback);
},
expireAt: function expireAt(date, callback){
... |
Add the Accept header to all API calls | import Vuex from 'vuex'
import axios from 'axios'
import VueAxios from 'vue-axios'
import HalJsonVuex from 'hal-json-vuex'
import lang from './lang'
class StorePlugin {
install (Vue, options) {
Vue.use(Vuex)
store = new Vuex.Store({
modules: {
lang
},
strict: process.env.NODE_ENV !... | import Vuex from 'vuex'
import axios from 'axios'
import VueAxios from 'vue-axios'
import HalJsonVuex from 'hal-json-vuex'
import lang from './lang'
class StorePlugin {
install (Vue, options) {
Vue.use(Vuex)
store = new Vuex.Store({
modules: {
lang
},
strict: process.env.NODE_ENV !... |
Use standard 3-part version number. |
import os
from setuptools import setup, find_packages
setup(
name = 'temps',
version = '0.1.0',
license = 'MIT',
description = 'Context managers for creating and cleaning up temporary directories and files.',
long_description = open(os.path.join(os.path.dirname(__file__),
... |
import os
from setuptools import setup, find_packages
setup(
name = 'temps',
version = '0.1',
license = 'MIT',
description = 'Context managers for creating and cleaning up temporary directories and files.',
long_description = open(os.path.join(os.path.dirname(__file__),
... |
Convert *_INTERVAL variables to int
ALERT_INTERVAL and NOTIFICATION_INTERVAL are now converted to
numbers. This allows user-defined ALERT_INTERVAL and
NOTIFICATION_INTERVAL env variables to work without throwing
TypeErrors:
return self.run(*args, **kwargs)
File "/cabot/cabot/cabotapp/tasks.py", line 68, in upda... | import os
GRAPHITE_API = os.environ.get('GRAPHITE_API')
GRAPHITE_USER = os.environ.get('GRAPHITE_USER')
GRAPHITE_PASS = os.environ.get('GRAPHITE_PASS')
GRAPHITE_FROM = os.getenv('GRAPHITE_FROM', '-10minute')
JENKINS_API = os.environ.get('JENKINS_API')
JENKINS_USER = os.environ.get('JENKINS_USER')
JENKINS_PASS = os.env... | import os
GRAPHITE_API = os.environ.get('GRAPHITE_API')
GRAPHITE_USER = os.environ.get('GRAPHITE_USER')
GRAPHITE_PASS = os.environ.get('GRAPHITE_PASS')
GRAPHITE_FROM = os.getenv('GRAPHITE_FROM', '-10minute')
JENKINS_API = os.environ.get('JENKINS_API')
JENKINS_USER = os.environ.get('JENKINS_USER')
JENKINS_PASS = os.env... |
Make each manufacturer a link to the edit page instead of using a form button | <!-- resources/views/admin/manufacturer_index.blade.php -->
@extends('layouts.app')
@section('content')
<h2>Manufacturers</h2>
<p>Click a manufacturer to edit</p>
<table class="table">
<tbody>
@foreach ($manufacturers->chunk(2) as $chunk )
<tr>
@foreach ($chunk as $manufacturer)
<td>{{ $manufacturer->id }}</t... | <!-- resources/views/admin/manufacturer_index.blade.php -->
@extends('layouts.app')
@section('content')
<h2>Manufacturers</h2>
<table class="table">
<tbody>
@foreach ($manufacturers->chunk(2) as $chunk )
<tr>
@foreach ($chunk as $manufacturer)
<td>{{ $manufacturer->id }}</td>
<td>{{ $manufacturer->manufac... |
Fix some confusion of creating folders | import os
import json
import shutil
import subprocess
import string
import random
from chunsabot.database import Database
from chunsabot.botlogic import brain
RNN_PATH = Database.load_config('rnn_library_path')
MODEL_PATH = os.path.join(RNN_PATH, "models/checkpoint_v1.t7_cpu.t7")
def id_generator(size=12, chars=stri... | import os
import json
import shutil
import subprocess
import string
import random
from chunsabot.database import Database
from chunsabot.botlogic import brain
RNN_PATH = Database.load_config('rnn_library_path')
MODEL_PATH = os.path.join(RNN_PATH, "models/checkpoint_v1.t7_cpu.t7")
def id_generator(size=12, chars=stri... |
Set a flag when config is loaded on a browser | // Copyright (c) 2014 Readium Foundation and/or its licensees. All rights reserved.
//
// Redistribution and use in source and binary forms, with or without modification,
// are permitted provided that the following conditions are met:
// 1. Redistributions of source code must retain the above copyright notice, thi... | // Copyright (c) 2014 Readium Foundation and/or its licensees. All rights reserved.
//
// Redistribution and use in source and binary forms, with or without modification,
// are permitted provided that the following conditions are met:
// 1. Redistributions of source code must retain the above copyright notice, thi... |
Handle case of generating ID with no speakers | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
from flask import Flask, request, json
from flask.ext.cors import CORS
import database
import rsser
# Update data before application is allowed to start
database.update_database()
app = Flask(__name__)
CORS(app)
@app.route('/speakercast/speakers')
def speakers():
... | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
from flask import Flask, request, json
from flask.ext.cors import CORS
import database
import rsser
# Update data before application is allowed to start
database.update_database()
app = Flask(__name__)
CORS(app)
@app.route('/speakercast/speakers')
def speakers():
... |
Change presence clientId to _cookieId in client object | const program = require('commander');
program
.version('1.0.0')
.option('-p, --port <port>', 'specify the websocket port to listen to [9870]', 9870)
.parse(process.argv);
const io = require('socket.io'),
winston = require('winston');
winston.level = 'debug';
winston.remove(winston.transports.Conso... | const program = require('commander');
program
.version('1.0.0')
.option('-p, --port <port>', 'specify the websocket port to listen to [9870]', 9870)
.parse(process.argv);
const io = require('socket.io'),
winston = require('winston');
winston.level = 'debug';
winston.remove(winston.transports.Conso... |
Switch to PropTypes because Hyper's React got rid of it | import React from 'react'
import PropTypes from 'prop-types'
import Component from 'hyper/component'
import SvgIcon from '../../utils/svg-icon'
export default class Draining extends Component {
static propTypes() {
return {
percentage: PropTypes.number
}
}
calculateChargePoint(percent) {
const... | import React, {PropTypes} from 'react'
import Component from 'hyper/component'
import SvgIcon from '../../utils/svg-icon'
export default class Draining extends Component {
static propTypes() {
return {
percentage: PropTypes.number
}
}
calculateChargePoint(percent) {
const base = 3.5,
val... |
Add raw line data to output | #!/usr/bin/python
# -*- coding: utf-8 -*-
import sys
import os
sys.path.append(os.path.dirname(os.path.dirname(__file__)) + '/src')
import DataVisualizing
if len(sys.argv) != 2:
print 'usage: create_heatmap.py <data file>'
print ' expected infile is a datafile containing tracking data'
print ' this is a... | #!/usr/bin/python
# -*- coding: utf-8 -*-
import sys
import os
sys.path.append(os.path.dirname(os.path.dirname(__file__)) + '/src')
import DataVisualizing
if len(sys.argv) != 2:
print 'usage: create_heatmap.py <data file>'
print ' expected infile is a datafile containing tracking data'
print ' this is a... |
Change "error" to "error_code" in error object | var logger = require('log4js').getLogger('APP_LOG');
var request = require('request');
function sendMessage(config, receiver, message, botname, callback) {
var chat_id = config.receivers[receiver].chat_id;
var token = config.bots[botname].token;
request.post({
url: 'https://api.telegram.org/bot' + token + '/se... | var logger = require('log4js').getLogger('APP_LOG');
var request = require('request');
function sendMessage(config, receiver, message, botname, callback) {
var chat_id = config.receivers[receiver].chat_id;
var token = config.bots[botname].token;
request.post({
url: 'https://api.telegram.org/bot' + token + '/se... |
[previews] Fix more FAKE syntax errors | import React, {PropTypes} from 'react'
import PreviewComponentCard from 'part:@sanity/components/previews/card'
import PreviewComponentDefault from 'part:@sanity/components/previews/default'
import PreviewComponentDetail from 'part:@sanity/components/previews/detail'
import PreviewComponentInline from 'part:@sanity/co... | import React, {PropTypes} from 'react'
import PreviewComponentCard from 'part:@sanity/components/previews/card'
import PreviewComponentDefault from 'part:@sanity/components/previews/default'
import PreviewComponentDetail from 'part:@sanity/components/previews/detail'
import PreviewComponentInline from 'part:@sanity/co... |
Use this instead of local variable | /*
* Application logic
*/
var Logic = {
parser: PEG.buildParser(" \
start = logic* \
logic = q:query a:action ' '* { return {query:q, action:a} } \
query = q:[^{]+ { return Query.compile(q.join('').trim()) } \
action = block:curly { return eval('(function()' + block + ')') } \
curly = curly:('{... | /*
* Application logic
*/
var Logic = {
parser: PEG.buildParser(" \
start = logic* \
logic = q:query a:action ' '* { return {query:q, action:a} } \
query = q:[^{]+ { return Query.compile(q.join('').trim()) } \
action = block:curly { return eval('(function()' + block + ')') } \
curly = curly:('{... |
Add "test" disposition to doc | <?php
declare(strict_types=1);
namespace MaxMind\MinFraud\Model;
/**
* Model with the disposition set by custom rules.
*
* In order to receive a disposition, you must be using minFraud custom rules.
*
* @property-read string|null $action The action to take on the transaction as
* defined by your custom rules. ... | <?php
declare(strict_types=1);
namespace MaxMind\MinFraud\Model;
/**
* Model with the disposition set by custom rules.
*
* In order to receive a disposition, you must be using minFraud custom rules.
*
* @property-read string|null $action The action to take on the transaction as
* defined by your custom rules. ... |
Fix error causing PhantomJS to eat RAM | // This is a manifest file that'll be compiled into application.js, which will include all the files
// listed below.
//
// Any JavaScript/Coffee file within this directory, lib/assets/javascripts, vendor/assets/javascripts,
// or any plugin's vendor/assets/javascripts directory can be referenced here using a relative ... | // This is a manifest file that'll be compiled into application.js, which will include all the files
// listed below.
//
// Any JavaScript/Coffee file within this directory, lib/assets/javascripts, vendor/assets/javascripts,
// or any plugin's vendor/assets/javascripts directory can be referenced here using a relative ... |
Return the EntityData on entity undo | package com.elmakers.mine.bukkit.api.block;
import java.util.List;
import com.elmakers.mine.bukkit.api.entity.EntityData;
import org.bukkit.Location;
import org.bukkit.block.Block;
import org.bukkit.entity.Entity;
import com.elmakers.mine.bukkit.api.magic.Mage;
public interface UndoList extends BlockList, Comparabl... | package com.elmakers.mine.bukkit.api.block;
import java.util.List;
import org.bukkit.Location;
import org.bukkit.block.Block;
import org.bukkit.entity.Entity;
import com.elmakers.mine.bukkit.api.magic.Mage;
public interface UndoList extends BlockList, Comparable<UndoList> {
public void commit();
public void... |
Fix test failing in macOS due to short GIdleThread timeout
Signed-off-by: Dan Yeaw <2591e5f46f28d303f9dc027d475a5c60d8dea17a@yeaw.me> | import pytest
from gaphor.misc.gidlethread import GIdleThread
def counter(count):
for x in range(count):
yield x
@pytest.fixture
def gidle_counter(request):
# Setup GIdle Thread with 0.02 sec timeout
t = GIdleThread(counter(request.param))
t.start()
assert t.is_alive()
wait_result =... | import pytest
from gaphor.misc.gidlethread import GIdleThread
def counter(count):
for x in range(count):
yield x
@pytest.fixture
def gidle_counter(request):
# Setup GIdle Thread with 0.01 sec timeout
t = GIdleThread(counter(request.param))
t.start()
assert t.is_alive()
wait_result =... |
Remove unneccessary Customer Dashboard navbar link | import React from 'react';
import { Link } from 'react-router';
import { Menu, Segment } from 'semantic-ui-react';
import DynamicLinks from './DynamicLinks';
const Navbar = ({ id, location, logout }) =>
<Segment inverted>
<Menu inverted borderless>
<Menu.Item
as={Link}
to="landing"
... | import React from 'react';
import { Link } from 'react-router';
import { Menu, Segment } from 'semantic-ui-react';
import DynamicLinks from './DynamicLinks';
const Navbar = ({ id, location, logout }) =>
<Segment inverted>
<Menu inverted borderless>
<Menu.Item
as={Link}
to="landing"
... |
[desk-tool] Remove Ink on Pane items | import styles from './styles/PaneItem.css'
import listStyles from './styles/ListView.css'
import PropTypes from 'prop-types'
import React from 'react'
// import Ink from 'react-ink'
import {StateLink} from 'part:@sanity/base/router'
import {Item as GridListItem} from 'part:@sanity/components/lists/grid'
export default... | import styles from './styles/PaneItem.css'
import listStyles from './styles/ListView.css'
import PropTypes from 'prop-types'
import React from 'react'
import Ink from 'react-ink'
import {StateLink} from 'part:@sanity/base/router'
import {Item as GridListItem} from 'part:@sanity/components/lists/grid'
export default fu... |
Use `-w` flag to display password directly
Fixes #2. | 'use strict';
var execFile = require('child_process').execFile;
var wifiName = require('wifi-name');
function getPassword(ssid, cb) {
var cmd = 'security';
var args = ['find-generic-password', '-D', 'AirPort network password', '-wa', ssid];
execFile(cmd, args, function (err, stdout) {
stdout = stdout.trim();
... | 'use strict';
var execFile = require('child_process').execFile;
var wifiName = require('wifi-name');
function getPassword(ssid, cb) {
var cmd = 'security';
var args = ['find-generic-password', '-D', 'AirPort network password', '-ga', ssid];
var ret;
execFile(cmd, args, function (err, stdout, stderr) {
if (err &... |
Check for active session before bootstrapping | //make sure all dependencies are loaded
require([
'es5shim',
'angular',
'json!data/config.json',
'angular-ui-router',
'angular-flash',
'angular-moment',
'angular-sanitize',
'emoji',
'socketio',
'socket',
'jquery',
'jquery-filedrop',
'app',
'services/services',
'controllers/controller... | //make sure all dependencies are loaded
require([
'es5shim',
'angular',
'json!data/config.json',
'angular-ui-router',
'angular-flash',
'angular-moment',
'angular-sanitize',
'emoji',
'socketio',
'socket',
'jquery',
'jquery-filedrop',
'app',
'services/services',
'controllers/controller... |
Add author to post transformer | <?php namespace Autumn\Tools\Transformers;
use RainLab\Blog\Models\Post;
use League\Fractal\TransformerAbstract;
class BlogPostTransformer extends TransformerAbstract
{
protected $defaultIncludes = [
'featured_images',
];
public function transform(Post $post)
{
return [
'i... | <?php namespace Autumn\Tools\Transformers;
use RainLab\Blog\Models\Post;
use League\Fractal\TransformerAbstract;
class BlogPostTransformer extends TransformerAbstract
{
protected $defaultIncludes = [
'featured_images',
];
public function transform(Post $post)
{
return [
'i... |
Use interface as return type | <?php
declare(strict_types=1);
namespace phpDocumentor\Reflection\Php;
use phpDocumentor\Reflection\Exception;
use phpDocumentor\Reflection\Metadata\MetaDataContainer as MetaDataContainerInterface;
trait MetadataContainerTest
{
/**
* @covers ::addMetadata
* @covers ::getMetadata
*/
public fun... | <?php
declare(strict_types=1);
namespace phpDocumentor\Reflection\Php;
use phpDocumentor\Reflection\Exception;
trait MetadataContainerTest
{
/**
* @covers ::addMetadata
* @covers ::getMetadata
*/
public function testSetMetaDataForNonExistingKey(): void
{
$stub = new MetadataStub('... |
Fix parseNumber in case of 3 numbers after decimal dot |
if (typeof module !== 'undefined' && typeof module.exports !== 'undefined') {
module.exports = parseNumber;
}
var numberRegexp = new RegExp('^(?:((?:\\d{1,3}(?:\\.\\d{3})+|\\d+)(,\\d{1,})?)|((?:\\d{1,3}(?:,\\d{3})+|\\d+)(\\.\\d{1,})?))$');
var dotRegexp = /\./g;
var commaRegexp = /,/g;
/**
* Create float number... |
if (typeof module !== 'undefined' && typeof module.exports !== 'undefined') {
module.exports = parseNumber;
}
var numberRegexp = new RegExp('^(?:((?:\\d{1,3}(?:\\.\\d{3})+|\\d+)(?:,\\d{1,})?)|((?:\\d{1,3}(?:,\\d{3})+|\\d+)(?:\\.\\d{1,})?))$');
var dotRegexp = /\./g;
var commaRegexp = /,/g;
/**
* Create float nu... |
Test setting @Transactional on findById repository method. | /*
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distr... | /*
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distr... |
Fix a problem with PESEL validation | # -*- coding: utf-8 -*-
from operator import mul
from openerp import models, fields, api, exceptions
class Volunteer(models.Model):
_inherit = 'res.users'
pesel = fields.Char(string=u"PESEL")
def __init__(self, pool, cr):
super(Volunteer, self).__init__(pool, cr)
self._add_permitted_fiel... | # -*- coding: utf-8 -*-
from operator import mul
from openerp import models, fields, api, exceptions
class Volunteer(models.Model):
_inherit = 'res.users'
pesel = fields.Char(string=u"PESEL")
def __init__(self, pool, cr):
super(Volunteer, self).__init__(pool, cr)
self._add_permitted_fiel... |
Refactor public_view_url check to be more pythonic
In addition to this I also removed the is_public variable because the new utils
function says the same thing so it is redundant. | from django.contrib.auth.decorators import login_required
from stronghold import conf, utils
class LoginRequiredMiddleware(object):
"""
Force all views to use login required
View is deemed to be public if the @public decorator is applied to the view
View is also deemed to be Public if listed in in d... | from django.contrib.auth.decorators import login_required
from stronghold import conf, utils
class LoginRequiredMiddleware(object):
"""
Force all views to use login required
View is deemed to be public if the @public decorator is applied to the view
View is also deemed to be Public if listed in in d... |
Fix noisy processor propertycount output | package main.java.org.wikidata.analyzer.Processor;
import org.wikidata.wdtk.datamodel.interfaces.*;
/**
* This processor simply outputs status lines to the console.
*
* @author Addshore
*/
public class NoisyProcessor implements EntityDocumentProcessor {
private int itemCount = 0;
private int propertyCoun... | package main.java.org.wikidata.analyzer.Processor;
import org.wikidata.wdtk.datamodel.interfaces.*;
/**
* This processor simply outputs status lines to the console.
*
* @author Addshore
*/
public class NoisyProcessor implements EntityDocumentProcessor {
private int itemCount = 0;
private int propertyCoun... |
[chore] Define uglify (minify) grunt task | module.exports = function(grunt) {
grunt.initConfig({
jshint: {
files: ['*.js', 'client/app/*.js', 'server/**/*.js', 'database/**/*.js'],
options: {
ignores: [
// (TODO: add lib files here)
]
}
},
uglify: {
my_target: {
files: {
'client... | module.exports = function(grunt) {
grunt.initConfig({
jshint: {
files: ['*.js', 'client/app/*.js', 'server/**/*.js', 'database/**/*.js'],
options: {
ignores: [
// (TODO: add lib files here)
]
}
},
// TODO: add uglify, concat, cssmin tasks
watch: {
... |
Make path assertions windows friendly | package utils
import (
"os"
"os/user"
"path/filepath"
"testing"
"github.com/stretchr/testify/assert"
)
func TestNormalizingHomeDirectories(t *testing.T) {
t.Parallel()
usr, err := user.Current()
assert.NoError(t, err)
fp, err := NormalizeFilePath(filepath.Join(`~`, `.ssh`))
assert.NoError(t, err)
assert... | package utils
import (
"os"
"os/user"
"path/filepath"
"testing"
"github.com/stretchr/testify/assert"
)
func TestNormalizingHomeDirectories(t *testing.T) {
t.Parallel()
usr, err := user.Current()
assert.NoError(t, err)
fp, err := NormalizeFilePath(filepath.Join(`~`, `.ssh`))
assert.NoError(t, err)
assert... |
Remove deprecated lifecycle methods from ObserveModel | import React from 'react';
import PropTypes from 'prop-types';
import ModelObserver from '../models/model-observer';
export default class ObserveModel extends React.Component {
static propTypes = {
model: PropTypes.shape({
onDidUpdate: PropTypes.func.isRequired,
}),
fetchData: PropTypes.func.isReq... | import React from 'react';
import PropTypes from 'prop-types';
import ModelObserver from '../models/model-observer';
export default class ObserveModel extends React.Component {
static propTypes = {
model: PropTypes.shape({
onDidUpdate: PropTypes.func.isRequired,
}),
fetchData: PropTypes.func.isReq... |
Use fasthttp client in avalanche.HTTPWriter
benchmark old ns/op new ns/op delta
BenchmarkHTTPSmallPoints1-4 97655 75615 -22.57%
BenchmarkHTTPSmallPoints2-4 111484 73023 -34.50%
BenchmarkHTTPSmallPoints4-4 107066 72719 ... | package avalanche
import (
"fmt"
"github.com/valyala/fasthttp"
)
type HTTPWriterConfig struct {
Host string
Generator Generator
}
type HTTPWriter struct {
client fasthttp.Client
c HTTPWriterConfig
url []byte
}
func NewHTTPWriter(c HTTPWriterConfig) Writer {
return &HTTPWriter{
client: fasthttp.Client... | package avalanche
import (
"fmt"
"io/ioutil"
"net/http"
)
type HTTPWriterConfig struct {
Host string
Generator Generator
}
type HTTPWriter struct {
c HTTPWriterConfig
}
func NewHTTPWriter(c HTTPWriterConfig) Writer {
return &HTTPWriter{c: c}
}
func (w *HTTPWriter) Write() error {
g := w.c.Generator()
re... |
Use Str::random() instead of str_random() | <?php
use Faker\Generator as Faker;
use Illuminate\Support\Str;
/*
|--------------------------------------------------------------------------
| Model Factories
|--------------------------------------------------------------------------
|
| This directory should contain each of the model factory definitions for
| you... | <?php
use Faker\Generator as Faker;
/*
|--------------------------------------------------------------------------
| Model Factories
|--------------------------------------------------------------------------
|
| This directory should contain each of the model factory definitions for
| your application. Factories pro... |
Add delete method to source data cache interface. | <?php
/*
* This file is part of the Tadcka package.
*
* (c) Tadas Gliaubicas <tadcka89@gmail.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Tadcka\Mapper\Cache;
use Tadcka\Mapper\Source\Data\SourceDataInterface;
... | <?php
/*
* This file is part of the Tadcka package.
*
* (c) Tadas Gliaubicas <tadcka89@gmail.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Tadcka\Mapper\Cache;
use Tadcka\Mapper\Source\Data\SourceDataInterface;
... |
Fix for handling HTTP requests properly | package com.manning.siia;
import siia.booking.domain.trip.LegQuoteCommand;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.xml.transform.StringResult;
import org.springframework.xml.transform.StringSource;
import javax.xml.transform.Source;
public clas... | package com.manning.siia;
import siia.booking.domain.trip.LegQuoteCommand;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.xml.transform.StringResult;
import org.springframework.xml.transform.StringSource;
import javax.xml.transform.Source;
public clas... |
Make a unit test compatible with php 7.0 | <?php
/**
* @param ?array $a
* @param array{key:?string} $a2
* @param string $offset
*/
function example471Isset($a, array $a2, string $offset) {
if (isset($a[$offset])) {
echo intdiv($a, 2); // Expect array (not null)
}
if (isset($a2['key'])) {
echo intdiv($a2, -2); // Expect array{k... | <?php
/**
* @param ?array $a
* @param array{key:?string} $a2
* @param string $offset
*/
function example471Isset($a, array $a2, string $offset) {
if (isset($a[$offset])) {
echo intdiv($a, 2); // Expect array (not null)
}
if (isset($a2['key'])) {
echo intdiv($a2, -2); // Expect array{k... |
Add size parameter to chooseTasks, in case we need it |
var formatData = function(restaurants) {
var formattedData = [];
// for each restaurant element in restaurants
// {
// yelpId:
// name:
// rating:
// price:
// location: (might want to use display_address here - it's an array)
// address:
// zip_code:
// }
... |
var formatData = function(restaurants) {
var formattedData = [];
// for each restaurant element in restaurants
// {
// yelpId:
// name:
// rating:
// price:
// location: (might want to use display_address here - it's an array)
// address:
// zip_code:
// }
... |
Update url so it take care of filters and remove `t=id` not sure why it
was needed! | function showGenericRelatedObjectLookupPopup(triggeringLink, ctArray)
{
var realName = triggeringLink.id.replace(/^lookup_/, '');
var name = id_to_windowname(realName);
realName = realName.replace(/object_id/, 'content_type');
var select = document.getElementById(realName);
if (select.value === "")... | function showGenericRelatedObjectLookupPopup(triggeringLink, ctArray)
{
var realName = triggeringLink.id.replace(/^lookup_/, '');
var name = id_to_windowname(realName);
realName = realName.replace(/object_id/, 'content_type');
var select = document.getElementById(realName);
if (select.value === "")... |
Fix example to use get | """An example application using Confit for configuration."""
from __future__ import print_function
from __future__ import unicode_literals
import confit
import argparse
config = confit.LazyConfig('ConfitExample', __name__)
def main():
parser = argparse.ArgumentParser(description='example Confit program')
pa... | """An example application using Confit for configuration."""
from __future__ import print_function
from __future__ import unicode_literals
import confit
import argparse
config = confit.LazyConfig('ConfitExample', __name__)
def main():
parser = argparse.ArgumentParser(description='example Confit program')
pa... |
Fix async logic in integration test runner | /**
* Run each test under ./integration, one at a time.
* Each one will likely need to pollute global namespace, and thus will need to be run in a forked process.
*/
var fs = require('fs');
var files = fs.readdirSync(fs.realpathSync('./test/integration'));
var shell = require('shelljs');
var pattern = /^(test)\w*\.... | /**
* Run each test under ./integration, one at a time.
* Each one will likely need to pollute global namespace, and thus will need to be run in a forked process.
*/
var fs = require('fs');
var files = fs.readdirSync(fs.realpathSync('./test/integration'));
var shell = require('shelljs');
var pattern = /^(test)\w*\.... |
Update in output to terminal.
Signed-off-by: messiasthi <8562fc1efba9a3c99753c749fdfb1b6932b70fbf@gmail.com> | # The client of DDuplicated tool.
from os import path as opath, getcwd
from pprint import pprint
from sys import argv
from dduplicated import commands
def get_paths(params):
paths = []
for param in params:
path = opath.join(getcwd(), param)
if opath.exists(path) and opath.isdir(path) and not opath.islink(path):... | # The client of DDuplicated tool.
from os import path as opath, getcwd
from sys import argv
from dduplicated import commands
def get_paths(params):
paths = []
for param in params:
path = opath.join(getcwd(), param)
if opath.exists(path) and opath.isdir(path) and not opath.islink(path):
paths.append(path)
r... |
Update the PyPI version to 7.0.13. | # -*- coding: utf-8 -*-
import os
from setuptools import setup
def read(fname):
try:
return open(os.path.join(os.path.dirname(__file__), fname)).read()
except:
return ''
setup(
name='todoist-python',
version='7.0.13',
packages=['todoist', 'todoist.managers'],
author='Doist Team... | # -*- coding: utf-8 -*-
import os
from setuptools import setup
def read(fname):
try:
return open(os.path.join(os.path.dirname(__file__), fname)).read()
except:
return ''
setup(
name='todoist-python',
version='7.0.12',
packages=['todoist', 'todoist.managers'],
author='Doist Team... |
Remove chamadas desnecessárias da classe `App` | <?php
/**
* Alf CMS
*
* PHP 5
*
* Alf CMS
* Copyright 2013-2013, Tonight Systems, Inc. (https://github.com/tonightsystems)
*
* Licensed under The MIT License
* Redistributions of files must retain the above copyright notice.
*
* @package Alf
* @copyright Copyright 2013-2013, Tonight Systems, Inc.
* @link ... | <?php
/**
* Alf CMS
*
* PHP 5
*
* Alf CMS
* Copyright 2013-2013, Tonight Systems, Inc. (https://github.com/tonightsystems)
*
* Licensed under The MIT License
* Redistributions of files must retain the above copyright notice.
*
* @package Alf
* @copyright Copyright 2013-2013, Tonight Systems, Inc.
* @link ... |
Remove unneeded grunt task (PR comment) | 'use strict';
module.exports = function(grunt) {
var gtx = require('gruntfile-gtx').wrap(grunt);
gtx.loadAuto();
var gruntConfig = require('./grunt');
gruntConfig.package = require('./package.json');
gtx.config(gruntConfig);
gtx.alias('build', ['build-dist', 'less', 'copy']);
gtx.alias('build-dist', ['... | 'use strict';
module.exports = function(grunt) {
var gtx = require('gruntfile-gtx').wrap(grunt);
gtx.loadAuto();
var gruntConfig = require('./grunt');
gruntConfig.package = require('./package.json');
gtx.config(gruntConfig);
gtx.alias('build', ['build-dist', 'less', 'copy']);
gtx.alias('build-dist', ['... |
Select textarea contents on click | document.addEventListener('DOMContentLoaded', function() {
document.getElementById('source').addEventListener('click', function() {
this.focus();
this.select();
});
getSource();
});
function getSource() {
document.getElementById('source').innerText = "Loading";
chrome.tabs.query({active: true, currentWindow:... | document.addEventListener('DOMContentLoaded', function() {
getSource();
});
function getSource() {
document.getElementById('source').innerText = "Loading";
chrome.tabs.query({active: true, currentWindow: true}, function(tabs) {
chrome.tabs.sendMessage(tabs[0].id, {greeting: "GetEmailSource"}, function(response) {... |
Remove non-required column from test. | from pyxform.tests_v1.pyxform_test_case import PyxformTestCase
class AuditTest(PyxformTestCase):
def test_audit(self):
self.assertPyxformXform(
name="meta_audit",
md="""
| survey | | | |
| | type | name | label |
... | from pyxform.tests_v1.pyxform_test_case import PyxformTestCase
class AuditTest(PyxformTestCase):
def test_audit(self):
self.assertPyxformXform(
name="meta_audit",
md="""
| survey | | | | |
| | type | name ... |
Update ptvsd version number for 2.2 beta. | #!/usr/bin/env python
#-------------------------------------------------------------------------
# Copyright (c) Microsoft. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the ... | #!/usr/bin/env python
#-------------------------------------------------------------------------
# Copyright (c) Microsoft. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the ... |
Change the class name on the arrival component container | import Ember from 'ember';
import moment from 'moment';
import stringToHue from 'bus-detective/utils/string-to-hue';
var inject = Ember.inject;
export default Ember.Component.extend({
tagName: 'li',
clock: inject.service(),
attributeBindings: ['style'],
classNames: ['timeline__event'],
classNameBindings: ['i... | import Ember from 'ember';
import moment from 'moment';
import stringToHue from 'bus-detective/utils/string-to-hue';
var inject = Ember.inject;
export default Ember.Component.extend({
tagName: 'li',
clock: inject.service(),
attributeBindings: ['style'],
classNames: ['arrival'],
classNameBindings: ['isPast:ar... |
Fix error noticed when running Phan under php 7.2.0alpha1
In php 7.2, `count()` can only be called on `array` or `Countable`.
It will emit a warning if it is called on other types, e.g. `null`,
`string`, etc. | <?php declare(strict_types=1);
namespace Phan\Language\Element;
use Phan\Language\FQSEN;
use Phan\Language\FQSEN\FullyQualifiedClassName;
/**
* This contains info for a single sub-node of a node of type \ast\AST_USE_TRAIT
* (Which aliases of methods exist for this trait, which `insteadof` exist, etc)
*/
class Trai... | <?php declare(strict_types=1);
namespace Phan\Language\Element;
use Phan\Language\FQSEN;
use Phan\Language\FQSEN\FullyQualifiedClassName;
/**
* This contains info for a single sub-node of a node of type \ast\AST_USE_TRAIT
* (Which aliases of methods exist for this trait, which `insteadof` exist, etc)
*/
class Trai... |
Fix video view and remove some sub components
- Fixes #28 | import * as _ from 'lodash'
import React from 'react'
import {connect} from 'react-redux'
import {compose, withProps} from 'recompose'
import {updateVideo} from '../../actions/videos'
import CommentList from '../CommentList'
import {withDatabaseSubscribe} from '../hocs'
const mapStateToProps = ({videos}) => ({
vi... | import React from 'react'
import { connect } from 'react-redux'
import { compose } from 'recompose'
import { updateVideo } from '../../actions/videos'
import { withDatabaseSubscribe } from '../hocs'
import CommentList from '../CommentList'
import PerformanceFrame from '../PerformanceFrame'
const mapStateToProps = (... |
Set up a few items | package org.fountanio.juancode.out;
import java.awt.BorderLayout;
import javax.swing.*;
import javax.swing.border.Border;
import org.fountanio.juancode.eng.Engine;
import org.lwjgl.openal.AL;
import org.lwjgl.opengl.Display;
import java.awt.event.*;
import java.io.BufferedReader;
import java.io.File;
import java.io... | package org.fountanio.juancode.out;
import java.awt.BorderLayout;
import java.awt.GridLayout;
import javax.swing.*;
import javax.swing.border.Border;
import java.awt.event.*;
public class IPWindow extends JFrame {
private static final long serialVersionUID = 1L;
private JButton gotoip = new JButton("Go");
privat... |
Rename deleteRule variable to currentRule | 'use strict';
var FormManager = require('./formmanager');
var Rules = require('./rules');
var TableController = require('./table');
var translate = require('./translate');
var rulesContainer;
var currentRule;
var addButton = document.querySelector('#add-button');
addButton.addEventListener('click', () => FormManag... | 'use strict';
var FormManager = require('./formmanager');
var Rules = require('./rules');
var TableController = require('./table');
var translate = require('./translate');
var rulesContainer;
var deleteRule;
var addButton = document.querySelector('#add-button');
addButton.addEventListener('click', () => FormManage... |
Move Rollup.js babel plugin before commonjs | // https://github.com/rollup/rollup-starter-project
import resolve from 'rollup-plugin-node-resolve';
import commonjs from 'rollup-plugin-commonjs';
import babel from 'rollup-plugin-babel';
let pkg = require('./package.json');
let external = []
// Mark dependencies and peerDependencies as external
.concat(
Obj... | // https://github.com/rollup/rollup-starter-project
import resolve from 'rollup-plugin-node-resolve';
import commonjs from 'rollup-plugin-commonjs';
import babel from 'rollup-plugin-babel';
let pkg = require('./package.json');
let external = []
// Mark dependencies and peerDependencies as external
.concat(
Obj... |
Drop Ember v1.11/1.12 compatibility code
We don't support these old Ember versions anymore, so we can drop this codepath now | 'use strict';
/* eslint-env node */
let TEST_SELECTOR_PREFIX = /data-test-.*/;
function isTestSelector(attribute) {
return TEST_SELECTOR_PREFIX.test(attribute);
}
function stripTestSelectors(node) {
node.params = node.params.filter(function(param) {
return !isTestSelector(param.original);
});
node.hash... | 'use strict';
/* eslint-env node */
let TEST_SELECTOR_PREFIX = /data-test-.*/;
function isTestSelector(attribute) {
return TEST_SELECTOR_PREFIX.test(attribute);
}
function stripTestSelectors(node) {
if ('sexpr' in node) {
node = node.sexpr;
}
node.params = node.params.filter(function(param) {
retur... |
Test ingeschakeld om te testen of login scherm getoond wordt | <?php
class Webenq_Test_ControllerTestCase_UserControllerTest extends Webenq_Test_Controller
{
public function testLoginFormIsRendered()
{
$this->dispatch('user/login');
$this->assertQuery('input#username');
$this->assertQuery('input#password');
}
// public function testUserCanL... | <?php
class Webenq_Test_ControllerTestCase_UserControllerTest extends Webenq_Test_Controller
{
public function test() {}
// public function testLoginFormIsRendered()
// {
// $this->dispatch('user/login');
// $this->assertQuery('input#username');
// $this->assertQuery('input#password');
... |
Unify 'onEventAppeared' and 'onEvent' signatures.
`onEvent` has the signature `(subscription, event) => { }`.
`onEventAppeared` should also be `(subscription, event) => {}` and not `(event) => {}`. | import connectionManager from './connectionManager';
import mapEvents from './utilities/mapEvents';
import client from 'node-eventstore-client';
import debugModule from 'debug';
import assert from 'assert';
const debug = debugModule('geteventstore:subscribeToStream');
const baseErr = 'Subscribe to Stream - ';
export ... | import connectionManager from './connectionManager';
import mapEvents from './utilities/mapEvents';
import client from 'node-eventstore-client';
import debugModule from 'debug';
import assert from 'assert';
const debug = debugModule('geteventstore:subscribeToStream');
const baseErr = 'Subscribe to Stream - ';
export ... |
Remove testing of private methods (other than that they exist) | import unittest
from unittest.mock import patch
from utils import parse_worksheet
class TestParseWorksheet(unittest.TestCase):
def test_open_worksheet_function_is_defined(self):
if not hasattr(parse_worksheet, '__open_worksheet'):
self.fail('__open_worksheet should be defined.')
def test_g... | import unittest
from utils import parse_worksheet
class TestParseWorksheet(unittest.TestCase):
def test_open_worksheet_function_is_defined(self):
if not hasattr(parse_worksheet, '__open_worksheet'):
self.fail('__open_sheet should be defined.')
def test_get_data_function_is_defined(self):
... |
Use default formatter in dev env in unit-tests | module.exports = function (grunt) {
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
mochaTest: {
test: {
options: {
reporter: 'spec'
},
src: ['test/**/*.js']
},
test_with_xunit: {
options: process.env.BUILD_NUMBER ? {
reporter:... | module.exports = function (grunt) {
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
mochaTest: {
test: {
options: {
reporter: 'spec'
},
src: ['test/**/*.js']
},
test_with_xunit: {
options: {
reporter: 'xunit',
quiet: ... |
Fix test: make sure that Isolation Forest actually make a categorical split | import h2o
from h2o.tree import H2OTree
from h2o.estimators import H2OIsolationForestEstimator
from tests import pyunit_utils
def check_tree(tree, tree_number, tree_class = None):
assert tree is not None
assert len(tree) > 0
assert tree._tree_number == tree_number
assert tree._tree_class == tree_clas... | import h2o
from h2o.tree import H2OTree
from h2o.estimators import H2OIsolationForestEstimator
from tests import pyunit_utils
def check_tree(tree, tree_number, tree_class = None):
assert tree is not None
assert len(tree) > 0
assert tree._tree_number == tree_number
assert tree._tree_class == tree_clas... |
Use data attribute instead of val() | var EDSN_THRESHOLD = 30;
var EdsnSwitch = (function(){
var editing;
var validBaseLoads = /^(base_load|base_load_edsn)$/;
EdsnSwitch.prototype = {
enable: function(){
if(editing){
swapEdsnBaseLoadSelectBoxes();
}
},
isEdsn: function(){
return validBaseLoads.test($(this).dat... | var EDSN_THRESHOLD = 30;
var EdsnSwitch = (function(){
var editing;
var validBaseLoads = /^(base_load|base_load_edsn)$/;
EdsnSwitch.prototype = {
enable: function(){
if(editing){
swapEdsnBaseLoadSelectBoxes();
}
},
isEdsn: function(){
return validBaseLoads.test($(this).val... |
Change constant value for backward compatibility | export default class Constants {
static get USER_ACCOUNT_KEY() { return btoa('blipSdkUAccount'); }
static get IFRAMEURL_LOCAL() { return 'http://localhost:3000/'; }
static get IFRAMEURL_HMG() { return 'https://hmg-sdkcommon.blip.ai/'; }
static get IFRAMEURL_PRD() { return 'https://sdkcommon.blip.ai/'; }... | export default class Constants {
static get USER_ACCOUNT_KEY() { return btoa('blipSdkUAccount'); }
static get IFRAMEURL_LOCAL() { return 'http://localhost:3000/'; }
static get IFRAMEURL_HMG() { return 'https://hmg-sdkcommon.blip.ai/'; }
static get IFRAMEURL_PRD() { return 'https://sdkcommon.blip.ai/'; }... |
Remove left over console log | module("Hide department children", {
setup: function() {
this.$departments = $(
'<div class="js-hide-department-children">'
+ '<div class="department">'
+ '<div class="child-organisations">'
+ '<p>child content</p>'
+ '</div>'
+ '</div>'
+ '</div>');
$('#qunit-... | module("Hide department children", {
setup: function() {
this.$departments = $(
'<div class="js-hide-department-children">'
+ '<div class="department">'
+ '<div class="child-organisations">'
+ '<p>child content</p>'
+ '</div>'
+ '</div>'
+ '</div>');
$('#qunit-... |
Fix instance memory output for space-quota(s). | package resources
import "github.com/cloudfoundry/cli/cf/models"
type PaginatedSpaceQuotaResources struct {
Resources []SpaceQuotaResource
}
type SpaceQuotaResource struct {
Resource
Entity models.SpaceQuota
}
func (resource SpaceQuotaResource) ToModel() models.SpaceQuota {
entity := resource.Entity
return mo... | package resources
import "github.com/cloudfoundry/cli/cf/models"
type PaginatedSpaceQuotaResources struct {
Resources []SpaceQuotaResource
}
type SpaceQuotaResource struct {
Resource
Entity models.SpaceQuota
}
func (resource SpaceQuotaResource) ToModel() models.SpaceQuota {
entity := resource.Entity
return mo... |
Fix calling sendAction on destroyed object error | import Ember from 'ember';
import layout from '../templates/components/resize-detector';
const {
inject: { service },
run: { scheduleOnce, bind }
} = Ember;
export default Ember.Component.extend({
layout,
tagName: '',
resizeDetector: service(),
didInsertElement() {
this._super(...arguments);
... | import Ember from 'ember';
import layout from '../templates/components/resize-detector';
const {
inject: { service },
run: { scheduleOnce, bind }
} = Ember;
export default Ember.Component.extend({
layout,
tagName: '',
resizeDetector: service(),
didInsertElement() {
this._super(...arguments);
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.