text
stringlengths
16
4.96k
positive
stringlengths
321
2.24k
negative
stringlengths
310
2.21k
Make platform ID a Number
'use babel'; import { SelectView } from 'particle-dev-views'; let $$ = null; export default class SelectTargetPlatformView extends SelectView { constructor(...args) { super(...args); this.show = this.show.bind(this); } initialize(profileManager) { this.profileManager = profileManager; super.initialize(.....
'use babel'; import { SelectView } from 'particle-dev-views'; let $$ = null; export default class SelectTargetPlatformView extends SelectView { constructor(...args) { super(...args); this.show = this.show.bind(this); } initialize(profileManager) { this.profileManager = profileManager; super.initialize(.....
Allow compatibility with RN 0.47
package com.futurice.rctaudiotoolkit; import com.facebook.react.ReactPackage; import com.facebook.react.bridge.JavaScriptModule; import com.facebook.react.bridge.NativeModule; import com.facebook.react.bridge.ReactApplicationContext; import com.facebook.react.uimanager.ViewManager; import java.util.ArrayList; import ...
package com.futurice.rctaudiotoolkit; import com.facebook.react.ReactPackage; import com.facebook.react.bridge.JavaScriptModule; import com.facebook.react.bridge.NativeModule; import com.facebook.react.bridge.ReactApplicationContext; import com.facebook.react.uimanager.ViewManager; import java.util.ArrayList; import ...
Add pboothe temporarily for testing
# NOTE: User roles are not managed here. Visit PlanetLab to change user roles. user_list = [('Stephen', 'Stuart', 'sstuart@google.com'), ('Will', 'Hawkins', 'hawkinsw@opentechinstitute.org'), ('Jordan', 'McCarthy', 'mccarthy@opentechinstitute.org'), ('Chris', 'Ritzo', 'cri...
# NOTE: User roles are not managed here. Visit PlanetLab to change user roles. user_list = [('Stephen', 'Stuart', 'sstuart@google.com'), ('Will', 'Hawkins', 'hawkinsw@opentechinstitute.org'), ('Jordan', 'McCarthy', 'mccarthy@opentechinstitute.org'), ('Chris', 'Ritzo', 'cri...
Fix typo in delivery server.
// Continuous delivery server const { spawn } = require('child_process') const { resolve } = require('path') const { createServer } = require('http') const { urlencoded } = require('body-parser') const hostname = '127.0.0.1' const port = 80 const server = createServer((req, res) => { const { headers, method, url } =...
// Continuous delivery server const { spawn } = require('child_process') const { resolve } = require('path') const { createServer } = require('http') const { urlencoded } = require('body-parser') const hostname = '127.0.0.1' const port = 80 const server = http.createServer((req, res) => { const { headers, method, ur...
Trim the input on user form
<?php namespace UBC\Exam\MainBundle\Form; use Symfony\Component\Form\AbstractType; use Symfony\Component\Form\FormBuilderInterface; use Symfony\Component\OptionsResolver\OptionsResolverInterface; class UserType extends AbstractType { public function buildForm(FormBuilderInterface $builder, array $options) { ...
<?php namespace UBC\Exam\MainBundle\Form; use Symfony\Component\Form\AbstractType; use Symfony\Component\Form\FormBuilderInterface; use Symfony\Component\OptionsResolver\OptionsResolverInterface; class UserType extends AbstractType { public function buildForm(FormBuilderInterface $builder, array $options) { ...
Raise exception if sdb does not exist
#!/usr/bin/env python3 # Copyright 2015-2016 Samsung Electronics Co., Ltd. # # 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 requir...
#!/usr/bin/env python3 # Copyright 2015-2016 Samsung Electronics Co., Ltd. # # 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 requir...
Fix prefix problem that made a 404 error
package kwiscale import ( "crypto/md5" "fmt" "net/http" "os" "path/filepath" ) // StaticHandler handle static files handlers. Use App.SetStatic(path) that create the static handler type staticHandler struct { RequestHandler } // Use http.FileServer to serve file after adding ETag. func (s *staticHandler) Get()...
package kwiscale import ( "crypto/md5" "fmt" "net/http" "os" "path/filepath" ) // StaticHandler handle static files handlers. Use App.SetStatic(path) that create the static handler type staticHandler struct { RequestHandler } // Use http.FileServer to serve file after adding ETag. func (s *staticHandler) Get()...
Remove axios and unused function
export const liveRootUrl = 'https://bolg-app.herokuapp.com/posts/'; export const states = { LOADING: 0, EDITING: 1, SAVED: 2, ERROR: 3, EDITING_OFFLINE: 4, SAVED_OFFLINE: 5, PUBLISHED: 6, }; export const mapsAPIKey = 'AIzaSyBADvjevyMmDkHb_xjjh3FOltkO2Oa8iAQ'; export const sizes = [ { width: 2560,...
import axios from 'axios'; export const liveRootUrl = 'https://bolg-app.herokuapp.com/posts/'; export const states = { LOADING: 0, EDITING: 1, SAVED: 2, ERROR: 3, EDITING_OFFLINE: 4, SAVED_OFFLINE: 5, PUBLISHED: 6, }; export const mapsAPIKey = 'AIzaSyBADvjevyMmDkHb_xjjh3FOltkO2Oa8iAQ'; export function...
Remove CHANNEL. Why is it even there?
#!/usr/bin/env python2 ################################################################################ # broadcast_any_song.py # # Uses the Exfm REST API to broadcast a song, (basically scours Tumblr for an # audio file matching a query then sends it to PiFM.) # # Maintained By: Ryan Jacobs <ryan.mjacobs@gmail.com> # ...
#!/usr/bin/env python2 ################################################################################ # broadcast_any_song.py # # Uses the Exfm REST API to broadcast a song, (basically scours Tumblr for an # audio file matching a query then sends it to PiFM.) # # Maintained By: Ryan Jacobs <ryan.mjacobs@gmail.com> # ...
Fix (*): Remove unused variable
<?php namespace AppBundle\Twig\Extension; class GpsDMSExtension extends \Twig_Extension { public function getFilters() { return array( new \Twig_SimpleFilter('gps_dms', array($this, 'dmsFilter')), ); } public function dmsFilter($number) { $vars = explode(".",...
<?php namespace AppBundle\Twig\Extension; class GpsDMSExtension extends \Twig_Extension { public function getFilters() { return array( new \Twig_SimpleFilter('gps_dms', array($this, 'dmsFilter')), ); } public function dmsFilter($number) { $vars = explode(".",...
Allow `id` to be passed by default It seems rather common that you want to assign an id and since it's a generic prop it cannot hurt to allow it to always pass through.
/* @flow weak */ import { createElement, PropTypes } from 'react' export default function createComponent(rule, type = 'div', passThroughProps = []) { const FelaComponent = ({ children, className, id, style, passThrough = [], ...ruleProps }, { renderer, theme }) => { // filter props to extract props to pass thr...
/* @flow weak */ import { createElement, PropTypes } from 'react' export default function createComponent(rule, type = 'div', passThroughProps = []) { const FelaComponent = ({ children, className, style, passThrough = [], ...ruleProps }, { renderer, theme }) => { // filter props to extract props to pass through...
Allow for loading from inside a web component Walk up to the root to find url, don't depend on document's location
/* * Copyright 2012 The Toolkitchen Authors. All rights reserved. * Use of this source code is governed by a BSD-style * license that can be found in the LICENSE file. */ (function() { var thisFile = 'pointerevents.js'; var libLocation = ''; /* * if we are loaded inside a component, we need to know the rel...
/* * Copyright 2012 The Toolkitchen Authors. All rights reserved. * Use of this source code is governed by a BSD-style * license that can be found in the LICENSE file. */ (function() { var thisFile = 'pointerevents.js'; var source = '', base = ''; var s$ = document.querySelectorAll('script[src]'); Array.pro...
Use a custom logging handler.
package main import ( "flag" "fmt" "io" "net/http" "os" ) const VERSION = "0.1.0" var clientDir string func init() { clientEnv := os.Getenv("CLIENT") flag.StringVar(&clientDir, "client", clientEnv, "the directory where the client data is stored") } func main() { flag.Parse() fmt.Printf("resolutionizerd %s...
package main import ( "flag" "fmt" "net/http" "os" "github.com/gorilla/handlers" ) const VERSION = "0.1.0" var clientDir string func init() { clientEnv := os.Getenv("CLIENT") flag.StringVar(&clientDir, "client", clientEnv, "the directory where the client data is stored") } func main() { flag.Parse() fmt.P...
Add support for customizing the mysql port number
<?php namespace Nord\Lumen\Doctrine\ORM\Configuration; use Nord\Lumen\Doctrine\ORM\Contracts\ConfigurationAdapter as ConfigurationAdapterContract; class SqlAdapter implements ConfigurationAdapterContract { /** * @inheritdoc */ public function map(array $config) { return [ 'd...
<?php namespace Nord\Lumen\Doctrine\ORM\Configuration; use Nord\Lumen\Doctrine\ORM\Contracts\ConfigurationAdapter as ConfigurationAdapterContract; class SqlAdapter implements ConfigurationAdapterContract { /** * @inheritdoc */ public function map(array $config) { return [ 'd...
Use correct file name to require enums.js
var enums = require("./enums.js"); describe("Enum", function() { it("can have symbols with custom properties", function() { var color = new enums.Enum({ red: { de: "rot" }, green: { de: "grün" }, blue: { de: "blau" }, }); function translate(c) { ...
var enums = require("./enum.js"); describe("Enum", function() { it("can have symbols with custom properties", function() { var color = new enums.Enum({ red: { de: "rot" }, green: { de: "grün" }, blue: { de: "blau" }, }); function translate(c) { ...
Convert entire table to cartesian
""" Add very large RV errors for stars with no known RVs. Convert to cartesian. """ import numpy as np import sys sys.path.insert(0, '..') from chronostar import tabletool from astropy.table import Table datafile = '../data/ScoCen_box_result.fits') d = tabletool.read(datafile) # Set missing radial velocities (nan) t...
""" Add very large RV errors for stars with no known RVs. Convert to cartesian. """ import numpy as np import sys sys.path.insert(0, '..') from chronostar import tabletool from astropy.table import Table datafile = Table.read('../data/ScoCen_box_result.fits') d = Table.read(datafile) # Set missing radial velocities ...
Clean up imports in trade reporter
package org.jvirtanen.parity.reporter; import static org.jvirtanen.lang.Strings.*; import java.util.Locale; import org.jvirtanen.parity.net.ptr.PTR; import org.jvirtanen.parity.net.ptr.PTRListener; class Display implements PTRListener { private static final double PRICE_FACTOR = 10000.0; private static fin...
package org.jvirtanen.parity.reporter; import static org.jvirtanen.lang.Strings.*; import org.jvirtanen.parity.net.ptr.PTR; import org.jvirtanen.parity.net.ptr.PTRListener; import java.util.Locale; class Display implements PTRListener { private static final double PRICE_FACTOR = 10000.0; private static fin...
Add line to make code more visible
// PiscoBot Script var commandDescription = { name: 'Do It', author: 'Daniel Gallegos [@that_taco_guy]', trigger: 'do it', version: 1.0, description: 'Motivate your team using Shia Lebouf.', module: 'Fun' }; global.botHelp.push(commandDescription); var _ = require('underscore'); global.piscobot.hears(['...
// PiscoBot Script var commandDescription = { name: 'Do It', author: 'Daniel Gallegos [@that_taco_guy]', trigger: 'do it', version: 1.0, description: 'Motivate your team using Shia Lebouf.', module: 'Fun' }; global.botHelp.push(commandDescription); var _ = require('underscore'); global.piscobot.hears(['d...
Add ability to change how request parser decodes json Can choose between associative or object
<?php /** * Created by IntelliJ IDEA. * User: mduncan * Date: 9/29/15 * Time: 12:49 PM */ namespace Fulfillment\Api\Utilities; use GuzzleHttp\Exception\RequestException; class RequestParser { /** * Returns an object or array of the FDC error parsed from the Guzzle Request exception * @param Reque...
<?php /** * Created by IntelliJ IDEA. * User: mduncan * Date: 9/29/15 * Time: 12:49 PM */ namespace Fulfillment\Api\Utilities; use GuzzleHttp\Exception\RequestException; class RequestParser { public static function parseError(RequestException $requestException) { $error = $error = json_decode(...
Make new code pass all new tests This was done by setting the moderator flag in the helper function that creates admin users.
const Bluebird = require('bluebird'); const mongoose = require('mongoose'); const Alternative = require('../app/models/alternative'); const Election = require('../app/models/election'); const Vote = require('../app/models/vote'); const User = require('../app/models/user'); exports.dropDatabase = () => mongoose.conne...
const Bluebird = require('bluebird'); const mongoose = require('mongoose'); const Alternative = require('../app/models/alternative'); const Election = require('../app/models/election'); const Vote = require('../app/models/vote'); const User = require('../app/models/user'); exports.dropDatabase = () => mongoose.conne...
Update up to changes in memoizee
'use strict'; var noop = require('es5-ext/lib/Function/noop') , extend = require('es5-ext/lib/Object/extend') , memoize = require('memoizee') , ee = require('event-emitter') , deferred = require('deferred') , isPromise = deferred.isPromise; module.exports = function (fn/*, options*/) { va...
'use strict'; var noop = require('es5-ext/lib/Function/noop') , extend = require('es5-ext/lib/Object/extend') , memoize = require('memoizee') , ee = require('event-emitter') , deferred = require('deferred') , isPromise = deferred.isPromise; module.exports = function (fn/*, options*/) { va...
Test push post repo transfer to git-phaser org
angular.module('gitphaser') .controller('NearbyCtrl', NearbyCtrl); // @controller NearbyCtrl // @params: $scope, $reactive // @route: /tab/nearby // // Exposes Meteor mongo 'connections' to DOM, filtered against current user as 'transmitter' // Subscription to 'connections' is handled in the route resolve. Also /...
var nc_debug; angular.module('gitphaser') .controller('NearbyCtrl', NearbyCtrl); // @controller NearbyCtrl // @params: $scope, $reactive // @route: /tab/nearby // // Exposes Meteor mongo 'connections' to DOM, filtered against current user as 'transmitter' // Subscription to 'connections' is handled in the route ...
Change default close operation of main window to "dispose" Add windowClosed listener which interrupts all model threads
package ru.nsu.ccfit.bogush.view; import ru.nsu.ccfit.bogush.CarFactoryModel; import ru.nsu.ccfit.bogush.factory.Supplier; import javax.swing.*; import java.awt.event.WindowAdapter; import java.awt.event.WindowEvent; public class FactoryView extends JPanel { private JPanel mainPanel; private ControlPanel controlPa...
package ru.nsu.ccfit.bogush.view; import ru.nsu.ccfit.bogush.CarFactoryModel; import javax.swing.*; public class FactoryView extends JPanel { private JPanel mainPanel; private ControlPanel controlPanel; private InformationPanel infoPanel; private ButtonPanel buttonPanel; private CarFactoryModel model; public...
Fix botched React default require in bundled module Turns out you shouldn't mix `import React …` and `import * as React …`!
import React from 'react'; import Radium from 'radium'; type SpanT = { span: 1 | 2 | 3 | 4 | 5 | 6, children: React.Node }; const Span = ({span = 6, children}: SpanT) => { const style = { boxSizing: 'border-box', display: 'flex', flexBasis: '100%', // Bug fix for Firefox; width and flexBasis don...
import * as React from 'react'; import Radium from 'radium'; type SpanT = { span: 1 | 2 | 3 | 4 | 5 | 6, children: React.Node }; const Span = ({span = 6, children}: SpanT) => { const style = { boxSizing: 'border-box', display: 'flex', flexBasis: '100%', // Bug fix for Firefox; width and flexBasi...
Fix Parting Shot in Trademarked
'use strict'; exports.BattleScripts = { init: function() { Object.values(this.data.Movedex).forEach(move => { let bannedMoves = {'Baton Pass':1, 'Detect':1, 'Mat Block':1, 'Protect':1, 'Roar':1, 'Skill Swap':1, 'Whirlwind':1}; if (move.category === 'Status' && !bannedMoves[move.name]) { this.data.Abilitie...
'use strict'; exports.BattleScripts = { init: function() { Object.values(this.data.Movedex).forEach(move => { let bannedMoves = {'Baton Pass':1, 'Detect':1, 'Mat Block':1, 'Parting Shot':1, 'Protect':1, 'Roar':1, 'Skill Swap':1, 'Whirlwind':1}; if (move.category === 'Status' && !bannedMoves[move.name]) { ...
Add semicolon to allow concatenation The anonymous function syntax causes errors when this file gets concatenated with other files that are stingy with their semicolons, as happens in ``tests/a1-package-stubs.js`` with other community stubs with different semicolon conventions.
// router package // // Stubs for the tmeasday's Router package. // https://github.com/tmeasday/meteor-router ; (function () { var emptyFunction = function () {}; // The Meteor stub needs to be call before. Meteor = Meteor || {}; Meteor.Router = { add: function(paths){ var options; for(var i ...
// router package // // Stubs for the tmeasday's Router package. // https://github.com/tmeasday/meteor-router (function () { var emptyFunction = function () {}; // The Meteor stub needs to be call before. Meteor = Meteor || {}; Meteor.Router = { add: function(paths){ var options; for(var i i...
Fix a bug on a query example for python Methods used by the former example, `query.more()` and `query.next()`, do not exist any longer. I've modified them to `query.execute()`, according to `BaseXClient.py`, to make it run as good as it should be.
# This example shows how queries can be executed in an iterative manner. # Iterative evaluation will be slower, as more server requests are performed. # # Documentation: http://docs.basex.org/wiki/Clients # # (C) BaseX Team 2005-12, BSD License import BaseXClient, time try: # create session session = B...
# This example shows how queries can be executed in an iterative manner. # Iterative evaluation will be slower, as more server requests are performed. # # Documentation: http://docs.basex.org/wiki/Clients # # (C) BaseX Team 2005-12, BSD License import BaseXClient, time try: # create session session = B...
Print the Format class used
def print_header(): import sys from dxtbx.format.Registry import Registry # this will do the lookup for every frame - this is strictly not needed # if all frames are from the same instrument for arg in sys.argv[1:]: format = Registry.find(arg) print 'Using header reader: %s' % ...
def print_header(): import sys from dxtbx.format.Registry import Registry # this will do the lookup for every frame - this is strictly not needed # if all frames are from the same instrument for arg in sys.argv[1:]: format = Registry.find(arg) i = format(arg) print 'Bea...
Add homepage to plugin details
<?php namespace PopcornPHP\RedirectToHTTPS; use System\Classes\PluginBase; class Plugin extends PluginBase { public function pluginDetails() { return [ 'name' => 'RedirectToHTTPS', 'description' => 'Simple plugin for redirect all request to HTTPS', 'author' ...
<?php namespace PopcornPHP\RedirectToHTTPS; use System\Classes\PluginBase; class Plugin extends PluginBase { public function pluginDetails() { return [ 'name' => 'RedirectToHTTPS', 'description' => 'Simple plugin for redirect all request to HTTPS', 'author' ...
Update our Froala Editor license key
/* eslint ember/order-in-components: 0 */ import $ from 'jquery'; import { inject as service } from '@ember/service'; import Component from '@ember/component'; import { computed } from '@ember/object'; const defaultButtons = [ 'bold', 'italic', 'subscript', 'superscript', 'formatOL', 'formatUL', 'insertL...
/* eslint ember/order-in-components: 0 */ import $ from 'jquery'; import { inject as service } from '@ember/service'; import Component from '@ember/component'; import { computed } from '@ember/object'; const defaultButtons = [ 'bold', 'italic', 'subscript', 'superscript', 'formatOL', 'formatUL', 'insertL...
Remove prefix to save some characters.
// Copyright 2015 Google Inc. All Rights Reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable...
// Copyright 2015 Google Inc. All Rights Reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable...
Fix for dynamic value of FacilityDataset.preset.choices causing migration inconsistencies
# -*- coding: utf-8 -*- # Generated by Django 1.9.13 on 2017-12-26 19:25 from __future__ import unicode_literals from django.db import migrations, models # This is necessary because: # 1. The list generator has an unpredictable order, and when items swap places # then this would be picked up as a change in Django ...
# -*- coding: utf-8 -*- # Generated by Django 1.9.13 on 2017-12-26 19:25 from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('kolibriauth', '0006_auto_20171206_1207'), ] operations = [ migrations.Alter...
Add footnotes extension to showdown refs 1318 - based on Markdown Extra https://michelf.ca/projects/php-markdown/extra/ - allows [^n] for automatic numbering based on sequence
/* global Showdown, Handlebars, html_sanitize*/ import cajaSanitizers from 'ghost/utils/caja-sanitizers'; var showdown, formatMarkdown; showdown = new Showdown.converter({extensions: ['ghostimagepreview', 'ghostgfm', 'footnotes']}); formatMarkdown = Ember.Handlebars.makeBoundHelper(function (markdown) { var ...
/* global Showdown, Handlebars, html_sanitize*/ import cajaSanitizers from 'ghost/utils/caja-sanitizers'; var showdown, formatMarkdown; showdown = new Showdown.converter({extensions: ['ghostimagepreview', 'ghostgfm']}); formatMarkdown = Ember.Handlebars.makeBoundHelper(function (markdown) { var escapedhtml =...
Mask the API key shown in settings
package tr.xip.wanikani.settings; import android.os.Build; import android.os.Bundle; import android.preference.Preference; import android.preference.PreferenceActivity; import tr.xip.wanikani.R; import tr.xip.wanikani.managers.PrefManager; /** * Created by xihsa_000 on 4/4/14. */ public class SettingsActivity exte...
package tr.xip.wanikani.settings; import android.os.Build; import android.os.Bundle; import android.preference.Preference; import android.preference.PreferenceActivity; import tr.xip.wanikani.R; import tr.xip.wanikani.managers.PrefManager; /** * Created by xihsa_000 on 4/4/14. */ public class SettingsActivity exte...
Allow setup function to update dynamic mapping
import json import os from elasticsearch import Elasticsearch from elasticsearch_dsl import Index from model import APIDoc def exists(): return Index(APIDoc.Index.name).exists() def setup(): """ Setup Elasticsearch Index with dynamic template. Run it on an open index to update dynamic mapping. ...
import json import os from elasticsearch import Elasticsearch from elasticsearch_dsl import Index from model import APIDoc def exists(): return Index(APIDoc.Index.name).exists() def setup(): """ Setup Elasticsearch Index. Primary index with dynamic template. Secondary index with static mappings...
Add subdirs of nativeconfig package to build.
import os from setuptools import setup from sys import platform REQUIREMENTS = [] if platform.startswith('darwin'): REQUIREMENTS.append('pyobjc-core >= 2.5') with open(os.path.join(os.path.dirname(__file__), 'nativeconfig', 'version.py')) as f: version = None code = compile(f.read(), 'version.py', 'exe...
import os from setuptools import setup from sys import platform REQUIREMENTS = [] if platform.startswith('darwin'): REQUIREMENTS.append('pyobjc-core >= 2.5') with open(os.path.join(os.path.dirname(__file__), 'nativeconfig', 'version.py')) as f: version = None code = compile(f.read(), 'version.py', 'exe...
Exclude emulated attachment on OpenJ9.
package net.bytebuddy.test.utility; import com.sun.jna.Platform; import org.junit.rules.MethodRule; import org.junit.runners.model.FrameworkMethod; import org.junit.runners.model.Statement; import java.lang.annotation.ElementType; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; imp...
package net.bytebuddy.test.utility; import com.sun.jna.Platform; import org.junit.rules.MethodRule; import org.junit.runners.model.FrameworkMethod; import org.junit.runners.model.Statement; import java.lang.annotation.ElementType; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; imp...
Swap out global function for static Str::camel() method
<?php namespace Konsulting\Laravel\RuleRepository; use Illuminate\Support\Str; use Konsulting\Laravel\RuleRepository\Contracts\RuleRepository; use Konsulting\Laravel\RuleRepository\Exceptions\NonExistentStateException; class RepositoryManager { /** * The repository instance. * * @var RuleRepositor...
<?php namespace Konsulting\Laravel\RuleRepository; use Konsulting\Laravel\RuleRepository\Contracts\RuleRepository; use Konsulting\Laravel\RuleRepository\Exceptions\NonExistentStateException; class RepositoryManager { /** * The repository instance. * * @var RuleRepository */ protected $rep...
FIX Change the completed-error state
/* * Copyright 2014 Telefonica Investigación y Desarrollo, S.A.U * * This file is part of iotagent-thinking-things * * iotagent-thinking-things 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, eit...
/* * Copyright 2014 Telefonica Investigación y Desarrollo, S.A.U * * This file is part of iotagent-thinking-things * * iotagent-thinking-things 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, eit...
Add marker for log-lines that are printed to stdout
package org.apache.poi.benchmark.util; import com.google.common.collect.EvictingQueue; import org.apache.commons.lang3.StringUtils; import org.dstadler.commons.exec.BufferingLogOutputStream; import java.util.Collection; import java.util.Queue; /** * An extension to {@link BufferingLogOutputStream} which additionall...
package org.apache.poi.benchmark.util; import com.google.common.collect.EvictingQueue; import org.apache.commons.lang3.StringUtils; import org.dstadler.commons.exec.BufferingLogOutputStream; import java.util.Collection; import java.util.Queue; /** * An extension to {@link BufferingLogOutputStream} which additionall...
Mark the close map dialog button with role button Bug: T308320 Change-Id: I429ec8a081614d90e2b82e5e31918b9e61ca602d
/** * # Control to close the full screen dialog. * * See [L.Control](https://www.mapbox.com/mapbox.js/api/v2.3.0/l-control/) * documentation for more details. * * @class Kartographer.Dialog.CloseFullScreenControl * @extends L.Control */ var CloseFullScreenControl = L.Control.extend( { options: { position: 't...
/** * # Control to close the full screen dialog. * * See [L.Control](https://www.mapbox.com/mapbox.js/api/v2.3.0/l-control/) * documentation for more details. * * @class Kartographer.Dialog.CloseFullScreenControl * @extends L.Control */ var CloseFullScreenControl = L.Control.extend( { options: { position: 't...
Fix for redirect after signing up
<?php namespace App\Http\Controllers; use App\Http\Requests\UniversityRegisterRequest; use App\Http\Requests; use App\Http\Controllers\Controller; use App\University; use Illuminate\Support\Facades\Auth; use Illuminate\Support\Facades\Session; class RegisterController extends Controller { use CreateUserTrait; ...
<?php namespace App\Http\Controllers; use App\Http\Requests\UniversityRegisterRequest; use App\Http\Requests; use App\Http\Controllers\Controller; use App\University; use Illuminate\Support\Facades\Auth; use Illuminate\Support\Facades\Session; class RegisterController extends Controller { use CreateUserTrait; ...
Define a MD->RST conversion function
from setuptools import setup try: from pypandoc import convert def read_md(): return lambda f: convert(f, 'rst') except ImportError: print( "warning: pypandoc module not found, could not convert Markdown to RST" ) def read_md(): return lambda f: open(f, 'r').read() setup...
from setuptools import setup try: from pypandoc import convert read_md = lambda f: convert(f, 'rst') except ImportError: print("warning: pypandoc module not found, could not convert Markdown to RST") read_md = lambda f: open(f, 'r').read() setup(name='centerline', version='0.1', descriptio...
Determine API_URL based on hostname
import fetch from 'isomorphic-fetch' const hostname = window && window.location && window.location.hostname const API_URL = hostname === 'localhost' ? process.env.REACT_APP_RAILS_API_DEV_URL : process.env.REACT_APP_RAILS_API_PROD_URL const headers = () => { const token = JSON.parse(localStorage.getItem('token'))...
import fetch from 'isomorphic-fetch' const API_URL = process.env.REACT_APP_RAILS_API_URL const headers = () => { const token = JSON.parse(localStorage.getItem('token')) return { Accept: 'application/json', 'Content-Type': 'application/json', Authorization: `Bearer ${token}`, 'Access-Control-Allow...
Exclude notes and private_notes from api for now
from rest_framework import serializers from reversion import revisions from wafer.talks.models import Talk class TalkSerializer(serializers.ModelSerializer): class Meta: model = Talk # private_notes should possibly be accessible to # talk reviewers by the API, but certainly # not...
from rest_framework import serializers from reversion import revisions from wafer.talks.models import Talk class TalkSerializer(serializers.ModelSerializer): class Meta: model = Talk exclude = ('_abstract_rendered', ) @revisions.create_revision() def create(self, validated_data): ...
Remove query from method name and specify comment
package com.novoda.notils.string; import java.util.Arrays; public class QueryUtils { /** * Creates a string to be used as a placeholder in {@link android.content.ContentResolver} operations selection. * This will allow to use more selection arguments and have them replaced when using the IN operator. ...
package com.novoda.notils.string; import java.util.Arrays; public class QueryUtils { /** * Creates a string to be used as a placeholder in {@link android.content.ContentResolver} operations selection. * This will allow to use more selection arguments and have them replaced. * * @param size Th...
Set environment settings to suit localhost
import os # ***************************** # Environment specific settings # ***************************** # The settings below can (and should) be over-ruled by OS environment variable settings # Flask settings # Generated with: import os; os.urandom(24) SECRET_KEY = '\x9d|*\xbb\x82T\x83\xeb\xf52...
import os # ***************************** # Environment specific settings # ***************************** # The settings below can (and should) be over-ruled by OS environment variable settings # Flask settings # Generated with: import os; os.urandom(24) SECRET_KEY = '\xb9\x8d\xb5\xc2\xc4Q\xe7\x8...
test(store): Reset jest modules and NODE_ENV after store tests
// @flow describe('store', () => { beforeEach(() => jest.resetModules()) afterEach(() => jest.resetModules()) it('should create a development redux store with the reducers passed', () => { process.env.NODE_ENV = 'development' const createStore = require('../../../src/store') const store = createStore...
/* globals describe, expect, it, jest */ describe('store', () => { it('should create a development redux store with the reducers passed', () => { jest.resetModules() process.env.NODE_ENV = 'development' const createStore = require('../../../src/store') const store = createStore({}) expect(store....
Update requests to its latest version
try: from setuptools import setup except ImportError: from distutils.core import setup execfile('panoply/constants.py') setup( name=__package_name__, version=__version__, packages=["panoply"], install_requires=[ "requests==2.21.0", "oauth2client==4.1.1" ], extras_requi...
try: from setuptools import setup except ImportError: from distutils.core import setup execfile('panoply/constants.py') setup( name=__package_name__, version=__version__, packages=["panoply"], install_requires=[ "requests==2.3.0", "oauth2client==4.1.1" ], extras_requir...
Fix and refactor where() mutator
<?php namespace Underscore\Mutator; use Underscore\Collection; use Underscore\Mutator; class WhereMutator extends Mutator { /** * Remove all values that do not match the given key-value pairs. * * By default strict comparison is used. * * @param Collection $collection * @param array...
<?php namespace Underscore\Mutator; use Underscore\Collection; use Underscore\Mutator; /** * Class WhereMutator * @package Underscore\Mutator */ class WhereMutator extends Mutator { /** * Remove all values that do not match the given key-value pairs. * * By default strict comparison is used. ...
[Bundle] Make getPath() less error prone by allowing both backward and forward slashes
<?php /* * This file is part of the Symfony package. * * (c) Fabien Potencier <fabien.potencier@symfony-project.com> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Symfony\Bundle\WebProfilerBundle; use Symfony\Compone...
<?php /* * This file is part of the Symfony package. * * (c) Fabien Potencier <fabien.potencier@symfony-project.com> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Symfony\Bundle\WebProfilerBundle; use Symfony\Compone...
Fix wrong console command namespace
<?php declare(strict_types=1); namespace Cortex\Foundation\Console\Commands; use Illuminate\Database\Console\Migrations\MigrateMakeCommand as BaseMigrateMakeCommand; class MigrateMakeCommand extends BaseMigrateMakeCommand { /** * The console command signature. * * @var string */ protecte...
<?php declare(strict_types=1); namespace Cortex\Foundation\Console; use Illuminate\Database\Console\Migrations\MigrateMakeCommand as BaseMigrateMakeCommand; class MigrateMakeCommand extends BaseMigrateMakeCommand { /** * The console command signature. * * @var string */ protected $signat...
Add externalUrl to all resources
/* jshint node: true */ 'use strict'; module.exports = { name: 'ember-cli-respond', contentFor: function(type, config) { if (type === 'head-footer') { var output = '<script src="' + config.respond.externalUrl + 'ember-cli-respond/respond.min.js"></script>'; if (typeof config.respond !== 'undefi...
/* jshint node: true */ 'use strict'; module.exports = { name: 'ember-cli-respond', contentFor: function(type, config) { if (type === 'head-footer') { var output = '<script src="/ember-cli-respond/respond.min.js"></script>'; if (typeof config.respond !== 'undefined' && config.respond.proxy === ...
Fix the bugs in the main code ref #58
'use babel'; let InteractiveConfigurationPanel = null; let RandomTipPanel = null; function initializeInteractiveConfiguration() { if (InteractiveConfigurationPanel !== null) return ; InteractiveConfigurationPanel = require('./interactive-configuration-panel'); } function initializeRandomTips() { if (RandomTipP...
'use babel'; let InteractiveConfigurationPanel = null; let RandomTipPanel = null; initializeInteractiveConfiguration() { if (InteractiveConfigurationPanel !== null) return ; InteractiveConfigurationPanel = require('./interactive-configuration-panel'); } initializeRandomTips() { if (RandomTipPanel !== null) ret...
Add readable text for debugging.
package com.github.kubode.wiggle; import android.annotation.SuppressLint; import android.content.Context; import android.util.AttributeSet; import android.widget.TextView; public class MockView extends TextView { private final WiggleHelper helper = new WiggleHelper(); public MockView(Context context) { ...
package com.github.kubode.wiggle; import android.content.Context; import android.util.AttributeSet; import android.view.View; public class MockView extends View { private final WiggleHelper helper = new WiggleHelper(); public MockView(Context context) { super(context); } public MockView(Con...
Remove caching of normalized paths again Caching them avoided some short term allocations, but significantly increased long-term heap consumption.
/* * Copyright 2016 the original author or 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 applica...
/* * Copyright 2016 the original author or 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 applica...
Update test: mock module request
<?php namespace tests\SlackApi; use SlackApi\Client; use SlackApi\Response; use \tests\Fixtures\TestModule; /** * Class AbstractModuleTest */ class ModuleTest extends \PHPUnit_Framework_TestCase { /** * @return string */ protected function getRealToken() { return getenv('SLACK_TEST_TOK...
<?php namespace tests\SlackApi; use SlackApi\Client; use \tests\Fixtures\TestModule; /** * Class AbstractModuleTest */ class ModuleTest extends \PHPUnit_Framework_TestCase { /** * @return string */ protected function getRealToken() { return getenv('SLACK_TEST_TOKEN'); } /** ...
Fix - was flipping display twice Gah. Here is a speedup for pygame -- don't flip the display twice.
"""enchanting2.py This is the main entry point of the system""" import sys import xml.etree.cElementTree as ElementTree import actor import media def main(argv): """This is a naive, blocking, co-operatively multitasking approach""" filename = argv[1] # xml file to open tree = ElementTree.parse(filename) proje...
"""enchanting2.py This is the main entry point of the system""" import sys import xml.etree.cElementTree as ElementTree import pygame import actor import media def main(argv): """This is a naive, blocking, co-operatively multitasking approach""" filename = argv[1] # xml file to open tree = ElementTree.parse(fi...
Make icon a class component
import React from 'react'; import PropTypes from 'prop-types'; import constants from './constants'; import cx from 'classnames'; class Icon extends React.Component { render() { const classes = { 'material-icons': true }; constants.PLACEMENTS.forEach(p => { classes[p] = this.props[p]; }); ...
import React from 'react'; import PropTypes from 'prop-types'; import constants from './constants'; import cx from 'classnames'; const Icon = props => { let classes = { 'material-icons': true }; constants.PLACEMENTS.forEach(p => { classes[p] = props[p]; }); constants.ICON_SIZES.forEach(s => { cl...
Update ptvsd version number for 2.0 beta 2.
#!/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 ...
Use phpcs as a library.
#!/usr/bin/env php <?php chdir(__DIR__); $returnStatus = null; passthru('composer install --dev', $returnStatus); if ($returnStatus !== 0) { exit(1); } require 'vendor/autoload.php'; $phpcsCLI = new PHP_CodeSniffer_CLI(); $phpcsArguments = array('standard' => array('PSR1'), 'files' => array('src', 'tests', 'buil...
#!/usr/bin/env php <?php chdir(__DIR__); $returnStatus = null; passthru('composer install --dev', $returnStatus); if ($returnStatus !== 0) { exit(1); } require 'vendor/autoload.php'; passthru('./vendor/bin/phpcs --standard=PSR1 -n src tests *.php', $returnStatus); if ($returnStatus !== 0) { exit(1); } $phpu...
Update trove classifiers and django test version requirements
#-*- coding: utf-8 -*- from setuptools import setup version = "1.0.post1" setup( name = "django-easy-pjax", version = version, description = "Easy PJAX for Django.", license = "BSD", author = "Filip Wasilewski", author_email = "en@ig.ma", url = "https://github.com/nigma/django-easy-pjax...
#-*- coding: utf-8 -*- from setuptools import setup version = "1.0.post1" setup( name = "django-easy-pjax", version = version, description = "Easy PJAX for Django.", license = "BSD", author = "Filip Wasilewski", author_email = "en@ig.ma", url = "https://github.com/nigma/django-easy-pjax...
Add global vars for refreshing
function parseMessages(messages, users, callback) { var allWords = {}; console.log('parseMessages.js - messages', messages); console.log('parseMessages.js (start) - users', users); for(var i = 0; i < messages.length; i++) { var author = users[messages[i].from.name]; var split = messages[i].message.spli...
function parseMessages(messages, users, callback) { var allWords = {}; console.log('parseMessages.js - messages', messages); console.log('parseMessages.js (start) - users', users); for(var i = 0; i < messages.length; i++) { var author = users[messages[i].from.name]; var split = messages[i].message.spli...
Fix buildXML() call for extension w/o update_url
"use strict"; var path = require('path'); /** * Initializes the crx autoupdate grunt helper * * @param {grunt} grunt * @returns {{buildXML: Function, build: Function}} */ exports.init = function(grunt){ /** * Generates an autoupdate XML file * * @todo relocate that to {@link lib/crx.js} as it's totall...
"use strict"; var path = require('path'); /** * Initializes the crx autoupdate grunt helper * * @param {grunt} grunt * @returns {{buildXML: Function, build: Function}} */ exports.init = function(grunt){ /** * Generates an autoupdate XML file * * @todo relocate that to {@link lib/crx.js} as it's totall...
Fix unit test for JDK 1.3. git-svn-id: fe6d842192ccfb78748eb71580d1ce65f168b559@701 9830eeb5-ddf4-0310-9ef7-f4b9a3e3227e
package com.thoughtworks.xstream.core; import com.thoughtworks.acceptance.AbstractAcceptanceTest; import com.thoughtworks.xstream.XStream; public class TreeMarshallerTest extends AbstractAcceptanceTest { static class Thing { Thing thing; } protected void setUp() throws Exception { super....
package com.thoughtworks.xstream.core; import com.thoughtworks.acceptance.AbstractAcceptanceTest; import com.thoughtworks.xstream.XStream; public class TreeMarshallerTest extends AbstractAcceptanceTest { class Thing { Thing thing; } protected void setUp() throws Exception { super.setUp()...
Update config to point at keff.dev
module.exports = { siteMetadata: { title: 'keff', }, plugins: [ 'gatsby-plugin-react-helmet', 'gatsby-plugin-sass', { resolve: 'gatsby-plugin-manifest', options: { name: 'keff.dev', short_name: 'keff.dev', start_url: '/', display: 'minimal-ui', }, ...
module.exports = { siteMetadata: { title: 'keff', }, plugins: [ 'gatsby-plugin-react-helmet', 'gatsby-plugin-sass', { resolve: 'gatsby-plugin-manifest', options: { name: 'keff.me', short_name: 'keff.me', start_url: '/', display: 'minimal-ui', }, ...
Change shebang to /usr/bin/env for better venv support
#!/usr/bin/env python3 """Setup.py for dirbrowser.""" 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__)) # Get the long description from the relevant file with open(path.join(here, 'README.rst'), encodin...
#!/usr/bin/python3 """Setup.py for dirbrowser.""" 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__)) # Get the long description from the relevant file with open(path.join(here, 'README.rst'), encoding='u...
Use SecurityActions to set the TCCL
/* * JBoss, Home of Professional Open Source. * Copyright 2012 Red Hat, Inc., and individual contributors * as indicated by the @author tags. * * 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 Licen...
/* * JBoss, Home of Professional Open Source. * Copyright 2012 Red Hat, Inc., and individual contributors * as indicated by the @author tags. * * 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 Licen...
Fix test case for SLEEP statement
package com.orientechnologies.orient.core.sql.executor; import com.orientechnologies.orient.core.db.document.ODatabaseDocument; import com.orientechnologies.orient.core.db.document.ODatabaseDocumentTx; import org.junit.AfterClass; import org.junit.Assert; import org.junit.BeforeClass; import org.junit.Test; import st...
package com.orientechnologies.orient.core.sql.executor; import com.orientechnologies.orient.core.db.document.ODatabaseDocument; import com.orientechnologies.orient.core.db.document.ODatabaseDocumentTx; import org.junit.AfterClass; import org.junit.Assert; import org.junit.BeforeClass; import org.junit.Test; import st...
Add a TDD funct to test the solution (only kings)
# -*- coding: utf-8 -*- from app.chess.chess import Chess import unittest class TestBuildChess(unittest.TestCase): """ `TestBuildChess()` class is unit-testing the class Chess(). """ # /////////////////////////////////////////////////// def setUp(self): params = [4, 4] piece...
# -*- coding: utf-8 -*- from app.chess.chess import Chess import unittest class TestBuildChess(unittest.TestCase): """ `TestBuildChess()` class is unit-testing the class Chess(). """ # /////////////////////////////////////////////////// def setUp(self): params = [4, 4] piece...
Remove text coloring in AlertFeed if it seems like scheduled text
import asyncio import json import aiohttp import SLA_bot.config as cf class AlertFeed: source_url = 'http://pso2emq.flyergo.eu/api/v2/' async def download(url): try: async with aiohttp.get(url) as response: return await response.json() except json.decoder.JSONDeco...
import asyncio import json import aiohttp import SLA_bot.config as cf class AlertFeed: source_url = 'http://pso2emq.flyergo.eu/api/v2/' async def download(url): try: async with aiohttp.get(url) as response: return await response.json() except json.decoder.JSONDeco...
Set default isConfidential to false for client entity
<?php /** * @author Alex Bilbie <hello@alexbilbie.com> * @copyright Copyright (c) Alex Bilbie * @license http://mit-license.org/ * * @link https://github.com/thephpleague/oauth2-server */ namespace League\OAuth2\Server\Entities\Traits; trait ClientTrait { /** * @var string */ ...
<?php /** * @author Alex Bilbie <hello@alexbilbie.com> * @copyright Copyright (c) Alex Bilbie * @license http://mit-license.org/ * * @link https://github.com/thephpleague/oauth2-server */ namespace League\OAuth2\Server\Entities\Traits; trait ClientTrait { /** * @var string */ ...
Use Requests to encode stop as query param, verify API status code.
#!/usr/bin/env python import os, requests, getSchedule from flask import Flask, request, jsonify, render_template, abort app = Flask(__name__) @app.route('/') def root(): return render_template('index.html') @app.route('/m') def mobileView(): stop = request.args.get('stop', 1, type=int) payload = {'stop': stop} ...
#!/usr/bin/env python import os, requests, getSchedule from flask import Flask, request, jsonify, render_template, abort app = Flask(__name__) @app.route('/') def root(): return render_template('index.html') @app.route('/m') def mobileView(): stop = request.args.get('stop', 1, type=int) route = requests.get('htt...
fix: Fix useless parameter in Hash handling test data provider
<?php namespace Monolol\Lolifiers; use Monolog\Logger; class HashTest extends \PHPUnit_Framework_TestCase { /** * @dataProvider testHandlingProvider */ public function testHandling($level) { $record = array('level' => $level); $lolifier = new Hash(); $this->assertTrue(...
<?php namespace Monolol\Lolifiers; use Monolog\Logger; class HashTest extends \PHPUnit_Framework_TestCase { /** * @dataProvider testHandlingProvider */ public function testHandling($level, $expected) { $record = array('level' => $level); $lolifier = new Hash(); $this->...
Update version number to 0.1.3.
# # 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 # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writin...
# # 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 # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writin...
Fix for failing demo setup
/* 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 * distribu...
/* 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 * distribu...
Add cafile support to the go-nethttp stub
package main import ( "crypto/tls" "crypto/x509" "fmt" "io/ioutil" "net/http" "os" "strings" ) func main() { if len(os.Args) < 3 || len(os.Args) > 4 { fmt.Printf("usage: %v <host> <port> [cafile]\n", os.Args[0]) os.Exit(1) } client := http.DefaultClient if len(os.Args) == 4 { cadata, err := ioutil.R...
package main import ( "fmt" "net/http" "os" "strings" ) func main() { if len(os.Args) == 4 { fmt.Println("UNSUPPORTED") os.Exit(0) } else if len(os.Args) != 3 { fmt.Printf("usage: %v <host> <port>\n", os.Args[0]) os.Exit(1) } url := "https://" + os.Args[1] + ":" + os.Args[2] // Perform an HTTP(S) R...
Allow Ref's in addition to basestrings
# Copyright (c) 2013, Mark Peek <mark@peek.org> # All rights reserved. # # See LICENSE file for full license. from . import AWSObject, AWSProperty, Ref from .validators import integer, positive_integer, boolean class MetricDimension(AWSProperty): props = { 'Name': (basestring, True), 'Value': (bas...
# Copyright (c) 2013, Mark Peek <mark@peek.org> # All rights reserved. # # See LICENSE file for full license. from . import AWSObject, AWSProperty from .validators import integer, positive_integer, boolean class MetricDimension(AWSProperty): props = { 'Name': (basestring, True), 'Value': (basestri...
Fix a build error reported by ReadTheDocs
import os import pathlib import sys import toml # Allow autodoc to import listparser. sys.path.append(os.path.abspath("../src")) # General configuration # --------------------- # Add any Sphinx extension module names here, as strings. They can be # extensions coming with Sphinx (named 'sphinx.ext.*') or your custo...
import os import pathlib import sys import toml # Allow autodoc to import listparser. sys.path.append(os.path.abspath("../src")) # General configuration # --------------------- # Add any Sphinx extension module names here, as strings. They can be # extensions coming with Sphinx (named 'sphinx.ext.*') or your custo...
Add Basic Auth in generateToken()
<?php /** * ownCloud - oauth2 * * This file is licensed under the Affero General Public License version 3 or * later. See the COPYING file. * * @author Jonathan Neugebauer * @copyright Jonathan Neugebauer 2016 */ namespace OCA\OAuth2\Controller; use OCP\AppFramework\Http; use OCP\AppFramework\Http\JSONRespons...
<?php /** * ownCloud - oauth2 * * This file is licensed under the Affero General Public License version 3 or * later. See the COPYING file. * * @author Jonathan Neugebauer * @copyright Jonathan Neugebauer 2016 */ namespace OCA\OAuth2\Controller; use OCP\AppFramework\Http; use OCP\AppFramework\Http\JSONRespons...
Make generated QR code larger
<?php namespace eien\Http\Controllers; use Illuminate\Http\Request; use ParagonIE\ConstantTime\Base32; use PragmaRX\Google2FA\Vendor\Laravel\Facade as Google2FA; class TFAController extends Controller { /** * @param Request $request * @return \Illuminate\View\View */ public function enable(Req...
<?php namespace eien\Http\Controllers; use Illuminate\Http\Request; use ParagonIE\ConstantTime\Base32; use PragmaRX\Google2FA\Vendor\Laravel\Facade as Google2FA; class TFAController extends Controller { /** * @param Request $request * @return \Illuminate\View\View */ public function enable(Req...
Replace testcontainers deprecated image constant with name
package org.synyx.urlaubsverwaltung; import org.springframework.test.annotation.DirtiesContext; import org.springframework.test.context.DynamicPropertyRegistry; import org.springframework.test.context.DynamicPropertySource; import org.testcontainers.containers.MariaDBContainer; import static org.testcontainers.contai...
package org.synyx.urlaubsverwaltung; import org.springframework.test.annotation.DirtiesContext; import org.springframework.test.context.DynamicPropertyRegistry; import org.springframework.test.context.DynamicPropertySource; import org.testcontainers.containers.MariaDBContainer; import static org.testcontainers.contai...
Return "unknown" for the empty string key
<?php namespace Ojs\ImportBundle\Helper; class FileHelper { public static $mimeToExtMap = [ '' => 'unknown', 'application/pdf' => 'pdf', 'image/jpeg' => 'jpg', 'image/png' => 'png', 'application/msword' => 'doc', 'application/zip' => 'zip', ...
<?php namespace Ojs\ImportBundle\Helper; class FileHelper { public static $mimeToExtMap = [ 'application/pdf' => 'pdf', 'image/jpeg' => 'jpg', 'image/png' => 'png', 'application/msword' => 'doc', 'application/zip' => 'zip', 'application/xml' ...
Make nodeModulesBabelLoader compatible with Babel 6
import { includePaths, excludePaths } from '../config/utils'; export default options => ({ test: /\.(mjs|jsx?)$/, use: [ { loader: 'babel-loader', options, }, ], include: includePaths, exclude: excludePaths, }); export const nodeModulesBabelLoader = { test: /\.js$/, include: /\/node_...
import { includePaths, excludePaths } from '../config/utils'; export default options => ({ test: /\.(mjs|jsx?)$/, use: [ { loader: 'babel-loader', options, }, ], include: includePaths, exclude: excludePaths, }); export const nodeModulesBabelLoader = { test: /\.js$/, include: /\/node_...
Add text to selection grid
from wagtail.core import blocks from wagtail.core.blocks import RichTextBlock from wagtail.core.fields import StreamField from wagtail.admin.edit_handlers import TabbedInterface, StreamFieldPanel, ObjectList from falmer.content import components from falmer.content.blocks import HeroImageBlock, FalmerImageChooserBlock...
from wagtail.core import blocks from wagtail.core.blocks import RichTextBlock from wagtail.core.fields import StreamField from wagtail.admin.edit_handlers import TabbedInterface, StreamFieldPanel, ObjectList from falmer.content.blocks import HeroImageBlock, FalmerImageChooserBlock from falmer.content.models.core impor...
Rename type into hook_type "type" itself if a built-in function. Using this name could be unsave.
#!/usr/bin/env python3 # Copyright (c) 2015 Ultimaker B.V. # Cura is released under the terms of the AGPLv3 or higher. import sys def exceptHook(hook_type, value, traceback): import cura.CrashHandler cura.CrashHandler.show(hook_type, value, traceback) sys.excepthook = exceptHook # Workaround for a race con...
#!/usr/bin/env python3 # Copyright (c) 2015 Ultimaker B.V. # Cura is released under the terms of the AGPLv3 or higher. import sys def exceptHook(type, value, traceback): import cura.CrashHandler cura.CrashHandler.show(type, value, traceback) sys.excepthook = exceptHook # Workaround for a race condition on ...
Use absolute / implicit relative imports for local deps Since Composer is Python 2.7 only for now, this sample can use implicit relative imports. Airflow doesn't seem to support explicit relative imports when I try to run the use_local_deps.py file in Composer. Aside: Airflow is using the imp.load_source method to lo...
# Copyright 2018 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, ...
# Copyright 2018 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, ...
Golint: Replace += 1 with ++
// Copyright © 2017 Makoto Ito // // 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...
// Copyright © 2017 Makoto Ito // // 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...
Add an option to show the location of where hidden links point to.
export const CLASSNAME = 'list-graph'; export const SCROLLBAR_WIDTH = 6; export const COLUMNS = 5; export const ROWS = 5; // An empty path is equal to inline SVG. export const ICON_PATH = ''; // -1 = desc, 1 = asc export const DEFAULT_SORT_ORDER = -1; export const DEFAULT_BAR_MODE = 'one'; export const HIGHLIGHT_A...
export const CLASSNAME = 'list-graph'; export const SCROLLBAR_WIDTH = 6; export const COLUMNS = 5; export const ROWS = 5; // An empty path is equal to inline SVG. export const ICON_PATH = ''; // -1 = desc, 1 = asc export const DEFAULT_SORT_ORDER = -1; export const DEFAULT_BAR_MODE = 'one'; export const HIGHLIGHT_A...
Clean up and fix warnings
'use strict'; var cheerio = require('cheerio'); var curl = require('../../curl'); function messageListener(db, from, channel, message, reply) { var match = /(https?:\/\/[^ ]+)/.exec(message); if (match) { curl(match[1], function (html) { var $ = cheerio.load(html); var lines = []; if ($('t...
'use strict'; var cheerio = require('cheerio'); var curl = require('../../curl'); function messageListener(db, from, channel, message, reply) { var match = /(https?:\/\/[^ ]+)/.exec(message); if (match) { curl(match[1], function (res) { var $ = cheerio.load(res); var lines = []; if ($('met...
Fix postgres table exists command
package peergos.server.sql; public class PostgresCommands implements SqlSupplier { @Override public String listTablesCommand() { return "SELECT tablename FROM pg_catalog.pg_tables " + "WHERE schemaname != 'pg_catalog' AND schemaname != 'information_schema';"; } @Override p...
package peergos.server.sql; public class PostgresCommands implements SqlSupplier { @Override public String listTablesCommand() { return "SELECT tablename FROM pg_catalog.pg_tables " + "WHERE schemaname != 'pg_catalog' AND schemaname != 'information_schema';"; } @Override p...
Make command argument validation clear.
const commands = { 'join': ['channel'], 'part': ['channel', '?message'], 'ctcp': ['target', 'type', 'text'], 'action': ['target', 'message'], 'whois': ['nick'], 'list': [], }; export const CommandParser = { validateArgs(info, args) { return info.length === args.length || info.filter(s => s...
const commands = { 'join': ['channel'], 'part': ['channel', 'message?'], 'ctcp': ['target', 'type', 'text'], 'action': ['target', 'message'], 'whois': ['nick'], 'list': [], }; export const CommandParser = { validateArgs(info, args) { if (info.length !== args.length && info.filter(s => s[s.len...
Fix end of line format
#!/usr/bin/python # coding: utf-8 import sys import signal import logging import argparse from lib.DbConnector import DbConnector from lib.Acquisition import Acquisition from lib.SystemMonitor import SystemMonitor acq = Acquisition() sm = SystemMonitor() def signalHandler(signal, frame): logging.warning("Caught...
#!/usr/bin/python # coding: utf-8 import sys import signal import logging import argparse from lib.DbConnector import DbConnector from lib.Acquisition import Acquisition from lib.SystemMonitor import SystemMonitor acq = Acquisition() sm = SystemMonitor() def signalHandler(signal, frame): logging...
Make cards have h2s not h1s
import React, { PropTypes } from 'react'; import { Card } from '../UI'; import styles from './ImageCard.css'; export default class ImageCard extends React.Component { render() { const { onClick, onImageLoaded, image, text, description } = this.props; return ( <Card onClick={onClick} className={styles....
import React, { PropTypes } from 'react'; import { Card } from '../UI'; import styles from './ImageCard.css'; export default class ImageCard extends React.Component { render() { const { onClick, onImageLoaded, image, text, description } = this.props; return ( <Card onClick={onClick} className={styles....
Add flake8 to installation dependencies
import os from setuptools import find_packages from setuptools import setup import sys sys.path.insert(0, os.path.abspath('lib')) exec(open('lib/ansiblereview/version.py').read()) setup( name='ansible-review', version=__version__, description=('reviews ansible playbooks, roles and inventory and suggests...
import os from setuptools import find_packages from setuptools import setup import sys sys.path.insert(0, os.path.abspath('lib')) exec(open('lib/ansiblereview/version.py').read()) setup( name='ansible-review', version=__version__, description=('reviews ansible playbooks, roles and inventory and suggests...
Use match instead of non-existant head routing method
<?php namespace Vaffel\Tuski\Silex\Provider; use Symfony\Component\HttpFoundation\Response; use Symfony\Component\HttpFoundation\Request; use Silex\ControllerProviderInterface; use Silex\Application; class TusControllerProvider implements ControllerProviderInterface { public function setBaseRoute($baseRoute) ...
<?php namespace Vaffel\Tuski\Silex\Provider; use Symfony\Component\HttpFoundation\Response; use Symfony\Component\HttpFoundation\Request; use Silex\ControllerProviderInterface; use Silex\Application; class TusControllerProvider implements ControllerProviderInterface { public function setBaseRoute($baseRoute) ...
Update default testing SMTP settings in project template
""" Settings for local development. These settings are not fast or efficient, but allow local servers to be run using the django-admin.py utility. This file should be excluded from version control to keep the settings local. """ import os import os.path from .base import * # Run in debug mode. DEBUG = True TEMP...
""" Settings for local development. These settings are not fast or efficient, but allow local servers to be run using the django-admin.py utility. This file should be excluded from version control to keep the settings local. """ import os import os.path from .base import * # Run in debug mode. DEBUG = True TEMP...
Add missing trick to appear in the classmap This should have been part of 9a3d73acfcac1104c33cda810eedfedea2a7b7ba
<?php /* * This file is part of the Sonata Project package. * * (c) Thomas Rabaix <thomas.rabaix@sonata-project.org> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Sonata\CoreBundle\Model; if (interface_exists(\Sonata...
<?php /* * This file is part of the Sonata Project package. * * (c) Thomas Rabaix <thomas.rabaix@sonata-project.org> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Sonata\CoreBundle\Model; if (interface_exists(\Sonata...
Fix bug where progress bar can be wider than the screen
<?php namespace Concise\Console\ResultPrinter\Utilities; use Concise\Core\ArgumentChecker; class ProportionalProgressBar extends ProgressBar { /** * @param integer $size * @param integer $total * @param array $parts * @return string */ public function renderProportional($size, $tot...
<?php namespace Concise\Console\ResultPrinter\Utilities; use Concise\Core\ArgumentChecker; class ProportionalProgressBar extends ProgressBar { /** * @param integer $size * @param integer $total * @param array $parts * @return string */ public function renderProportional($size, $tot...
Add const and var rules to lit config
module.exports = { "extends": "./index.js", "parser": "babel-eslint", "env": { "browser": true }, "plugins": [ "lit", "html" ], "globals": { "D2L": false, "Promise": false }, "rules": { "no-var": 2, "prefer-const": 2, "strict": [2, "never"], "lit/no-duplicate-template-b...
module.exports = { "extends": "./index.js", "parser": "babel-eslint", "env": { "browser": true }, "plugins": [ "lit", "html" ], "globals": { "D2L": false, "Promise": false }, "rules": { "strict": [2, "never"], "lit/no-duplicate-template-bindings": 2, "lit/no-legacy-template...