text
stringlengths
16
4.96k
positive
stringlengths
321
2.24k
negative
stringlengths
310
2.21k
Add return types to trait methods
<?php namespace DanDMartin\LoggerAware\Traits; use Psr\Log\LoggerInterface as PsrLogger; use DanDMartin\LoggerAware\Logger\NullLogger; trait LoggerAware { /** * @var PsrLogger */ protected $logger; /** * @param PsrLogger $l * @required */ public function setLogger(PsrLogger $...
<?php namespace DanDMartin\LoggerAware\Traits; use Psr\Log\LoggerInterface as PsrLogger; use DanDMartin\LoggerAware\Logger\NullLogger; trait LoggerAware { /** * @var PsrLogger */ protected $logger; /** * @param PsrLogger $l * @required */ public function setLogger(PsrLogger $...
Use beforeEach in property test
import assert from "power-assert"; import Component from "../src/Component"; import * as property from "../src/property"; describe("property", () => { describe(".bind", () => { let c1, c2; beforeEach(() => { c1 = new Component(); property.define(c1, "p1"); c2 = new Component(); prope...
import assert from "power-assert"; import Component from "../src/Component"; import * as property from "../src/property"; describe("property", () => { describe(".bind", () => { const c1 = new Component(); property.define(c1, "p1"); const c2 = new Component(); property.bind(c2, "p2", [[c1, "p1"]], () ...
Return retcode properly iff erroring fixes #13
#!/usr/bin/env python import logging logging.basicConfig(level=logging.INFO) log = logging.getLogger() def yield_packages(handle, meta=False, retcode=None): for lineno, line in enumerate(handle): if line.startswith('#'): continue try: data = line.split('\t') keys...
#!/usr/bin/env python import logging logging.basicConfig(level=logging.INFO) log = logging.getLogger() def yield_packages(handle, meta=False, retcode=None): for lineno, line in enumerate(handle): if line.startswith('#'): continue try: data = line.split('\t') keys...
Add Panes for the display only component also
/** A layer for an adjust speed modification */ import React from 'react' import {Pane} from 'react-leaflet' import colors from 'lib/constants/colors' import PatternLayer from './pattern-layer' import HopLayer from './hop-layer' export default function AdjustSpeedLayer(p) { if (p.modification.hops) { return ( ...
/** A layer for an adjust speed modification */ import React from 'react' import colors from 'lib/constants/colors' import PatternLayer from './pattern-layer' import HopLayer from './hop-layer' export default function AdjustSpeedLayer(p) { if (p.modification.hops) { return ( <> <PatternLayer ...
Fix in the unit tests.
<?php /* * Bear CMS addon for Bear Framework * https://bearcms.com/ * Copyright (c) 2016 Amplilabs Ltd. * Free to use under the MIT license. */ /** * @runTestsInSeparateProcesses */ class DefaultThemeTest extends BearFrameworkAddonTestCase { /** * */ public function testBlogPostsElement() ...
<?php /* * Bear CMS addon for Bear Framework * https://bearcms.com/ * Copyright (c) 2016 Amplilabs Ltd. * Free to use under the MIT license. */ /** * @runTestsInSeparateProcesses */ class DefaultThemeTest extends BearFrameworkAddonTestCase { /** * */ public function testBlogPostsElement() ...
Use fetch column to be independent from the alias
<?php namespace Doctrine\Tests\DBAL\Functional; use Doctrine\Tests\DbalFunctionalTestCase; final class LikeWildcardsEscapingTest extends DbalFunctionalTestCase { public function testFetchLikeExpressionResult() : void { $string = '_25% off_ your next purchase \o/'; $escapeChar = '!'; ...
<?php namespace Doctrine\Tests\DBAL\Functional; use Doctrine\Tests\DbalFunctionalTestCase; final class LikeWildcardsEscapingTest extends DbalFunctionalTestCase { public function testFetchLikeExpressionResult() : void { $string = '_25% off_ your next purchase \o/'; $escapeChar = '!'; ...
Use proper filename for http.ServeContent
package controllers import ( "github.com/julienschmidt/httprouter" "github.com/raggaer/castro/app/util" "net/http" ) func ExtensionStatic(w http.ResponseWriter, req *http.Request, ps httprouter.Params) { // Get extension identifier id := ps.ByName("id") // Check if static file exists dir, exists := util.Exten...
package controllers import ( "github.com/julienschmidt/httprouter" "github.com/raggaer/castro/app/util" "net/http" ) func ExtensionStatic(w http.ResponseWriter, req *http.Request, ps httprouter.Params) { // Get extension identifier id := ps.ByName("id") // Check if static file exists dir, exists := util.Exten...
Convert type check targets in thrift/test to use configuration Summary: Migrating buck integration to use configurations. For more information about this migration, please see: https://fb.workplace.com/groups/295311271085134/permalink/552700215346237/ Reviewed By: dkgi Differential Revision: D30708385 fbshipit-sou...
# Copyright (c) Facebook, Inc. and its affiliates. # # 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 ...
# Copyright (c) Facebook, Inc. and its affiliates. # # 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 ...
Fix ListProperties to be compatible with buildbot 0.8.4p1. The duplicated code will be removed once 0.7.12 is removed. Review URL: http://codereview.chromium.org/7193037 git-svn-id: 239fca9b83025a0b6f823aeeca02ba5be3d9fd76@91477 0039d316-1c4b-4281-b951-d872f2087c98
# Copyright (c) 2011 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """Utility classes to enhance process.properties.Properties usefulness.""" from buildbot.process.properties import WithProperties class ListPropertie...
# Copyright (c) 2010 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """Utility classes to enhance process.properties.Properties usefulness.""" from buildbot.process.properties import WithProperties class ListPropertie...
Change repeating alarm to be ELAPSED_REALTIME type Change repeating alarms scheduled by AlarmManager in BootReceiver to be AlarmManager.ELAPSED_REALTIME type instead of RTC type, since we don't need alarms to be fired at particular time, only at particular interval; following best practices here: https://developer.and...
package com.marakana.android.yamba; import android.app.AlarmManager; import android.app.PendingIntent; import android.content.BroadcastReceiver; import android.content.Context; import android.content.Intent; import android.content.SharedPreferences; import android.os.SystemClock; import android.preference.PreferenceMa...
package com.marakana.android.yamba; import android.app.AlarmManager; import android.app.PendingIntent; import android.content.BroadcastReceiver; import android.content.Context; import android.content.Intent; import android.content.SharedPreferences; import android.preference.PreferenceManager; import android.util.Log;...
Improve page title for experts [WAL-1041]
// @ngInject export default function expertRequestsRoutes($stateProvider) { $stateProvider .state('appstore.expert', { url: 'experts/:category/', template: '<expert-request-create></expert-request-create>', data: { category: 'experts', pageTitle: gettext('Create expert request'),...
// @ngInject export default function expertRequestsRoutes($stateProvider) { $stateProvider .state('appstore.expert', { url: 'experts/:category/', template: '<expert-request-create></expert-request-create>', data: { category: 'experts', pageTitle: gettext('Create expert request'),...
Update tests to add option test
module.exports = function (grunt) { grunt.initConfig({ nugetpack: { options: { verbose: true }, dist: { src: 'tests/Package.nuspec', dest: 'tests/' } }, nugetrestore: { restore: { ...
module.exports = function (grunt) { grunt.initConfig({ nugetpack: { dist: { src: 'tests/Package.nuspec', dest: 'tests/' } }, nugetrestore: { restore: { src: 'tests/packages.config', dest: 'pa...
Include autoload.php if it exists
<?php $template_directory = get_template_directory(); if (file_exists("{$template_directory}/functions/autoload.php")) { require_once("{$template_directory}/functions/autoload.php"); } require_once("{$template_directory}/functions/vendor.php"); require_once("{$template_directory}/functions/custom-functions.php"); ...
<?php $template_directory = get_template_directory(); require_once("{$template_directory}/functions/vendor.php"); require_once("{$template_directory}/functions/custom-functions.php"); require_once("{$template_directory}/functions/filters.php"); require_once("{$template_directory}/functions/htaccess.php"); require_once...
Fix social media icon links.
<?php $options = get_option('plugin_options'); $social_media = array('facebook', 'twitter', 'google', 'mail', 'linkedin', 'xing', 'skype', 'youtube', 'vimeo', 'flickr', 'rss'); ?> <div class="social-media-wrapper"> <ul class="social-media-links"> <?php foreach ($social_media as $i => $name) {...
<?php $options = get_option('plugin_options'); $social_media = array('facebook', 'twitter', 'google', 'mail', 'linkedin', 'xing', 'skype', 'youtube', 'vimeo', 'flickr', 'rss'); ?> <div class="social-media-wrapper"> <ul class="social-media-links"> <?php foreach ($social_media as $i => $name) {...
Remove the alert message on addition of string
var Trie = require('trie'); trie = new Trie(); trie.add('bat'); trie.add('bad'); var searchInput = document.getElementById('search-input'); var searchResults = document.getElementById('search-results'); var addButton = document.getElementById('add-button'); addButton.style.display = 'none'; addButton.disabled = tru...
var Trie = require('trie'); trie = new Trie(); trie.add('bat'); trie.add('bad'); var searchInput = document.getElementById('search-input'); var searchResults = document.getElementById('search-results'); var addButton = document.getElementById('add-button'); addButton.style.display = 'none'; addButton.disabled = tru...
Fix PHP HHVM 'A void return value is being used'...
<?php namespace CrudGenerator\Tests\General\FileManager; use CrudGenerator\Utils\FileManager; class FilePutsContentTest extends \PHPUnit_Framework_TestCase { public function testRender() { $filePath = __DIR__ . '/test.phtml'; $content = 'toto'; $sUT = new FileManager(); $sUT...
<?php namespace CrudGenerator\Tests\General\FileManager; use CrudGenerator\Utils\FileManager; class FilePutsContentTest extends \PHPUnit_Framework_TestCase { public function testRender() { $filePath = __DIR__ . '/test.phtml'; $content = 'toto'; $sUT = new FileManager(); $fil...
Change the live users endpoint
var isOpen = false; function checkStatus(text) { let num = parseInt(text, 10); if (num > 0) { chrome.browserAction.setTitle({ title: 'λspace is open' }); chrome.browserAction.setBadgeText({ text: num.toString() }); chrome.browserAction.setBadgeBackgroundColor({ color: '#808080' }); chrome.browserAc...
var isOpen = false; function checkStatus(text) { let num = parseInt(text, 10); if (num > 0) { chrome.browserAction.setTitle({ title: 'λspace is open' }); chrome.browserAction.setBadgeText({ text: num.toString() }); chrome.browserAction.setBadgeBackgroundColor({ color: '#808080' }); chrome.browserAc...
Develop here. Belongs in top level Orthologs Project.
# Used: # https://github.com/pypa/sampleproject/blob/master/setup.py # https://github.com/biopython/biopython/blob/master/setup.py from setuptools import setup, find_packages # To use a consistent encoding from codecs import open from os import path here = path.abspath(path.dirname(__file__)) PACKAGES = [ 'lib',...
from setuptools import setup, find_packages # To use a consistent encoding from codecs import open from os import path here = path.abspath(path.dirname(__file__)) PACKAGES = [ 'lib', 'lib.scripts', 'lib.scripts.biosql', 'lib.scripts.blast', 'lib.scripts.ftp', 'lib.scripts.genbank', 'lib.sc...
Update code to be compliant with node 0.10
var serilog = require('../src/core/structured-log.js'); var serilogCompactSink = require('../src/npm/serilog-compact-console-sink.js'); var assert = require('assert'); describe('SerilogCompactConsoleSink', function() { var consoleInfoOutput = [] var originalConsoleInfo = console.info beforeEach(fu...
'use strict' const serilog = require('../src/core/structured-log.js'); const serilogCompactSink = require('../src/npm/serilog-compact-console-sink.js'); const assert = require('assert'); require('mocha-sinon'); describe('SerilogCompactConsoleSink', function() { const consoleInfoOutput = [] const orig...
Adjust dummy data to better fit new template.
$(function() { yourCollection = new Models.ItemListings(); friendCollection = new Models.ItemListings(); featuredCollection = new Models.ItemListings(); publicCollection = new Models.ItemListings(); yourView = new Views.ListingView({ collection: yourCollection, el: $('#you-listing')[0] }); friendView = new...
$(function() { yourCollection = new Models.ItemListings(); friendCollection = new Models.ItemListings(); featuredCollection = new Models.ItemListings(); publicCollection = new Models.ItemListings(); yourView = new Views.ListingView({ collection: yourCollection, el: $('#you-listing')[0] }); friendView = new...
Make sure this value is always an integer
from django.conf import settings from django.core.management.base import BaseCommand import stripe class Command(BaseCommand): help = "Make sure your Stripe account has the plans" def handle(self, *args, **options): stripe.api_key = settings.STRIPE_SECRET_KEY for plan in settings.PAYMENTS_P...
from django.conf import settings from django.core.management.base import BaseCommand import stripe class Command(BaseCommand): help = "Make sure your Stripe account has the plans" def handle(self, *args, **options): stripe.api_key = settings.STRIPE_SECRET_KEY for plan in settings.PAYMENTS_P...
Include solrBaseURL in 'connect-src' content security policy too. Allows normal JSON or JSON-P.
/* jshint node: true */ 'use strict'; var path = require('path'); module.exports = { name: 'ember-solr', _appendPolicy: function(csp, key, value) { var v = csp[key] || ''; if (v) { v += ' '; } csp[key] = v + value; }, config: function(environment, appConfig) { if (!appConfig.solrBa...
/* jshint node: true */ 'use strict'; var path = require('path'); module.exports = { name: 'ember-solr', config: function(environment, appConfig) { if (!appConfig.solrBaseURL || appConfig.solrBaseURL.indexOf(':') === -1) { return; } var solrSchemeAndHost = appConfig.solrBaseURL; var solrHo...
Fix the yield infinite loop error Because Blade uses the footer variable to store the template information, has to be initialized as an empty array.
<?php namespace Bkwld\LaravelHaml; // Dependencies use Illuminate\View\Compilers\BladeCompiler; use Illuminate\View\Compilers\CompilerInterface; use Illuminate\Filesystem\Filesystem; use MtHaml\Environment; class HamlBladeCompiler extends BladeCompiler implements CompilerInterface { /** * The MtHaml instance. *...
<?php namespace Bkwld\LaravelHaml; // Dependencies use Illuminate\View\Compilers\BladeCompiler; use Illuminate\View\Compilers\CompilerInterface; use Illuminate\Filesystem\Filesystem; use MtHaml\Environment; class HamlBladeCompiler extends BladeCompiler implements CompilerInterface { /** * The MtHaml instance. *...
Remove img task from grunt build As it takes ages, and it always seems to change the images every time someone else runs it. Probably no one else will ever need to update the images, or very rarely, in which case they can manually run the build img task.
module.exports = function(grunt) { // load all tasks from package.json require('load-grunt-config')(grunt); require('time-grunt')(grunt); /** * TASKS */ // build everything ready for a commit grunt.registerTask('build', ['css', 'js']); // just CSS grunt.registerTask('css', ['sass', 'cssmin']); ...
module.exports = function(grunt) { // load all tasks from package.json require('load-grunt-config')(grunt); require('time-grunt')(grunt); /** * TASKS */ // build everything ready for a commit grunt.registerTask('build', ['img', 'css', 'js']); // just CSS grunt.registerTask('css', ['sass', 'cssmi...
Make sure shard key is a string
/* Copyright (c) 2014 Chico Charlesworth, MIT License */ 'use strict'; var sharder = require('sharder'); var async = require('async'); var name = 'seneca-shard-cache'; module.exports = function( options ) { var seneca = this; var shards = sharder(options); var role = 'cache'; seneca.add({role: role, cmd:...
/* Copyright (c) 2014 Chico Charlesworth, MIT License */ 'use strict'; var sharder = require('sharder'); var async = require('async'); var name = 'seneca-shard-cache'; module.exports = function( options ) { var seneca = this; var shards = sharder(options); var role = 'cache'; seneca.add({role: role, cmd:...
Revert "be more explicit when importing files"
import React, { Component, PropTypes } from 'react' import { connect } from 'react-redux' import { checkout } from '../actions' import { getTotal, getCartProducts } from '../reducers' import Cart from '../components/Cart' class CartContainer extends Component { render() { const { products, total } = this.props ...
import React, { Component, PropTypes } from 'react' import { connect } from 'react-redux' import { checkout } from '../actions/index' import { getTotal, getCartProducts } from '../reducers/index' import Cart from '../components/Cart' class CartContainer extends Component { render() { const { products, total } = ...
Fix the license header regex. Most of the files are attributed to Google Inc so I used this instead of Chromium Authors. R=mark@chromium.org BUG= TEST= Review URL: http://codereview.chromium.org/7108074 git-svn-id: e7e1075985beda50ea81ac4472467b4f6e91fc78@936 78cadc50-ecff-11dd-a971-7dbc132099af
# Copyright (c) 2011 Google Inc. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """Top-level presubmit script for GYP. See http://dev.chromium.org/developers/how-tos/depottools/presubmit-scripts for more details about the presubmit API built...
# Copyright (c) 2011 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """Top-level presubmit script for GYP. See http://dev.chromium.org/developers/how-tos/depottools/presubmit-scripts for more details about the presubmit...
Set the timezone on MySQL formatted dates.
'use strict'; /* * Number Filters * * In HTML Template Binding * {{ filter_expression | filter : expression : comparator}} * * In JavaScript * $filter('filter')(array, expression, comparator) * * https://docs.angularjs.org/api/ng/filter/filter */ var app = angular.module('app.filters.number', []); app.f...
'use strict'; /* * Number Filters * * In HTML Template Binding * {{ filter_expression | filter : expression : comparator}} * * In JavaScript * $filter('filter')(array, expression, comparator) * * https://docs.angularjs.org/api/ng/filter/filter */ var app = angular.module('app.filters.number', []); app.f...
Use correct kwarg for requests.post()
import os import pytest import requests REGISTER_TITLE_URL = os.environ['DIGITAL_REGISTER_URL'] USERNAME = os.environ['SMOKE_USERNAME'] PASSWORD = os.environ['SMOKE_PASSWORD'] TITLE_NUMBER = os.environ['SMOKE_TITLE_NUMBER'] PARTIAL_ADDRESS = os.environ['SMOKE_PARTIAL_ADDRESS'] POSTCODE = os.environ['SMOKE_POSTCODE'] ...
import os import pytest import requests REGISTER_TITLE_URL = os.environ['DIGITAL_REGISTER_URL'] USERNAME = os.environ['SMOKE_USERNAME'] PASSWORD = os.environ['SMOKE_PASSWORD'] TITLE_NUMBER = os.environ['SMOKE_TITLE_NUMBER'] PARTIAL_ADDRESS = os.environ['SMOKE_PARTIAL_ADDRESS'] POSTCODE = os.environ['SMOKE_POSTCODE'] ...
Mask Service is pending the completed object model SVN-Revision: 396
package gov.nih.nci.calab.service.workflow; /** * Generalizes Mask functionality for masking Aliquot, File, etc. * @author doswellj * @param strType Type of Mask (e.g., aliquot, file, run, etc.) * @param strId The id associated to the type * @param strDescription The mask description associated to the mask ty...
package gov.nih.nci.calab.service.workflow; /** * Generalizes Mask functionality for masking Aliquot, File, etc. * @author doswellj * @param strType Type of Mask (e.g., aliquot, file, run, etc.) * @param strId The id associated to the type * @param strDescription The mask description associated to the mask ty...
Fix bug showing the wrong date when creating a new lotto because it depended on the current time
Template.lottoAdd.created = function() { Session.set('lottoAddErrors', {}); }; Template.lottoAdd.rendered = function() { var nextSaturday = moment().startOf('day').day(6).utcOffset(0); this.find('#date').value = nextSaturday.format('YYYY-MM-DD'); this.find('#date').valueAsDate = nextSaturday.toDate(); }; Templ...
Template.lottoAdd.created = function() { Session.set('lottoAddErrors', {}); }; Template.lottoAdd.rendered = function() { var nextSaturday = moment().day(5).utcOffset(0); this.find('#date').value = nextSaturday.format('YYYY-MM-DD'); this.find('#date').valueAsDate = nextSaturday.toDate(); }; Template.lottoAdd.he...
Fix up failing boilerplate test
#!/usr/bin/env python # Copyright 2016 The Kubernetes Authors. # # 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 appli...
#!/usr/bin/env python # Copyright 2016 The Kubernetes Authors. # # 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 appli...
Disable Redux DevTools in prod
var path = require('path'); var webpack = require('webpack'); var ExtractTextPlugin = require('extract-text-webpack-plugin'); module.exports = { entry: './src/index', output: { filename: './dist/index.js' }, module: { loaders: [{ test: /\.js$/, loaders: ['babel'], include: path.join...
var path = require('path'); var webpack = require('webpack'); var ExtractTextPlugin = require('extract-text-webpack-plugin'); module.exports = { entry: './src/index', output: { filename: './dist/index.js' }, module: { loaders: [{ test: /\.js$/, loaders: ['babel'], include: path.join...
Fix weird issue with craft price calculation in some cases
// Update the tree prices function treePrices (tree, itemPrices) { tree = {...tree} // Either use the "used quantity" which gets set when the user uses // own materials, or the base "total quantity" of this tree segment let quantity = tree.usedQuantity !== undefined ? tree.usedQuantity : tree.totalQuantity ...
// Update the tree prices function treePrices (tree, itemPrices) { tree = {...tree} // Either use the "used quantity" which gets set when the user uses // own materials, or the base "total quantity" of this tree segment let quantity = tree.usedQuantity !== undefined ? tree.usedQuantity : tree.totalQuantity ...
Remove the default maximum parsing limit of 1,000 keys
var querystring = require("querystring"); var list = /L_([A-Za-z]+)(\d+)/; module.exports = function(input) { var data; var output = {}; if (typeof input === "string") { // Parse without limits on the maximum number of keys, see: // https://nodejs.org/api/querystring.html#querystring_querystring_parse_s...
var querystring = require("querystring"); var list = /L_([A-Za-z]+)(\d+)/; module.exports = function(input) { var data; var output = {}; if (typeof input === "string") { data = querystring.parse(input); } else { data = input; } Object.keys(data).forEach(function(key) { var list_match = key.ma...
Load storybook page to ensure everything is ok before proceeding with the tests
describe('Entire feed', () => { it('should render the entire feed component correctly', () => { cy.visit('/') cy.visit('/iframe.html?id=activityfeed--entire-feed') cy.get('#root').should('be.visible').compareSnapshot('entire-feed') }) }) describe('Empty feed', () => { it('should render the entire fee...
describe('Entire feed', () => { it('should render the entire feed component correctly', () => { cy.visit('/iframe.html?id=activityfeed--entire-feed') cy.get('#root').should('be.visible').compareSnapshot('entire-feed') }) }) describe('Empty feed', () => { it('should render the entire feed component correc...
Use dato data instead of contentful
import React from 'react'; import Img from 'gatsby-image'; import { Container, Section, Title } from 'bloomer'; import Markdown from 'react-markdown'; function SpeakerTemplate(props) { const speaker = props.data.datoCmsSpeaker; return ( <Section> <Container> <Title>{speaker.name}</Title> ...
import React from 'react'; import Img from 'gatsby-image'; import { Container, Section, Title } from 'bloomer'; import Markdown from 'react-markdown'; function SpeakerTemplate(props) { const speaker = props.data.contentfulSpeaker; return ( <Section> <Container> <Title>{speaker.name}</Title> ...
Fix pattern matching for multiline comments. fixes kkemple/grunt-stripcomments#1
/* * grunt-strip-comments * https://github.com/kkemple/grunt-strip-comments * * Copyright (c) 2013 Kurtis Kemple * Licensed under the MIT license. */ 'use strict'; module.exports = function(grunt) { // Please see the Grunt documentation for more information regarding task // creation: http://gruntjs.com/cr...
/* * grunt-strip-comments * https://github.com/kkemple/grunt-strip-comments * * Copyright (c) 2013 Kurtis Kemple * Licensed under the MIT license. */ 'use strict'; module.exports = function(grunt) { // Please see the Grunt documentation for more information regarding task // creation: http://gruntjs.com/cr...
Order cancel - don't pass mutli-D array
<?php namespace CartRover; class Orders extends APIObject { /** * Insert one or more orders into CartRover * @param string $api_user * @param string $api_key * @param array $orders_array Array of orders, even if only one * @return array */ public static function CreateOrders($api_user, $api_key, $orde...
<?php namespace CartRover; class Orders extends APIObject { /** * Insert one or more orders into CartRover * @param string $api_user * @param string $api_key * @param array $orders_array Array of orders, even if only one * @return array */ public static function CreateOrders($api_user, $api_key, $orde...
Add semicolons to avoid generating typos
/*! { "name": "Unicode characters", "property": "unicode", "tags": ["encoding"], "warnings": [ "positive Unicode support doesn't mean you can use it inside <title>, this seems more related to OS & Language packs" ] } !*/ /* DOC Detects if unicode characters are supported in the current document. */ define...
/*! { "name": "Unicode characters", "property": "unicode", "tags": ["encoding"], "warnings": [ "positive Unicode support doesn't mean you can use it inside <title>, this seems more related to OS & Language packs" ] } !*/ /* DOC Detects if unicode characters are supported in the current document. */ define...
Allow for minus signs in project slug.
import re MODULE_REGEX = r"^[-_a-zA-Z0-9]*$" ENVIRON_REGEX = r"^[-_a-zA-Z0-9]*$" PYTHONVERSION_REGEX = r"^(3)\.[6-9]$" module_name = "{{ cookiecutter.project_slug}}" if not re.match(MODULE_REGEX, module_name): raise ValueError( f""" ERROR: The project slug ({module_name}) is not a valid name. Please d...
import re MODULE_REGEX = r"^[_a-zA-Z][_a-zA-Z0-9]*$" ENVIRON_REGEX = r"^[_a-zA-Z][_a-zA-Z0-9]*$" PYTHONVERSION_REGEX = r"^(3)\.[6-9]$" module_name = "{{ cookiecutter.project_slug}}" if not re.match(MODULE_REGEX, module_name): raise ValueError( f""" ERROR: The project slug ({module_name}) is not a valid...
Fix JS tests for mocking modals with correct API.
describe('Utils.OPAL._run', function (){ it('Should add open_modal to the root scope.', function () { var mock_scope = { $on: function(){} }; var mock_modal = { open: function(){} }; OPAL._run(mock_scope, {}, mock_modal) expect(mock_scope.open_modal).toBeDefined(); }); it...
describe('Utils.OPAL._run', function (){ it('Should add open_modal to the root scope.', function () { var mock_scope = { $on: function(){} }; var mock_modal = { open: function(){} }; OPAL._run(mock_scope, {}, mock_modal) expect(mock_scope.open_modal).toBeDefined(); }); it...
Make dfp library path come first on include path
<?php /** * PHP Datafeed Library * * LICENSE * * This source file is subject to the new BSD license that is bundled * with this package in the file LICENSE.txt. * It is also available through the world-wide-web at this URL: * http://www.opensource.org/licenses/bsd-license.php * * @category Dfp * @package ...
<?php /** * PHP Datafeed Library * * LICENSE * * This source file is subject to the new BSD license that is bundled * with this package in the file LICENSE.txt. * It is also available through the world-wide-web at this URL: * http://www.opensource.org/licenses/bsd-license.php * * @category Dfp * @package ...
Remove unused function. [rev: matthew.gordon]
define([ 'js-whatever/js/base-page', 'text!about-page/templates/about-page.html', 'datatables.net-bs' ], function(BasePage, template) { return BasePage.extend({ template: _.template(template), initialize: function(options) { this.options = options; this.options...
define([ 'js-whatever/js/base-page', 'text!about-page/templates/about-page.html', 'datatables.net-bs' ], function(BasePage, template) { return BasePage.extend({ template: _.template(template), initialize: function(options) { this.options = options; this.options...
Exclude node_modules from Babel processing
var webpack = require('webpack'); var HtmlWebpackPlugin = require('html-webpack-plugin'), ExtractTextPlugin = require('extract-text-webpack-plugin'); module.exports = { entry: { index: './src/demo/index.js' }, output: { path: './target/demo', filename: '[name].js' }, plugins: [ new HtmlW...
var webpack = require('webpack'); var HtmlWebpackPlugin = require('html-webpack-plugin'), ExtractTextPlugin = require('extract-text-webpack-plugin'); module.exports = { entry: { index: './src/demo/index.js' }, output: { path: './target/demo', filename: '[name].js' }, plugins: [ new HtmlW...
Document difference between ID and virtual ID
// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. package com.yahoo.config.provision.zone; import com.yahoo.config.provision.CloudName; import com.yahoo.config.provision.Environment; import com.yahoo.config.provision.RegionName; import com.yahoo.config.provision.S...
// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. package com.yahoo.config.provision.zone; import com.yahoo.config.provision.CloudName; import com.yahoo.config.provision.Environment; import com.yahoo.config.provision.RegionName; import com.yahoo.config.provision.S...
Add service name to embedded Job representations Change-Id: I7bb7e8dcbb85f563267dcd9ad823365c8a4efa9c
package com.cgi.eoss.ftep.api.projections; import com.cgi.eoss.ftep.api.security.FtepPermission; import com.cgi.eoss.ftep.model.Job; import com.cgi.eoss.ftep.model.JobStatus; import org.springframework.beans.factory.annotation.Value; import org.springframework.data.rest.core.config.Projection; import java.time.LocalD...
package com.cgi.eoss.ftep.api.projections; import com.cgi.eoss.ftep.api.security.FtepPermission; import com.cgi.eoss.ftep.model.Job; import com.cgi.eoss.ftep.model.JobStatus; import org.springframework.beans.factory.annotation.Value; import org.springframework.data.rest.core.config.Projection; import java.time.LocalD...
Add "it" as locale alias for it_IT
<?php return array( // Native language name 'language' => array('it_IT' => 'Italiano'), 'englishlang' => array('it_IT' => 'Italian'), // Possible locale for language 'locale' => array('it_IT' => 'it,it_IT,it_IT.utf8,it_IT.utf-8,it_IT.UTF-8,it_IT@euro,italian,Italian_Italy.1252'), // Encoding of...
<?php return array( // Native language name 'language' => array('it_IT' => 'Italiano'), 'englishlang' => array('it_IT' => 'Italian'), // Possible locale for language 'locale' => array('it_IT' => 'it_IT,it_IT.utf8,it_IT.utf-8,it_IT.UTF-8,it_IT@euro,italian,Italian_Italy.1252'), // Encoding of th...
Fix execjs.ProgramError: Error: Cannot find module 'nib' for -stylus
from docutils.core import publish_parts import coffeescript from scss import Scss from stylus import Stylus from .util import as_unicode def rst_to_html(source): # This code was taken from http://wiki.python.org/moin/ReStructuredText # You may also be interested in http://www.tele3.cz/jbar/rest/about.html ...
from docutils.core import publish_parts import coffeescript from scss import Scss from stylus import Stylus from .util import as_unicode def rst_to_html(source): # This code was taken from http://wiki.python.org/moin/ReStructuredText # You may also be interested in http://www.tele3.cz/jbar/rest/about.html ...
Set id on page frame and comment frame.
function receiveMessage(event) { var commentPath, iframeURL; // get url of comment commentPath = event.data.commentURL; iframeURL = "https://news.ycombinator.com/" + commentPath; } var drawIframe = function( URL ) { var frameset, pageURL, pageFrame, commentFrame, html, body; html = document.queryS...
function receiveMessage(event) { var commentPath, iframeURL; // get url of comment commentPath = event.data.commentURL; iframeURL = "https://news.ycombinator.com/" + commentPath; } var drawIframe = function( URL ) { var frameset, pageURL, pageFrame, commentFrame, html, body; console.log("drawing if...
Remove cartocss, not used anymore
var TC = require('tangram.cartodb'); var LeafletLayerView = require('./leaflet-layer-view'); var L = require('leaflet'); var LeafletCartoDBWebglLayerGroupView = L.Class.extend({ includes: [ LeafletLayerView.prototype ], options: { minZoom: 0, maxZoom: 28, tileSize: 256, zoomOffset: 0, ti...
var TC = require('tangram.cartodb'); var LeafletLayerView = require('./leaflet-layer-view'); var L = require('leaflet'); var LeafletCartoDBWebglLayerGroupView = L.Class.extend({ includes: [ LeafletLayerView.prototype ], options: { minZoom: 0, maxZoom: 28, tileSize: 256, zoomOffset: 0, ti...
Fix typoe items vs items()
import time, gevent seen = None def used(url, http_pool): __patch() seen[(url, http_pool)] = time.time() def __patch(): global seen if seen is None: seen = {} gevent.spawn(clean) def clean(): while True: for k, last_seen in seen.items(): if time.ti...
import time, gevent seen = None def used(url, http_pool): __patch() seen[(url, http_pool)] = time.time() def __patch(): global seen if seen is None: seen = {} gevent.spawn(clean) def clean(): while True: for k, last_seen in seen.items: if time.time...
[Flow] Use "Promise<any>" instead of "Promise<*>" to avoid inference `Promise<*>` is getting inferred to be `Promise<Map | Set>` but we actually want `Promise<any>`.
// @flow import isPlainObject from 'lodash/isPlainObject'; import zip from 'lodash/zip'; import zipObject from 'lodash/zipObject'; export default async function mux(promises: any): Promise<any> { if (promises == null) { return promises; } if (typeof promises.then === 'function') { let value = await prom...
// @flow import isPlainObject from 'lodash/isPlainObject'; import zip from 'lodash/zip'; import zipObject from 'lodash/zipObject'; export default async function mux(promises: any): Promise<*> { if (promises == null) { return promises; } if (typeof promises.then === 'function') { let value = await promis...
Change to new setter-less date time method
<?php namespace Becklyn\RadBundle\Entity\Traits; use Doctrine\ORM\Mapping as ORM; /** * */ trait TimestampsTrait { /** * @var \DateTimeImmutable * @ORM\Column(name="time_created", type="datetime_immutable") */ private $timeCreated; /** * @var \DateTimeImmutable|null * @ORM\C...
<?php namespace Becklyn\RadBundle\Entity\Traits; use Doctrine\ORM\Mapping as ORM; /** * */ trait TimestampsTrait { /** * @var \DateTimeImmutable * @ORM\Column(name="time_created", type="datetime_immutable") */ private $timeCreated; /** * @var \DateTimeImmutable|null * @ORM\C...
Fix empty Path not removing files correctly
<?php use Codeception\Configuration; use Codeception\Util\Debug; use Illuminate\Filesystem\Filesystem; /** * Output Path * * @author Alin Eugen Deac <aedart@gmail.com> */ trait OutputPath { /** * Creates an output path, if it does not already exist */ public function createOutputPath() { ...
<?php use Codeception\Configuration; use Codeception\Util\Debug; use Illuminate\Filesystem\Filesystem; /** * Output Path * * @author Alin Eugen Deac <aedart@gmail.com> */ trait OutputPath { /** * Creates an output path, if it does not already exist */ public function createOutputPath() { ...
Add parse param type test
/*! * wef.cssParser tests * Copyright (c) 2011 Pablo Escalada * MIT Licensed */ module("cssParser"); test("namespace", function() { notEqual(wef.cssParser , undefined, "is wef.cssParser namespace defined?"); equal(typeof wef.cssParser, "function", "is wef.cssParser a function?"); }); test("constructor", fu...
/*! * wef.cssParser tests * Copyright (c) 2011 Pablo Escalada * MIT Licensed */ module("cssParser"); test("namespace", function() { notEqual(wef.cssParser , undefined, "is wef.cssParser namespace defined?"); equal(typeof wef.cssParser, "function", "is wef.cssParser a function?"); }); test("constructor", fu...
Fix azure terraform fixture filename.
package azure_test import ( "io/ioutil" "github.com/cloudfoundry/bosh-bootloader/storage" "github.com/cloudfoundry/bosh-bootloader/terraform/azure" . "github.com/onsi/ginkgo" . "github.com/onsi/gomega" ) var _ = Describe("TemplateGenerator", func() { var ( templateGenerator azure.TemplateGenerator ) Befor...
package azure_test import ( "io/ioutil" "github.com/cloudfoundry/bosh-bootloader/storage" "github.com/cloudfoundry/bosh-bootloader/terraform/azure" . "github.com/onsi/ginkgo" . "github.com/onsi/gomega" ) var _ = Describe("TemplateGenerator", func() { var ( templateGenerator azure.TemplateGenerator ) Befor...
Reduce visibility where `public` is not required
/* * Copyright 2019, TeamDev. All rights reserved. * * Redistribution and use in source and/or binary forms, with or without * modification, must retain the above copyright notice and the following * disclaimer. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR...
/* * Copyright 2019, TeamDev. All rights reserved. * * Redistribution and use in source and/or binary forms, with or without * modification, must retain the above copyright notice and the following * disclaimer. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR...
Add default for 'initial' parameter on Select monkeypatch
from django.apps import AppConfig class DjangoCmsSpaConfig(AppConfig): name = 'djangocms_spa' def ready(self): from django.forms import CheckboxInput, RadioSelect, Select, SelectMultiple from .form_helpers import get_placeholder_for_choices_field, get_serialized_choices_for_field Che...
from django.apps import AppConfig class DjangoCmsSpaConfig(AppConfig): name = 'djangocms_spa' def ready(self): from django.forms import CheckboxInput, RadioSelect, Select, SelectMultiple from .form_helpers import get_placeholder_for_choices_field, get_serialized_choices_for_field Che...
Add uglify2 minification to build
({ mainConfigFile: '../requirejs.conf.js', paths: { almond: 'lib/almond/almond' }, baseUrl: '..', name: "streamhub-permalink", include: [ 'almond', 'streamhub-permalink/default-permalink-content-renderer' ], stubModules: ['text', 'hgn', 'json'], out: "../dist/streamhub-permalink.min.js", ...
({ mainConfigFile: '../requirejs.conf.js', paths: { almond: 'lib/almond/almond' }, baseUrl: '..', name: "streamhub-permalink", include: [ 'almond', 'streamhub-permalink/default-permalink-content-renderer' ], stubModules: ['text', 'hgn', 'json'], out: "../dist/streamhub-permalink.min.js", ...
Hide the label component for table editing.
export default [ { key: 'label', ignore: true }, { type: 'number', label: 'Number of Rows', key: 'numRows', input: true, weight: 1, placeholder: 'Number of Rows', tooltip: 'Enter the number or rows that should be displayed by this table.' }, { type: 'number', label:...
export default [ { type: 'number', label: 'Number of Rows', key: 'numRows', input: true, weight: 0, placeholder: 'Number of Rows', tooltip: 'Enter the number or rows that should be displayed by this table.' }, { type: 'number', label: 'Number of Columns', key: 'numCols', ...
IMplement hashCode to eliminate warning
package arez.dom; import java.util.Objects; /** * A class containing width and height dimensions. */ public final class Dimension { private final int _width; private final int _height; /** * Create the dimension object. * * @param width the width. * @param height the height. */ public Dimen...
package arez.dom; /** * A class containing width and height dimensions. */ public final class Dimension { private final int _width; private final int _height; /** * Create the dimension object. * * @param width the width. * @param height the height. */ public Dimension( final int width, fina...
Add missing class to select
$( window ).load(function() { var togglePanel = function(panelId, link){ var panel = $(panelId); panel.toggle(); if(panel.is(":visible")){ $(link).html('<span class="glyphicon glyphicon-circle-arrow-up">Hide</span>'); }else{ $(link).html('<span class="glyphicon glyphicon-circle-arrow-down"...
$( window ).load(function() { var togglePanel = function(panelId, link){ var panel = $(panelId); panel.toggle(); if(panel.is(":visible")){ $(link).html('<span class="glyphicon glyphicon-circle-arrow-up">Hide</span>'); }else{ $(link).html('<span class="glyphicon glyphicon-circle-arrow-down"...
Remove test item from config grabbing script
#!/usr/bin/env python2 import os, shutil files = ["/etc/crontab", "/usr/local/bin/ssu", "/usr/local/bin/xyzzy", "/home/dagon/.bashrc","/home/dagon/.i3status.conf", "/home/dagon/.profile", "/home/dagon/.vimrc", "/home/dagon/.i3/config", "/home/dagon/.vim", "/home/dagon/.config/bless", "/home/...
#!/usr/bin/env python2 import os, shutil files = ["/etc/crontab", "/usr/local/bin/ssu", "/usr/local/bin/xyzzy", "/home/dagon/.bashrc","/home/dagon/.i3status.conf", "/home/dagon/.profile", "/home/dagon/.vimrc", "/home/dagon/.i3/config", "/home/dagon/.vim", "/home/dagon/.config/bless", "/home/...
Remove unnecessary error log from js module bundle
"use strict"; const Task = require('../Task'), gulp = require('gulp'), path = require('path'), ProjectType = require('../../ProjectType'), tsc = require('gulp-typescript'); class JSTask extends Task { constructor(buildManager, taskRunner) { super(buildManager, taskRunner); this.co...
"use strict"; const Task = require('../Task'), gulp = require('gulp'), path = require('path'), ProjectType = require('../../ProjectType'), tsc = require('gulp-typescript'); class JSTask extends Task { constructor(buildManager, taskRunner) { super(buildManager, taskRunner); this.co...
Convert double to single quotes
'use strict'; var Redis = require('ioredis'); var start = new Date(); // I can't get to 1,000,000 commands in one pipeline, not even to 120,000, because ioredis would just hang. // Therefore I use 100,000 and hope that this is precise enough. var N = 100*1000; var redis = new Redis(); redis.del('foo'); var pipeli...
"use strict"; var Redis = require('ioredis'); var start = new Date(); // I can't get to 1,000,000 commands in one pipeline, not even to 120,000, because ioredis would just hang. // Therefore I use 100,000 and hope that this is precise enough. var N = 100*1000; var redis = new Redis(); redis.del("foo"); var pipeli...
Modify event listener should implement modify method with ItemPipelineEvent parameter in order to be able to stop propagation.
<?php /* * This file is part of the ONGR package. * * (c) NFQ Technologies UAB <info@nfq.com> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace ONGR\ConnectionsBundle\EventListener; use ONGR\ConnectionsBundle\Pipeline\It...
<?php /* * This file is part of the ONGR package. * * (c) NFQ Technologies UAB <info@nfq.com> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace ONGR\ConnectionsBundle\EventListener; use ONGR\ConnectionsBundle\Pipeline\It...
Update Encode documentation for golint.
package utilities import ( "errors" "unicode/utf8" ) // The string encoding options. Currently only support UTF-8. Don't really // see the merit in supporting anything else at the moment. const ( UTF8 = iota ) // ErrInvalidEncodingType is returned when the encoding type is not one that // is supported. var ErrInv...
package utilities import ( "errors" "unicode/utf8" ) // The string encoding options. Currently only support UTF-8. Don't really // see the merit in supporting anything else at the moment. const ( UTF8 = iota ) // ErrInvalidEncodingType is returned when the encoding type is not one that // is supported. var ErrInv...
Make the AB test case more stable.
from . import TheInternetTestCase from helium.api import go_to, S, get_driver class AbTestingTest(TheInternetTestCase): def get_page(self): return "http://the-internet.herokuapp.com/abtest" def test_ab_variates(self): header = S("h3") first_variation = header.web_element.text self.assertIn( first_variatio...
from . import TheInternetTestCase from helium.api import go_to, S, get_driver class AbTestingTest(TheInternetTestCase): def get_page(self): return "http://the-internet.herokuapp.com/abtest" def test_ab_variates(self): variation = S("h3") first_variation = variation.web_element.text self.assertIn( first_va...
Add a register method and a getRegister Method
package info.u_team.u_team_core.util.registry; import java.util.function.Supplier; import net.minecraft.entity.*; import net.minecraft.entity.EntityType.Builder; import net.minecraftforge.eventbus.api.IEventBus; import net.minecraftforge.fml.RegistryObject; import net.minecraftforge.registries.ForgeRegistries; publi...
package info.u_team.u_team_core.util.registry; import java.util.function.Supplier; import net.minecraft.entity.*; import net.minecraft.entity.EntityType.Builder; import net.minecraftforge.fml.RegistryObject; import net.minecraftforge.registries.ForgeRegistries; public class EntityTypeDeferredRegister { public sta...
Use storage sub-namespace for generic annex
from .base import AnnexBase from . import utils __all__ = ('Annex',) # ----------------------------------------------------------------------------- def get_annex_class(storage): if storage == 'file': from .file import FileAnnex return FileAnnex else: raise ValueError("unsupported st...
from .base import AnnexBase __all__ = ('Annex',) # ----------------------------------------------------------------------------- def get_annex_class(storage): if storage == 'file': from .file import FileAnnex return FileAnnex else: raise ValueError("unsupported storage {}".format(sto...
Add solution to problem 70
/* * Copyright (C) 2014 Pedro Vicente Gómez Sánchez. * * 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 ...
/* * Copyright (C) 2014 Pedro Vicente Gómez Sánchez. * * 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 ...
Fix CORS allowed origin typo.
import express from 'express'; import leagueTips from 'league-tooltips'; import runTask from './cronTask'; import taskGenerator from './cronTasks/generator'; import config from './config'; import routes from './routes'; // ==== Server ==== const app = express(); app.use(leagueTips(config.key.riot, 'euw', { url: '/...
import express from 'express'; import leagueTips from 'league-tooltips'; import runTask from './cronTask'; import taskGenerator from './cronTasks/generator'; import config from './config'; import routes from './routes'; // ==== Server ==== const app = express(); app.use(leagueTips(config.key.riot, 'euw', { url: '/...
Remove double quote characters when producing default SQL query.
/* * Copyright 2014 Josef Hardi <josef.hardi@gmail.com> * * 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 app...
/* * Copyright 2014 Josef Hardi <josef.hardi@gmail.com> * * 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 app...
Allow a commond replSetName for all shards
/* * ToroDB * Copyright © 2014 8Kdata Technology (www.8kdata.com) * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later...
/* * ToroDB * Copyright © 2014 8Kdata Technology (www.8kdata.com) * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later...
Use TCX coordinates to fetch local weather
import tcxparser from configparser import ConfigParser from datetime import datetime import urllib.request import dateutil.parser t = '1984-06-02T19:05:00.000Z' # Darksky weather API # Create config file manually parser = ConfigParser() parser.read('slowburn.config', encoding='utf-8') darksky_key = parser.get('darksky...
import tcxparser from configparser import ConfigParser from datetime import datetime import urllib.request import dateutil.parser t = '1984-06-02T19:05:00.000Z' # Darksky weather API # Create config file manually parser = ConfigParser() parser.read('slowburn.config', encoding='utf-8') darksky_key = parser.get('darksky...
Use the platform() in sublime.py rather than importing platform.
# # linter.py # Linter for SublimeLinter3, a code checking framework for Sublime Text 3 # # Written by Jack Cherng # Copyright (c) 2015 jfcherng # # License: MIT # import sublime, sublime_plugin from SublimeLinter.lint import Linter, util class Iverilog (Linter): syntax = ('verilog') cmd = 'iverilog -t null'...
# # linter.py # Linter for SublimeLinter3, a code checking framework for Sublime Text 3 # # Written by Jack Cherng # Copyright (c) 2015 jfcherng # # License: MIT # from SublimeLinter.lint import Linter, util import platform class Iverilog (Linter): syntax = ('verilog') cmd = 'iverilog -t null' tempfile_s...
Update output to render HTML Fixes #2
@if (Session::has('flashNotification.message')) @if (Session::has('flashNotification.modal')) @include('partials.modal', ['modalClass' => 'flashModal', 'title' => 'Notice', 'body' => Session::get('flashNotification.message')]) @else <div class="notification {{ Session::get('flashNotification.level') }}"> <div class="a...
@if (Session::has('flashNotification.message')) @if (Session::has('flashNotification.modal')) @include('partials.modal', ['modalClass' => 'flashModal', 'title' => 'Notice', 'body' => Session::get('flashNotification.message')]) @else <div class="notification {{ Session::get('flashNotification.level') }}"> <div class="a...
docs: Fix simple typo, ussage -> usage There is a small typo in magicembed/templatetags/magicembed_tags.py. Should read `usage` rather than `ussage`.
# -*- coding: utf-8 -*- from django import template from django.utils.safestring import mark_safe from magicembed.providers import get_provider register = template.Library() @register.filter(is_safe=True) def magicembed(value, arg=None): '''value is the url and arg the size tuple usage: {% http://myurl.com/...
# -*- coding: utf-8 -*- from django import template from django.utils.safestring import mark_safe from magicembed.providers import get_provider register = template.Library() @register.filter(is_safe=True) def magicembed(value, arg=None): '''value is the url and arg the size tuple ussage: {% http://myurl.com...
Fix send email logging: return string instead of Mongo ObjectID
'use strict'; var _ = require('lodash'), nodemailer = require('nodemailer'), path = require('path'), config = require(path.resolve('./config/config')), log = require(path.resolve('./config/lib/logger')); module.exports = function(job, done) { var smtpTransport = nodemailer.createTransport(config.mai...
'use strict'; var _ = require('lodash'), nodemailer = require('nodemailer'), path = require('path'), config = require(path.resolve('./config/config')), log = require(path.resolve('./config/lib/logger')); module.exports = function(job, done) { var smtpTransport = nodemailer.createTransport(config.mai...
Load orgs inside location promise
import React, { Component } from 'react' import globalConfig from '../../config' import { fetchLocation, fetchOrganization } from '../../core/firebaseRestAPI' import Layout from '../../components/Layout' import Loading from '../../components/Loading' import Location from '../../components/Location' export default c...
import React, { Component } from 'react' import globalConfig from '../../config' import { fetchLocation, fetchOrganization } from '../../core/firebaseRestAPI' import Layout from '../../components/Layout' import Loading from '../../components/Loading' import Location from '../../components/Location' export default c...
Remove .render() - JSTransformer should do that
/** * jstransformer-toffee <https://github.com/jstransformers/jstransformer-toffee> * * Copyright (c) 2015 Charlike Mike Reagent, contributors. * Released under the MIT license. */ 'use strict'; var fs = require('fs'); var path = require('path'); var lodash = { template: require('lodash.template'), mixin: re...
/** * jstransformer-toffee <https://github.com/jstransformers/jstransformer-toffee> * * Copyright (c) 2015 Charlike Mike Reagent, contributors. * Released under the MIT license. */ 'use strict'; var fs = require('fs'); var path = require('path'); var lodash = { template: require('lodash.template'), mixin: re...
Use toDouble() method to convert values.
/* * Copyright (C) 2013 Conductor, 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 * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or ag...
/* * Copyright (C) 2013 Conductor, 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 * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or ag...
Fix raw ender buckets not creating full fluid blocks in the world
package squeek.veganoption.blocks; import net.minecraft.block.BlockDoublePlant; import net.minecraft.block.material.Material; import net.minecraft.util.math.BlockPos; import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; import net.minecraftforge.fluids.BlockFluidFinite; import net.minecraftforge....
package squeek.veganoption.blocks; import net.minecraft.block.material.Material; import net.minecraft.util.math.BlockPos; import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; import net.minecraftforge.fluids.BlockFluidFinite; import net.minecraftforge.fluids.Fluid; public class BlockRawEnder ext...
Add type and id to script tag The current script tag recommended by inspectlet contains an ID and the type specified. I don't think it makes too much difference but I think it is interesting to keep the script tag as close as possible of what is recommended by inspectlet =D
/* jshint node: true */ 'use strict'; module.exports = { name: 'ember-cli-inspectlet', contentFor: function(type, config) { var wid = config.APP.INSPECTLET_WID; if (wid != null && type === 'head') { return "<script type='text/javascript' id='inspectletjs'>\n" + "window.__insp = window.__ins...
/* jshint node: true */ 'use strict'; module.exports = { name: 'ember-cli-inspectlet', contentFor: function(type, config) { var wid = config.APP.INSPECTLET_WID; if (wid != null && type === 'head') { return "<script>\n" + "window.__insp = window.__insp || [];\n" + "__insp.push(['wid'...
Use string representation of object when formatting error messages
'use strict'; exports.formatStr = function () { var args = Array.prototype.slice.call(arguments) , str = args.shift() , i = 0; return str.replace(/\{([0-9]*)\}/g, function (m, argI) { argI = argI || i; i += 1; return String(args[argI]); }); }; exports.stringListJoin = function (arr) { if (arr....
'use strict'; exports.formatStr = function () { var args = Array.prototype.slice.call(arguments) , str = args.shift() , i = 0; return str.replace(/\{([0-9]*)\}/g, function (m, argI) { argI = argI || i; i += 1; return typeof(args[argI]) !== 'undefined' ? args[argI] : ''; }); }; exports.stringList...
Add condition to only launch updater if -u or --updater is specified
import os import sys import time from multiprocessing import Process, Event import mfhclient import update from arguments import parse from settings import HONEYPORT def main(): update_event = Event() mfhclient_process = Process( args=(args, update_event,), name="mfhclient_process", t...
import os import sys import time from multiprocessing import Process, Event import mfhclient import update from arguments import parse from settings import HONEYPORT def main(): update_event = Event() mfhclient_process = Process( args=(args, update_event,), name="mfhclient_process", t...
Set the download link to the current version of django-request, not latest git.
#!/usr/bin/env python from distutils.core import setup import request setup( name='django-request', version='%s' % request.__version__, description='django-request is a statistics module for django. It stores requests in a database for admins to see, it can also be used to get statistics on who is online e...
#!/usr/bin/env python from distutils.core import setup import request setup( name='django-request', version='%s' % request.__version__, description='django-request is a statistics module for django. It stores requests in a database for admins to see, it can also be used to get statistics on who is online e...
Modify to handle ARtool output
import os, sys from operator import itemgetter def errorExit(msg): sys.stderr.write(msg) sys.exit(1) def main(): # Verify arguments if len(sys.argv) != 2: errorExit("Usage: {} FILE\n".format(os.path.basename(sys.argv[0]))) fileName = sys.argv[1] if not os.path.isfile(fileName): ...
import os, sys from operator import itemgetter def errorExit(msg): sys.stderr.write(msg) sys.exit(1) def main(): # Verify arguments if len(sys.argv) != 2: errorExit("Usage: {} FILE\n".format(os.path.basename(sys.argv[0]))) fileName = sys.argv[1] if not os.path.isfile(fileName): ...
Fix relative import for py3
from __future__ import unicode_literals import datetime from django.http import HttpResponse, HttpResponseBadRequest from django.core.exceptions import ValidationError from django.views.decorators.csrf import csrf_exempt from django.views.decorators.http import require_POST from . import models import json def hello(...
from __future__ import unicode_literals import datetime from django.http import HttpResponse, HttpResponseBadRequest from django.core.exceptions import ValidationError from django.views.decorators.csrf import csrf_exempt from django.views.decorators.http import require_POST import models import json def hello(request...
Fix checking against null, supposed to be NO_USER
package co.phoenixlab.discord.commands; import co.phoenixlab.discord.MessageContext; import co.phoenixlab.discord.api.DiscordApiClient; import co.phoenixlab.discord.api.entities.Channel; import co.phoenixlab.discord.api.entities.Message; import co.phoenixlab.discord.api.entities.User; public class CommandUtil { ...
package co.phoenixlab.discord.commands; import co.phoenixlab.discord.MessageContext; import co.phoenixlab.discord.api.entities.Channel; import co.phoenixlab.discord.api.entities.Message; import co.phoenixlab.discord.api.entities.User; public class CommandUtil { static User findUser(MessageContext context, String...
Fix broken key generation code
package org.cru.godtools.s3; import com.google.common.base.Strings; /** * Created by ryancarlson on 7/11/15. */ public class AmazonS3GodToolsConfig { public static final String BUCKET_NAME = "cru-godtools"; private static final String META = "meta/"; private static final String PACKAGES = "packages/"; private ...
package org.cru.godtools.s3; import com.google.common.base.Strings; /** * Created by ryancarlson on 7/11/15. */ public class AmazonS3GodToolsConfig { public static final String BUCKET_NAME = "cru-godtools"; private static final String META = "meta"; private static final String PACKAGES = "packages/"; private s...
Remove wrong reference to quantum Change-Id: Ic3d8b26e061e85c1d128a79b115fd2da4412e705 Signed-off-by: Rosario Di Somma <73b2fe5f91895aea2b4d0e8942a5edf9f18fa897@dreamhost.com>
from django.utils.translation import ugettext_lazy as _ # noqa from horizon import exceptions from openstack_dashboard import api def get_interfaces_data(self): try: router_id = self.kwargs['router_id'] router = api.quantum.router_get(self.request, router_id) # Note(rods): Filter off the...
from django.utils.translation import ugettext_lazy as _ # noqa from horizon import exceptions from openstack_dashboard import api def get_interfaces_data(self): try: router_id = self.kwargs['router_id'] router = api.quantum.router_get(self.request, router_id) # Note(rods): Filter off the...
Fix `register` for 1.13.13 - 2.1 apps Also moved the register function above the call to `beforeEach` so you can register in a tests `beforeEach` if necessary.
import { module } from 'qunit'; import startApp from '../helpers/start-app'; import destroyApp from '../helpers/destroy-app'; export default function(name, options = {}) { module(name, { beforeEach() { this.application = startApp(); // BugFix: Can be removed after 2.1. If resolver is set then fallb...
import { module } from 'qunit'; import startApp from '../helpers/start-app'; import destroyApp from '../helpers/destroy-app'; export default function(name, options = {}) { module(name, { beforeEach() { this.application = startApp(); if (options.beforeEach) { options.beforeEach.apply(this, ar...
Remove mixins from namespace after monkey patching After their job is done, they can go home ;-)
# Copyright (c) 2014, German Neuroinformatics Node (G-Node) # # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted under the terms of the BSD License. See # LICENSE file in the root of the Project. from nix.core import File, FileMode, Block, DataTy...
# Copyright (c) 2014, German Neuroinformatics Node (G-Node) # # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted under the terms of the BSD License. See # LICENSE file in the root of the Project. from nix.core import File, FileMode, Block, DataTy...
Change to better argument name
from TestStack.White.UIItems import TextBox from WhiteLibrary.keywords.librarycomponent import LibraryComponent from WhiteLibrary.keywords.robotlibcore import keyword class TextBoxKeywords(LibraryComponent): @keyword def input_text_to_textbox(self, locator, input_value): """ Writes text to a t...
from TestStack.White.UIItems import TextBox from WhiteLibrary.keywords.librarycomponent import LibraryComponent from WhiteLibrary.keywords.robotlibcore import keyword class TextBoxKeywords(LibraryComponent): @keyword def input_text_to_textbox(self, locator, input): """ Writes text to a textbox...
Add test to check whether a variable is a number.
// Source: http://stackoverflow.com/a/1830844 function isNumber(n) { return !isNaN(parseFloat(n)) && isFinite(n); } function AppViewModel() { this.statStrength = ko.observable(); this.statEndurance = ko.observable(); this.statAgility = ko.observable(); this.statSpeed = ko.observable(); this.stat...
function AppViewModel() { this.statStrength = ko.observable(); this.statEndurance = ko.observable(); this.statAgility = ko.observable(); this.statSpeed = ko.observable(); this.statWillpower = ko.observable(); this.statInsight = ko.observable(); this.statReasoning = ko.observable(); this...
config: Fix loading of default config values If RawConfigParser is not able to find config using get(), it doesn't return None, instead it raises an Exception. Signed-off-by: Vivek Anand <6cbec6cb1b0c30c91d3fca6c61ddeb9b64cef11c@gmail.com>
# -*- coding: utf-8 -*- import ConfigParser import os PROJECT_ROOT = os.path.abspath(os.path.dirname(__name__)) name = '/etc/autocloud/autocloud.cfg' if not os.path.exists(name): raise Exception('Please add a proper config file under /etc/autocloud/') default = {'host': '127.0.0.1', 'port': 5000} config = Confi...
# -*- coding: utf-8 -*- import ConfigParser import os PROJECT_ROOT = os.path.abspath(os.path.dirname(__name__)) name = '/etc/autocloud/autocloud.cfg' if not os.path.exists(name): raise Exception('Please add a proper config file under /etc/autocloud/') config = ConfigParser.RawConfigParser() config.read(name) K...
Fix up bad last commit
def parse_app_page(response): # Should always be able to grab a title title = response.xpath('//div[@class = "panel panel-default panel-gameinfo"]/div[@class = "panel-heading"]/text()').extract()[0].strip() # Parse times into floats time_to_hundo = response.xpath('//table[@class = "Default1000"]/tr/td[s...
def parse_app_page(response): # Should always be able to grab a title title = response.xpath('//div[@class = "panel panel-default panel-gameinfo"]/div[@class = "panel-heading"]/text()').extract()[0].strip() # Parse times into floats time_to_hundo = response.xpath('//table[@class = "Default1000"]/tr/td[s...
Test of a vendor repository checkin.
<?php namespace Cerad\Module\AuthModule\Tests; require __DIR__ . '/../../../vendor/autoload.php'; use Cerad\Module\KernelModule\KernelContainer; use Cerad\Module\AuthModule\AuthServices; class AuthTests extends \PHPUnit_Framework_TestCase { protected $container; public static function setUpBeforeClass()...
<?php namespace Cerad\Module\AuthModule\Tests; require __DIR__ . '/../../../vendor/autoload.php'; use Cerad\Module\KernelModule\KernelContainer; use Cerad\Module\AuthModule\AuthServices; class AuthTests extends \PHPUnit_Framework_TestCase { protected $container; public static function setUpBeforeClass() ...