text
stringlengths
16
4.96k
positive
stringlengths
321
2.24k
negative
stringlengths
310
2.21k
Improve sidebar a bit - remove long class names from navigation git-svn-id: e2c3038d01fb1e63d9a6e7e9a258c7088cd26e08@1160300 13f79535-47bb-0310-9956-ffa450edef68
package org.apache.karaf.webconsole.core.internal; import org.apache.wicket.Page; import org.apache.wicket.markup.html.basic.Label; import org.apache.wicket.markup.html.link.BookmarkablePageLink; import org.apache.wicket.markup.html.list.ListItem; import org.apache.wicket.markup.html.list.ListView; import org.apache.w...
package org.apache.karaf.webconsole.core.internal; import org.apache.wicket.Page; import org.apache.wicket.markup.html.basic.Label; import org.apache.wicket.markup.html.link.BookmarkablePageLink; import org.apache.wicket.markup.html.list.ListItem; import org.apache.wicket.markup.html.list.ListView; import org.apache.w...
Hide comments meant as unseen
from ckan.plugins import toolkit as tk def archiver_resource_show(resource_id): data_dict = {'id': resource_id} return tk.get_action('archiver_resource_show')(data_dict) def archiver_is_resource_broken_html(resource): archival = resource.get('archiver') if not archival: return tk.literal('<!...
from ckan.plugins import toolkit as tk def archiver_resource_show(resource_id): data_dict = {'id': resource_id} return tk.get_action('archiver_resource_show')(data_dict) def archiver_is_resource_broken_html(resource): archival = resource.get('archiver') if not archival: return '<!-- No archi...
Check if dir exists before calling listdir Changes along the way to how we clean up and detach after copying an image to a volume exposed a problem in the cleanup of the brick/initiator routines. The clean up in the initiator detach was doing a blind listdir of /dev/disk/by-path, however due to detach and cleanup bei...
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2013 OpenStack Foundation. # 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.apac...
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2013 OpenStack Foundation. # 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.apac...
Update "Girls With Slingshots" after feed change
from comics.aggregator.crawler import CrawlerBase, CrawlerImage from comics.core.comic_data import ComicDataBase class ComicData(ComicDataBase): name = "Girls With Slingshots" language = "en" url = "http://www.girlswithslingshots.com/" start_date = "2004-09-30" rights = "Danielle Corsetto" class...
from comics.aggregator.crawler import CrawlerBase, CrawlerImage from comics.core.comic_data import ComicDataBase class ComicData(ComicDataBase): name = "Girls With Slingshots" language = "en" url = "http://www.girlswithslingshots.com/" start_date = "2004-09-30" rights = "Danielle Corsetto" class...
Add backup and restore functions
import sys from corvus.client import Corvus def backup(corvus, filename): total_sectors = corvus.get_drive_capacity(1) with open(filename, "wb") as f: for i in range(total_sectors): data = corvus.read_sector_512(1, i) f.write(''.join([ chr(d) for d in data ])) sys.st...
import sys from corvus.client import Corvus def main(): corvus = Corvus() corvus.init_drive() total_sectors = corvus.get_drive_capacity(1) with open("image.bin", "wb") as f: for i in range(total_sectors): orig_data = corvus.read_sector_512(1, i) corvus.write_sector_512(1...
Handle both possible JSON formats for data bag items. This won't work if there is an actual data bag item key called 'json_class', but that would be silly.
import abc import collections from chef.base import ChefObject, ChefQuery, ChefObjectMeta class DataBagMeta(ChefObjectMeta, abc.ABCMeta): """A metaclass to allow DataBag to use multiple inheritance.""" class DataBag(ChefObject, ChefQuery): __metaclass__ = DataBagMeta url = '/data' def _populate(se...
import abc import collections from chef.base import ChefObject, ChefQuery, ChefObjectMeta class DataBagMeta(ChefObjectMeta, abc.ABCMeta): """A metaclass to allow DataBag to use multiple inheritance.""" class DataBag(ChefObject, ChefQuery): __metaclass__ = DataBagMeta url = '/data' def _popu...
Add first type(array) check method.
// is.js 0.0.1 // Author Aras Atasaygin ;(function() { // Baseline // -------- // root object is window in the browser var root = this; // define is object, current version and configs var is = {}; is.version = '0.0.1'; is.config = {}; // TODO: Add AMD and CommonJS support /...
// is.js 0.0.1 // Author Aras Atasaygin ;(function() { // Baseline // -------- // root object is window in the browser var root = this; // define is object, current version and configs var is = {}; is.version = '0.0.1'; is.config = {}; // TODO: Add AMD and CommonJS support // is object set global to the ...
Store + Shipping + Menus * Using new Store feature from Elcodi * Added Store management in Admin * Changed all definitions that was depending on such implementation * Removed under construction logic and tests * Removed menu fixtures * Defined them as dynamic content. Some of them are generated dinamically, and som...
<?php /* * This file is part of the Elcodi package. * * Copyright (c) 2014-2015 Elcodi.com * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. * * Feel free to edit as you please, and have fun. * * @author Marc Morera <yuhu@mmoreram.c...
<?php /* * This file is part of the Elcodi package. * * Copyright (c) 2014-2015 Elcodi.com * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. * * Feel free to edit as you please, and have fun. * * @author Marc Morera <yuhu@mmoreram.c...
Add test for `play_track` function New tests make sure that `play_track` raises a TrackError when an invalid track is requested.
""" test_itunes.py Copyright © 2015 Alex Danoff. All Rights Reserved. 2015-08-02 This file tests the functionality provided by the itunes module. """ import unittest from datetime import datetime from itunes.itunes import parse_value, run_applescript, play_track from itunes.exceptions import AppleScriptError, Track...
""" test_itunes.py Copyright © 2015 Alex Danoff. All Rights Reserved. 2015-08-02 This file tests the functionality provided by the itunes module. """ import unittest from datetime import datetime from itunes.itunes import parse_value, run_applescript from itunes.exceptions import AppleScriptError class ITunesTests...
Use start of tick so that all processing happens before MC. Fixes #190
package invtweaks.forge; import cpw.mods.fml.client.FMLClientHandler; import cpw.mods.fml.common.eventhandler.SubscribeEvent; import cpw.mods.fml.common.gameevent.TickEvent; import invtweaks.InvTweaks; import net.minecraft.client.Minecraft; public class ForgeClientTick { private InvTweaks instance; public Fo...
package invtweaks.forge; import cpw.mods.fml.client.FMLClientHandler; import cpw.mods.fml.common.eventhandler.SubscribeEvent; import cpw.mods.fml.common.gameevent.TickEvent; import invtweaks.InvTweaks; import net.minecraft.client.Minecraft; public class ForgeClientTick { private InvTweaks instance; public Fo...
Fix 'Number too big' weirdness
# # Sivakumar Kailasam and lowliet # import sublime, sublime_plugin class RepeatMacroCommand(sublime_plugin.TextCommand): def run(self, edit): self.view.window().show_input_panel("Repeat count or [Enter] to run till end of file", "", self.__execute, None, None) def __execute(self, text): if...
# # Sivakumar Kailasam and lowliet # import sublime, sublime_plugin class RepeatMacroCommand(sublime_plugin.TextCommand): def run(self, edit): self.view.window().show_input_panel("Repeat count or [Enter] to run till end of file", "", self.__execute, None, None) def __execute(self, text): if...
Disable block dropping for destroyBlock().
package de.craften.plugins.educraft.luaapi.functions; import de.craften.plugins.educraft.environment.LivingArmorStandBehavior; import de.craften.plugins.educraft.luaapi.EduCraftApiFunction; import org.bukkit.Material; import org.bukkit.inventory.ItemStack; import org.luaj.vm2.LuaValue; import org.luaj.vm2.Varargs; /*...
package de.craften.plugins.educraft.luaapi.functions; import de.craften.plugins.educraft.environment.LivingArmorStandBehavior; import de.craften.plugins.educraft.luaapi.EduCraftApiFunction; import org.bukkit.Material; import org.bukkit.inventory.ItemStack; import org.luaj.vm2.LuaValue; import org.luaj.vm2.Varargs; /*...
Add form classes for User and UserProfile
from django import forms from django.contrib.auth.models import User from rango.models import Category, Page, UserProfile class CategoryForm(forms.ModelForm): name = forms.CharField(max_length=128, help_text="Please enter a category name") views = forms.IntegerField(widget=forms.HiddenInput(), initial = 0) likes...
from django import forms from rango.models import Category, Page class CategoryForm(forms.ModelForm): name = forms.CharField(max_length=128, help_text="Please enter a category name") views = forms.IntegerField(widget=forms.HiddenInput(), initial = 0) likes = forms.IntegerField(widget=forms.HiddenInput(), initial...
Change class definitions from old style to new style
# encoding: utf-8 """ .. codeauthor:: Tsuyoshi Hombashi <tsuyoshi.hombashi@gmail.com> """ from __future__ import unicode_literals from ipaddress import ip_address import itertools import pytest import six from typepy import ( Typecode, StrictLevel, ) from typepy.type import IpAddress nan = float("nan") i...
# encoding: utf-8 """ .. codeauthor:: Tsuyoshi Hombashi <tsuyoshi.hombashi@gmail.com> """ from __future__ import unicode_literals from ipaddress import ip_address import itertools import pytest import six from typepy import ( Typecode, StrictLevel, ) from typepy.type import IpAddress nan = float("nan") i...
Load actions from correct path
import { connect } from 'react-redux' import { addTableRow, editTableRow, saveTableRow } from '../actions/actions' import InventoryTable from '../Components/InventoryTable' const getMaltInventory = (tableRows) => { return tableRows.filter((tableRow) => { return tableRow.tableName === "maltInventory" ...
import { connect } from 'react-redux' import { addTableRow, editTableRow, saveTableRow } from '../actions' import InventoryTable from '../Components/InventoryTable' const getMaltInventory = (tableRows) => { return tableRows.filter((tableRow) => { return tableRow.tableName === "maltInventory" }) } ...
var-space-rule: Fix nested JSON obj false positive When using compact form nested JSON object within a Jinja2 context as shown in the following example: set_fact:"{{ {'test': {'subtest': variable}} }}" 'variable}}' will raise a false positive [206] error. This commit adds an intermediate step within 206 (VariableH...
# Copyright (c) 2016, Will Thames and contributors # Copyright (c) 2018, Ansible Project from ansiblelint import AnsibleLintRule import re class VariableHasSpacesRule(AnsibleLintRule): id = '206' shortdesc = 'Variables should have spaces before and after: {{ var_name }}' description = 'Variables should h...
# Copyright (c) 2016, Will Thames and contributors # Copyright (c) 2018, Ansible Project from ansiblelint import AnsibleLintRule import re class VariableHasSpacesRule(AnsibleLintRule): id = '206' shortdesc = 'Variables should have spaces before and after: {{ var_name }}' description = 'Variables should h...
Add test to show disk usage ratio per partition.
package com.alibaba.rocketmq.example.verify; import com.alibaba.rocketmq.common.UtilAll; import org.apache.commons.cli.*; public class SelectPartition { public static void main(String[] args) throws ParseException { Options options = new Options(); Option option = new Option("p", "path", true, "P...
package com.alibaba.rocketmq.example.verify; import com.alibaba.rocketmq.common.UtilAll; import org.apache.commons.cli.*; public class SelectPartition { public static void main(String[] args) throws ParseException { Options options = new Options(); Option option = new Option("p", "path", true, "P...
Initialize Parser with aliases at startup
package jfdi.logic; import jfdi.logic.commands.InvalidCommand; import jfdi.logic.interfaces.Command; import jfdi.logic.interfaces.ILogic; import jfdi.parser.InputParser; import jfdi.parser.exceptions.InvalidInputException; import jfdi.storage.apis.AliasDb; import jfdi.storage.apis.MainStorage; import jfdi.storage.exce...
package jfdi.logic; import jfdi.logic.commands.InvalidCommand; import jfdi.logic.interfaces.Command; import jfdi.logic.interfaces.ILogic; import jfdi.parser.InputParser; import jfdi.parser.exceptions.InvalidInputException; import jfdi.storage.apis.MainStorage; import jfdi.storage.exceptions.FilesReplacedException; /*...
Fix detection tests silent fails CC @sourrust
'use strict'; var bluebird = require('bluebird'); var fs = bluebird.promisifyAll(require('fs')); var hljs = require('../../build'); var path = require('path'); var utility = require('../utility'); function testAutoDetection(language) { var languagePath = utility.buildPath('detect', language); it('...
'use strict'; var bluebird = require('bluebird'); var fs = bluebird.promisifyAll(require('fs')); var hljs = require('../../build'); var path = require('path'); var utility = require('../utility'); function testAutoDetection(language) { var languagePath = utility.buildPath('detect', language); it('...
Disable user activity recording for now
<?php namespace OpenDominion\Providers; use Illuminate\Foundation\Support\Providers\EventServiceProvider as ServiceProvider; use OpenDominion\Events\UserRegisteredEvent; use OpenDominion\Listeners\SendUserRegistrationNotification; use OpenDominion\Listeners\Subscribers\AnalyticsSubscriber; //use OpenDominion\Events\...
<?php namespace OpenDominion\Providers; use Illuminate\Foundation\Support\Providers\EventServiceProvider as ServiceProvider; use OpenDominion\Events\UserRegisteredEvent; use OpenDominion\Listeners\SendUserRegistrationNotification; use OpenDominion\Listeners\Subscribers\AnalyticsSubscriber; //use OpenDominion\Events\...
Print usage info on no-args Closes #5
var readJson = require('read-package-json'); var minimist = require('minimist'); var path = require('path'); var url = require('url'); var shields = require('../'); var argv = minimist(process.argv.slice(2)); // no args if (!argv._.length) { var usage = [ 'Shield generator for your current project.', '', ...
var readJson = require('read-package-json'); var minimist = require('minimist'); var path = require('path'); var url = require('url'); var shields = require('../'); var argv = minimist(process.argv.slice(2)); var p = path.resolve('./package.json'); readJson(p, function(error, pkg) { if (error) { throw error; ...
Fix presentation of toggle button in narrower screen resolutions * Remove incorrect attribute escaping of translation exported to JS. * Restore amp-validation-error-detail-toggle to webpack config.
/* global require, module, __dirname */ const path = require( 'path' ); module.exports = { entry: { './assets/js/amp-blocks-compiled': './blocks/index.js', './assets/js/amp-block-editor-toggle-compiled': './assets/src/amp-block-editor-toggle', './assets/js/amp-validation-error-detail-toggle-compiled': './asset...
/* global require, module, __dirname */ const path = require( 'path' ); module.exports = { entry: { './assets/js/amp-blocks-compiled': './blocks/index.js', './assets/js/amp-block-editor-toggle-compiled': './assets/src/amp-block-editor-toggle', './assets/js/amp-validation-single-error-url-details-compiled': './...
Use consistent auth token variable Other snippets for installations auth token is called `installationToken` using that here instead.
const firebase = require("firebase"); async function deleteInstallation() { try { // [START delete_installation] await firebase.installations().delete(); // [END delete_installation] } catch (err) { console.error('Unable to delete installation: ', err); } } async function getInstallationId() { ...
const firebase = require("firebase"); async function deleteInstallation() { try { // [START delete_installation] await firebase.installations().delete(); // [END delete_installation] } catch (err) { console.error('Unable to delete installation: ', err); } } async function getInstallationId() { ...
Fix promotion and approval for media fields
/* * #%L * BroadleafCommerce Framework * %% * Copyright (C) 2009 - 2014 Broadleaf Commerce * %% * 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/licens...
/* * #%L * BroadleafCommerce Framework * %% * Copyright (C) 2009 - 2014 Broadleaf Commerce * %% * 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/licens...
Update setListener() warning for iOS.
/** * Copyright 2012 The PlayN Authors * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of * the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed ...
/** * Copyright 2012 The PlayN Authors * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of * the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed ...
Correct off by one error in trial count
#!/usr/bin/pyton from __future__ import division import random initial_items = int(raw_input("how many items do you have at the start?: ") or "50") iteration_days = int(raw_input("how many days do you have to multiple them?: ") or "100") trials = 1000 def iterate_n_days(n, initial_items): current_items = initial_i...
#!/usr/bin/pyton from __future__ import division import random initial_items = int(raw_input("how many items do you have at the start?: ") or "50") iteration_days = int(raw_input("how many days do you have to multiple them?: ") or "100") trials = 1000 def iterate_n_days(n, initial_items): current_items = initial_i...
Fix an integer out of range error with a migration to the transient integer bounds field (superseded by a float bounds field).
# -*- coding: utf-8 -*- # Generated by Django 1.11.2 on 2017-06-27 19:14 from __future__ import unicode_literals import django.contrib.postgres.fields.ranges from django.db import migrations class Migration(migrations.Migration): dependencies = [ ('climate_data', '0025_auto_20170627_1850'), ] o...
# -*- coding: utf-8 -*- # Generated by Django 1.11.2 on 2017-06-27 19:14 from __future__ import unicode_literals import django.contrib.postgres.fields.ranges from django.db import migrations class Migration(migrations.Migration): dependencies = [ ('climate_data', '0025_auto_20170627_1850'), ] o...
Remove newrelic from the project.
'use strict'; const common = require('../common/common'); const db = require('./db'); const logger = require('./logger'); const httpServer = require('./staticHttpServer'); const createWsServer = require('./createWsServer'); const PORT = Number(process.env.PORT || common.PORT); process.title = 'jcm2018-server'; db.co...
'use strict'; require('newrelic'); const common = require('../common/common'); const db = require('./db'); const logger = require('./logger'); const httpServer = require('./staticHttpServer'); const createWsServer = require('./createWsServer'); const PORT = Number(process.env.PORT || common.PORT); process.title = 'jc...
Remove the stupid fake spam detection crap why is this even here holy fuuuuuuuuu
package main import ( "fmt" ) func handleMessages(in <-chan Message) { for { msg := <-in fmt.Println("Got message\n", msg, "\n") } } func main() { messages := make(chan Message) server := NewServer(messages, SMTPConfig{ Ip4address: "127.0.0.1", Ip4port: 25, Domain: "local", All...
package main import ( "fmt" ) func handleMessages(in <-chan Message) { for { msg := <-in fmt.Println("Got message\n", msg, "\n") } } func main() { messages := make(chan Message) server := NewServer(messages, SMTPConfig{ Ip4address: "127.0.0.1", Ip4port: 25, Domain: "local", All...
Support return of live channel
<?php /** * @package api * @subpackage objects.factory */ class KalturaEntryFactory { /** * @param int $type * @param bool $isAdmin * @return KalturaBaseEntry */ static function getInstanceByType ($type, $isAdmin = false) { switch ($type) { case KalturaEntryType::MEDIA_CLIP: $obj = new Kaltura...
<?php /** * @package api * @subpackage objects.factory */ class KalturaEntryFactory { /** * @param int $type * @param bool $isAdmin * @return KalturaBaseEntry */ static function getInstanceByType ($type, $isAdmin = false) { switch ($type) { case KalturaEntryType::MEDIA_CLIP: $obj = new Kaltura...
Use an actually random transcript; update stats immediately
import random from django.core.management.base import BaseCommand from django.contrib.auth.models import User from mla_game.apps.accounts.models import Profile from ...models import ( Transcript, TranscriptPhraseDownvote ) from ...tasks import update_transcript_stats class Command(BaseCommand): help = 'Cre...
import random from django.core.management.base import BaseCommand from django.contrib.auth.models import User from mla_game.apps.accounts.models import Profile from ...models import ( Transcript, TranscriptPhraseDownvote ) class Command(BaseCommand): help = 'Creates random votes for 5 phrases in a random t...
Add Bootstrap JavaScript to build
/* global require, module */ var EmberApp = require('ember-cli/lib/broccoli/ember-app'); var app = new EmberApp({ 'ember-cli-jquery-ui': { 'theme': 'redmond' }, 'ember-cli-bootstrap-sass': { 'importBootstrapJS': true }, vendorFiles: { 'handlebars.js': { production: 'bower_components/handl...
/* global require, module */ var EmberApp = require('ember-cli/lib/broccoli/ember-app'); var app = new EmberApp({ 'ember-cli-jquery-ui': { 'theme': 'redmond' }, vendorFiles: { 'handlebars.js': { production: 'bower_components/handlebars/handlebars.js' } } }); // Use `app.import` to add addi...
Update the PyPI version to 0.2.9
# -*- coding: utf-8 -*- import os from setuptools import setup def read(fname): try: return open(os.path.join(os.path.dirname(__file__), fname)).read() except: return '' setup( name='todoist-python', version='0.2.9', packages=['todoist', 'todoist.managers'], author='Doist Team'...
# -*- coding: utf-8 -*- import os from setuptools import setup def read(fname): try: return open(os.path.join(os.path.dirname(__file__), fname)).read() except: return '' setup( name='todoist-python', version='0.2.8', packages=['todoist', 'todoist.managers'], author='Doist Team'...
Make it apply only to variation databases
package org.ensembl.healthcheck.testcase.eg_core; import java.sql.Connection; import org.ensembl.healthcheck.DatabaseType; import org.ensembl.healthcheck.Team; /** * @author mnuhn * * <p> * Test for correctness of variation schemas, suggests a patch, if the schemas * differ. * </p> * */ public class EGCom...
package org.ensembl.healthcheck.testcase.eg_core; import java.sql.Connection; import org.ensembl.healthcheck.DatabaseType; import org.ensembl.healthcheck.Team; /** * @author mnuhn * * <p> * Test for correctness of variation schemas, suggests a patch, if the schemas * differ. * </p> * */ public class EGCom...
Change solution of get config from config file
var logger = require('log4js').getLogger('APP_LOG'); function verifiyMessage(config, receiver, message, botname, sender, password) { //If miss message, return error message if (message === undefined || message === null) { return 'Bad Request: Missing message'; } //If receiver not found, return error message ...
var logger = require('log4js').getLogger('APP_LOG'); function verifiyMessage(config, receiver, message, botname, sender, password) { //If miss message, return error message if (message === undefined || message === null) { return 'Bad Request: Missing message'; } //If receiver not found, return error message ...
Add missing py2py3 compatibility imports
from __future__ import absolute_import from __future__ import division from __future__ import print_function from __future__ import unicode_literals import torch from . import Kernel from gpytorch.lazy import DiagLazyVariable, ZeroLazyVariable class WhiteNoiseKernel(Kernel): def __init__(self, variances): ...
import torch from . import Kernel from gpytorch.lazy import DiagLazyVariable, ZeroLazyVariable class WhiteNoiseKernel(Kernel): def __init__(self, variances): super(WhiteNoiseKernel, self).__init__() self.register_buffer("variances", variances) def forward(self, x1, x2): if self.traini...
Fix changelog url open bug.
console.log( "=== simpread version load ===" ) import {browser} from 'browser'; /** * Manifest.json version */ const version = browser.runtime.getManifest().version; /** * Verify version * * @param {string} local version * @param {object} simpread data structure */ function Verify( curver, dat...
console.log( "=== simpread version load ===" ) import {browser} from 'browser'; /** * Manifest.json version */ const version = browser.runtime.getManifest().version; /** * Verify version * * @param {string} local version * @param {object} simpread data structure */ function Verify( curver, dat...
Change default compileMode to while typing
'use babel' export default { moieExec: { type: 'string', default: '/home/user/moie.jar', description: 'Full path to moie-server' }, javaExec: { type: 'string', default: '/usr/bin/java', description: 'Full path to java; `whereis java`' }, startServer: { type: 'boolean', default...
'use babel' export default { moieExec: { type: 'string', default: '/home/user/moie.jar', description: 'Full path to moie-server' }, javaExec: { type: 'string', default: '/usr/bin/java', description: 'Full path to java; `whereis java`' }, startServer: { type: 'boolean', default...
FIX: Remove empty field, hangover from access keys module
<?php class FacebookMetadataSiteConfig extends DataExtension { static $db = array( 'SkipToMainContentAccessKey' => 'VarChar(1)' ); static $has_one = array( 'FacebookLogo' => 'Image' ); public function updateCMSFields(FieldList $fields) { $fields->rename...
<?php class FacebookMetadataSiteConfig extends DataExtension { static $db = array( 'SkipToMainContentAccessKey' => 'VarChar(1)' ); static $has_one = array( 'FacebookLogo' => 'Image' ); public function updateCMSFields(FieldList $fields) { $tf2 = new TextFie...
Add sources to example scrape.
from pupa.scrape import Scraper from pupa.models import Person, Organization class PersonScraper(Scraper): def get_people(self): # committee tech = Organization('Technology', classification='committee') tech.add_post('Chairman', 'chairman') tech.add_source('https://example.com') ...
from pupa.scrape import Scraper from pupa.models import Person, Organization class PersonScraper(Scraper): def get_people(self): # committee tech = Organization('Technology', classification='committee') tech.add_post('Chairman', 'chairman') yield tech # subcommittee ...
Fix python version syntax errors, bump minimum to 3.6 [no ci]
from setuptools import setup import sys import cozify with open('README.rst') as file: long_description = file.read() setup( name='cozify', version=cozify.__version__, python_requires='>=3.6', author='artanicus', author_email='python-cozify@nocturnal.fi', url='https://github.com/Artanicus...
from setuptools import setup import sys import cozify with open('README.rst') as file: long_description = file.read() setup( name='cozify', version=cozify.__version__, python_requires='>=3.5', author='artanicus', author_email='python-cozify@nocturnal.fi', url='https://github.com/Artanicus...
Remove webpack dev server definition
let webpack = require('webpack'); let path = require('path'); module.exports = { entry: ['babel-polyfill', './source/client.js'], output: { filename: 'index.js', path: path.resolve(__dirname, 'public/') }, plugins:[ new webpack.DefinePlugin({ 'process.env':{ 'NODE_ENV': JSON.stringify(...
let webpack = require('webpack'); let path = require('path'); module.exports = { entry: ['babel-polyfill', './source/client.js'], output: { filename: 'index.js', path: path.resolve(__dirname, 'public/') }, plugins:[ new webpack.DefinePlugin({ 'process.env':{ 'NODE_ENV': JSON.stringify(...
Fix out redirection in python2
# -*- coding: utf-8 -*- # vim: tabstop=4 shiftwidth=4 softtabstop=4 # # Copyright (C) 2017 GEM Foundation # # OpenQuake 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, o...
# -*- coding: utf-8 -*- # vim: tabstop=4 shiftwidth=4 softtabstop=4 # # Copyright (C) 2017 GEM Foundation # # OpenQuake 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, o...
Add url mapping for github callback
"""ssoproject URL Configuration The `urlpatterns` list routes URLs to views. For more information please see: https://docs.djangoproject.com/en/1.9/topics/http/urls/ Examples: Function views 1. Add an import: from my_app import views 2. Add a URL to urlpatterns: url(r'^$', views.home, name='home') Class-...
"""ssoproject URL Configuration The `urlpatterns` list routes URLs to views. For more information please see: https://docs.djangoproject.com/en/1.9/topics/http/urls/ Examples: Function views 1. Add an import: from my_app import views 2. Add a URL to urlpatterns: url(r'^$', views.home, name='home') Class-...
Fix problème de timezone. Le client peut envoyer des dates en timezone UTC, on compare alors des objets equivalent mais pas dans la meme timezone. Le hash d'un datetime ne doit pas dépendre de la timezone
<?php namespace AppBundle\Entity; use DateTime; use Doctrine\ORM\Mapping as ORM; use JMS\Serializer\Annotation\Type; /** * @ORM\Entity * @ORM\Table(name="actualite_eleveur") */ class Actualite implements StatePersistableInterface { use Persistable; /** * @var string * @ORM\Column(type="string",...
<?php namespace AppBundle\Entity; use DateTime; use Doctrine\ORM\Mapping as ORM; use JMS\Serializer\Annotation\Type; /** * @ORM\Entity * @ORM\Table(name="actualite_eleveur") */ class Actualite implements StatePersistableInterface { use Persistable; /** * @var string * @ORM\Column(type="string",...
Add sign out button to banner.
import React, { Component } from 'react'; import { Navbar } from 'react-bootstrap'; import SignOutButton from './SignOut'; import 'bootstrap/dist/css/bootstrap.css'; import './Banner.css'; class Banner extends Component { render() { return ( <Navbar bg="light" variant="light" sticky="top"> <Navba...
import React, { Component } from 'react'; import { Link } from 'react-router-dom'; import { Navbar } from 'react-bootstrap'; import 'bootstrap/dist/css/bootstrap.css'; import './Banner.css'; class Banner extends Component { render() { return ( <Navbar bg="light" variant="light" sticky="top"> <Navba...
Rewrite header handling in websocket disconnect event
import WebSocketRequestContext from './WebSocketRequestContext.js' import { parseHeaders, parseMultiValueHeaders } from '../../utils/index.js' export default class WebSocketDisconnectEvent { constructor(connectionId) { this._connectionId = connectionId } create() { // TODO FIXME not sure where the heade...
import WebSocketRequestContext from './WebSocketRequestContext.js' // TODO this should be probably moved to utils, and combined with other header // functions and utilities function createMultiValueHeaders(headers) { return Object.entries(headers).reduce((acc, [key, value]) => { acc[key] = [value] return ac...
Remove WKPB from geosearch - also change other test
import unittest from datapunt_geosearch import config from datapunt_geosearch import datasource class TestBAGDataset(unittest.TestCase): def test_query(self): x = 120993 y = 485919 ds = datasource.BagDataSource(dsn=config.DSN_BAG) results = ds.query(x, y) self.assertEqua...
import unittest from datapunt_geosearch import config from datapunt_geosearch import datasource class TestBAGDataset(unittest.TestCase): def test_query(self): x = 120993 y = 485919 ds = datasource.BagDataSource(dsn=config.DSN_BAG) results = ds.query(x, y) self.assertEqua...
Fix a bug where the correct link wasn't rendering Previously, the href tag wasn't being set, at all. So the default route was always being linked to, instead of the add new feed route. This corrects that behaviour.
<?php /* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */ /** * Short description for file * * Long description for file (if any)... * * PHP version 5.4 * * @category CategoryName * @package PackageName * @author Matthew Setter <matthew@maltblue.com> * @copyright 2014 Client/Author * @s...
<?php /* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */ /** * Short description for file * * Long description for file (if any)... * * PHP version 5.4 * * @category CategoryName * @package PackageName * @author Matthew Setter <matthew@maltblue.com> * @copyright 2014 Client/Author * @s...
Add temp directory config setting
<?php /** * Config class * Configuration for Skeleton\Core * * @author Christophe Gosiau <christophe@tigron.be> * @author Gerry Demaret <gerry@tigron.be> */ namespace Skeleton\Core; class Config { /** * Application directory * * @access public * @var string $application_dir */ public static $applic...
<?php /** * Config class * Configuration for Skeleton\Core * * @author Christophe Gosiau <christophe@tigron.be> * @author Gerry Demaret <gerry@tigron.be> */ namespace Skeleton\Core; class Config { /** * Application directory * * @access public * @var string $application_dir */ public static $applic...
Remove not needed fields from schema
const mongoose = require("mongoose"); const shortid = require("shortid"); const ProcessorItem = require("./ProcessorItem"); const originals = require("mongoose-originals"); const Address = new mongoose.Schema({ _id: { type: String, default: shortid.generate, }, processor: { type: Pr...
const mongoose = require("mongoose"); const shortid = require("shortid"); const ProcessorItem = require("./ProcessorItem"); const originals = require("mongoose-originals"); const Address = new mongoose.Schema({ _id: { type: String, default: shortid.generate, }, processor: { type: Pr...
Use const instead of var
#!/usr/bin/env node const stdin = require('get-stdin') const parseTorrent = require('../') function usage () { console.error('Usage: parse-torrent /path/to/torrent') console.error(' parse-torrent magnet_uri') console.error(' parse-torrent --stdin') } function error (err) { console.error(err.messa...
#!/usr/bin/env node var stdin = require('get-stdin') var parseTorrent = require('../') function usage () { console.error('Usage: parse-torrent /path/to/torrent') console.error(' parse-torrent magnet_uri') console.error(' parse-torrent --stdin') } function error (err) { console.error(err.message) ...
Add translation messages to generated command
<?php /** *@file * Contains \Drupal\AppConsole\Generator\CommandGenerator. */ namespace Drupal\AppConsole\Generator; class CommandGenerator extends Generator { /** * Generator Plugin Block * @param string $module Module name * @param string $command Command name * @param string $class_name ...
<?php /** *@file * Contains \Drupal\AppConsole\Generator\CommandGenerator. */ namespace Drupal\AppConsole\Generator; class CommandGenerator extends Generator { /** * Generator Plugin Block * @param string $module Module name * @param string $command Command name * @param string $class_name ...
Use correct name for twit package
var Twit = Npm.require('twit'); PostTweetForFlight = { post: function (flight) { var tweetMessage = "✈✈✈ Flight #" + flight.number + " on @airstripio - http://airstrip.io/f/" + flight.date + " #digitalnomad"; this.twitterAPI.post('statuses/update', {status: tweetMessage}, function (err, data, response) { ...
var Twit = Npm.require('Twit'); PostTweetForFlight = { post: function (flight) { var tweetMessage = "✈✈✈ Flight #" + flight.number + " on @airstripio - http://airstrip.io/f/" + flight.date + " #digitalnomad"; this.twitterAPI.post('statuses/update', {status: tweetMessage}, function (err, data, response) { ...
Fix spacing in one more file
/* * Zorbage: an algebraic data hierarchy for use in numeric processing. * * Copyright (C) 2016-2020 Barry DeZonia * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * 1. Redistributions of source code must ret...
/* * Zorbage: an algebraic data hierarchy for use in numeric processing. * * Copyright (C) 2016-2020 Barry DeZonia * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * 1. Redistributions of source code must ret...
Revert "Remove apparently superfluous call to fill_recommended_bugs_cache." This reverts commit 83ca8575e68fe9b2b59431e73e94b3247e3485d4.
import datetime import logging from django.core.management.base import BaseCommand import mysite.profile.tasks import mysite.search.models import mysite.search.tasks ## FIXME: Move to a search management command? def periodically_check_if_bug_epoch_eclipsed_the_cached_search_epoch(): logging.info("Checking if bu...
import datetime import logging from django.core.management.base import BaseCommand import mysite.profile.tasks import mysite.search.models import mysite.search.tasks ## FIXME: Move to a search management command? def periodically_check_if_bug_epoch_eclipsed_the_cached_search_epoch(): logging.info("Checking if bu...
Increase size of the alternative field - NC-87
from __future__ import unicode_literals from django.db import models from django.utils.encoding import python_2_unicode_compatible from django.utils.translation import ugettext_lazy as _ from django.contrib.auth.models import AbstractUser from django.conf import settings from uuidfield import UUIDField class UuidM...
from __future__ import unicode_literals from django.db import models from django.utils.encoding import python_2_unicode_compatible from django.utils.translation import ugettext_lazy as _ from django.contrib.auth.models import AbstractUser from django.conf import settings from uuidfield import UUIDField class UuidM...
Add a Println-based test of expandPathnameTemplate
// Copyright (C) 2017 Damon Revoe. All rights reserved. // Use of this source code is governed by the MIT // license, which can be found in the LICENSE file. package main import ( "fmt" "strings" "testing" ) func substTestCase(t *testing.T, node *verbatim, expected string) { var result string for { result +=...
// Copyright (C) 2017 Damon Revoe. All rights reserved. // Use of this source code is governed by the MIT // license, which can be found in the LICENSE file. package main import ( "strings" "testing" ) func substTestCase(t *testing.T, node *verbatim, expected string) { var result string for { result += node.t...
Add requests as a dependency
from setuptools import setup, find_packages setup( name = 'plumbing', version = '2.9.9', description = 'Helps with plumbing-type programing in python.', license = 'MIT', url = 'http://github.com/xapple/plumbing/', author = 'Lucas Sinclai...
from setuptools import setup, find_packages setup( name = 'plumbing', version = '2.9.9', description = 'Helps with plumbing-type programing in python.', license = 'MIT', url = 'http://github.com/xapple/plumbing/', author = 'Lucas Sinclai...
Make core activator extendable of Plugin class
package org.jetbrains.kotlin.core; import static org.eclipse.core.resources.ResourcesPlugin.getWorkspace; import org.eclipse.core.resources.IResourceChangeEvent; import org.eclipse.core.resources.IResourceChangeListener; import org.eclipse.core.runtime.Plugin; import org.jetbrains.kotlin.core.builder.ResourceChangeLi...
package org.jetbrains.kotlin.core; import static org.eclipse.core.resources.ResourcesPlugin.getWorkspace; import org.eclipse.core.resources.IResourceChangeEvent; import org.eclipse.core.resources.IResourceChangeListener; import org.jetbrains.kotlin.core.builder.ResourceChangeListener; import org.osgi.framework.Bundle...
Make calendar schedule options translatable Signed-off-by: Julius Härtl <bf353fa4999f2f148afcc6d8ee6cb1ee74cc07c3@bitgrid.net>
<?php style('dav', 'schedule-response'); ?> <div class="update"> <form action="" method="post"> <fieldset id="partStat"> <h2><?php p($l->t('Are you accepting the invitation?')); ?></h2> <div id="selectPartStatForm"> <input type="radio" id="partStatAccept" name="partStat" value="ACCEPTED" checked /> <l...
<?php style('dav', 'schedule-response'); ?> <div class="update"> <form action="" method="post"> <fieldset id="partStat"> <h2><?php p($l->t('Are you accepting the invitation?')); ?></h2> <div id="selectPartStatForm"> <input type="radio" id="partStatAccept" name="partStat" value="ACCEPTED" checked /> <l...
Change props.route to actual value
import Component from 'react-pure-render/component'; import React, {PropTypes} from 'react'; // RouterHandler is back since suggested solution via React.cloneElement sucks. // https://github.com/rackt/react-router/blob/master/UPGRADE_GUIDE.md#routehandler // This is just syntax sugar for react-router 1.0.0 filtering c...
import Component from 'react-pure-render/component'; import React, {PropTypes} from 'react'; // RouterHandler is back since suggested solution via React.cloneElement sucks. // https://github.com/rackt/react-router/blob/master/UPGRADE_GUIDE.md#routehandler // This is just syntax sugar for react-router 1.0.0 filtering c...
Remove uneeded boot to make compatible with Laravel 5 Removing this because this package does not use any resources and thus is not needed for Laravel 4.
<?php namespace SimpleSoftwareIO\QrCode; /** * Simple Laravel QrCode Generator * A simple wrapper for the popular BaconQrCode made for Laravel. * * @link http://www.simplesoftware.io * @author SimpleSoftware support@simplesoftware.io * */ use Illuminate\Support\ServiceProvider; class QrCodeServiceProvider ext...
<?php namespace SimpleSoftwareIO\QrCode; /** * Simple Laravel QrCode Generator * A simple wrapper for the popular BaconQrCode made for Laravel. * * @link http://www.simplesoftware.io * @author SimpleSoftware support@simplesoftware.io * */ use Illuminate\Support\ServiceProvider; class QrCodeServiceProvider ext...
Set connection driver as `postgres` by default.
import typeorm from 'typeorm'; import { resetCache } from '../src'; import User from './entity/UserSchema'; beforeEach(resetCache); export const createConnection = () => { const {TYPE, DB_HOST, DB_USER, DB_PASSWORD, DB_DATABASE} = process.env; const driverOptions = { type: TYPE || 'postgres', port: 5...
import typeorm from 'typeorm'; import { resetCache } from '../src'; import User from './entity/UserSchema'; beforeEach(resetCache); export const createConnection = () => { const {TYPE, DB_HOST, DB_USER, DB_PASSWORD, DB_DATABASE} = process.env; const driverOptions = { type: TYPE, port: 5432, host:...
Add missing space to jslint config line.
/*jslint forin: true */ var log = console.log; exports.report = function(file, lint) { log(file); var options = [], key, value, i, len, pad, e; for (key in lint.options) { value = lint.options[key]; options.push(key + ": " + value); } log("/*jslint " + options.join(", ") ...
/*jslint forin: true */ var log = console.log; exports.report = function(file, lint) { log(file); var options = [], key, value, i, len, pad, e; for (key in lint.options) { value = lint.options[key]; options.push(key + ": " + value); } log("/*jslint " + options.join(", ") ...
Fix calls to request object
<!DOCTYPE html> <html class="koowa-html" xmlns="http://www.w3.org/1999/xhtml"> <head> <meta name="viewport" content="width=device-width, initial-scale=1.0"/> <link rel="stylesheet" href="<?php echo KObjectManager::getInstance()->getObject('request')->getBaseUrl('site'); ?>/media/koowa/com_koowa/css/bo...
<!DOCTYPE html> <html class="koowa-html" xmlns="http://www.w3.org/1999/xhtml"> <head> <meta name="viewport" content="width=device-width, initial-scale=1.0"/> <link rel="stylesheet" href="<?php echo $this->getObject('request')->getBaseUrl('site'); ?>/media/koowa/com_koowa/css/bootstrap.min.css" type="t...
storage: Add alias for VariantAnnotation.geneCancerAssociations to handle property renaming
/* * Copyright 2015-2017 OpenCB * * 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 2015-2017 OpenCB * * 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 ...
Use argparse for 4D to 3D
#!/usr/bin/env python ''' Tiny script to write 4D files in any format that we read (nifti, analyze, MINC, at the moment, as nifti 3D files ''' import os import nipy.externals.argparse as argparse import nipy.io.imageformats as nii def main(): # create the parser parser = argparse.ArgumentParser() # add ...
#!/usr/bin/env python ''' Tiny script to write 4D files in any format that we read (nifti, analyze, MINC, at the moment, as nifti 3D files ''' import os import sys import nipy.io.imageformats as nii if __name__ == '__main__': try: fname = sys.argv[1] except IndexError: raise OSError('Expecti...
Change yield from to yield ...because `yield from` doesn't actually work in that context.
#!/usr/bin/env php <?php require dirname(__DIR__) . '/vendor/autoload.php'; use Icicle\Coroutine; use Icicle\Dns\Resolver\Resolver; use Icicle\Loop; if (2 > $argc) { throw new InvalidArgumentException('Too few arguments provided. Usage: {DomainName}'); } $domain = $argv[1]; $coroutine = Coroutine\create(functi...
#!/usr/bin/env php <?php require dirname(__DIR__) . '/vendor/autoload.php'; use Icicle\Coroutine; use Icicle\Dns\Resolver\Resolver; use Icicle\Loop; if (2 > $argc) { throw new InvalidArgumentException('Too few arguments provided. Usage: {DomainName}'); } $domain = $argv[1]; $coroutine = Coroutine\create(functi...
Add support for token query-param as fallback
'use strict'; var authHeader = require('auth-header'); var tokenUtils = require('./token'); module.exports = function (options) { return function (req, res, next) { var authorization = req.get('authorization') || req.query.token; req.challenge = authorization; var auth = authHeader.parse(authorization...
'use strict'; var authHeader = require('auth-header'); var tokenUtils = require('./token'); module.exports = function (options) { return function (req, res, next) { var authorization = req.get('authorization'); req.challenge = authorization; var auth = authHeader.parse(authorization); if (auth &&...
Check if there are encodings before trying to delete them
<?php namespace Bkwld\Decoy\Observers; /** * Trigger encoding or delete the encodings rows */ class Encoding { /** * Start a new encode if a new encodable file was uploaded * * @param Bkwld\Decoy\Models\Base $model * @return void */ public function onSaving($model) { if (!$this->isEncodable($model)...
<?php namespace Bkwld\Decoy\Observers; /** * Trigger encoding or delete the encodings rows */ class Encoding { /** * Start a new encode if a new encodable file was uploaded * * @param Bkwld\Decoy\Models\Base $model * @return void */ public function onSaving($model) { if (!$this->isEncodable($model)...
Use range so code works with python 3
import re def ensure_trailing_slash(mystr): if not mystr.endswith('/'): mystr = mystr + '/' return mystr def remove_trailing_slash(mystr): if mystr.endswith('/'): mystr = mystr[:-1] return mystr def split_s3_bucket_key(s3_path): if s3_path.startswith('s3://'): s3_path =...
import re def ensure_trailing_slash(mystr): if not mystr.endswith('/'): mystr = mystr + '/' return mystr def remove_trailing_slash(mystr): if mystr.endswith('/'): mystr = mystr[:-1] return mystr def split_s3_bucket_key(s3_path): if s3_path.startswith('s3://'): s3_path =...
Fix - in cli mode PROJECT_ROOT was not empty when script was run not from project.
<? define('E_REPORTING', E_ALL & ~E_NOTICE); error_reporting(E_REPORTING); ini_set('display_errors', 'On'); define('TIME_START', microtime(true)); define('ROOT', dirname(dirname(__FILE__))); define('CONFIG_ROOT', dirname(dirname(dirname(__FILE__))).'/config'); define('PROJECT', strtolower(isset($_ENV["PROJECT"]) ? $_EN...
<? define('E_REPORTING', E_ALL & ~E_NOTICE); error_reporting(E_REPORTING); ini_set('display_errors', 'On'); define('TIME_START', microtime(true)); define('ROOT', dirname(dirname(__FILE__))); define('CONFIG_ROOT', dirname(dirname(dirname(__FILE__))).'/config'); define('PROJECT', strtolower(isset($_ENV["PROJECT"]) ? $_EN...
Add requirement for fork version of gnupg
#!/usr/bin/env python from setuptools import setup, find_packages import sys with open('README.md') as f: readme = f.read() install_requires = [ 'gnupg>=2.0.2', 'seria', 'python-gnupg' ] setup( name='figgypy', version='0.3.dev', description='Simple configuration tool. Get config from ya...
#!/usr/bin/env python from setuptools import setup, find_packages import sys with open('README.md') as f: readme = f.read() install_requires = [ 'seria', 'python-gnupg' ] setup( name='figgypy', version='0.3.dev', description='Simple configuration tool. Get config from yaml, json, or xml.', ...
Make sliding token lifetime defaults a bit more conservative
from __future__ import unicode_literals from datetime import timedelta from django.conf import settings from rest_framework.settings import APISettings USER_SETTINGS = getattr(settings, 'SIMPLE_JWT', None) DEFAULTS = { 'AUTH_HEADER_TYPE': 'Bearer', 'USER_ID_FIELD': 'id', 'USER_ID_CLAIM': 'user_id', ...
from __future__ import unicode_literals from datetime import timedelta from django.conf import settings from rest_framework.settings import APISettings USER_SETTINGS = getattr(settings, 'SIMPLE_JWT', None) DEFAULTS = { 'AUTH_HEADER_TYPE': 'Bearer', 'USER_ID_FIELD': 'id', 'USER_ID_CLAIM': 'user_id', ...
Send to server as json
var App = window.App || {}; App.Create = (function ($, w) { 'use strict'; function Create ($el, options) { this.options = $.extend({}, Create.defaults, options); $($el).midgardCreate(); w.Backbone.sync = this.sync.bind(this); } // Override Backbone.sync Create.prototyp...
var App = window.App || {}; App.Create = (function ($, w) { 'use strict'; function Create ($el, options) { this.options = $.extend({}, Create.defaults, options); $($el).midgardCreate(); w.Backbone.sync = this.sync.bind(this); } // Override Backbone.sync Create.prototyp...
Disable the "read and upload" step (not working yet)
module.exports = { model: 'step_type', data: [ { id: 1, name: 'Announcement Message', description: 'No response from the user to move the next step' }, { id: 2, name: 'Question Step', description: 'Owner must enter a question and the confirmation word that the user mu...
module.exports = { model: 'step_type', data: [ { id: 1, name: 'Announcement Message', description: 'No response from the user to move the next step' }, { id: 2, name: 'Question Step', description: 'Owner must enter a question and the confirmation word that the user mu...
Add R language key for matrix column
import Ember from 'ember'; var configKeys, configKeysMap, languageConfigKeys; languageConfigKeys = { go: 'Go', php: 'PHP', node_js: 'Node.js', perl: 'Perl', perl6: 'Perl6', python: 'Python', scala: 'Scala', smalltalk: 'Smalltalk', ruby: 'Ruby', d: 'D', julia: 'Julia', csharp: 'C#', mono: 'Mo...
import Ember from 'ember'; var configKeys, configKeysMap, languageConfigKeys; languageConfigKeys = { go: 'Go', php: 'PHP', node_js: 'Node.js', perl: 'Perl', perl6: 'Perl6', python: 'Python', scala: 'Scala', smalltalk: 'Smalltalk', ruby: 'Ruby', d: 'D', julia: 'Julia', csharp: 'C#', mono: 'Mo...
Update build script for Rollup change
import * as p from 'path'; import * as fs from 'fs'; import {rollup} from 'rollup'; import babel from 'rollup-plugin-babel'; const copyright = ( `/* * Copyright ${new Date().getFullYear()}, Yahoo Inc. * Copyrights licensed under the New BSD License. * See the accompanying LICENSE file for terms. */ ` ); let babel...
import * as p from 'path'; import * as fs from 'fs'; import {rollup} from 'rollup'; import babel from 'rollup-plugin-babel'; const copyright = ( `/* * Copyright ${new Date().getFullYear()}, Yahoo Inc. * Copyrights licensed under the New BSD License. * See the accompanying LICENSE file for terms. */ ` ); let babel...
Remove the decorate `facts` from mapper `Hostname` - And update the class comment
from .. import Mapper, mapper @mapper("hostname") class Hostname(Mapper): """Class for parsing ``hostname`` command output. Attributes: fqdn: The fully qualified domain name of the host. The same to ``hostname`` when domain part is not set. hostname: The hostname. domain: ...
from .. import Mapper, mapper @mapper("facts") @mapper("hostname") class Hostname(Mapper): def parse_content(self, content): fqdn = None if len(content) == 1: fqdn = content[0].strip() elif len(content) > 1: for line in content: if line.startswith('...
Change exemple code to generate OTP link
import binascii import base64 import os.path def __content(f): return open(os.path.join(os.path.dirname(__file__), f)).read() crypto_js = __content('crypto.js') hotp_js = __content('hotp.js') myotp_js = __content('my-otp.js') def dataize(document, type='text/html'): return 'data:%s;base64,%s' % (type, base6...
import binascii import base64 import os.path def __content(f): return open(os.path.join(os.path.dirname(__file__), f)).read() crypto_js = __content('crypto.js') hotp_js = __content('hotp.js') myotp_js = __content('my-otp.js') def dataize(document, type='text/html'): return 'data:%s;base64,%s' % (type, base6...
Add a print with file where mistake is
#!/usr/bin/python # -*- coding: utf-8 -*- from __future__ import print_function from xml.etree.ElementTree import ParseError import xml.etree.ElementTree as ET import glob import sys def eprint(*args, **kwargs): print(*args, file=sys.stderr, **kwargs) def parse(): for infile in glob.glob('*.xml'): tr...
#!/usr/bin/python # -*- coding: utf-8 -*- from __future__ import print_function from xml.etree.ElementTree import ParseError import xml.etree.ElementTree as ET import glob import sys def eprint(*args, **kwargs): print(*args, file=sys.stderr, **kwargs) def parse(): for infile in glob.glob('*.xml'): tr...
Change test to use card concept
var tape = require("tape"), jsdom = require("jsdom"), d3 = Object.assign(require("../"), require("d3-selection")); /************************************* ************ Components ************* *************************************/ // Leveraging create hook with selection as first argument. var card = d3.com...
var tape = require("tape"), jsdom = require("jsdom"), d3 = Object.assign(require("../"), require("d3-selection")); /************************************* ************ Components ************* *************************************/ // Leveraging create hook with selection as first argument. var checkboxHTML ...
Allow public on list of subscribers Summary: Fixes T7317, allows public to be set on this list controller. Test Plan: Tested a list of subscribers on a logged in and logged out Diff. Reviewers: btrahan, epriestley Reviewed By: epriestley Subscribers: Korvin, epriestley Maniphest Tasks: T7317 Differential Revisio...
<?php final class PhabricatorSubscriptionsListController extends PhabricatorController { private $phid; public function willProcessRequest(array $data) { $this->phid = idx($data, 'phid'); } public function shouldAllowPublic() { return true; } public function processRequest() { $request = ...
<?php final class PhabricatorSubscriptionsListController extends PhabricatorController { private $phid; public function willProcessRequest(array $data) { $this->phid = idx($data, 'phid'); } public function processRequest() { $request = $this->getRequest(); $viewer = $request->getUser(); $...
Use LargeBitList instead of BitBuffer.
package net.katsuster.strview.media.ts; import net.katsuster.strview.io.*; import net.katsuster.strview.media.*; /** * @author katsuhiro */ public class TSPacketList extends AbstractLargeList<TSPacket> { public LargeBitList buf; public TSPacketList() { super(LENGTH_UNKNOWN); } public TSPac...
package net.katsuster.strview.media.ts; import net.katsuster.strview.io.*; import net.katsuster.strview.media.*; /** * @author katsuhiro */ public class TSPacketList extends AbstractLargeList<TSPacket> { public LargeBitList buf; public TSPacketList() { super(LENGTH_UNKNOWN); } public TSPac...
Use enum for subtype as well
<?php use Illuminate\Database\Migrations\Migration; use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; class CreateWatches extends Migration { /** * Run the migrations. * * @return void */ public function up() { Schema::create('watches', function (...
<?php use Illuminate\Database\Migrations\Migration; use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; class CreateWatches extends Migration { /** * Run the migrations. * * @return void */ public function up() { Schema::create('watches', function (...
Add custom repository methods to obtain only placed orders
<?php /* * This file is part of the Sylius package. * * (c) Paweł Jędrzejewski * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Sylius\Component\Order\Repository; use Sylius\Component\Order\Model\OrderInterface; use Syl...
<?php /* * This file is part of the Sylius package. * * (c) Paweł Jędrzejewski * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Sylius\Component\Order\Repository; use Sylius\Component\Order\Model\OrderInterface; use Syl...
Enable parsing of more modules This was failing due to having a `git@` URL in the `repository` field https://github.com/sveltejs/svelte-loader/blob/d4e2c2025e8cf0cf448d61a5f5206d6e77ee0d9a/package.json#L35
// This can't be replaced with `new URL()` because browsers don't support git+http urls const protocol = '(?:([^:]+:)?(?://)?)?'; const auth = '(?:(\\S+(?::\\S*)?)@)?'; const host = '([^/:]*)'; const path = '([/]?[^#]*)'; const hash = '(#.+)?'; const urlLaxRegex = new RegExp(protocol + auth + host + path + hash); exp...
// This can't be replaced with `new URL()` because browsers don't support git+http urls const protocol = '(?:([^:]+:)?(?://)?)?'; const auth = '(?:(\\S+(?::\\S*)?)@)?'; const host = '([^/:]*)'; const path = '([/]?[^#]*)'; const hash = '(#.+)?'; const urlLaxRegex = new RegExp(protocol + auth + host + path + hash); exp...
Change dependencies to load only in backend
<?php class Kwc_Basic_Link_Trl_Component extends Kwc_Abstract_Composite_Trl_Component { public static function getSettings($mainComponentClass) { $ret = parent::getSettings($mainComponentClass); $ret['ownModel'] = Kwc_Abstract::getSetting($mainComponentClass, 'ownModel'); $ret['assetsAdm...
<?php class Kwc_Basic_Link_Trl_Component extends Kwc_Abstract_Composite_Trl_Component { public static function getSettings($mainComponentClass) { $ret = parent::getSettings($mainComponentClass); $ret['ownModel'] = Kwc_Abstract::getSetting($mainComponentClass, 'ownModel'); $ret['assets'][...
Change sample using sftp to not run if prelive is down
package com.litle.sdk.samples; import com.litle.sdk.*; import com.litle.sdk.generate.AccountUpdateFileRequestData; import com.litle.sdk.generate.RFRRequest; import java.util.Calendar; public class RfrLitleExample { public static void main(String[] args) { String preliveStatus = System.getenv("preliveStatus"...
package com.litle.sdk.samples; import com.litle.sdk.*; import com.litle.sdk.generate.AccountUpdateFileRequestData; import com.litle.sdk.generate.RFRRequest; import java.util.Calendar; public class RfrLitleExample { public static void main(String[] args) { String merchantId = "0180"; String requestFi...
Add a FORM_POST method with streamResponse=true
/** * Copyright 2010-2012 Ralph Schaer <ralphschaer@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by...
/** * Copyright 2010-2012 Ralph Schaer <ralphschaer@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by...
Test the failure branch in BaseEntityJSONDecoder
from test_provider_gtfs import provider from busbus.entity import BaseEntityJSONEncoder import json import pytest @pytest.fixture(scope='module') def agency(provider): return next(provider.agencies) def test_entity_repr(agency): assert 'DTA' in repr(agency) def test_entity_failed_getattr(agency): wi...
from test_provider_gtfs import provider from busbus.entity import BaseEntityJSONEncoder import json import pytest @pytest.fixture(scope='module') def agency(provider): return next(provider.agencies) def test_entity_repr(agency): assert 'DTA' in repr(agency) def test_entity_failed_getattr(agency): wi...
Fix 'last chance' reminder email Both payment reminder emails were accidentally configured to go out at the same time.
from uber.config import c from uber.automated_emails import MarketplaceEmailFixture from uber.utils import days_before MarketplaceEmailFixture( 'Your {EVENT_NAME} ({EVENT_DATE}) Dealer registration is due in one week', 'dealers/payment_reminder.txt', lambda g: g.status == c.APPROVED and days_before(7, g.d...
from uber.config import c from uber.automated_emails import MarketplaceEmailFixture from uber.utils import days_before MarketplaceEmailFixture( 'Your {EVENT_NAME} ({EVENT_DATE}) Dealer registration is due in one week', 'dealers/payment_reminder.txt', lambda g: g.status == c.APPROVED and days_before(7, g.d...
Fix the way index redirect works for latest Ember
define([ 'ember', 'JST/index', ], function (Em) { 'use strict'; var IndexRoute = Em.Route.extend({ actions: { // error handler for when descendent // routes fail to resolve their model promises. // 'reason' is the value passed to the rejected promise. error: function (reason) { ...
define([ 'ember', 'JST/index', ], function (Em) { 'use strict'; var IndexRoute = Em.Route.extend({ actions: { // error handler for when descendent // routes fail to resolve their model promises. // 'reason' is the value passed to the rejected promise. error: function (reason) { ...
Fix Babel config env being shared.
module.exports = () => { const env = process.env.BABEL_ENV || process.env.NODE_ENV || 'development'; const browsers = process.env.BROWSERSLIST; const targets = {}; if (browsers) { targets.browsers = browsers; } if (env === 'production') { targets.uglify = true; } if (env === 'testing') { ta...
const env = process.env.BABEL_ENV || process.env.NODE_ENV || 'development'; const browsers = process.env.BROWSERSLIST; const targets = {}; if (browsers) { targets.browsers = browsers; } if (env === 'production') { targets.uglify = true; } if (env === 'testing') { targets.node = 'current'; } const preset = { p...
Increase timeouts for async query compilation even more.
import slimdom from 'slimdom'; import blueprint from 'fontoxml-blueprints/readOnlyBlueprint'; import createSelectorFromXPathAsync from 'fontoxml-selectors/parsing/createSelectorFromXPathAsync'; import evaluateXPath from 'fontoxml-selectors/evaluateXPath'; describe('createSelectorFromXPathAsync', () => { let document...
import slimdom from 'slimdom'; import blueprint from 'fontoxml-blueprints/readOnlyBlueprint'; import createSelectorFromXPathAsync from 'fontoxml-selectors/parsing/createSelectorFromXPathAsync'; import evaluateXPath from 'fontoxml-selectors/evaluateXPath'; describe('createSelectorFromXPathAsync', () => { let document...
Remove trailing comma to appease JSHint.
(function () { "use strict"; var delay, jitter, blacklist; safari.application.addEventListener('message', function (event) { if (event.name === 'getSettings') { delay = safari.extension.settings.delay; jitter = safari.extension.settings.jitter; blacklist = safari...
(function () { "use strict"; var delay, jitter, blacklist; safari.application.addEventListener('message', function (event) { if (event.name === 'getSettings') { delay = safari.extension.settings.delay; jitter = safari.extension.settings.jitter; blacklist = safari...
Revert "Use the native Object.keys if it's available." This reverts commit 60689993d75db32701e99f7eb9110ce8eff54610.
"use strict"; // modified from https://github.com/es-shims/es6-shim var keys = require('object-keys'); var isObject = function (obj) { return typeof obj !== 'undefined' && obj !== null; }; var assignShim = function assign(target, source) { var s, i, props; if (!isObject(target)) { throw new TypeError('target must ...
"use strict"; // modified from https://github.com/es-shims/es6-shim var keys = Object.keys || require('object-keys'); var isObject = function (obj) { return typeof obj !== 'undefined' && obj !== null; }; var assignShim = function assign(target, source) { var s, i, props; if (!isObject(target)) { throw new TypeErro...
Move option parsing outside of loadAccount
package main import ( "fmt" "log" "github.com/jessevdk/go-flags" "github.com/k0kubun/go-readline" ) type Options struct { ScreenName string `short:"a" long:"account" description:"login as an account of selected screen_name"` } func main() { options := new(Options) if _, err := flags.Parse(options); err != ni...
package main import ( "fmt" "log" "github.com/jessevdk/go-flags" "github.com/k0kubun/go-readline" ) type Options struct { ScreenName string `short:"a" long:"account" description:"login as an account of selected screen_name"` } func main() { account := loadAccount() startUserStream(account) invokeInteractiv...
Return if PR doesn't exist
var request = require('request') // With username parsed from request, check that the user has submitted a // PR to jlord/Patchwork. // Because PRs are merged so fast by @RR, we loop through each of the closed // issues to find the user's PR. // called by: checkPR(username, function(err, pr){ prStatus(res, err, pr) })...
var request = require('request') // With username parsed from request, check that the user has submitted a // PR to jlord/Patchwork. // Because PRs are merged so fast by @RR, we loop through each of the closed // issues to find the user's PR. // called by: checkPR(username, function(err, pr){ prStatus(res, err, pr) })...