text
stringlengths
16
4.96k
positive
stringlengths
321
2.24k
negative
stringlengths
310
2.21k
Remove unused var to flags test.
package flags_test import ( "github.com/cloudfoundry/bosh-bootloader/flags" . "github.com/onsi/ginkgo" . "github.com/onsi/gomega" ) var _ = Describe("Flags", func() { var ( f flags.Flags stringVal string ) BeforeEach(func() { f = flags.New("test") f.String(&stringVal, "string", "") }) Descr...
package flags_test import ( "github.com/cloudfoundry/bosh-bootloader/flags" . "github.com/onsi/ginkgo" . "github.com/onsi/gomega" ) var _ = Describe("Flags", func() { var ( f flags.Flags // boolVal bool stringVal string ) BeforeEach(func() { f = flags.New("test") f.String(&stringVal, "string", "")...
Check if callback before invoking it
// // Copyright (c) Microsoft and contributors. 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 requi...
// // Copyright (c) Microsoft and contributors. 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 requi...
Add a wait to get authorize response before initial trade page
import { configure } from 'mobx'; import React from 'react'; import { render } from 'react-dom'; import Client from '_common/base/client_base'; import BinarySocket from '_common/base/socket_base'; import NetworkMonitor from 'Services/network_monitor'; import R...
import { configure } from 'mobx'; import React from 'react'; import { render } from 'react-dom'; import Client from '_common/base/client_base'; import NetworkMonitor from 'Services/network_monitor'; import RootStore from 'Stores'; import { setStorageEvents ...
Add value fallback to empty string
import React, { Component } from 'react'; import PropTypes from 'prop-types'; // Prevents the defaultValue/defaultChecked fields from rendering with value/checked class ComponentWrapper extends Component { render() { /* eslint-disable no-unused-vars */ const { defaultValue, defaultChecked, ...
import React, { Component } from 'react'; import PropTypes from 'prop-types'; // Prevents the defaultValue/defaultChecked fields from rendering with value/checked class ComponentWrapper extends Component { render() { /* eslint-disable no-unused-vars */ const { defaultValue, defaultChecked, ...
Add more variables and bug fixes
__author__ = 'mcsquaredjr' import os import socket node_file = os.environ["NODES"] cad_file = os.environ["CAD"] procs_per_nod = os.environ["PROCS_PER_NODE"] itemcount = os.environ["ITEMCOUNT"] ddp = os.environment["DDP"] def my_lines(): ip = socket.gethostbyname(socket.gethostname()) with open(cad_file, "r...
__author__ = 'mcsquaredjr' import os import socket node_file = os.environ["NODES"] cad_file = os.environ["CAD"] procs_per_nod = os.environ["PROCS_PER_NODE"] itemcount = os.environ["ITEMCOUNT"] ddp = os.environment["DDP"] def my_lines(i): ip = socket.gethostbyname(socket.gethostname()) with open(cad_file, "...
Remove broken logic from controller.
'use strict'; angular.module('fivefifteenApp') .controller('MainCtrl', function ($scope, $routeParams, Data, Steps) { // Simple Data service to persist form values. $scope.data = Data; $scope.steps = Steps.data; if (angular.isDefined($routeParams.stepName)) { $scope.path = $routeParams.stepN...
'use strict'; angular.module('fivefifteenApp') .controller('MainCtrl', function ($scope, $routeParams, Data, Steps) { // Simple Data service to persist form values. $scope.data = Data; if (angular.isDefined($routeParams.stepName)) { $scope.path = $routeParams.stepName; $scope.step = Steps.r...
[Utils] Allow colons in filenames for now
# coding=utf-8 import string from numbers import Number __author__ = 'Gareth Coles' FILENAME_SAFE_CHARS = ( "/\\-_.()#:" + string.digits + string.letters + string.whitespace ) class EmptyStringFormatter(string.Formatter): """ EmptyStringFormatter - The same as the normal string formatter, ex...
# coding=utf-8 import string from numbers import Number __author__ = 'Gareth Coles' FILENAME_SAFE_CHARS = ( "/\\-_.()#" + string.digits + string.letters + string.whitespace ) class EmptyStringFormatter(string.Formatter): """ EmptyStringFormatter - The same as the normal string formatter, exc...
Update findDomNode to react 0.14 style
var React = require('react') var cx = require('./cx') var Toggle = React.createClass({ componentDidMount() { // ensure ratchet toggles initialised require('../vendor/toggles') React.findDOMNode(this.refs.toggle).addEventListener('toggle', this.handleToggle) }, componentWillUnmount() { React.findD...
var React = require('react') var cx = require('./cx') var Toggle = React.createClass({ componentDidMount() { // ensure ratchet toggles initialised require('../vendor/toggles') this.refs.toggle.getDOMNode().addEventListener('toggle', this.handleToggle) }, componentWillUnmount() { this.refs.toggle....
Add name to api-token-auth url endpoint.
from django.conf.urls import patterns, include, url from services.api import all_views as services_views from services.api import AccessibilityRuleView from observations.api import views as observations_views from rest_framework import routers from observations.views import obtain_auth_token from munigeo.api import all...
from django.conf.urls import patterns, include, url from services.api import all_views as services_views from services.api import AccessibilityRuleView from observations.api import views as observations_views from rest_framework import routers from observations.views import obtain_auth_token from munigeo.api import all...
Remove "cast" from Promise test Promise.resolve now behaves as Promise.cast
/*! { "name": "ES6 Promises", "property": "promises", "caniuse": "promises", "polyfills": ["es6promises"], "authors": ["Krister Kari", "Jake Archibald"], "tags": ["es6"], "notes": [{ "name": "The ES6 promises spec", "href": "https://github.com/domenic/promises-unwrapping" },{ "name": "Chromi...
/*! { "name": "ES6 Promises", "property": "promises", "caniuse": "promises", "polyfills": ["es6promises"], "authors": ["Krister Kari", "Jake Archibald"], "tags": ["es6"], "notes": [{ "name": "The ES6 promises spec", "href": "https://github.com/domenic/promises-unwrapping" },{ "name": "Chromi...
Add minor spaces to docblock Signed-off-by: crynobone <e1a543840a942eb68427510a8a483282a7bfeddf@gmail.com>
<?php /* |-------------------------------------------------------------------------- | Orchestra Library |-------------------------------------------------------------------------- | | Map Orchestra Library using PSR-0 standard namespace. | */ Autoloader::namespaces(array( 'Orchestra\Model' => Bundle::path('orchest...
<?php /* |-------------------------------------------------------------------------- | Orchestra Library |-------------------------------------------------------------------------- | | Map Orchestra Library using PSR-0 standard namespace. */ Autoloader::namespaces(array( 'Orchestra\Model' => Bundle::path('orchestra...
Add icon to represent successful and failed requests
package main import ( "flag" "fmt" ) func main() { tester, err := NewTTFB() if err != nil { fmt.Println(err) return } flag.Parse() results, err := tester.Report(flag.Arg(0)) if err != nil { fmt.Println(err) return } var icon string fmt.Printf("@ Testing domain '%s'\n", tester.domain) fmt.Pri...
package main import ( "flag" "fmt" ) func main() { tester, err := NewTTFB() if err != nil { fmt.Println(err) return } flag.Parse() results, err := tester.Report(flag.Arg(0)) if err != nil { fmt.Println(err) return } fmt.Printf("@ Testing domain '%s'\n", tester.domain) fmt.Printf(" Status: Con...
Fix matching users against R: extbans
from twisted.plugin import IPlugin from txircd.module_interface import IModuleData, ModuleData from txircd.utils import ircLower from zope.interface import implements from fnmatch import fnmatchcase class AccountExtban(ModuleData): implements(IPlugin, IModuleData) name = "AccountExtban" def actions(self): ret...
from twisted.plugin import IPlugin from txircd.module_interface import IModuleData, ModuleData from txircd.utils import ircLower from zope.interface import implements from fnmatch import fnmatchcase class AccountExtban(ModuleData): implements(IPlugin, IModuleData) name = "AccountExtban" def actions(self): ret...
Support static references of getVetoLayer
package infn.bed.util; import infn.bed.geometry.GeometricConstants; /** * Returns the layer of a veto. * * @author Angelo Licastro */ public class GetVetoLayer { /** * Returns the layer of a veto. * * @param veto The number of a veto in one-based indexing. * @return The layer of the veto. * If the ...
package infn.bed.util; import infn.bed.geometry.GeometricConstants; /** * Returns the layer of a veto. * * @author Angelo Licastro */ public class GetVetoLayer { /** * Returns the layer of a veto. * * @param veto The number of a veto in one-based indexing. * @return The layer of the veto. * If the ...
Move pages to root URL Fixes #1
#!/usr/bin/env python # -*- coding: utf-8 -*- # AUTHOR = 'Glowstone Organization' SITENAME = 'Glowstone' SITEURL = '' PATH = 'content' PAGE_PATHS = [''] PAGE_URL = '{slug}/' PAGE_SAVE_AS = '{slug}/index.html' TIMEZONE = 'UTC' DEFAULT_LANG = 'en' # Feed generation is usually not desired when developing FEED_ALL_AT...
#!/usr/bin/env python # -*- coding: utf-8 -*- # AUTHOR = 'Glowstone Organization' SITENAME = 'Glowstone' SITEURL = '' PATH = 'content' TIMEZONE = 'UTC' DEFAULT_LANG = 'en' # Feed generation is usually not desired when developing FEED_ALL_ATOM = None CATEGORY_FEED_ATOM = None TRANSLATION_FEED_ATOM = None AUTHOR_FEE...
Support `page` parameter in stream API.
package tw.wancw.curator.api; import com.loopj.android.http.AsyncHttpClient; import com.loopj.android.http.RequestParams; public class CuratorApi { private static final String API_END_POINT = "http://curator.im/api/"; private static final AsyncHttpClient client = new AsyncHttpClient(); private final St...
package tw.wancw.curator.api; import com.loopj.android.http.AsyncHttpClient; import com.loopj.android.http.RequestParams; public class CuratorApi { private static final String API_END_POINT = "http://curator.im/api/"; private static final AsyncHttpClient client = new AsyncHttpClient(); private final St...
Update test suite to ensure spinner and spinner options are rendered as expected
/** @jsx React.DOM */ var React = require('react'); var Loader = require('../../lib/react-loader'); var expect = require('chai').expect; describe('Loader', function () { var testCases = [{ description: 'loading is in progress', options: { loaded: false }, expectedOutput: /<div class="loader".*<div class...
/** @jsx React.DOM */ var React = require('react'); var Loader = require('../../lib/react-loader'); var expect = require('chai').expect; var loader; describe('Loader', function () { describe('before loaded', function () { beforeEach(function () { loader = <Loader loaded={false}>Welcome</Loader>; Re...
Add packages for ecoapi e xapi
#!/usr/bin/env python """ Setup to allow pip installs of pok-eco module """ from setuptools import setup setup( name='pok-eco', version='0.1.0', description='POK-ECO Integrations ', author='METID - Politecnico di Milano', url='http://www.metid.polimi.it', license='AGPL', classifiers=[ ...
#!/usr/bin/env python """ Setup to allow pip installs of pok-eco module """ from setuptools import setup setup( name='pok-eco', version='0.1.0', description='POK-ECO Integrations ', author='METID - Politecnico di Milano', url='http://www.metid.polimi.it', license='AGPL', classifiers=[ ...
Remove unsued code until configuration is defined
<?php /* * This file is part of the WobbleCodeRestBundle package. * * (c) WobbleCode <http://www.wobblecode.com/> * * For the full copyright and license information, please view the LICENSE file * that was distributed with this source code. */ namespace WobbleCode\RestBundle\DependencyInjection; use Symfony\C...
<?php /* * This file is part of the WobbleCodeRestBundle package. * * (c) WobbleCode <http://www.wobblecode.com/> * * For the full copyright and license information, please view the LICENSE file * that was distributed with this source code. */ namespace WobbleCode\RestBundle\DependencyInjection; use Symfony\C...
Comment out dotenv for heroku deployment
'use strict'; var express = require('express'); var routes = require('./app/routes/index.js'); var mongoose = require('mongoose'); var passport = require('passport'); var session = require('express-session'); var bodyParser = require('body-parser') var app = express(); // require('dotenv').load(); require('./app/conf...
'use strict'; var express = require('express'); var routes = require('./app/routes/index.js'); var mongoose = require('mongoose'); var passport = require('passport'); var session = require('express-session'); var bodyParser = require('body-parser') var app = express(); require('dotenv').load(); require('./app/config/...
Add OCA as author of OCA addons In order to get visibility on https://www.odoo.com/apps the OCA board has decided to add the OCA as author of all the addons maintained as part of the association.
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # This module copyright (C) 2012-2013 Therp BV (<http://therp.nl>). # # This program is free software: you can redistribute it and/or modify # it under the term...
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # This module copyright (C) 2012-2013 Therp BV (<http://therp.nl>). # # This program is free software: you can redistribute it and/or modify # it under the term...
Fix stupid mistake in reexports.
export { setResolver, getResolver } from './resolver'; export { setApplication } from './application'; export { default as setupContext, getContext, setContext, unsetContext, pauseTest, resumeTest, } from './setup-context'; export { default as teardownContext } from './teardown-context'; export { default as...
export { setResolver, getResolver } from './resolver'; export { setApplication } from './application'; export { default as setupContext, getContext, setContext, unsetContext, pauseTest, resumeTest, } from './setup-context'; export { default as teardownContext } from './teardown-context'; export { default as...
Remove commented code in wifflechat js
if (Meteor.isClient) { Accounts.ui.config({ passwordSignupFields: 'USERNAME_ONLY' }); Template.messages.helpers({ messages: function() { return Messages.find({}, { sort: { time: 1}}); } }); var scrollPosition = function() { $('#messages').scrollTop($('#messages')[0].scrollHei...
if (Meteor.isClient) { Accounts.ui.config({ passwordSignupFields: 'USERNAME_ONLY' }); Template.messages.helpers({ messages: function() { return Messages.find({}, { sort: { time: 1}}); } }); var scrollPosition = function() { $('#messages').scrollTop($('#messages')[0].scrollHei...
Add index on userid to transaction database
var seq = require('seq'); var args = require('yargs').argv; var Factory = require('./lib/database/Factory'); var config = require('./lib/configuration'); var fileName = args.filename || null; var dbOptions = config.database; if (fileName) { dbOptions.options.filename = fileName; } Factory.create(dbOptions, func...
var seq = require('seq'); var args = require('yargs').argv; var Factory = require('./lib/database/Factory'); var config = require('./lib/configuration'); var fileName = args.filename || null; var dbOptions = config.database; if (fileName) { dbOptions.options.filename = fileName; } Factory.create(dbOptions, func...
Fix example test env reference
'use strict'; // workflows/createDeployment var Joi = require('joi'); module.exports = { schema: Joi.object({ deployerId: Joi.string().required(), name: Joi.string().min(1).required(), }).required().unknown(true), version: '1.0', decider: function(args) { return { createDeploymentDo...
'use strict'; // workflows/createDeployment var Joi = require('joi'); module.exports = { schema: Joi.object({ deployerId: Joi.string().required(), name: Joi.string().min(1).required(), }).required().unknown(true), version: '1.0', decider: function(args) { return { createDeploymentDo...
Check for entities ahead before moving forward.
package de.craften.plugins.educraft.luaapi.functions; import de.craften.plugins.educraft.luaapi.EduCraftApiFunction; import org.bukkit.Location; import org.bukkit.block.BlockFace; import org.bukkit.entity.Entity; import org.luaj.vm2.LuaValue; import org.luaj.vm2.Varargs; import java.util.Collection; /** * Lua API f...
package de.craften.plugins.educraft.luaapi.functions; import de.craften.plugins.educraft.luaapi.EduCraftApiFunction; import org.bukkit.Location; import org.bukkit.block.BlockFace; import org.luaj.vm2.LuaValue; import org.luaj.vm2.Varargs; /** * Lua API function to move one block forward. */ public class MoveForward...
Revert "Implement send message functionality"
from lib.config import Config from slackclient import SlackClient class Tubey(): def __init__(self, **kwargs): # cache the client in memory self._client = None def send_message(self, message): raise NotImplemented def get_client(self): ### Fetch a cached slack client or c...
from lib.config import Config from slackclient import SlackClient class Tubey(): def __init__(self, **kwargs): ### Cache the client in memory ### self._client = None def get_client(self): ### Fetch a cached slack client or create one and return it ### if self._client is not No...
Update service provider to reflect changes in Laravel.
<?php namespace Krucas\Notification; use Illuminate\Support\ServiceProvider; class NotificationServiceProvider extends ServiceProvider { /** * Indicates if loading of the provider is deferred. * * @var bool */ protected $defer = false; /** * Bootstrap the application events. * * @re...
<?php namespace Krucas\Notification; use Illuminate\Support\ServiceProvider; class NotificationServiceProvider extends ServiceProvider { /** * Indicates if loading of the provider is deferred. * * @var bool */ protected $defer = false; /** * Bootstrap the application events. * * @re...
Add exit step and alter log
var Cylon = require('cylon'); var color = require('onecolor'); var config = require('./config.js'); if(config.uuid === "insert uuid here"){ console.log('please identify the bluetooth uuid of your sphero, see the readme!'); return; } var log = function(){ if(config.debugger){ console.log(arguments); } } C...
var Cylon = require('cylon'); var color = require('onecolor'); var config = require('./config.js'); if(config.uuid === "insert uuid here"){ console.log('please identify the bluetooth uuid of your sphero, see the readme!'); return; } var log = function(){ if(config.debugger){ console.log(arguments[0],argumen...
Add binding name to route list command
<?php namespace Honeybee\FrameworkBinding\Silex\Console\Command\Route; use Honeybee\FrameworkBinding\Silex\Console\Command\Command; use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Output\OutputInterface; class ListRoutes extends Command { protected function configure() { ...
<?php namespace Honeybee\FrameworkBinding\Silex\Console\Command\Route; use Honeybee\FrameworkBinding\Silex\Console\Command\Command; use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Output\OutputInterface; class ListRoutes extends Command { protected function configure() { ...
Change the MainHandler to Schedule_Handler and changed the “/“ to “/schedule”
# Import blockmodels file import BlockModels import webapp2, jinja2, os from datetime import * jinja_environment = jinja2.Environment(autoescape=True, loader=jinja2.FileSystemLoader(os.path.join(os.path.dirname(__file__), 'templates'))) class CST(tzinfo): def utcoffset(self, dt): return timedelta(hour...
# Import blockmodels file import BlockModels import webapp2, jinja2, os from datetime import * jinja_environment = jinja2.Environment(autoescape=True, loader=jinja2.FileSystemLoader(os.path.join(os.path.dirname(__file__), 'templates'))) class CST(tzinfo): def utcoffset(self, dt): return timedelta(hour...
Remove unnecessary push calls to improve readability
const isAuthorized = function () { let isLoggedIn, characterID, isAdmin, isWhitelisted; isLoggedIn = this.userId; if (isLoggedIn) { characterID = Meteor.users.findOne(this.userId).profile.eveOnlineCharacterId isAdmin = characterID == Meteor.settings.public.adminID; isWhitelisted = Whitelist.findOne({...
const isAuthorized = function () { let isLoggedIn, characterID, isAdmin, isWhitelisted; isLoggedIn = this.userId; if (isLoggedIn) { characterID = Meteor.users.findOne(this.userId).profile.eveOnlineCharacterId isAdmin = characterID == Meteor.settings.public.adminID; isWhitelisted = Whitelist.findOne({...
Update connected_to index from number to string to match the input numbering.
<?php namespace OnlyBits\Outputs; use OnlyBits\Connectors\WireAbstract; class BinaryLight extends OutputAbstract { /** * Constructor. */ public function __construct() { parent::__construct(1, false); $this->state = false; } /** * {@inheritdoc} */ public f...
<?php namespace OnlyBits\Outputs; use OnlyBits\Connectors\WireAbstract; class BinaryLight extends OutputAbstract { /** * Constructor. */ public function __construct() { parent::__construct(1, false); $this->state = false; } /** * {@inheritdoc} */ public f...
Rename and reorder CreateIndexes tests
<?php namespace MongoDB\Tests\Operation; use MongoDB\Operation\CreateIndexes; class CreateIndexesTest extends TestCase { /** * @expectedException MongoDB\Exception\InvalidArgumentException * @expectedExceptionMessage $indexes is not a list (unexpected index: "1") */ public function testConstru...
<?php namespace MongoDB\Tests\Operation; use MongoDB\Operation\CreateIndexes; class CreateIndexesTest extends TestCase { /** * @expectedException MongoDB\Exception\InvalidArgumentException * @expectedExceptionMessage $indexes is empty */ public function testCreateIndexesRequiresAtLeastOneIndex...
Increase the pagination amount for blog app
""" Blog App This module provides generic django URL routing. """ from django.conf.urls import patterns, url from tunobase.blog import views urlpatterns = patterns('', url(r'^list/$', views.BlogList.as_view( template_name='blog/blog_list.html' ), name='blog_list' ), ...
""" Blog App This module provides generic django URL routing. """ from django.conf.urls import patterns, url from tunobase.blog import views urlpatterns = patterns('', url(r'^list/$', views.BlogList.as_view( template_name='blog/blog_list.html' ), name='blog_list' ), ...
Remove language from HTML tag
<!doctype html> <html> <head> <meta charset="utf-8"> <title>Speedtests</title> <meta name="viewport" content="width=device-width, initial-scale=1"> <meta name="mobile-web-app-capable" content="yes"> <meta name="apple-mobile-web-app-capable" content="yes"> <link rel="icon" href="speedometer_trans...
<!doctype html> <html lang="en"> <head> <meta charset="utf-8"> <title>Speedtests</title> <meta name="viewport" content="width=device-width, initial-scale=1"> <meta name="mobile-web-app-capable" content="yes"> <meta name="apple-mobile-web-app-capable" content="yes"> <link rel="icon" href="speedom...
Move ecdsa from extras_require to install_requires
#from distribute_setup import use_setuptools #use_setuptools() from setuptools import setup, find_packages from os.path import dirname, join here = dirname(__file__) setup( name='btchip-python', version='0.1.28', author='BTChip', author_email='hello@ledger.fr', description='Python library to commu...
#from distribute_setup import use_setuptools #use_setuptools() from setuptools import setup, find_packages from os.path import dirname, join here = dirname(__file__) setup( name='btchip-python', version='0.1.28', author='BTChip', author_email='hello@ledger.fr', description='Python library to commu...
Allow setting hide text related css classes on wrapper So far the css classes `hide_content_with_text` and `no_hidden_text_indicator` had to be present on the page's `section` element. Allowing them also on the `.content_and_background` wrapper element makes things much easer to control for page types since that eleme...
(function($) { $.widget('pageflow.hiddenTextIndicator', { _create: function() { var parent = this.options.parent, that = this; parent.on('pageactivate', function(event) { var pageOrPageWrapper = $(event.target).add('.content_and_background', event.target); that.element.togg...
(function($) { $.widget('pageflow.hiddenTextIndicator', { _create: function() { var parent = this.options.parent, that = this; parent.on('pageactivate', function(event) { that.element.toggleClass('invert', $(event.target).hasClass('invert')); that.element.toggleClass('hidden...
Fix login error: password check
var response = require('response'); var JSONStream = require('JSONStream'); var formBody = require('body/form'); var redirect = require('../lib/redirect'); exports.install = function (server, prefix) { var prefix = prefix || '/sessions'; /* * Create a session */ server.route(prefix, function (req, res) { ...
var response = require('response'); var JSONStream = require('JSONStream'); var formBody = require('body/form'); var redirect = require('../lib/redirect'); exports.install = function (server, prefix) { var prefix = prefix || '/sessions'; /* * Create a session */ server.route(prefix, function (req, res) { ...
Update to beautify HTML output from Jade
// set up ====================================================================== // get all the tools we need var express = require('express'); var app = express(); var port = process.env.PORT || 8080; var mongoose = require('mongoose'); var passport = require('passport'); var flash = require('connect-flas...
// set up ====================================================================== // get all the tools we need var express = require('express'); var app = express(); var port = process.env.PORT || 8080; var mongoose = require('mongoose'); var passport = require('passport'); var flash = require('connect-flas...
Include the new PaymentCondition class in the classinclude file
<?php /************************************************************************************************* * Copyright 2015 MajorLabel -- This file is a part of MajorLabel coreBOS Customizations. * Licensed under the vtiger CRM Public License Version 1.1 (the "License"); you may not use this * file except in complianc...
<?php /************************************************************************************************* * Copyright 2015 MajorLabel -- This file is a part of MajorLabel coreBOS Customizations. * Licensed under the vtiger CRM Public License Version 1.1 (the "License"); you may not use this * file except in complianc...
Change unicode test string to ascii
from django.test import TestCase from django.conf import settings from phonenumber_field.modelfields import PhoneNumberField from whats_fresh.models import * from django.contrib.gis.db import models import os import time import sys import datetime class PreparationsTestCase(TestCase): def setUp(self): s...
from django.test import TestCase from django.conf import settings from phonenumber_field.modelfields import PhoneNumberField from whats_fresh.models import * from django.contrib.gis.db import models import os import time import sys import datetime class PreparationsTestCase(TestCase): def setUp(self): s...
Check for valid currencies in a file
import urllib.parse from bs4 import BeautifulSoup import re import syscmd def currency( self ): amount = 1 frm = "eur" to = "usd" if len(self.msg) < 7: self.send_chan("Usage: !currency <amount> <from> <to>") if len(self.msg) == 7: try: amount = float(self.msg[4]) except ValueError: pass frm = se...
import urllib.parse from bs4 import BeautifulSoup import re import syscmd def currency( self ): amount = 1 frm = "eur" to = "usd" if len(self.msg) < 7: self.send_chan("Usage: !currency <amount> <from> <to>") else: try: amount = float(self.msg[4]) except ValueError: pass frm = self.msg[5] to = ...
Update tags for Cache config option Updated tags for config options consistency [1]. [1] https://wiki.openstack.org/wiki/ConfigOptionsConsistency Change-Id: I3f82d2b4d60028221bc861bfe0fe5dff6efd971f Implements: Blueprint centralize-config-options-newton
# Copyright 2010 United States Government as represented by the # Administrator of the National Aeronautics and Space Administration. # Copyright 2016 OpenStack Foundation # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance wi...
# needs:fix_opt_description # needs:check_deprecation_status # needs:check_opt_group_and_type # needs:fix_opt_description_indentation # needs:fix_opt_registration_consistency # Copyright 2010 United States Government as represented by the # Administrator of the National Aeronautics and Space Administration. # Copyrig...
Add externs for Polymer template instance properties This symbols can collide when using the `shadyUpgradeFragment` optimization.
/** * @fileoverview Externs for closure compiler * @externs */ /** * Block renaming of properties added to Node to * prevent conflicts with other closure-compiler code. * @type {Object} */ EventTarget.prototype.__handlers; /** @type {Object} */ Node.prototype.__shady; /** @interface */ function IWrapper() {} ...
/** * @fileoverview Externs for closure compiler * @externs */ /** * Block renaming of properties added to Node to * prevent conflicts with other closure-compiler code. * @type {Object} */ EventTarget.prototype.__handlers; /** @type {Object} */ Node.prototype.__shady; /** @interface */ function IWrapper() {} ...
Remove prop-types and create-react-class as externals.
import resolve from 'rollup-plugin-node-resolve'; import commonjs from 'rollup-plugin-commonjs'; import babel from 'rollup-plugin-babel'; export default { entry: 'src/index.js', plugins: [ commonjs(), resolve({ customResolveOptions: { moduleDirectory: 'node_modules',...
import resolve from 'rollup-plugin-node-resolve'; import commonjs from 'rollup-plugin-commonjs'; import babel from 'rollup-plugin-babel'; export default { entry: 'src/index.js', plugins: [ commonjs(), resolve({ customResolveOptions: { moduleDirectory: 'node_modules',...
Update Cloud Files mock to match.
// Mock pkgcloud functionality. var util = require("util"), stream = require("stream"), Writable = stream.Writable, Readable = stream.Readable; util.inherits(Sink, Writable); function Sink(options) { Writable.call(this, options); var self = this; this._write = function (chunk, enc, next) { next();...
// Mock pkgcloud functionality. var util = require("util"), stream = require("stream"), Writable = stream.Writable, Readable = stream.Readable; util.inherits(Sink, Writable); function Sink(options) { Writable.call(this, options); var self = this; this._write = function (chunk, enc, next) { next();...
Fix issue with ‘respect user's privacy’ code! It’s Js and not PHP, stupid!
<?php /////////////////////////////////////////////////////// // ---------------------------------------------------------- // SNIPPET // ---------------------------------------------------------- // Google analytics.js // ---------------------------------------------------------- // Enable and set analytics ID/API KEY...
<?php /////////////////////////////////////////////////////// // ---------------------------------------------------------- // SNIPPET // ---------------------------------------------------------- // Google analytics.js // ---------------------------------------------------------- // Enable and set analytics ID/API KEY...
Fix player stats not actually working Fixed what @kayteh broke
$(document).ready(function(event){ $('#submit').click(function(event){ getData(); }); $('#formThing').submit(function(event){ event.preventDefault(); getData(); }); }); function getData(){ $.get('https://player.me/api/v1/users/' + $('#inputText').val(), "username=true", function...
$(document).ready(function(event){ $('#submit').click(function(event){ getData(); }); $('#formThing').submit(function(event){ event.preventDefault(); getData(); }); }); function getData(){ $.get('https://player.me/api/v1/users/' + $('#inputText').val(), "?username=true", functio...
Fix label of radio field.
<div class="{{$config['divClass']}} @if($errors)f-error @endif"> <label>{{$label}}</label> @if($errors) <ul class="{{$config['errorMessageClass']}}"> @foreach ($errors as $error) <li>{{$error}}</li> @endforeach </ul> @endif @foreach($radios as $radio) <label for="{{$r...
<div class="{{$config['divClass']}} @if($errors)f-error @endif"> <label>{{$label}}</label> @if($errors) <ul class="{{$config['errorMessageClass']}}"> @foreach ($errors as $error) <li>{{$error}}</li> @endforeach </ul> @endif @foreach($radios as $radio) <label for="{{$n...
Reformat output to match other examples. Signed-off-by: Blaž Hrastnik <e26a9cc74a1e4715764aa09d1071b1ef182b1807@gmail.com>
package main import ( "fmt" "log" "net/http" "os" "github.com/flynn/go-flynn/migrate" "github.com/flynn/go-flynn/postgres" ) func main() { log.SetFlags(log.Lmicroseconds | log.Lshortfile) db, err := postgres.Open("", "") if err != nil { log.Fatal(err) } m := migrate.NewMigrations() m.Add(1, "CREATE S...
package main import ( "fmt" "log" "net/http" "os" "github.com/flynn/go-flynn/migrate" "github.com/flynn/go-flynn/postgres" ) func main() { log.SetFlags(log.Lmicroseconds | log.Lshortfile) db, err := postgres.Open("", "") if err != nil { log.Fatal(err) } m := migrate.NewMigrations() m.Add(1, "CREATE S...
Read "autofmt" option from storage
import browser from 'webextension-polyfill'; import render from '../../common/popup/render'; import enhance from '../../common/enhance'; import '../../common/popup/popup.scss'; import store from '../store'; const background = browser.extension.getBackgroundPage(); function pbcopy(text) { const input = document.cr...
import browser from 'webextension-polyfill'; import render from '../../common/popup/render'; import enhance from '../../common/enhance'; import '../../common/popup/popup.scss'; import store from '../store'; const background = browser.extension.getBackgroundPage(); function pbcopy(text) { const input = document.cr...
Clean up warnings in test fixture
/* * Copyright 2002-2022 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 * * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by a...
/* * Copyright 2002-2022 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 * * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by a...
Set session cookie flag `SameSite` to `Lax` (instead of `None`)
""" byceps.config_defaults ~~~~~~~~~~~~~~~~~~~~~~ Default configuration values :Copyright: 2006-2021 Jochen Kupperschmidt :License: Revised BSD (see `LICENSE` file for details) """ from datetime import timedelta from pathlib import Path # database connection SQLALCHEMY_ECHO = False # Avoid connection errors after...
""" byceps.config_defaults ~~~~~~~~~~~~~~~~~~~~~~ Default configuration values :Copyright: 2006-2021 Jochen Kupperschmidt :License: Revised BSD (see `LICENSE` file for details) """ from datetime import timedelta from pathlib import Path # database connection SQLALCHEMY_ECHO = False # Avoid connection errors after...
Prepend '-S rubocop' to version args Fixes #17
# # linter.py # Linter for SublimeLinter3, a code checking framework for Sublime Text 3 # # Written by Aparajita Fishman # Copyright (c) 2013 Aparajita Fishman # # License: MIT # """This module exports the Rubocop plugin class.""" from SublimeLinter.lint import RubyLinter class Rubocop(RubyLinter): """Provides...
# # linter.py # Linter for SublimeLinter3, a code checking framework for Sublime Text 3 # # Written by Aparajita Fishman # Copyright (c) 2013 Aparajita Fishman # # License: MIT # """This module exports the Rubocop plugin class.""" from SublimeLinter.lint import RubyLinter class Rubocop(RubyLinter): """Provides...
Validate resource schema are valid on startup
'use strict' const schemaValidator = module.exports = { } schemaValidator.validate = function (resources) { Object.keys(resources).forEach(resource => { Object.keys(resources[resource].attributes).forEach(attribute => { let joiSchema = resources[resource].attributes[attribute] if (!joiSchema._setting...
'use strict' const schemaValidator = module.exports = { } schemaValidator.validate = function (resources) { Object.keys(resources).forEach(resource => { Object.keys(resources[resource].attributes).forEach(attribute => { let joiSchema = resources[resource].attributes[attribute] if (!joiSchema._setting...
Change way CSV parser opts are passed in - i'll open that up to the CLI args somehow so the user can alter the 'fast-csv' package parsing args
const fs = require('fs') const csv = require('fast-csv') const transformToDocs = require('./transform-data-to-docs') /** * Input should be a single CSV row at a time. From one row we can transform a number of documents, * each of which will get serialised to JSON and written to the output stream. */ const onInputD...
const fs = require('fs') const csv = require('fast-csv') const transformToDocs = require('./transform-data-to-docs') /** * Input should be a single CSV row at a time. From one row we can transform a number of documents, * each of which will get serialised to JSON and written to the output stream. */ const onInputD...
Change cross-origin check to work behind proxies Signed-off-by: Jan Dvořák <86df5a4870880bf501c926309e3bcfbe57789f3f@anilinux.org>
#!/usr/bin/python3 -tt # -*- coding: utf-8 -*- __all__ = ['internal_origin_only'] from urllib.parse import urlparse from functools import wraps from werkzeug.exceptions import Forbidden import flask import re def internal_origin_only(fn): @wraps(fn) def wrapper(*args, **kwargs): host = flask.reques...
#!/usr/bin/python3 -tt # -*- coding: utf-8 -*- __all__ = ['internal_origin_only'] from urllib.parse import urlparse from functools import wraps from werkzeug.exceptions import Forbidden import flask import re def internal_origin_only(fn): @wraps(fn) def wrapper(*args, **kwargs): h = urlparse('http:...
Read test host from env variable Signed-off-by: Max Ehrlich <c7cd0513ef0c504f678ca33c2b168f4f84cd4d51@gmail.com>
package acmedns import ( "github.com/stretchr/testify/assert" "os" "testing" ) var ( acmednsLiveTest bool acmednsHost string acmednsAccountsJson []byte acmednsDomain string ) func init() { acmednsHost = os.Getenv("ACME_DNS_HOST") acmednsAccountsJson = []byte(os.Getenv("ACME_DNS_ACCOUNTS_JS...
package acmedns import ( "github.com/stretchr/testify/assert" "os" "testing" ) var ( acmednsLiveTest bool acmednsHost string acmednsAccountsJson []byte acmednsDomain string ) func init() { acmednsHost = os.Getenv("ACME_DNS_HOST") acmednsAccountsJson = []byte(os.Getenv("ACME_DNS_ACCOUNTS_JS...
Add ability to reference users by ID
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...
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...
Remove the no longer existing function "isUserVerified" Thx @eMerzh
<?php // Check if we are a user OCP\JSON::callCheck(); OC_JSON::checkLoggedIn(); $username = isset($_POST["username"]) ? $_POST["username"] : OC_User::getUser(); $password = $_POST["password"]; $oldPassword=isset($_POST["oldpassword"])?$_POST["oldpassword"]:''; $userstatus = null; if(OC_User::isAdminUser(OC_User::ge...
<?php // Check if we are a user OCP\JSON::callCheck(); OC_JSON::checkLoggedIn(); $username = isset($_POST["username"]) ? $_POST["username"] : OC_User::getUser(); $password = $_POST["password"]; $oldPassword=isset($_POST["oldpassword"])?$_POST["oldpassword"]:''; $userstatus = null; if(OC_User::isAdminUser(OC_User::ge...
Update API to expose: render, parse, and clearCache methods
var mustache = require('mustache') var defaultWriter = new mustache.Writer() mustache.tags = '% %' function unescapeKeywords (template) { var KEYWORD_REGEX = /%(asset_name_linked|asset_short_name_linked)\b/g return template.replace(KEYWORD_REGEX, '%&$1') } exports.clearCache = function clearCache () { return d...
var mustache = require('mustache') mustache.tags = '% %' function render (template, view) { var KEYWORD_REGEX = /%(asset_name_linked|asset_short_name_linked)\b/g var _template = template.replace(KEYWORD_REGEX, '%&$1') var _view = { asset_name_linked: function nameLinked () { if (view.name && view.href...
Create download directory if not exists.
#!/usr/bin/python3 # -*- coding: utf8 -*- import os import shutil import subprocess bootstrap_updater_version = 1 BootstrapDownloads = 'BootstrapDownloads/' BootstrapPrograms = 'BootstrapPrograms/' bootstrap = 'https://www.dropbox.com/s/0zhbgb1ftspcv9w/polygon4.zip?dl=1' bootstrap_zip = BootstrapDownloads + 'boots...
#!/usr/bin/python3 # -*- coding: utf8 -*- import os import shutil import subprocess bootstrap_updater_version = 1 BootstrapDownloads = 'BootstrapDownloads/' BootstrapPrograms = 'BootstrapPrograms/' bootstrap = 'https://www.dropbox.com/s/0zhbgb1ftspcv9w/polygon4.zip?dl=1' bootstrap_zip = BootstrapDownloads + 'boots...
Make buttons of person links
@extends('layouts.offcanvas') @section('sidebar') @endsection @section('main') <div id="tribe-details"> <h2>@lang("ui.about")</h2> {{ link_to_action('FriendsController@getGoals', trans('ui.goals.title_index'), $d->id, array('class' => 'button small')) }} {{ link_to_action('FriendsController@getEndorsements', tr...
@extends('layouts.offcanvas') @section('sidebar') @endsection @section('main') <div id="tribe-details"> <h2>@lang("ui.about")</h2> {{ link_to_action('FriendsController@getGoals', trans('ui.goals.title_index'), $d->id) }} {{ link_to_action('FriendsController@getEndorsements', trans('ui.endorsements.title_index')...
Tweak server to be shorter
package main import ( "crypto/tls" "flag" "fmt" "log" "net/http" ) func main() { addr := flag.String("addr", ":4000", "HTTP network address") certFile := flag.String("certfile", "cert.pem", "certificate PEM file") keyFile := flag.String("keyfile", "key.pem", "key PEM file") flag.Parse() mux := http.NewServ...
package main import ( "crypto/tls" "flag" "fmt" "log" "net/http" "time" ) func main() { addr := flag.String("addr", ":4000", "HTTP network address") certFile := flag.String("certfile", "cert.pem", "certificate PEM file") keyFile := flag.String("keyfile", "key.pem", "key PEM file") flag.Parse() tlsConfig :...
Refactor uploader tests to use the fixture module.
"""Tests for the uploader module""" from __future__ import unicode_literals from __future__ import print_function from __future__ import division from __future__ import absolute_import from datapackage import DataPackage from future import standard_library from gobble.user import User standard_library.install_alias...
"""Tests for the uploader module""" from __future__ import unicode_literals from __future__ import print_function from __future__ import division from __future__ import absolute_import from builtins import open from future import standard_library standard_library.install_aliases() from os.path import join from datap...
Revert "Hide exceptions if elasticsearch is not running. This needs some fixing and cleaning up by someone smarter than myself." This reverts commit eb1900265fb3f077cf104c0944d8832a8d48012e and fixes #45.
<?php namespace FOQ\ElasticaBundle; use Elastica_Client; use FOQ\ElasticaBundle\Logger\ElasticaLogger; /** * @author Gordon Franke <info@nevalon.de> */ class Client extends Elastica_Client { protected $logger; public function setLogger(ElasticaLogger $logger) { $this->logger = $logger; } ...
<?php namespace FOQ\ElasticaBundle; use Elastica_Client; use FOQ\ElasticaBundle\Logger\ElasticaLogger; /** * @author Gordon Franke <info@nevalon.de> */ class Client extends Elastica_Client { protected $logger; public function setLogger(ElasticaLogger $logger) { $this->logger = $logger; } ...
[BUG] Fix string typo in migration
var dbm = require('db-migrate'); var type = dbm.dataType; exports.up = function(db, callback) { db.createTable('users', { id: { type: 'int', primaryKey: true, autoIncrement: true }, name: { type: 'string', notNull: true, unique: true }, salt: { type: 'string', notNull: true }, federation_tag: { type: ...
var dbm = require('db-migrate'); var type = dbm.dataType; exports.up = function(db, callback) { db.createTable('users', { id: { type: 'int', primaryKey: true, autoIncrement: true }, name: { type: 'string', notNull: true, unique: true }, salt: { type: 'string', notNull: true }, federation_tag: { type: ...
Enhancement: Add return type declaration and DocBlock Co-authored-by: Andreas Möller <96e8155732e8324ae26f64d4516eb6fe696ac84f@localheinz.com> Co-authored-by: Arne Blankerts <2d7739f42ebd62662a710577d3d9078342a69dee@Blankerts.de>
<?php declare(strict_types=1); /* * This file is part of PHPUnit. * * (c) Sebastian Bergmann <sebastian@phpunit.de> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace PHPUnit\Event\TestRunner; use function array_merge; use ...
<?php declare(strict_types=1); /* * This file is part of PHPUnit. * * (c) Sebastian Bergmann <sebastian@phpunit.de> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace PHPUnit\Event\TestRunner; use function array_merge; use ...
Make clear how to use HTTPS in the helloworld example
/* * Copyright 2013 The Netty Project * * The Netty Project licenses this file to you 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 ...
/* * Copyright 2013 The Netty Project * * The Netty Project licenses this file to you 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 ...
Add mkdn extension to markdown extension list mkdn is an acceptable extension as per https://github.com/github/markup/tree/master#markups
<?php /* * This file is a part of Sculpin. * * (c) Dragonfly Development Inc. * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Sculpin\Bundle\MarkdownBundle\DependencyInjection; use Symfony\Component\Config\Definition\B...
<?php /* * This file is a part of Sculpin. * * (c) Dragonfly Development Inc. * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Sculpin\Bundle\MarkdownBundle\DependencyInjection; use Symfony\Component\Config\Definition\B...
Add socket connect timeout option to sentinel connection
from redis import sentinel, StrictRedis class Sentinel(object): def __init__(self, app=None): self.app = app self.master = StrictRedis() self.slave = self.master if app is not None: # pragma: no cover self.init_app(app) def init_app(self, app): self.connec...
from redis import sentinel, StrictRedis class Sentinel(object): def __init__(self, app=None): self.app = app self.master = StrictRedis() self.slave = self.master if app is not None: # pragma: no cover self.init_app(app) def init_app(self, app): self.connec...
Remove ".label" from optional field 'fv-word:part_of_speech'
// TODO: IMPORT ONLY WHAT IS USED import * as yup from 'yup' import copy from './internationalization' const validForm = yup.object().shape({ 'dc:title': yup.string().required(copy.validation.title), 'fv-word:part_of_speech': yup.string(), 'fv-word:pronunciation': yup.string(), 'fv-word:available_in_games': y...
// TODO: IMPORT ONLY WHAT IS USED import * as yup from 'yup' import copy from './internationalization' const validForm = yup.object().shape({ 'dc:title': yup.string().required(copy.validation.title), 'fv-word:part_of_speech': yup.string().label('Part of speech'), 'fv-word:pronunciation': yup.string(), 'fv-wor...
Add hide for casting to the default mod list
var rModsList = []; /* start ui_mod_list */ var global_mod_list = [ ]; var scene_mod_list = {'connect_to_game': [ ],'game_over': [ ], 'icon_atlas': [ ], 'live_game': [ //In game timer '../../mods/dTimer/dTimer.css', '../../mods/dTimer/dTimer.js', //Mex/Energy Count '../../mods/dMexCount/dMexCount.css', '.....
var rModsList = []; /* start ui_mod_list */ var global_mod_list = [ ]; var scene_mod_list = {'connect_to_game': [ ],'game_over': [ ], 'icon_atlas': [ ], 'live_game': [ //In game timer '../../mods/dTimer/dTimer.css', '../../mods/dTimer/dTimer.js', //Mex/Energy Count '../../mods/dMexCount/dMexCount.css', '.....
UNIT_TEST: Add ability to run unit test script from anywhere
#!/usr/bin/env python import serial import os # Make and flash the unit test FILE_LOCATION = os.path.dirname(os.path.abspath(__file__)) os.chdir(FILE_LOCATION + "/../") print os.system("make flash_unit_test") # Ask the user to reset the board raw_input("\nPlease press the phsyical reset button on the STM32F4Discove...
#!/usr/bin/env python import serial import os # Make and flash the unit test FILE_LOCATION = os.path.dirname(os.path.abspath(__file__)) os.system("cd " + FILE_LOCATION + " ../") print os.system("make flash_unit_test") # Ask the user to reset the board raw_input("\nPlease press the phsyical reset button on the STM32...
Fix cl console.log shorthand to show real path Merge pull request #100 from Novicell/tbb2-patch-1 Update novicell.js
'use strict'; /*global console:true */ /*! * * Novicell JavaScript Library v0.5 * http://www.novicell.dk * * Copyright Novicell * */ // Prevent console errors in IE if (typeof (console) === 'undefined') { var console = {}; console.log = console.error = console.info = console.debug = console.warn = console....
'use strict'; /*global console:true */ /*! * * Novicell JavaScript Library v0.5 * http://www.novicell.dk * * Copyright Novicell * */ // Prevent console errors in IE if (typeof (console) === 'undefined') { var console = {}; console.log = console.error = console.info = console.debug = console.warn = console....
Make curl follow redirects to prevent relocation in the future
<?php namespace Raffle; class RandomService { /** * Base URL */ const BASE_URL = 'https://www.random.org/integer-sets/?sets=1&min=%d&max=%d&num=%d&order=random&format=plain&rnd=new'; /** * Retrieve a block of random numbers. * * @param int $min Minimum amount. * @param int...
<?php namespace Raffle; class RandomService { /** * Base URL */ const BASE_URL = 'https://www.random.org/integer-sets/?sets=1&min=%d&max=%d&num=%d&order=random&format=plain&rnd=new'; /** * Retrieve a block of random numbers. * * @param int $min Minimum amount. * @param int...
Move configuration variables to constants.
from urlparse import urlparse import logging import os from flask import Flask import pymongo HOST= '0.0.0.0' PORT = int(os.environ.get('PORT', 5000)) MONGO_URL = os.environ.get('MONGOHQ_URL', 'http://localhost:27017/db') DEBUG = True app = Flask(__name__) _logger = logging.getLogger(__name__) db = None def get_con...
from urlparse import urlparse import logging import os from flask import Flask import pymongo app = Flask(__name__) _logger = logging.getLogger(__name__) db = None def get_connection(): global db if db: return db config = urlparse(os.environ.get('MONGOHQ_URL', 'http://localhost:27017/db')) db...
Update copyright notice with MIT license
/*++ NASM Assembly Language Plugin Copyright (c) 2017-2018 Aidan Khoury Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use...
/*++ NASM Assembly Language Plugin Copyright (c) 2017-2018 Aidan Khoury. All rights reserved. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your opt...
Make perms write_roles actually work
/** * Based on: https://github.com/iriscouch/manage_couchdb/ * License: Apache License 2.0 **/ function(newDoc, oldDoc, userCtx, secObj) { var ddoc = this; secObj.admins = secObj.admins || {}; secObj.admins.names = secObj.admins.names || []; secObj.admins.roles = secObj.admins.roles || []; var IS_DB_ADMI...
/** * Based on: https://github.com/iriscouch/manage_couchdb/ * License: Apache License 2.0 **/ function(newDoc, oldDoc, userCtx, secObj) { var ddoc = this; secObj.admins = secObj.admins || {}; secObj.admins.names = secObj.admins.names || []; secObj.admins.roles = secObj.admins.roles || []; var IS_DB_ADMI...
Use "elm-format" as the default binary path Not all people have elm-format installed into /usr/local/bin/elm-format (I installed it via package manager so it's in /usr/bin/elm-format), but I assume most of the people have it int their PATH. This should fix #18 for most users.
'use babel'; export default { binary: { title: 'Binary path', description: 'Path for elm-format', type: 'string', default: 'elm-format', order: 1, }, formatOnSave: { title: 'Format on save', description: 'Do we format when you save files?', type: 'boolean', default: true, ...
'use babel'; export default { binary: { title: 'Binary path', description: 'Path for elm-format', type: 'string', default: '/usr/local/bin/elm-format', order: 1, }, formatOnSave: { title: 'Format on save', description: 'Do we format when you save files?', type: 'boolean', defa...
Update license classifier to MIT
from os import path, pardir, chdir from setuptools import setup, find_packages README = open(path.join(path.dirname(__file__), 'README.rst')).read() # allow setup.py to be run from any path chdir(path.normpath(path.join(path.abspath(__file__), pardir))) setup( name='django-perimeter', version='0.9', pack...
from os import path, pardir, chdir from setuptools import setup, find_packages README = open(path.join(path.dirname(__file__), 'README.rst')).read() # allow setup.py to be run from any path chdir(path.normpath(path.join(path.abspath(__file__), pardir))) setup( name='django-perimeter', version='0.9', pack...
Add simple UI for first example
package org.kikermo.blepotcontroller.activity; import android.support.v7.app.AppCompatActivity; import android.os.Bundle; import android.widget.SeekBar; import android.widget.TextView; import org.kikermo.blepotcontroller.R; public class MainActivity extends AppCompatActivity implements SeekBar.OnSeekBarChangeListene...
package org.kikermo.blepotcontroller.activity; import android.support.v7.app.AppCompatActivity; import android.os.Bundle; import android.widget.SeekBar; import android.widget.TextView; import org.kikermo.blepotcontroller.R; public class MainActivity extends AppCompatActivity implements SeekBar.OnSeekBarChangeListene...
Add updated_at attribute for Dashboard.Repository
require('dashboard/core'); Dashboard.Repository = DS.Model.extend({ name: DS.attr('string'), full_name: DS.attr('string'), description: DS.attr('string'), html_url: DS.attr('string'), homepage: DS.attr('string'), watchers: DS.attr('number'), forks: DS.attr('number'), language: DS.attr('string'), upda...
require('dashboard/core'); Dashboard.Repository = DS.Model.extend({ name: DS.attr('string'), full_name: DS.attr('string'), description: DS.attr('string'), html_url: DS.attr('string'), homepage: DS.attr('string'), watchers: DS.attr('number'), forks: DS.attr('number'), language: DS.attr('string'), owne...
Add Last Modified date and author
#!/usr/bin/env php <?php /** * Last modified 2014-03-10 * @author Ryo Utsunomiya (https://twitter.com/ryo511) */ if (empty($argv[1])) { fputs(STDERR, "1st argument is empty; Pass me a text file which contains file list\n"); exit(1); } if (empty($argv[2])) { fputs(STDERR, "2nd argument is empty; Pass me...
#!/usr/bin/env php <?php if (empty($argv[1])) { fputs(STDERR, "1st argument is empty; Pass me a text file which contains file list\n"); exit(1); } if (empty($argv[2])) { fputs(STDERR, "2nd argument is empty; Pass me a path to destination\n"); exit(1); } $destination = trim($argv[2]); $files = file_get...
Fix doubling quotes when closing string literal
/* * Copyright 2000-2013 JetBrains s.r.o. * Copyright 2014-2014 AS3Boyan * Copyright 2014-2014 Elias Ku * * 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/lice...
/* * Copyright 2000-2013 JetBrains s.r.o. * Copyright 2014-2014 AS3Boyan * Copyright 2014-2014 Elias Ku * * 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/lice...
Make number of attributes in editor variable
package editor.views; import javax.swing.*; import java.awt.*; import java.util.ArrayList; import java.util.HashMap; /** * The AttributesPanelView is used to show all of the attributes of an XML * element in an editable form. * @see xml.Element */ public class AttributesPanelView extends JPanel { private JPan...
package editor.views; import javax.swing.*; import java.awt.*; import java.util.HashMap; /** * The AttributesPanelView is used to show all of the attributes of an XML * element in an editable form. * @see xml.Element */ public class AttributesPanelView extends JPanel { private JPanel attributesPanel; /**...
Use array shorthand for cache table
<?php namespace Craft; class Wistia_CacheRecord extends BaseRecord { public function getTableName() { return 'wistia_cache'; } protected function defineAttributes() { return [ 'id' => [ AttributeType::Number, 'column' => ColumnType::PK ], 'hashedId' => AttributeType::String, 'type' => [ ...
<?php namespace Craft; class Wistia_CacheRecord extends BaseRecord { public function getTableName() { return 'wistia_cache'; } protected function defineAttributes() { return array( 'id' => array( AttributeType::Number, 'column' => ColumnType::PK ), 'hashedId' => AttributeType::String, 'ty...
FEATURE: Add PHPs json_encode options to stringify eel helper
<?php namespace Neos\Eel\Helper; /* * This file is part of the Neos.Eel package. * * (c) Contributors of the Neos Project - www.neos.io * * This package is Open Source Software. For the full copyright and license * information, please view the LICENSE file which was distributed with this * source code. */ use...
<?php namespace Neos\Eel\Helper; /* * This file is part of the Neos.Eel package. * * (c) Contributors of the Neos Project - www.neos.io * * This package is Open Source Software. For the full copyright and license * information, please view the LICENSE file which was distributed with this * source code. */ use...
Fix spacing in last method of file. Signed-off-by: messiasthi <8562fc1efba9a3c99753c749fdfb1b6932b70fbf@gmail.com>
import os from threading import Thread def _delete(path): os.remove(path) def _link(src, path): os.symlink(src, path) def manager_files(paths, link): # The first file is preserved to not delete all files in directories. first = True src = "" deleted_files = [] linked_files = [] errors = [] for path in pat...
import os from threading import Thread def _delete(path): os.remove(path) def _link(src, path): os.symlink(src, path) def manager_files(paths, link): # The first file is preserved to not delete all files in directories. first = True src = "" deleted_files = [] linked_files = [] errors = [] for path in pat...
Add new test pending dependencies.
'use strict'; var path = require('path'); var assert = require('yeoman-assert'); var helpers = require('yeoman-test'); describe('pc simple ruby app', function(){ it('will barf without arguments'); describe('default', function(){ before(function(done){ // on smaller dev machines this setup takes lo...
'use strict'; var path = require('path'); var assert = require('yeoman-assert'); var helpers = require('yeoman-test'); describe('pc simple ruby app', function(){ describe('default', function(){ before(function(done){ // on smaller dev machines this setup takes longer than the default 2s. this.timeou...
Remove import models from init in sepa_credit_transfer
# -*- encoding: utf-8 -*- ############################################################################## # # SEPA Credit Transfer module for OpenERP # Copyright (C) 2010-2013 Akretion (http://www.akretion.com) # @author: Alexis de Lattre <alexis.delattre@akretion.com> # # This program is free software: you ...
# -*- encoding: utf-8 -*- ############################################################################## # # SEPA Credit Transfer module for OpenERP # Copyright (C) 2010-2013 Akretion (http://www.akretion.com) # @author: Alexis de Lattre <alexis.delattre@akretion.com> # # This program is free software: you ...
Reset scroll on back/next pages.
import Ember from 'ember'; export default Ember.Route.extend({ queryParams: { page: { refreshModel: true } }, model(params) { let now = new Date(); let twoMonthsAgo = new Date(now.getFullYear(), now.getMonth() - 2, now.getD...
import Ember from 'ember'; export default Ember.Route.extend({ queryParams: { page: { refreshModel: true } }, model(params) { let now = new Date(); let twoMonthsAgo = new Date(now.getFullYear(), now.getMonth() - 2, now.getD...
Make auto-incrementing event names work with a mixture of numeric and non-numeric event names
import ckan.logic as logic import ckan.plugins.toolkit as toolkit def event_create(context, data_dict): """ Creates a 'event' type group with a custom unique identifier for the event """ if data_dict.get('name'): name = data_dict.get('name') else: # Generate a new operation ID ...
import ckan.logic as logic import ckan.plugins.toolkit as toolkit def event_create(context, data_dict): """ Creates a 'event' type group with a custom unique identifier for the event """ if data_dict.get('name'): name = data_dict.get('name') else: # Generate a new operation ID ...
Bring `this` back into scope
import Ember from 'ember'; import RestUtils from 'moviematcher/utils/rest'; import Cookie from 'moviematcher/utils/cookies'; export default Ember.Controller.extend({ queryParams: ['redirect'], actions: { userLogin(username, password) { const sessionDurationSeconds = 2 * 60 * 60; // 2 hours return RestUti...
import Ember from 'ember'; import RestUtils from 'moviematcher/utils/rest'; import Cookie from 'moviematcher/utils/cookies'; export default Ember.Controller.extend({ queryParams: ['redirect'], actions: { userLogin(username, password) { const loginThis = this; const sessionDurationSeconds = 2 * 60 * 60...
Make custom generated anotation only availabe at source
package net.vergien.beanautoutils.annotation; import static java.lang.annotation.ElementType.TYPE; import static java.lang.annotation.RetentionPolicy.SOURCE; import java.lang.annotation.Retention; import java.lang.annotation.Target; /** * Used as long java8 and java9/10/.. is on the market */ @Retention(SOURCE) @Ta...
package net.vergien.beanautoutils.annotation; /** * Used as long java8 and java9/10/.. is on the market */ public @interface Generated { /** * The value element MUST have the name of the code generator. The * name is the fully qualified name of the code generator. * * @return The name of the code gen...
Fix syntax error on phantom js browser
'use strict'; const BrowserWorker = require('./BrowserWorker'); const WebDriver = require('webdriverio'); class PhantomJsBrowserWorker extends BrowserWorker { constructor(scenario) { super(scenario); } setup(done) { if(typeof Browser === 'undefined') { global.Browser = WebDrive...
'use strict'; const BrowserWorker = require('./BrowserWorker'); const WebDriver = require('webdriverio'); class PhantomJsBrowserWorker extends BrowserWorker { constructor(scenario) { super(scenario); } setup(done) { if(typeof Browser === 'undefined') { global.Browser = WebDrive...
Add proptype validation to Table component
import React from 'react'; import { map } from 'lodash'; import PropTypes from 'prop-types'; import CampaignRow from './CampaignRow'; import EventRow from './EventRow'; import './table.scss'; class Table extends React.Component { render() { const heading = this.props.headings.map((title, index) => { retur...
import React from 'react'; import { map } from 'lodash'; import CampaignRow from './CampaignRow'; import EventRow from './EventRow'; import './table.scss'; class Table extends React.Component { render() { const heading = this.props.headings.map((title, index) => { return <th key={index} className="table__...
Fix typo which breaks test build: [] GITHUB_BREAKING_CHANGES=n/a ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=339165220
/* * Copyright 2020 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 ...
/* * Copyright 2020 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 ...
Fix management command for submitted exercises
# -*- coding: utf-8 *-* # This file is part of wger Workout Manager. # # wger Workout Manager 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 ...
# -*- coding: utf-8 *-* # This file is part of wger Workout Manager. # # wger Workout Manager 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 ...