text
stringlengths
16
4.96k
positive
stringlengths
321
2.24k
negative
stringlengths
310
2.21k
Change search route remove multiple createuser routes change getAllRegular to getAll Role
import express from 'express'; import userController from '../controllers/userController'; // import documentController from '../controllers/documentController'; import auth from '../middleware/auth'; // import utils from '../middlewares/utils'; const user = express.Router(); user.route('/api/user') .get(auth.ve...
import express from 'express'; import userController from '../controllers/userController'; // import documentController from '../controllers/documentController'; import auth from '../middleware/auth'; // import utils from '../middlewares/utils'; const user = express.Router(); user.route('/api/user') .get(auth.ve...
Make it easier to repro tests in the wild
;(function(){ console.log('# ' + location); var __filename = (function(){ var scripts = document.getElementsByTagName('script'); var a = document.createElement('a'); a.href = scripts[scripts.length-1].src; return a.pathname; }()); var __dirname = __filename.split('/').reverse().slice(1).revers...
;(function(){ var __filename = (function(){ var scripts = document.getElementsByTagName('script'); var a = document.createElement('a'); a.href = scripts[scripts.length-1].src; return a.pathname; }()); var __dirname = __filename.split('/').reverse().slice(1).reverse().join('/'); document.head....
Use form variable instead hard-coding
from .utils import SESSION_KEY_CURRENT_OS from .forms import OSForm class CurrentOSMixin(object): allowed_oses = OSForm.OS_CHOICES def get_context_data(self, **kwargs): """Inject current active OS key and the choice form into context. """ # Zip the 2-tuple into a [keys, values] gener...
from .utils import SESSION_KEY_CURRENT_OS from .forms import OSForm class CurrentOSMixin(object): allowed_oses = OSForm.OS_CHOICES def get_context_data(self, **kwargs): """Inject current active OS key and the choice form into context. """ # Zip the 2-tuple into a [keys, values] gener...
Implement a bad sig test
#!/usr/bin/env python ''' Copyright 2009 Slide, Inc. ''' import unittest import pyecc DEFAULT_DATA = 'This message will be signed\n' DEFAULT_SIG = '$HPI?t(I*1vAYsl$|%21WXND=6Br*[>k(OR9B!GOwHqL0s+3Uq' DEFAULT_PUBKEY = '8W;>i^H0qi|J&$coR5MFpR*Vn' DEFAULT_PRIVKEY = 'my private key' class ECC_Verify_Tests(unittest...
#!/usr/bin/env python ''' Copyright 2009 Slide, Inc. ''' import unittest import pyecc DEFAULT_DATA = 'This message will be signed\n' DEFAULT_SIG = '$HPI?t(I*1vAYsl$|%21WXND=6Br*[>k(OR9B!GOwHqL0s+3Uq' DEFAULT_PUBKEY = '8W;>i^H0qi|J&$coR5MFpR*Vn' DEFAULT_PRIVKEY = 'my private key' class ECC_Verify_Tests(unittest...
Remove debug print from view
import six from django.http import HttpResponseRedirect from django.shortcuts import reverse from django.conf import settings from openid.consumer import consumer import wargaming wot = wargaming.WoT(settings.WARGAMING_KEY, language='ru', region='ru') def auth_callback(request): oidconsumer = consumer.Consume...
import six from django.http import HttpResponseRedirect from django.shortcuts import reverse from django.conf import settings from openid.consumer import consumer import wargaming wot = wargaming.WoT(settings.WARGAMING_KEY, language='ru', region='ru') def auth_callback(request): oidconsumer = consumer.Consume...
Include longer playlist in pagination example Signed-off-by: Noah Stride <1db01d43e08596f43a65fb393d969b98ee5b4dc6@noahstride.co.uk>
package main import ( "context" "log" "os" "github.com/zmb3/spotify" "golang.org/x/oauth2/clientcredentials" ) func main() { config := &clientcredentials.Config{ ClientID: os.Getenv("SPOTIFY_ID"), ClientSecret: os.Getenv("SPOTIFY_SECRET"), TokenURL: spotify.TokenURL, } token, err := config.Toke...
package main import ( "context" "log" "os" "github.com/zmb3/spotify" "golang.org/x/oauth2/clientcredentials" ) func main() { config := &clientcredentials.Config{ ClientID: os.Getenv("SPOTIFY_ID"), ClientSecret: os.Getenv("SPOTIFY_SECRET"), TokenURL: spotify.TokenURL, } token, err := config.Toke...
Fix suggested solution for failure to clone.
from __future__ import division, absolute_import, print_function import contextlib from punic.logger import logger class RepositoryNotClonedError(Exception): pass class CartfileNotFound(Exception): def __init__(self, path): self.path = path class PunicRepresentableError(Exception): pass cla...
from __future__ import division, absolute_import, print_function import contextlib from punic.logger import logger class RepositoryNotClonedError(Exception): pass class CartfileNotFound(Exception): def __init__(self, path): self.path = path class PunicRepresentableError(Exception): pass cla...
Add Opbeat performance flag for client
import initOpbeat from 'opbeat-react'; import 'opbeat-react/router'; let opbeat_app_id = process.env.REACT_APP_OPBEAT_APP_ID; let opbeat_org_id = process.env.REACT_APP_OPBEAT_ORG_ID; if(process.env.NODE_ENV === 'production' && opbeat_app_id && opbeat_org_id) { initOpbeat({ appId: opbeat_app_id, or...
import initOpbeat from 'opbeat-react'; import 'opbeat-react/router'; let opbeat_app_id = process.env.REACT_APP_OPBEAT_APP_ID; let opbeat_org_id = process.env.REACT_APP_OPBEAT_ORG_ID; if(process.env.NODE_ENV === 'production' && opbeat_app_id && opbeat_org_id) { initOpbeat({ appId: opbeat_app_id, or...
Remove explicit initialize_tpu_system call from model garden. PiperOrigin-RevId: 290354680
# Copyright 2019 The TensorFlow Authors. 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 applica...
# Copyright 2019 The TensorFlow Authors. 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 applica...
Include migrations in package data
from setuptools import setup, find_packages setup( name = "countries", version = "0.1.1-2", description = 'Provides models for a "complete" list of countries', author = 'David Danier', author_email = 'david.danier@team23.de', url = 'https://github.com/ddanier/django_countries', long_descrip...
from setuptools import setup, find_packages setup( name = "countries", version = "0.1.1-1", description = 'Provides models for a "complete" list of countries', author = 'David Danier', author_email = 'david.danier@team23.de', url = 'https://github.com/ddanier/django_countries', long_descrip...
Fix bug that arose through grammar tweaking
from .models import Node, Info from sqlalchemy import ForeignKey, Column, String import random class Source(Node): __tablename__ = "source" __mapper_args__ = {"polymorphic_identity": "generic_source"} uuid = Column(String(32), ForeignKey("node.uuid"), primary_key=True) def create_information(self): ...
from .models import Node, Info from sqlalchemy import ForeignKey, Column, String import random class Source(Node): __tablename__ = "source" __mapper_args__ = {"polymorphic_identity": "generic_source"} uuid = Column(String(32), ForeignKey("node.uuid"), primary_key=True) def create_information(self, w...
Use STATIC_URL/STATIC_ROOT when using django.contrib.staticfiles (django 1.3)
import os from django.conf import settings DEFAULT_CONFIG = getattr(settings, 'TINYMCE_DEFAULT_CONFIG', {'theme': "simple", 'relative_urls': False}) USE_SPELLCHECKER = getattr(settings, 'TINYMCE_SPELLCHECKER', False) USE_COMPRESSOR = getattr(settings, 'TINYMCE_COMPRESSOR', False) USE_FILEBROWSER = getattr(s...
import os from django.conf import settings DEFAULT_CONFIG = getattr(settings, 'TINYMCE_DEFAULT_CONFIG', {'theme': "simple", 'relative_urls': False}) USE_SPELLCHECKER = getattr(settings, 'TINYMCE_SPELLCHECKER', False) USE_COMPRESSOR = getattr(settings, 'TINYMCE_COMPRESSOR', False) USE_FILEBROWSER = getattr(s...
Update divs to ExampleContainer component
import React from 'react'; import CentralColumnLayout from '../../containers/CentralColumnLayout/CentralColumnLayout'; import { SprkDivider } from '@sparkdesignsystem/spark-core-react'; import ExampleContainer from '../../containers/ExampleContainer/ExampleContainer'; const SprkDividerDocs = () => { return ( <C...
import React from 'react'; import CentralColumnLayout from '../../containers/CentralColumnLayout/CentralColumnLayout'; import { SprkDivider } from '@sparkdesignsystem/spark-core-react'; const SprkDividerDocs = () => { return ( <CentralColumnLayout> <div className="sprk-u-mbm"> <h2 className="drizz...
Add flag for new module loader.
/* ___ usage ___ en_US ___ usage: prolific udp <options> -u, --url <string> The URL of the logging destination. --help Display this message. ___ $ ___ en_US ___ ___ . ___ */ require('arguable')(module, require('cadence')(function (async, program) { progra...
/* ___ usage ___ en_US ___ usage: prolific udp <options> -u, --url <string> The URL of the logging destination. --help Display this message. ___ $ ___ en_US ___ ___ . ___ */ require('arguable')(module, require('cadence')(function (async, program) { progra...
Exclude bin files from built zips.
/** * Gulp copy task. * * Site Kit by Google, Copyright 2020 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 * * Unle...
/** * Gulp copy task. * * Site Kit by Google, Copyright 2020 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 * * Unle...
Fix pandoc statement Update version number
#!/usr/bin/env python #pandoc -t rst -f markdown README.mkd -o README import os from setuptools import setup def read(fname): return open(os.path.join(os.path.dirname(__file__), fname)).read() setup( name='mass', version='0.1.3', description='Merge and Simplify Scripts: an automated tool for managin...
#!/usr/bin/env python #pandoc -f rst -t markdown README.mkd -o README import os from setuptools import setup def read(fname): return open(os.path.join(os.path.dirname(__file__), fname)).read() setup( name='mass', version='0.1.2', description='Merge and Simplify Scripts: an automated tool for managin...
Fix mismatched horizontal and vertical proptypes
import React, { PropTypes } from 'react'; import Radium from 'radium'; import resolveCellStyles from './util/resolve-cell-styles'; import omit from 'lodash.omit'; const Cell = Radium(props => { const styles = resolveCellStyles(props); console.log(styles); return ( <div style={styles}> {props.children}...
import React, { PropTypes } from 'react'; import Radium from 'radium'; import resolveCellStyles from './util/resolve-cell-styles'; import omit from 'lodash.omit'; const Cell = Radium(props => { const styles = resolveCellStyles(props); console.log(styles); return ( <div style={styles}> {props.children}...
Fix layout for Eiger example
'''Virtual datasets: The 'Eiger' use case https://support.hdfgroup.org/HDF5/docNewFeatures/VDS/HDF5-VDS-requirements-use-cases-2014-12-10.pdf ''' import h5py import numpy as np files = ['1.h5', '2.h5', '3.h5', '4.h5', '5.h5'] entry_key = 'data' # where the data is inside of the source files. sh = h5py.File(files[0]...
'''Virtual datasets: The 'Eiger' use case https://support.hdfgroup.org/HDF5/docNewFeatures/VDS/HDF5-VDS-requirements-use-cases-2014-12-10.pdf ''' import h5py import numpy as np files = ['1.h5', '2.h5', '3.h5', '4.h5', '5.h5'] entry_key = 'data' # where the data is inside of the source files. sh = h5py.File(files[0]...
Use the bridge in the router
<?php /** * @author Aaron Scherer <aequasi@gmail.com> * @date 2013 * @license http://www.apache.org/licenses/LICENSE-2.0.html Apache License, Version 2.0 */ namespace Aequasi\Bundle\CacheBundle\DependencyInjection\Compiler; use Symfony\Component\Config\Definition\Exception\InvalidConfigurationException...
<?php /** * @author Aaron Scherer <aequasi@gmail.com> * @date 2013 * @license http://www.apache.org/licenses/LICENSE-2.0.html Apache License, Version 2.0 */ namespace Aequasi\Bundle\CacheBundle\DependencyInjection\Compiler; use Symfony\Component\Config\Definition\Exception\InvalidConfigurationException...
Fix test for new bands_inspect version.
#!/usr/bin/env python # -*- coding: utf-8 -*- import os import pytest import tempfile import numpy as np import bands_inspect as bi from click.testing import CliRunner import tbmodels from tbmodels._cli import cli def test_cli_eigenvals(sample): samples_dir = sample('cli_eigenvals') runner = CliRunner() ...
#!/usr/bin/env python # -*- coding: utf-8 -*- import os import pytest import tempfile import numpy as np import bands_inspect as bi from click.testing import CliRunner import tbmodels from tbmodels._cli import cli def test_cli_eigenvals(sample): samples_dir = sample('cli_eigenvals') runner = CliRunner() ...
Add option for suffix when wrapping API
module.exports = function promisifyNvim(nvim, opts) { //promisify APIs var interfaces = { Nvim: nvim.constructor, Buffer: nvim.Buffer, Window: nvim.Window, Tabpage: nvim.Tabpage, }; var options = opts || {}; Object.keys(interfaces).forEach(function(key) { var name = key; Object.keys(...
module.exports = function promisifyNvim(nvim) { //promisify APIs var interfaces = { Nvim: nvim.constructor, Buffer: nvim.Buffer, Window: nvim.Window, Tabpage: nvim.Tabpage, }; Object.keys(interfaces).forEach(function(key) { var name = key; Object.keys(interfaces[key].prototype).forEach(...
Remove referee.isArrayLike from public API This is not used by referee itself
"use strict"; var isArguments = require("lodash.isarguments"); var actualMessageValues = require("../actual-message-values"); module.exports = function(referee) { function isArrayLike(object) { return ( Array.isArray(object) || (Boolean(object) && typeof object.leng...
"use strict"; var isArguments = require("lodash.isarguments"); var actualMessageValues = require("../actual-message-values"); module.exports = function(referee) { function isArrayLike(object) { return ( Array.isArray(object) || (Boolean(object) && typeof object.leng...
Fix latex output for splitted up/down values
#!/usr/bin/python import json def storeJSON(dict, file_string): with open(file_string, 'w') as fp: json.dump(dict, fp, indent=4) def storeTEX(dict, file_string): with open(file_string, 'w') as fp: fp.write("\\begin{tabular}\n") fp.write(" \\hline\n") fp.write(" ") # ...
#!/usr/bin/python import json def storeJSON(dict, file_string): with open(file_string, 'w') as fp: json.dump(dict, fp, indent=4) def storeTEX(dict, file_string): with open(file_string, 'w') as fp: fp.write("\\begin{tabular}\n") fp.write(" \\hline\n") fp.write(" ") # ...
Remove import DatabaseTransactions as causes conflict
<?php use Laracasts\Integrated\Extensions\Selenium as IntegrationTest; # use Illuminate\Foundation\Testing\DatabaseTransactions; class UserRegistrationProcessTest extends IntegrationTest { # use DatabaseTransactions; # protected $baseUrl = 'http://localhost:8000'; /** @test */ public function testRe...
<?php use Laracasts\Integrated\Extensions\Selenium as IntegrationTest; use Illuminate\Foundation\Testing\DatabaseTransactions; class UserRegistrationProcessTest extends IntegrationTest { use DatabaseTransactions; # protected $baseUrl = 'http://localhost:8000'; /** @test */ public function testRegist...
Use underlying table name in foreign key
export default function(sequelize, DataTypes) { let BSDCallAssignment = sequelize.define('BSDCallAssignment', { name: DataTypes.STRING }, { underscored: true, tableName: 'bsd_call_assignments', classMethods: { associate: (models) => { BSDCallAssignment.belongsTo(models.BSDSurvey, {fore...
export default function(sequelize, DataTypes) { let BSDCallAssignment = sequelize.define('BSDCallAssignment', { name: DataTypes.STRING }, { underscored: true, tableName: 'bsd_call_assignments', classMethods: { associate: (models) => { BSDCallAssignment.belongsTo(models.BSDSurvey, {fore...
Change DataIndex to restrict on published and archived flags only In addition, the warnings of the deprecated settings have been removed. Fix #290 Signed-off-by: Byron Ruth <e9d71f5ee7c92d6dc9e92ffdad17b8bd49418f98@devel.io>
from haystack import indexes from avocado.models import DataConcept, DataField class DataIndex(indexes.SearchIndex): text = indexes.CharField(document=True, use_template=True) text_auto = indexes.EdgeNgramField(use_template=True) def index_queryset(self, using=None): return self.get_model().objec...
import warnings from haystack import indexes from avocado.conf import settings from avocado.models import DataConcept, DataField # Warn if either of the settings are set to false if not getattr(settings, 'CONCEPT_SEARCH_ENABLED', True) or \ not getattr(settings, 'FIELD_SEARCH_ENABLED', True): warnings.warn...
Add missing UnexpectedResponseFormat for backward compatability Signed-off-by: Abhijeet Kasurde <6334fd0c217b1f2a15926284df229acde5b4fc3a@redhat.com>
# -*- coding: utf-8 -*- class PysnowException(Exception): pass class InvalidUsage(PysnowException): pass class UnexpectedResponseFormat(PysnowException): pass class ResponseError(PysnowException): message = "<empty>" detail = "<empty>" def __init__(self, error): if "message" in ...
# -*- coding: utf-8 -*- class PysnowException(Exception): pass class InvalidUsage(PysnowException): pass class ResponseError(PysnowException): message = "<empty>" detail = "<empty>" def __init__(self, error): if "message" in error: self.message = error["message"] or self.m...
Change interval: 10 -> 20
from __future__ import print_function from apscheduler.schedulers.blocking import BlockingScheduler import logging import subprocess logging.basicConfig() job_defaults = { 'coalesce': False, 'max_instances': 2 } scheduler = BlockingScheduler(job_defaults=job_defaults) @scheduler.scheduled_job('interval', min...
from __future__ import print_function from apscheduler.schedulers.blocking import BlockingScheduler import logging import subprocess logging.basicConfig() job_defaults = { 'coalesce': False, 'max_instances': 2 } scheduler = BlockingScheduler(job_defaults=job_defaults) @scheduler.scheduled_job('interval', min...
Allow falsey but not null and undefined values to come through
/* * Copyright 2018, Emanuel Rabina (http://www.ultraq.net.nz/) * * 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...
/* * Copyright 2018, Emanuel Rabina (http://www.ultraq.net.nz/) * * 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...
Add isConfidential function to client entity trait
<?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 */ ...
Increase storage prefix in order to clear old data
import React from 'react'; import { render } from 'react-dom'; import { createStore, applyMiddleware, compose } from 'redux'; import { Provider } from 'react-redux'; import { browserHistory } from 'react-router'; import { syncHistoryWithStore, routerMiddleware } from 'react-router-redux'; import { persistStore, autoReh...
import React from 'react'; import { render } from 'react-dom'; import { createStore, applyMiddleware, compose } from 'redux'; import { Provider } from 'react-redux'; import { browserHistory } from 'react-router'; import { syncHistoryWithStore, routerMiddleware } from 'react-router-redux'; import { persistStore, autoReh...
Add Setting model creation test
from django.test import TestCase from .models import Author, Publisher, Edition, Setting, Adventure class AuthorTests(TestCase): def test_create_author(self): gygax = Author.objects.create(name='Gary Gygax') self.assertEqual(Author.objects.first(), gygax) self.assertEqual(Author.objects.co...
from django.test import TestCase from .models import Author, Publisher, Edition, Setting, Adventure class AuthorTests(TestCase): def test_create_author(self): gygax = Author.objects.create(name='Gary Gygax') self.assertEqual(Author.objects.first(), gygax) self.assertEqual(Author.objects.co...
Remove declare strict to be consistent with rest of code base
<?php /* * This file is part of the php-code-coverage package. * * (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 SebastianBergmann\CodeCoverage\Report\Xml; use TheSeer\Tok...
<?php declare(strict_types = 1); /* * This file is part of the php-code-coverage package. * * (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 SebastianBergmann\CodeCoverage\R...
[FIX] Use var instead of let for variable declaration ES2015 will probably not be available on the Raspberry Pi.
Template.dashboard.onCreated( () => { Template.instance().subscribe( 'train' ); }); Template.dashboard.helpers({ getTargetspeed: function() { var query = Train.findOne({ targetspeed: {$ne: "" } }, { fields: {'targetspeed': 1 }} ); if(query) { return query.targetspeed; } else { return 0; } }, ...
Template.dashboard.onCreated( () => { Template.instance().subscribe( 'train' ); }); Template.dashboard.helpers({ getTargetspeed: function() { let query = Train.findOne({ targetspeed: {$ne: "" } }, { fields: {'targetspeed': 1 }} ); if(query) { return query.targetspeed; } else { return 0; } }, ...
Add detailed routes for Rooms
//= require "lib/moment.min" //= require "lib/jquery-2.0.3" //= require "lib/handlebars-v1.1.2" //= require "lib/ember" //= require "lib/ember-data" //= require_self //= require "models" //= require "views" //= require "helpers" //= require "./routes/authenticated_route" //= require_tree "./controllers" //= require_tre...
//= require "lib/moment.min" //= require "lib/jquery-2.0.3" //= require "lib/handlebars-v1.1.2" //= require "lib/ember" //= require "lib/ember-data" //= require_self //= require "models" //= require "views" //= require "helpers" //= require "./routes/authenticated_route" //= require_tree "./controllers" //= require_tre...
:wrench: Fix export in right place
import Arrow from './arrow' import Atm from './atm' import Attributes from './attributes' import Bag from './bag' import Bubbles from './bubbles' import Cart from './cart' import Checkmark from './checkmark' import Error from './error' import Headset from './headset' import Magnifier from './magnifier' import Magnifier...
import Arrow from './arrow' import Atm from './atm' import Attributes from './attributes' import Bag from './bag' import Bubbles from './bubbles' import Cart from './cart' import Checkmark from './checkmark' import Error from './error' import Headset from './headset' import Magnifier from './magnifier' import Magnifier...
Make $METEOR_NPM_REBUILD_FLAGS override default flags.
// Command-line arguments passed to npm when rebuilding binary packages. var args = [ "rebuild", // The --no-bin-links flag tells npm not to create symlinks in the // node_modules/.bin/ directory when rebuilding packages, which helps // avoid problems like https://github.com/meteor/meteor/issues/7401. "--no-...
// Command-line arguments passed to npm when rebuilding binary packages. var args = [ "rebuild", // The --no-bin-links flag tells npm not to create symlinks in the // node_modules/.bin/ directory when rebuilding packages, which helps // avoid problems like https://github.com/meteor/meteor/issues/7401. "--no-...
Include the new note order template
<?php include 'templates/header.php'; ?> <div class="col-sm-12 row"> <div class="col-sm-12"> <h2> User Options </h2> <p> <form action="includes/logout.php"> <button class="btn btn-default pull-right"> Logout </button> </form> </p> <p> Modify your options to your preferences....
<?php include 'templates/header.php'; ?> <div class="col-sm-12 row"> <div class="col-sm-12"> <h2> User Options </h2> <p> <form action="includes/logout.php"> <button class="btn btn-default pull-right"> Logout </button> </form> </p> <p> Modify your options to your preferences....
Update to work on full view
// ==UserScript== // @name FA Cleanup // @author Erra Boothale <erra@boothale.net> // @namespace http://boothale.net/ // @description Fixes various annoyances with FA's user interface // @include http://www.furaffinity.net/view/* // @include https://www.furaffinity.net/view/* // @include http:...
// ==UserScript== // @name FA Cleanup // @author Erra Boothale <erra@boothale.net> // @namespace http://boothale.net/ // @description Fixes various annoyances with FA's user interface // @include http://www.furaffinity.net/view/* // @include https://www.furaffinity.net/view/* // ==/UserScript== v...
Switch user type check to acl
<?php /** * Outputs the admin toolbar if the user is an admin, * otherwise simply loads jQuery for other scripts that * may rely on it. */ if ($appconf['Scripts']['jquery_source'] === 'local') { $page->add_script ('/js/jquery-1.8.3.min.js'); } elseif ($appconf['Scripts']['jquery_source'] === 'google') { $page->...
<?php /** * Outputs the admin toolbar if the user is an admin, * otherwise simply loads jQuery for other scripts that * may rely on it. */ if ($appconf['Scripts']['jquery_source'] === 'local') { $page->add_script ('/js/jquery-1.8.3.min.js'); } elseif ($appconf['Scripts']['jquery_source'] === 'google') { $page->...
Use pathlib to read ext.conf
import pathlib import pkg_resources from mopidy import config, ext __version__ = pkg_resources.get_distribution("Mopidy-NAD").version class Extension(ext.Extension): dist_name = "Mopidy-NAD" ext_name = "nad" version = __version__ def get_default_config(self): return config.read(pathlib.Pat...
import os import pkg_resources from mopidy import config, ext __version__ = pkg_resources.get_distribution("Mopidy-NAD").version class Extension(ext.Extension): dist_name = "Mopidy-NAD" ext_name = "nad" version = __version__ def get_default_config(self): conf_file = os.path.join(os.path.di...
Add JDK 1.8 version support Signed-off-by: Pekka Enberg <add4fcd06328a394f0ad91feda7ee057316dc5ed@iki.fi>
/** * Copyright 2012 Douglas Campos <qmx@qmx.me> * * 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 applicabl...
/** * Copyright 2012 Douglas Campos <qmx@qmx.me> * * 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 applicabl...
Remove an argument of Productor.FindProduct
package main type Productor struct { items [][]string indexes []int ch chan []int } func NewProductor(items [][]string, ch chan []int) *Productor { return &Productor{ items: items, indexes: make([]int, len(items)), ch: ch, } } func (p *Productor) findProduct(index_i int) { if index_i == len...
package main type Productor struct { items [][]string indexes []int ch chan []int } func NewProductor(items [][]string, ch chan []int) *Productor { return &Productor{ items: items, indexes: make([]int, len(items)), ch: ch, } } func (p *Productor) FindProduct(index_i int) { if index_i == len...
Add hashCode and equals methods.
package ca.corefacility.bioinformatics.irida.model; import java.util.Date; import java.util.Objects; import java.util.UUID; import javax.persistence.*; import javax.validation.constraints.NotNull; /** * A password reset object. * * @author Josh Adam <josh.adam@phac-aspc.gc.ca> */ @Entity @Table(name = "password...
package ca.corefacility.bioinformatics.irida.model; import java.util.Date; import java.util.UUID; import javax.persistence.*; import javax.validation.constraints.NotNull; /** * A password reset object. * * @author Josh Adam <josh.adam@phac-aspc.gc.ca> */ @Entity @Table(name = "password_reset") public class Pass...
Allow instantiating a Metadata Factory if one is not passed in the constructor to simplify instantiating the metadata registry
<?php namespace Tystr\RestOrm\Metadata; /** * @author Tyler Stroud <tyler@tylerstroud.com> */ class Registry { /** * @var array */ private $metadata = []; /** * @param Factory $factory */ public function __construct(Factory $factory = null) { $this->factory = $factor...
<?php namespace Tystr\RestOrm\Metadata; /** * @author Tyler Stroud <tyler@tylerstroud.com> */ class Registry { /** * @var array */ private $metadata = []; /** * @param Factory $factory */ public function __construct(Factory $factory) { $this->factory = $factory; ...
Upgrade release number to 0.6.0 (oq-engine 1.3.0)
# coding=utf-8 # Copyright (c) 2010-2014, GEM Foundation. # # OpenQuake Risklib is free software: you can redistribute it and/or # modify it under the terms of the GNU Affero General Public License # as published by the Free Software Foundation, either version 3 of # the License, or (at your option) any later version. ...
# coding=utf-8 # Copyright (c) 2010-2014, GEM Foundation. # # OpenQuake Risklib is free software: you can redistribute it and/or # modify it under the terms of the GNU Affero General Public License # as published by the Free Software Foundation, either version 3 of # the License, or (at your option) any later version. ...
Include tiddlywebplugins.utils as a dependency
AUTHOR = 'Chris Dent' AUTHOR_EMAIL = 'cdent@peermore.com' MAINTAINER = 'Ben Paddock' MAINTAINER_EMAIL = 'pads@thisispads.me.uk' NAME = 'tiddlywebplugins.jsondispatcher' DESCRIPTION = 'A TiddlyWeb plugin to allow the dispatching of tiddlers to non-Python handlers by serialising tiddler data to JSON' VERSION = '0.1.0' ...
AUTHOR = 'Chris Dent' AUTHOR_EMAIL = 'cdent@peermore.com' MAINTAINER = 'Ben Paddock' MAINTAINER_EMAIL = 'pads@thisispads.me.uk' NAME = 'tiddlywebplugins.jsondispatcher' DESCRIPTION = 'A TiddlyWeb plugin to allow the dispatching of tiddlers to non-Python handlers by serialising tiddler data to JSON' VERSION = '0.1.0' ...
Add `computationInputs` property to `Project` model.
'use strict'; const PouchDocument = require('./pouch-document'); const joi = require('joi'); /** * @class Project * @extends PouchDocument * @constructor * @property {string} name * @property {string=} consortiumId * @property {(File[])=} files * @property {string=} metaFile Full path to the project's metadata...
'use strict'; const PouchDocument = require('./pouch-document'); const joi = require('joi'); /** * @class Project * @extends PouchDocument * @constructor * @property {string} name * @property {string=} consortiumId * @property {(File[])=} files * @property {string=} metaFile Full path to the project's metadata...
Add viewbox, fill, and fill-rule in draw command
var express = require('express'); var gm = require('gm'); var hashblot = require('hashblot'); function encode(str) { return encodeURIComponent(str).replace(/%20/g,'+')} function decode(str) { return decodeURIComponent(str.replace(/\+/g,' '))} module.exports = function appctor(opts) { var gmopts = opts.gm || {};...
var express = require('express'); var gm = require('gm'); var hashblot = require('hashblot'); function encode(str) { return encodeURIComponent(str).replace(/%20/g,'+')} function decode(str) { return decodeURIComponent(str.replace(/\+/g,' '))} module.exports = function appctor(opts) { var gmopts = opts.gm || {};...
Change log level to info
angular.module('app.task') .controller('TaskListContentController', TaskListContentController); /*@ngInject*/ function TaskListContentController($state, taskService) { var vm = this; vm.tasks = undefined; vm.edit = edit; activate(); function activate() { return getTasks().then(functio...
angular.module('app.task') .controller('TaskListContentController', TaskListContentController); /*@ngInject*/ function TaskListContentController($state, taskService) { var vm = this; vm.tasks = undefined; vm.edit = edit; activate(); function activate() { return getTasks().then(functio...
Include confirmation key in context object. This way our templates can reference the confirmation key later. (imported from commit 4d57e1309386f2236829b6fdf4e4ad43c5b125c8)
# -*- coding: utf-8 -*- # Copyright: (c) 2008, Jarek Zgoda <jarek.zgoda@gmail.com> __revision__ = '$Id: views.py 21 2008-12-05 09:21:03Z jarek.zgoda $' from django.shortcuts import render_to_response from django.template import RequestContext from django.conf import settings from confirmation.models import Confirm...
# -*- coding: utf-8 -*- # Copyright: (c) 2008, Jarek Zgoda <jarek.zgoda@gmail.com> __revision__ = '$Id: views.py 21 2008-12-05 09:21:03Z jarek.zgoda $' from django.shortcuts import render_to_response from django.template import RequestContext from django.conf import settings from confirmation.models import Confirm...
Add a cached ballot fetcher to the DevsDC helper If we happen to run out of RAM in Lambda (we won't), Lambda will just kill the function and invoke a new one next time.
import requests from django.conf import settings class DevsDCAPIHelper: def __init__(self): self.AUTH_TOKEN = settings.DEVS_DC_AUTH_TOKEN self.base_url = "https://developers.democracyclub.org.uk/api/v1" self.ballot_cache = {} def make_request(self, endpoint, **params): defaul...
import requests from django.conf import settings class DevsDCAPIHelper: def __init__(self): self.AUTH_TOKEN = settings.DEVS_DC_AUTH_TOKEN self.base_url = "https://developers.democracyclub.org.uk/api/v1" def make_request(self, endpoint, **params): default_params = { "auth_...
Include typeof check in JSONP callback response. This is more robust, and helps against attacks such as Rosetta Flash: https://miki.it/blog/2014/7/8/abusing-jsonp-with-rosetta-flash/
import re from .view_error import * class JSONPMiddleware(object): def process_response(self, request, response): # If the response is a redirect, the callback will be dealt # on the next request: if response.status_code == 302: return response else: cb = re...
import re from .view_error import * class JSONPMiddleware(object): def process_response(self, request, response): # If the response is a redirect, the callback will be dealt # on the next request: if response.status_code == 302: return response else: if requ...
Use a better regex to avoid transforming all modules
module.exports = { roots: ['<rootDir>/src/', '<rootDir>/test/'], transform: { '^.+\\.tsx?$': 'ts-jest', '\\.m?jsx?$': 'jest-esm-transformer', }, testMatch: ['**/unit/**/*-test.ts{,x}'], moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx', 'json', 'node'], setupFiles: ['<rootDir>/test/globals.ts', '<root...
module.exports = { roots: ['<rootDir>/src/', '<rootDir>/test/'], transform: { '^.+\\.tsx?$': 'ts-jest', '\\.m?jsx?$': 'jest-esm-transformer', }, testMatch: ['**/unit/**/*-test.ts{,x}'], moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx', 'json', 'node'], setupFiles: ['<rootDir>/test/globals.ts', '<root...
Fix linking new device to user.
<?php namespace App\Models; use Illuminate\Database\Eloquent\Model; class Device extends Model { static $rules = [ 'template_id' => 'required|integer', 'udid' => 'required|regex:/^[a-z0-9]{16}$/', 'name' => 'required|max:255' ]; protected $fillable = ['user_id', 'template_id', 'udid', 'name']; public $time...
<?php namespace App\Models; use Illuminate\Database\Eloquent\Model; class Device extends Model { static $rules = [ 'template_id' => 'required|integer', 'udid' => 'required|regex:/^[a-z0-9]{16}$/', 'name' => 'required|max:255' ]; protected $fillable = ['user_id', 'template_id', 'udid', 'name']; public $time...
Remove name field. It already exists
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ ('wagtailimages', '0013_make_rendition_upload_callable'), ('catalogue', '0010_auto_20160616_1048'), ...
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ ('wagtailimages', '0013_make_rendition_upload_callable'), ('catalogue', '0010_auto_20160616_1048'), ...
Print one name at a time.
from __future__ import unicode_literals, print_function import sqlite3, os, random _select_random = 'select {0} from {1} limit 1 offset abs(random()) % (select count({0}) from {1});' _select_uncommon = 'select value from uncommons where key=?;' def generate_name(): conn = sqlite3.connect(os.path.join(os.path.dirn...
from __future__ import unicode_literals, print_function import sqlite3, os, random _select_random = 'select {0} from {1} limit 1 offset abs(random()) % (select count({0}) from {1});' _select_uncommon = 'select value from uncommons where key=?;' def generate_name(): conn = sqlite3.connect(os.path.join(os.path.dirn...
Use https for git dependency
# This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0/. from setuptools import setup setup( name="atsy", version="0.0.1", description="AreTheySlimYet", long_de...
# This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0/. from setuptools import setup setup( name="atsy", version="0.0.1", description="AreTheySlimYet", long_de...
Add test for MotorAsyncIOReference await support
from umongo import Document from umongo.dal.motor_asyncio import MotorAsyncIOReference # Await syntax related tests are stored in a separate file in order to # catch a SyntaxError when Python doesn't support it async def test_await_syntax(db): class Doc(Document): class Meta: collection = db....
from umongo import Document # Await syntax related tests are stored in a separate file in order to # catch a SyntaxError when Python doesn't support it async def test_await_syntax(db): class Doc(Document): class Meta: collection = db.doc async def test_cursor(cursor): await curso...
Use a smaller set of users in fake game two gameplay
import random from django.core.management.base import BaseCommand from django.contrib.auth.models import User from ...models import ( Transcript, TranscriptPhraseVote ) from ...tasks import update_transcript_stats class Command(BaseCommand): help = 'Creates random votes for 5 phrases in a random transcript'...
import random from django.core.management.base import BaseCommand from django.contrib.auth.models import User from ...models import ( Transcript, TranscriptPhraseVote ) from ...tasks import update_transcript_stats class Command(BaseCommand): help = 'Creates random votes for 5 phrases in a random transcript'...
Enable disk cache for PhJS
# Copyright (C) Ivan Kravets <me@ikravets.com> # See LICENSE for details. from subprocess import check_output from urllib import unquote def application(env, start_response): status = "200 OK" response = "" qs = env.get("QUERY_STRING", None) if not qs or not qs.startswith("_escaped_fragment_="): ...
# Copyright (C) Ivan Kravets <me@ikravets.com> # See LICENSE for details. from subprocess import check_output from urllib import unquote def application(env, start_response): status = "200 OK" response = "" qs = env.get("QUERY_STRING", None) if not qs or not qs.startswith("_escaped_fragment_="): ...
Remove holder item as not used anymore
package flickr.demo.qvdev.com.flickrdemo; import android.support.v7.widget.RecyclerView; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import java.util.List; import flickr.demo.qvdev.com.flickrdemo.dummy.DummyContent; class FlickrItemRecyclerViewAdapter extends...
package flickr.demo.qvdev.com.flickrdemo; import android.support.v7.widget.RecyclerView; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import java.util.List; import flickr.demo.qvdev.com.flickrdemo.dummy.DummyContent; class FlickrItemRecyclerViewAdapter extends...
Add a todo comment for forms test case
package com.ushahidi.android.data.api.model; import com.ushahidi.android.BuildConfig; import com.ushahidi.android.data.api.BaseApiTestCase; import org.junit.Before; import org.junit.Test; import org.junit.runner.RunWith; import org.robolectric.RobolectricGradleTestRunner; import org.robolectric.annotation.Config; im...
package com.ushahidi.android.data.api.model; import com.ushahidi.android.BuildConfig; import com.ushahidi.android.data.api.BaseApiTestCase; import org.junit.Before; import org.junit.Test; import org.junit.runner.RunWith; import org.robolectric.RobolectricGradleTestRunner; import org.robolectric.annotation.Config; im...
Stop pylint complaining about bare-except
""" plumbium.environment ==================== Module containing the get_environment function. """ import os try: import pip except ImportError: pass import socket def get_environment(): """Obtain information about the executing environment. Captures: * installed Python packages using pip (i...
""" plumbium.environment ==================== Module containing the get_environment function. """ import os try: import pip except ImportError: pass import socket def get_environment(): """Obtain information about the executing environment. Captures: * installed Python packages using pip (i...
Fix "element.getAttribute is not a function" Selenium errors when filling in fields The root cause was the locator strategy was naively returning an element that was not a form field, causing Selenium's internals to blow up
// Credit to: http://simonwillison.net/2006/Jan/20/escape/ RegExp.escape = function(text) { if (!arguments.callee.sRE) { var specials = [ '/', '.', '*', '+', '?', '|', '(', ')', '[', ']', '{', '}', '\\' ]; arguments.callee.sRE = new RegExp( '(\\' + specials.join('|\\') + ')', 'g' ); ...
RegExp.escape = function(text) { if (!arguments.callee.sRE) { var specials = [ '/', '.', '*', '+', '?', '|', '(', ')', '[', ']', '{', '}', '\\' ]; arguments.callee.sRE = new RegExp( '(\\' + specials.join('|\\') + ')', 'g' ); } return text.replace(arguments.callee.sRE, '\\$1'); } ...
Load package version from flake8_coding.py
# -*- coding: utf-8 -*- from setuptools import setup from flake8_coding import __version__ setup( name='flake8-coding', version=__version__, description='Adds coding magic comment checks to flake8', long_description=open("README.rst").read(), classifiers=[ 'Development Status :: 3 - Alpha...
# -*- coding: utf-8 -*- from setuptools import setup setup( name='flake8-coding', version='0.1.0', description='Adds coding magic comment checks to flake8', long_description=open("README.rst").read(), classifiers=[ 'Development Status :: 3 - Alpha', 'Programming Language :: Python...
Correct variables, and have it add to number given in get request.
<html> <head> <title>Number Counter</title> </head> <body> <?php $date = $_GET['date']; if (!isset($num)) die("Give me a number boo"); if ($num < 0) die ("Yo, digits are not valid, bro..."); $num = $numend; echo "<h2>Counting towards ".$date.":"."</h2>"; for ($num=$numend; $numend>=0; $numend++) ...
<html> <head> <title>Number Counter</title> </head> <body> <?php $date = $_GET['date']; if (!isset($date)) die("Give me a number boo"); if ($date < 0) die ("Yo, digits are not valid, bro..."); $date = $numend; $numstart=0; echo "<h2>Counting towards ".$date.":"."</h2>"; for ($date>=$numstart; $date=...
Change pin LED is connected to.
from apiclient import errors import threading import time import RPi.GPIO as GPIO import GmailAuthorization PIN = 35 CHECK_INTERVAL = 30 service = None unread_count = 0 def refresh(): global unread_count try: messages = service.users().messages().list(userId='me', q='is:inbox + is:unread').execute()...
from apiclient import errors import threading import time import RPi.GPIO as GPIO import GmailAuthorization PIN = 22 CHECK_INTERVAL = 30 service = None unread_count = 0 def refresh(): global unread_count try: messages = service.users().messages().list(userId='me', q='is:inbox + is:unread').execute()...
Add docstrings for sigproc benchmarks
""" Test the sigproc read function """ from timeit import default_timer as timer import bifrost as bf from bifrost import pipeline as bfp from bifrost import blocks as blocks from bifrost_benchmarks import PipelineBenchmarker class SigprocBenchmarker(PipelineBenchmarker): """ Test the sigproc read function """ ...
from timeit import default_timer as timer import bifrost as bf from bifrost import pipeline as bfp from bifrost import blocks as blocks from bifrost_benchmarks import PipelineBenchmarker class SigprocBenchmarker(PipelineBenchmarker): def run_benchmark(self): with bf.Pipeline() as pipeline: fil_...
Fix autoformat issue on new file
/*global atom*/ module.exports = { formatter: function () { if (!this.standardFormat) { this.standardFormat = require('standard-format') } return this.standardFormat }, activate: function () { this.commands = atom.commands.add('atom-workspace', 'standard-formatter:format', this.format.bind(...
/*global atom*/ module.exports = { formatter: function () { if (!this.standardFormat) { this.standardFormat = require('standard-format') } return this.standardFormat }, activate: function () { this.commands = atom.commands.add('atom-workspace', 'standard-formatter:format', this.format.bind(...
Fix for environments without process var
var parser = require('js-yaml') var optionalByteOrderMark = '\\ufeff?' var platform = typeof process !== 'undefined' ? process.platform : '' var pattern = '^(' + optionalByteOrderMark + '(= yaml =|---)' + '$([\\s\\S]*?)' + '^(?:\\2|\\.\\.\\.)\\s*' + '$' + (platform === 'win32' ? '\\r?' : '') + '(?:\\n)?)'...
var parser = require('js-yaml') var optionalByteOrderMark = '\\ufeff?' var pattern = '^(' + optionalByteOrderMark + '(= yaml =|---)' + '$([\\s\\S]*?)' + '^(?:\\2|\\.\\.\\.)\\s*' + '$' + (process.platform === 'win32' ? '\\r?' : '') + '(?:\\n)?)' // NOTE: If this pattern uses the 'g' flag the `regex` variab...
Update repository endpoint location for BI server
/** * Repository query */ var SavedQuery = Backbone.Model.extend({ parse: function(response, XHR) { this.xml = response.xml; }, url: function() { var segment = Settings.BIPLUGIN ? "/pentahorepository/" : "/repository/"; return encodeURI(Saiku.session.username ...
/** * Repository query */ var SavedQuery = Backbone.Model.extend({ parse: function(response, XHR) { this.xml = response.xml; }, url: function() { return encodeURI(Saiku.session.username + "/repository/" + this.get('name')); }, move_query_to_workspace: function(model, resp...
Add an implicit wait of 1 second
import os import pytest from pyvirtualdisplay import Display from selenium.webdriver import Chrome from selenium.webdriver.chrome.options import Options REPORTS_DIR = "reports" @pytest.fixture(scope='function') def webdriver(request): display = Display(visible=0, size=(800, 600), use_xauth=True) display.sta...
import os import pytest from pyvirtualdisplay import Display from selenium.webdriver import Chrome from selenium.webdriver.chrome.options import Options REPORTS_DIR = "reports" @pytest.fixture(scope='function') def webdriver(request): display = Display(visible=0, size=(800, 600), use_xauth=True) display.sta...
Fix for enzyme and react 15
"use strict"; /** * Webpack frontend test configuration. */ var path = require("path"); var prodCfg = require("./webpack.config"); // Replace with `__dirname` if using in project root. var ROOT = process.cwd(); var _ = require("lodash"); // devDependency module.exports = { cache: true, context: path.join(ROOT, ...
"use strict"; /** * Webpack frontend test configuration. */ var path = require("path"); var prodCfg = require("./webpack.config"); // Replace with `__dirname` if using in project root. var ROOT = process.cwd(); var _ = require("lodash"); // devDependency module.exports = { cache: true, context: path.join(ROOT, ...
Upgrade menu widget to use yiistrap
<?php Yii::import('bootstrap.widgets.TbNav'); class MlLanguageMenu extends TbNav { /** * Initializes the widget. */ public function init() { $languages = Yii::app()->getLanguages(); $activeLocale = Yii::app()->language; $items = array(array('label'=>'Language')); foreach ($languages as $locale => $la...
<?php Yii::import('bootstrap.widgets.TbMenu'); class MlLanguageMenu extends TbMenu { /** * Initializes the widget. */ public function init() { $languages = Yii::app()->getLanguages(); $activeLocale = Yii::app()->language; $items = array(array('label'=>'Language')); foreach ($languages as $locale => $...
Add support for css Keyframes properties
<?php namespace Neilime\AssetsBundle\Service\Filter; class CssFilter implements \Neilime\AssetsBundle\Service\Filter\FilterInterface{ /** * @param string $sContent * @see \Neilime\AssetsBundle\Service\Filter\FilterInterface::run() * @throws \Exception * @return string */ public function run($sContent){ i...
<?php namespace Neilime\AssetsBundle\Service\Filter; class CssFilter implements \Neilime\AssetsBundle\Service\Filter\FilterInterface{ /** * @param string $sContent * @see \Neilime\AssetsBundle\Service\Filter\FilterInterface::run() * @throws \Exception * @return string */ public function run($sContent){ ...
Fix test failures after method renames
import unittest import re import importlib import importlib_metadata class BasicTests(unittest.TestCase): version_pattern = r'\d+\.\d+(\.\d)?' def test_retrieves_version_of_self(self): dist = importlib_metadata.Distribution.from_module(importlib_metadata) assert isinstance(dist.version, str)...
import unittest import re import importlib import importlib_metadata class BasicTests(unittest.TestCase): version_pattern = r'\d+\.\d+(\.\d)?' def test_retrieves_version_of_self(self): dist = importlib_metadata.Distribution.for_module(importlib_metadata) assert isinstance(dist.version, str) ...
Add different prefixes for the experiments
#!/usr/bin/env python template = """#!/bin/bash #PBS -l walltime=72:00:00 #PBS -l nodes=1:ppn=1 cd /RQusagers/vanmerb/rnnencdec export PYTHONPATH=/RQusagers/vanmerb/rnnencdec/groundhog-private/:$PYTHONPATH python /RQusagers/vanmerb/rnnencdec/groundhog-private/scripts/RNN_Enc_Dec_Phrase.py \"{options}\" >{log} 2>&1"...
#!/usr/bin/env python template = """#!/bin/bash #PBS -l walltime=72:00:00 #PBS -l nodes=1:ppn=1 cd /RQusagers/vanmerb/rnnencdec export PYTHONPATH=/RQusagers/vanmerb/rnnencdec/groundhog-private/:$PYTHONPATH python /RQusagers/vanmerb/rnnencdec/groundhog-private/scripts/RNN_Enc_Dec_Phrase.py \"{options}\" >{log} 2>&1"...
Make Pholio description behave as a remarkup field (e.g., subscribe mentioned users) Summary: Ref T12732. This is pre-existing but fix it since I caught it while banging around. Test Plan: {F4967442} Reviewers: chad, amckinley Reviewed By: chad Maniphest Tasks: T12732 Differential Revision: https://secure.phabric...
<?php final class PholioMockDescriptionTransaction extends PholioMockTransactionType { const TRANSACTIONTYPE = 'description'; public function generateOldValue($object) { return $object->getDescription(); } public function applyInternalEffects($object, $value) { $object->setDescription($value); }...
<?php final class PholioMockDescriptionTransaction extends PholioMockTransactionType { const TRANSACTIONTYPE = 'description'; public function generateOldValue($object) { return $object->getDescription(); } public function applyInternalEffects($object, $value) { $object->setDescription($value); }...
Migrate away from componentWillMount in declarative bootstrap container
/* eslint-disable no-underscore-dangle */ import PropTypes from 'prop-types'; import { Component } from 'react'; import bootstrap from 'bootstrap'; /** * Component that declaratively wraps logic for idempotently bootstrapping the library. Client code * can be contained within the children of this component at the h...
/* eslint-disable no-underscore-dangle */ import PropTypes from 'prop-types'; import { Component } from 'react'; import bootstrap from 'bootstrap'; /** * Component that declaratively wraps logic for idempotently bootstrapping the library. Client code * can be contained within the children of this component at the h...
Correct input type for password in Login
import React, { Component } from 'react' import { Field, reduxForm } from 'redux-form' class LoginForm extends Component { render() { return ( <form onSubmit={this.props.handleSubmit}> <div> <label htmlFor="email">Email: </label> <Field name="email" component="input" type="text"...
import React, { Component } from 'react' import { Field, reduxForm } from 'redux-form' class LoginForm extends Component { render() { return ( <form onSubmit={this.props.handleSubmit}> <div> <label htmlFor="email">Email: </label> <Field name="email" component="input" type="text"...
Piwik: Mark sidemenu entry as active
# This file is part of Indico. # Copyright (C) 2002 - 2015 European Organization for Nuclear Research (CERN). # # Indico 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 (a...
# This file is part of Indico. # Copyright (C) 2002 - 2015 European Organization for Nuclear Research (CERN). # # Indico 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 (a...
Remove the default tab if there aren't any fields in it
<?php defined('BASEPATH') or exit('No direct script access allowed'); /** * @package PyroCMS * @subpackage Streams Tabs Helper * @author Chris Harvey <chris@chrisnharvey.com> * @license MIT */ /** * Build a tabs array for streams * * @param array $tabs Your associative tab array * @param string $st...
<?php defined('BASEPATH') or exit('No direct script access allowed'); /** * @package PyroCMS * @subpackage Streams Tabs Helper * @author Chris Harvey <chris@chrisnharvey.com> * @license MIT */ /** * Build a tabs array for streams * * @param array $tabs Your associative tab array * @param string $st...
Change click number to user polls
'use strict'; (function () { // var addButton = document.querySelector('.btn-add'); // var deleteButton = document.querySelector('.btn-delete'); var userPolls = document.querySelector('#user-polls'); // var loginButton = document.querySelector('.') var apiUrl = appUrl + '/api/:id/polls'; function u...
'use strict'; (function () { // var addButton = document.querySelector('.btn-add'); // var deleteButton = document.querySelector('.btn-delete'); var clickNbr = document.querySelector('#click-nbr'); // var loginButton = document.querySelector('.') var apiUrl = appUrl + '/api/:id/polls'; function upd...
Fix codemirror include for built version of examples.
yepnope([ { test : (navigator.appVersion.indexOf("MSIE") != -1 && parseFloat(navigator.appVersion.split("MSIE")[1]) < 9), // Load for IE < 9 yep : [ '../flotr2.ie.min.js' ] }, '../flotr2.js', 'lib/codemirror/lib/codemirror.js', 'lib/codemirror/mode/javascript/javascript.js', 'lib/beaut...
yepnope([ { test : (navigator.appVersion.indexOf("MSIE") != -1 && parseFloat(navigator.appVersion.split("MSIE")[1]) < 9), // Load for IE < 9 yep : [ '../flotr2.ie.min.js' ] }, '../flotr2.js', 'lib/google-code-prettify/prettify.js', 'lib/beautify.js', 'lib/randomseed.js', 'lib/jquery-...
Make command block do something
(function(ext) { // Cleanup function when the extension is unloaded ext._shutdown = function() {}; // Status reporting code // Use this to report missing hardware, plugin or unsupported browser ext._getStatus = function() { return {status: 2, msg: 'Ready'}; }; ext.my_first_block = fun...
(function(ext) { // Cleanup function when the extension is unloaded ext._shutdown = function() {}; // Status reporting code // Use this to report missing hardware, plugin or unsupported browser ext._getStatus = function() { return {status: 2, msg: 'Ready'}; }; ext.my_first_block = fun...
Adjust audio button position, size
function AudioButton() { var that = this; this.position = { x: 15.5, y: 0.4 }; if (typeof localStorage.soundActivated === 'undefined') { localStorage.soundActivated = "1"; } this.on = !!localStorage.soundActivated; setTimeout(function() { createjs.Sound.setMute(!that.on); mm.music.vo...
function AudioButton() { var that = this; this.position = { x: 15.5, y: 0.5 }; if (typeof localStorage.soundActivated === 'undefined') { localStorage.soundActivated = "1"; } this.on = !!localStorage.soundActivated; setTimeout(function() { createjs.Sound.setMute(!that.on); mm.music.vo...
Remove unsupported python 3.4 from trove classifiers
from setuptools import find_packages, setup version = '0.1.0' setup( author='Charlie Denton', author_email='charlie@meshy.co.uk', classifiers=[ 'Development Status :: 2 - Pre-Alpha', 'Intended Audience :: Developers', 'License :: OSI Approved :: BSD License', 'Natural Lan...
from setuptools import find_packages, setup version = '0.1.0' setup( author='Charlie Denton', author_email='charlie@meshy.co.uk', classifiers=[ 'Development Status :: 2 - Pre-Alpha', 'Intended Audience :: Developers', 'License :: OSI Approved :: BSD License', 'Natural Lan...
[Client] Use %q to generate quoted values in airtable query
package redirect import ( "fmt" "github.com/fabioberger/airtable-go" ) const ( // DefaultRedirectKey should be fetched if the requested key is not found. DefaultRedirectKey = "default" redirectTableName = "Redirects" ) // Client uses Airtable to implement Redirector. type Client struct { airtableGo *airtable...
package redirect import ( "fmt" "github.com/fabioberger/airtable-go" ) const ( // DefaultRedirectKey should be fetched if the requested key is not found. DefaultRedirectKey = "default" redirectTableName = "Redirects" ) // Client uses Airtable to implement Redirector. type Client struct { airtableGo *airtable...
Use Github's cache, but store for offline access
import Rx from 'rx'; import request from 'axios'; import moment from 'moment'; const INDEX_URL = "http://tldr-pages.github.io/assets/index.json"; let search = (name) => { return getIndex() .filter( cmd => { return cmd.name === name }) .last( { platform: ["client"], name: "not-found" } ); }; let r...
import Rx from 'rx'; import request from 'axios'; import moment from 'moment'; const INDEX_URL = "http://tldr-pages.github.io/assets/index.json"; let search = (name) => { return getIndex() .filter( cmd => { return cmd.name === name }) .last( { platform: ["client"], name: "not-found" } ); }; let r...
Change name to pyqtool (available on PyPI)
from setuptools import setup VERSION = '0.0.1' setup( name='pyqtool', version=VERSION, description="Search Python code with jQuery-like selectors", author="Caio Ariede", author_email="caio.ariede@gmail.com", url="http://github.com/caioariede/pyq", license="MIT", zip_safe=False, p...
from setuptools import setup VERSION = '0.0.1' setup( name='pyq', version=VERSION, description="Search Python code with jQuery-like selectors", author="Caio Ariede", author_email="caio.ariede@gmail.com", url="http://github.com/caioariede/pyq", license="MIT", zip_safe=False, platf...
Fix gulp script (run metascript after clean).
var gulp = require('gulp'); var metascriptPipe = require('gulp-metascript'); var headerPipe = require('gulp-header'); var chmod = require('gulp-chmod'); var clean = require('gulp-clean'); gulp.task('metascript', ['clean'], function () { return gulp.src('Sources/**/*.js') .pipe(metascriptPipe()) .pipe(header...
var gulp = require('gulp'); var metascriptPipe = require('gulp-metascript'); var headerPipe = require('gulp-header'); var chmod = require('gulp-chmod'); var clean = require('gulp-clean'); gulp.task('metascript', function () { return gulp.src('Sources/**/*.js') .pipe(metascriptPipe()) .pipe(headerPipe("/* It...
Use an empty write instead of drain event. Closes gh-5, gh-4.
/* * exit * https://github.com/cowboy/node-exit * * Copyright (c) 2013 "Cowboy" Ben Alman * Licensed under the MIT license. */ 'use strict'; module.exports = function exit(exitCode, streams) { if (!streams) { streams = [process.stdout, process.stderr]; } var drainCount = 0; // Actually exit if all streams...
/* * exit * https://github.com/cowboy/node-exit * * Copyright (c) 2013 "Cowboy" Ben Alman * Licensed under the MIT license. */ 'use strict'; module.exports = function exit(exitCode, streams) { if (!streams) { streams = [process.stdout, process.stderr]; } var drainCount = 0; // Actually exit if all streams...
Remove related model data attribute not included
'use strict'; var _ = require('lodash'); var debug = require('ghost-ignition').debug('format'); var Mapper = require('./vendor/jsonapi-mapper'); var defaultSerializerOptions = {}; var defaultMapperOptions = {enableLinks: true}; module.exports = function format(api, apiReq, apiRes) { if (!apiRes || _.isEmpty(apiRe...
'use strict'; var _ = require('lodash'); var debug = require('ghost-ignition').debug('format'); var Mapper = require('./vendor/jsonapi-mapper'); var defaultSerializerOptions = {}; var defaultMapperOptions = {enableLinks: true}; module.exports = function format(api, apiReq, apiRes) { if (!apiRes || _.isEmpty(apiRe...
Check that command is not null before saving.
/* * Copyright 2015, TeamDev Ltd. All rights reserved. * * Redistribution and use in source and/or binary forms, with or without * modification, must retain the above copyright notice and the following * disclaimer. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRES...
/* * Copyright 2015, TeamDev Ltd. All rights reserved. * * Redistribution and use in source and/or binary forms, with or without * modification, must retain the above copyright notice and the following * disclaimer. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRES...
Check only the files that are staged for commit
<?php namespace GrumPHP\Locator; use Gitonomy\Git\Diff\File; use Gitonomy\Git\Repository; use GrumPHP\Collection\FilesCollection; use SplFileInfo; /** * Class Git * * @package GrumPHP\Locator */ class ChangedFiles implements LocatorInterface { /** * @var Repository */ protected $repository; ...
<?php namespace GrumPHP\Locator; use Gitonomy\Git\Diff\File; use Gitonomy\Git\Repository; use GrumPHP\Collection\FilesCollection; use SplFileInfo; /** * Class Git * * @package GrumPHP\Locator */ class ChangedFiles implements LocatorInterface { /** * @var Repository */ protected $repository; ...
Use new extension setup() API
from __future__ import unicode_literals import os from mopidy import ext, config __version__ = '0.2' class SubsonicExtension(ext.Extension): dist_name = 'Mopidy-Subsonic' ext_name = 'subsonic' version = __version__ def get_default_config(self): conf_file = os.path.join(os.path.dirname(__f...
from __future__ import unicode_literals import os from mopidy import ext, config __version__ = '0.2' class SubsonicExtension(ext.Extension): dist_name = 'Mopidy-Subsonic' ext_name = 'subsonic' version = __version__ def get_default_config(self): conf_file = os.path.join(os.path.dirname(__f...
Add logger to events.persons module
# This file is part of Indico. # Copyright (C) 2002 - 2016 European Organization for Nuclear Research (CERN). # # Indico 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 (a...
# This file is part of Indico. # Copyright (C) 2002 - 2016 European Organization for Nuclear Research (CERN). # # Indico 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 (a...
Remove .only on socket game controller tests
const CONSTANTS = require('../../../data/constants'); const gameController = require('../../../../app/socket/controllers/game'); const knex = require('../../../../app/lib/db'); const chai = require('chai'); const chaiHttp = require('chai-http'); chai.use(chaiHttp); const should = chai.should(); describe('Game Socket ...
const CONSTANTS = require('../../../data/constants'); const gameController = require('../../../../app/socket/controllers/game'); const knex = require('../../../../app/lib/db'); const chai = require('chai'); const chaiHttp = require('chai-http'); chai.use(chaiHttp); const should = chai.should(); describe.only('Game So...
Update failing metadata settings acceptance test.
# disable missing docstring #pylint: disable=C0111 from lettuce import world, step @step('I see the correct settings and default values$') def i_see_the_correct_settings_and_values(step): world.verify_all_setting_entries([['Default Speed', '', False], ['Display Name', 'defau...
# disable missing docstring #pylint: disable=C0111 from lettuce import world, step @step('I see the correct settings and default values$') def i_see_the_correct_settings_and_values(step): world.verify_all_setting_entries([['.75x', '', False], ['1.25x', '', False], ...