text
stringlengths
17
1.47k
positive
stringlengths
673
4.43k
negative
stringlengths
677
2.81k
Fix user seeder (giving DateTime when setter expects string)
<?php class UsersTableSeeder extends Seeder { public function run() { $faker = Faker\Factory::create(); User::truncate(); User::create([ 'first_name' => 'Dave', 'email' => 'dfurnes@dosomething.org', 'password' => 'tops3cret', ])->assignRole(1); User::create([ 'firs...
<?php class UsersTableSeeder extends Seeder { public function run() { $faker = Faker\Factory::create(); User::truncate(); User::create([ 'first_name' => 'Dave', 'email' => 'dfurnes@dosomething.org', 'password' => 'tops3cret', ])->assignRole(1); User::create([ 'firs...
Raise DependencyError when series plugin is missing
from __future__ import unicode_literals, division, absolute_import import logging from sqlalchemy import desc, func from flexget.manager import Session from flexget.plugin import register_plugin, priority, DependencyError from flexget.utils.tools import multiply_timedelta try: from flexget.plugins.filter.series i...
from __future__ import unicode_literals, division, absolute_import import logging from sqlalchemy import desc, func from flexget.manager import Session from flexget.plugin import register_plugin, priority from flexget.plugins.filter.series import SeriesDatabase, Series, Episode from flexget.utils.tools import multipl...
Remove alerts when clicking link or button
(function(){ var app = angular.module('runnersNotes',[]); app.controller('NoteController',['$http',function($http){ var rn = this; rn.success = false; rn.errors = []; rn.notes = []; rn.note = {}; $http.get('http://localhost:8080/notes').success(function(data){ ...
(function(){ var app = angular.module('runnersNotes',[]); app.controller('NoteController',['$http',function($http){ var rn = this; rn.success = false; rn.errors = []; rn.notes = []; rn.note = {}; $http.get('http://localhost:8080/notes').success(function(data){ ...
Rename default -> vespa and add clarifying comment.
// Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. package com.yahoo.vespa.model.admin.monitoring; import ai.vespa.metricsproxy.core.VespaMetrics; import com.google.common.collect.ImmutableList; import static com.yahoo.vespa.model.admin.monitoring.Ne...
// Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. package com.yahoo.vespa.model.admin.monitoring; import ai.vespa.metricsproxy.core.VespaMetrics; import com.google.common.collect.ImmutableList; import static com.yahoo.vespa.model.admin.monitoring.Ne...
Make OptionList return gracefully when iterating over falsy values
import PropTypes from "prop-types"; import React, { Component } from "react"; import { StyleSheet, ScrollView, View, TouchableWithoutFeedback, ViewPropTypes } from "react-native"; export default class OptionList extends Component { static defaultProps = { onSelect: () => {} }; static propTypes = { ...
import PropTypes from "prop-types"; import React, { Component } from "react"; import { StyleSheet, ScrollView, View, TouchableWithoutFeedback, ViewPropTypes } from "react-native"; export default class OptionList extends Component { static defaultProps = { onSelect: () => {} }; static propTypes = { ...
[Backend] Include exception cause's stacktrace in JSON in case of error.
package org.talend.dataprep.exception; import java.io.IOException; import java.io.PrintWriter; import java.io.StringWriter; import java.io.Writer; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import com.fasterxml.jackson.core.JsonFactory; import com.fasterxml.jackson.core.JsonGenerator; class TDPExcepti...
package org.talend.dataprep.exception; import java.io.IOException; import java.io.Writer; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import com.fasterxml.jackson.core.JsonFactory; import com.fasterxml.jackson.core.JsonGenerator; class TDPException extends RuntimeException { private static final L...
Change id query parameter to route parameter
'use strict' module.exports = (function(){ /** * Import modules */ const footballDb = require('./../db/footballDb') /** * football module API */ return { 'leagues': leagues, 'leagueTable_id': leagueTable_id } /** * football module API --...
'use strict' module.exports = (function(){ /** * Import modules */ const footballDb = require('./../db/footballDb') /** * football module API */ return { 'leagues': leagues, 'leagueTable': leagueTable } /** * football module API -- leagu...
Build production without any devtool (no source-map)
/** * webpack configuration for react-to-mdl */ const webpack = require('webpack'); const path = require('path'); const libraryName = 'react-to-mdl'; // export config module.exports = { // devtool: 'cheap-module-eval-source-map', devtool: process.env.NODE_ENV == 'production' ? false : 'eval', entry: { but...
/** * webpack configuration for react-to-mdl */ const webpack = require('webpack'); const path = require('path'); const libraryName = 'react-to-mdl'; // export config module.exports = { // devtool: 'cheap-module-eval-source-map', devtool: process.env.NODE_ENV == 'production' ? 'source-map' : 'eval', entry: { ...
Tweak CesiumViewer build to avoid some warnings.
var profile = { basePath : '../..', baseUrl : '.', releaseDir : './Build/Apps/CesiumViewer', action : 'release', cssOptimize : 'comments', mini : true, optimize : 'closure', layerOptimize : 'closure', stripConsole : 'all', selectorEngine : 'acme', layers : { 'dojo/doj...
var profile = { basePath : '../..', baseUrl : '.', releaseDir : './Build/Apps/CesiumViewer', action : 'release', cssOptimize : 'comments', mini : true, optimize : 'closure', layerOptimize : 'closure', stripConsole : 'all', selectorEngine : 'acme', layers : { 'dojo/doj...
Write ajax post request for pin form submit
$(document).ready(function() { $("#map-placeholder").on("click", "#new-gem-button", function(event){ event.preventDefault(); var url = $(event.target).attr('href'); $.ajax({ url: url, type: 'get' }).done(function(data){ var $popupForm = $(data).children('section'); ...
$(document).ready(function() { $("#map-placeholder").on("click", "#new-gem-button", function(event){ event.preventDefault(); var url = $(event.target).attr('href'); $.ajax({ url: url, type: 'get' }).done(function(data){ var $popupForm = $(data).children('section'); ...
Fix UMD build for webpack 2 Closes #4
import path from 'path'; const projectRoot = path.join(__dirname, '..'); export default { cache: true, entry: [ path.join(projectRoot, 'src', 'hibp.js'), ], output: { library: 'hibp', libraryTarget: 'umd', path: path.join(projectRoot, 'dist'), }, module: { rules: [ { test...
import path from 'path'; const projectRoot = path.join(__dirname, '..'); export default { cache: true, entry: [ path.join(projectRoot, 'src', 'hibp.js'), ], output: { library: 'hibp', libraryTarget: 'umd', path: path.join(projectRoot, 'dist'), }, module: { rules: [ { test...
Convert model not found exceptions to 404 not found exceptions.
<?php namespace App\Exceptions; use Exception; use Illuminate\Http\Response; use Illuminate\Validation\ValidationException; use Illuminate\Auth\Access\AuthorizationException; use Illuminate\Database\Eloquent\ModelNotFoundException; use Symfony\Component\HttpKernel\Exception\HttpException; use Laravel\Lumen\Exceptions...
<?php namespace App\Exceptions; use Exception; use Illuminate\Http\Response; use Illuminate\Validation\ValidationException; use Illuminate\Auth\Access\AuthorizationException; use Illuminate\Database\Eloquent\ModelNotFoundException; use Symfony\Component\HttpKernel\Exception\HttpException; use Laravel\Lumen\Exceptions...
Fix units on wallet info screen
'use strict'; angular.module('copayApp.controllers').controller('walletInfoController', function ($scope, $rootScope, $timeout, profileService, configService, lodash, coloredCoins, walletService) { function initAssets(assets) { if (!assets) { this.assets = []; return; } this.assets = lod...
'use strict'; angular.module('copayApp.controllers').controller('walletInfoController', function ($scope, $rootScope, $timeout, profileService, configService, lodash, coloredCoins, walletService) { function initAssets(assets) { if (!assets) { this.assets = []; return; } this.assets = lod...
Change bs4 html parser to html.parser This is to fix wrapping with <html> tags.
import re from bs4 import BeautifulSoup from django import template register = template.Library() @register.filter(is_safe=True) def baseurl(html, base): if not base.endswith('/'): base += '/' absurl = re.compile(r'\s*[a-zA-Z][a-zA-Z0-9\+\.\-]*:') # Starts with scheme:. def isabs(url): ...
import re from bs4 import BeautifulSoup from django import template register = template.Library() @register.filter(is_safe=True) def baseurl(html, base): if not base.endswith('/'): base += '/' absurl = re.compile(r'\s*[a-zA-Z][a-zA-Z0-9\+\.\-]*:') # Starts with scheme:. def isabs(url): ...
Fix empty pixel set list message
from django.core.urlresolvers import reverse from apps.core.factories import PIXELER_PASSWORD, PixelerFactory from apps.core.tests import CoreFixturesTestCase from apps.core.management.commands.make_development_fixtures import ( make_development_fixtures ) class PixelSetListViewTestCase(CoreFixturesTestCase): ...
from django.core.urlresolvers import reverse from apps.core.factories import PIXELER_PASSWORD, PixelerFactory from apps.core.tests import CoreFixturesTestCase from apps.core.management.commands.make_development_fixtures import ( make_development_fixtures ) class PixelSetListViewTestCase(CoreFixturesTestCase): ...
Use kwargs when calling User.__init__
from faker import Faker import click from app.database import db from app.user.models import User @click.option('--num_users', default=5, help='Number of users.') def populate_db(num_users): """Populates the database with seed data.""" fake = Faker() users = [] for _ in range(num_users): user...
from faker import Faker import click from app.database import db from app.user.models import User @click.option('--num_users', default=5, help='Number of users.') def populate_db(num_users): """Populates the database with seed data.""" fake = Faker() users = [] for _ in range(num_users): user...
Resolve style errors on data block
var Data = require('../../lib/data'); module.exports = { className: 'data', template: require('./index.html'), data: { name: 'Data', icon: '/images/blocks_text.png', attributes: { label: { label: 'Header Text', type: 'string', ...
var Data = require('../../lib/data'); module.exports = { className: 'data', template: require('./index.html'), data: { name: 'Data', icon: '/images/blocks_text.png', attributes: { label: { label: 'Header Text', type: 'string', ...
Adjust the ds deployment example to use the directly-usable DatasourceArchive.
package org.wildfly.swarm.examples.ds.deployment; import org.jboss.shrinkwrap.api.ShrinkWrap; import org.wildfly.swarm.Swarm; import org.wildfly.swarm.container.Container; import org.wildfly.swarm.datasources.DatasourceArchive; import org.wildfly.swarm.jaxrs.JAXRSArchive; import org.wildfly.swarm.spi.api.JARArchive; ...
package org.wildfly.swarm.examples.ds.deployment; import org.jboss.shrinkwrap.api.ShrinkWrap; import org.wildfly.swarm.Swarm; import org.wildfly.swarm.container.Container; import org.wildfly.swarm.datasources.DatasourceArchive; import org.wildfly.swarm.jaxrs.JAXRSArchive; import org.wildfly.swarm.spi.api.JARArchive; ...
Allow quit on first page without reset prompt
define(["dist/local_object"], function(LocalObject){ function Pipeline(id, finalNode, resetPage, overwrite){ this.id = id; this.finalNode = finalNode; this.resetPage = resetPage; this.indexObj = new LocalObject(this.id, overwrite); } Pipeline.prototype.nodes = []; Pipeli...
define(["dist/local_object"], function(LocalObject){ function Pipeline(id, finalNode, resetPage, overwrite){ this.id = id; this.finalNode = finalNode; this.resetPage = resetPage; this.indexObj = new LocalObject(this.id, overwrite); } Pipeline.prototype.nodes = []; Pipeli...
Update select to remove warnning messages, use MenuItem instead
/** * Created by steve on 15/09/15. */ import React from 'react'; import ValidationMixin from './ValidationMixin'; import MenuItem from 'material-ui/lib/menus/menu-item'; const SelectField = require('material-ui/lib/select-field'); class Select extends React.Component { constructor(props) { super(props)...
/** * Created by steve on 15/09/15. */ import React from 'react'; import ValidationMixin from './ValidationMixin'; const SelectField = require('material-ui/lib/select-field'); class Select extends React.Component { constructor(props) { super(props); this.onSelected = this.onSelected.bind(this); ...
Return a Link for collection fields
<?php namespace SoliantConsulting\Apigility\Server\Hydrator\Strategy; use Zend\Stdlib\Hydrator\Strategy\StrategyInterface; use DoctrineModule\Persistence\ObjectManagerAwareInterface; use DoctrineModule\Persistence\ProvidesObjectManager; use DoctrineModule\Stdlib\Hydrator\Strategy\AbstractCollectionStrategy; use ZF\Ha...
<?php namespace SoliantConsulting\Apigility\Server\Hydrator\Strategy; use Zend\Stdlib\Hydrator\Strategy\StrategyInterface; use DoctrineModule\Persistence\ObjectManagerAwareInterface; use DoctrineModule\Persistence\ProvidesObjectManager; use DoctrineModule\Stdlib\Hydrator\Strategy\AbstractCollectionStrategy; use ZF\Ha...
Fix write path for generate command secret.
<?php namespace Tymon\JWTAuth\Commands; use Illuminate\Support\Str; use Illuminate\Console\Command; use Symfony\Component\Console\Input\InputOption; class JWTGenerateCommand extends Command { /** * The console command name. * * @var string */ protected $name = 'jwt:generate'; /** ...
<?php namespace Tymon\JWTAuth\Commands; use Illuminate\Support\Str; use Illuminate\Console\Command; use Symfony\Component\Console\Input\InputOption; class JWTGenerateCommand extends Command { /** * The console command name. * * @var string */ protected $name = 'jwt:generate'; /** ...
Revert the removal of an unused import (in [14175]) that was referenced in documentation. Thanks for noticing, clong. git-svn-id: 554f83ef17aa7291f84efa897c1acfc5d0035373@14359 bcc190cf-cafb-0310-a4f2-bffc1f526a37
# ACTION_CHECKBOX_NAME is unused, but should stay since its import from here # has been referenced in documentation. from django.contrib.admin.helpers import ACTION_CHECKBOX_NAME from django.contrib.admin.options import ModelAdmin, HORIZONTAL, VERTICAL from django.contrib.admin.options import StackedInline, TabularInli...
from django.contrib.admin.options import ModelAdmin, HORIZONTAL, VERTICAL from django.contrib.admin.options import StackedInline, TabularInline from django.contrib.admin.sites import AdminSite, site def autodiscover(): """ Auto-discover INSTALLED_APPS admin.py modules and fail silently when not present. T...
Create array in old manner (PHP 5.3)
<?php namespace Ratchet\Session\Serialize; class PhpHandler implements HandlerInterface { /** * Simply reverse behaviour of unserialize method. * {@inheritdoc} */ function serialize(array $data) { $preSerialized = array(); $serialized = ''; if (count($data)) { ...
<?php namespace Ratchet\Session\Serialize; class PhpHandler implements HandlerInterface { /** * Simply reverse behaviour of unserialize method. * {@inheritdoc} */ function serialize(array $data) { $preSerialized = []; $serialized = ''; if (count($data)) { ...
Add method to generate config and load config on vendor class
<?php namespace Core; /** * Manage vendor and can automatically detect vendor. * * @package Core */ class Vendor { /** * Cache vendor list * * @var array */ private $vendors = array(); public function __construct() ...
<?php namespace Core; /** * Manage vendor and can automatically detect vendor. * * @package Core */ class Vendor { /** * Cache vendor list * * @var array */ private $vendors = array(); public function __construct() ...
Test ´ifShortPart´: fix code style
import chai from 'chai' import ifShortPart from '@/wordbreaker-russian/rules/if-short-part' describe( 'ifShortPart', () => { it( 'Это функция', () => chai.assert.isFunction(ifShortPart) ) describe( 'Правильно работает', () => { ...
import chai from 'chai' import ifShortPart from '@/wordbreaker-russian/rules/if-short-part' describe( 'ifShortPart', () => { it( 'Это функция', () => { chai.assert.isFunction(ifShortPart) } ) it( 'Правильно работает', () => { ...
Return true if there are no filters to validate.
var _ = require('lodash'); var RunValidations = require('../utils/RunValidations').run; var FilterValidations = require('../validations/FilterValidations'); var TimeframeUtils = require('../utils/TimeframeUtils'); var FilterUtils = require('../utils/FilterUtils'); module.exports = { event_collection: { msg...
var RunValidations = require('../utils/RunValidations').run; var FilterValidations = require('../validations/FilterValidations'); var TimeframeUtils = require('../utils/TimeframeUtils'); var FilterUtils = require('../utils/FilterUtils'); module.exports = { event_collection: { msg: 'Choose an Event Collecti...
Add sleep on start database
# -*- coding: utf-8 -*- import logging from util import full_stack from workflow.steps.util.base import BaseStep from workflow.exceptions.error_codes import DBAAS_0022 from workflow.steps.util.restore_snapshot import use_database_initialization_script from time import sleep LOG = logging.getLogger(__name__) class St...
# -*- coding: utf-8 -*- import logging from util import full_stack from workflow.steps.util.base import BaseStep from workflow.exceptions.error_codes import DBAAS_0022 from workflow.steps.util.restore_snapshot import use_database_initialization_script LOG = logging.getLogger(__name__) class StartDatabase(BaseStep): ...
Fix total number of values printed
// **************************************************************** // PowersOf2.java // // Print out as many powers of 2 as the user requests // // **************************************************************** import java.util.Scanner; public class PowersOf2 { public static void main(String[] arg...
// **************************************************************** // PowersOf2.java // // Print out as many powers of 2 as the user requests // // **************************************************************** import java.util.Scanner; public class PowersOf2 { public static void main(String[] arg...
Fix failing command on Linux.
# :coding: utf-8 # :copyright: Copyright (c) 2013 Martin Pengelly-Phillips # :license: See LICENSE.txt. import subprocess import pickle import base64 try: from shlex import quote except ImportError: from pipes import quote from .base import Processor from .. import pickle_support class BackgroundProcessor(...
# :coding: utf-8 # :copyright: Copyright (c) 2013 Martin Pengelly-Phillips # :license: See LICENSE.txt. import subprocess import pickle import base64 try: from shlex import quote except ImportError: from pipes import quote from .base import Processor from .. import pickle_support class BackgroundProcessor(...
Fix typo in matplotlib setup.
import tables import tables as tb try: import fipy import fipy as fp except: pass import numpy import numpy as np import scipy import scipy as spy import matplotlib.pyplot as plt def gitCommand(cmd, verbose=False): from subprocess import Popen, PIPE p = Popen(['git'] + cmd, shell=False, stdin=...
import tables import tables as tb try: import fipy import fipy as fp except: pass import numpy import numpy as np import scipy import scipy as spy import matplotlib.pylot as plt def gitCommand(cmd, verbose=False): from subprocess import Popen, PIPE p = Popen(['git'] + cmd, shell=False, stdin=P...
Fix NameError: global name 'messsage' is not defined
import json class Database(dict): """Holds a dict that contains all the information about the users in a channel""" def __init__(self, irc): super(Database, self).__init__(json.load(open("userdb.json"))) self.irc = irc def remove_entry(self, event, nick): try: del self...
import json class Database(dict): """Holds a dict that contains all the information about the users in a channel""" def __init__(self, irc): super(Database, self).__init__(json.load(open("userdb.json"))) self.irc = irc def remove_entry(self, event, nick): try: del self...
Fix url to 404 template
(function() { 'use strict'; moment.locale('nb'); var module = angular.module('billett', [ 'ngRoute', 'billett.auth', // common 'billett.common.directives', 'billett.common.filters', 'billett.common.CsrfInceptorService', 'billett.common.HeaderControl...
(function() { 'use strict'; moment.locale('nb'); var module = angular.module('billett', [ 'ngRoute', 'billett.auth', // common 'billett.common.directives', 'billett.common.filters', 'billett.common.CsrfInceptorService', 'billett.common.HeaderControl...
Fix incorrect member visibility on event
<?php namespace Flarum\Events; use Flarum\Api\Actions\SerializeAction; class BuildApiAction { public $action; /** * @param SerializeAction $action */ public function __construct($action) { $this->action = $action; } public function serializer($serializer) { $thi...
<?php namespace Flarum\Events; use Flarum\Api\Actions\SerializeAction; class BuildApiAction { protected $action; /** * @param SerializeAction $action */ public function __construct($action) { $this->action = $action; } public function serializer($serializer) { $...
BAP-738: Rename buttons "Add new" to "Add {entity_name}"
<?php namespace Acme\Bundle\DemoFlexibleEntityBundle\Tests\Functional\Controller; /** * Test related class * * @author Romain Monceau <romain@akeneo.com> * @copyright 2012 Akeneo SAS (http://www.akeneo.com) * @license http://opensource.org/licenses/MIT MIT * */ class FlexibleControllerTest extends KernelA...
<?php namespace Acme\Bundle\DemoFlexibleEntityBundle\Tests\Functional\Controller; /** * Test related class * * @author Romain Monceau <romain@akeneo.com> * @copyright 2012 Akeneo SAS (http://www.akeneo.com) * @license http://opensource.org/licenses/MIT MIT * */ class FlexibleControllerTest extends KernelA...
Revert getLocked (Lombokified name was isLocked)
package net.glowstone.scoreboard; import lombok.Getter; import lombok.RequiredArgsConstructor; import lombok.Setter; import net.glowstone.net.message.play.scoreboard.ScoreboardScoreMessage; import org.bukkit.Bukkit; import org.bukkit.OfflinePlayer; import org.bukkit.scoreboard.Objective; import org.bukkit.scoreboard.S...
package net.glowstone.scoreboard; import lombok.Getter; import lombok.RequiredArgsConstructor; import lombok.Setter; import net.glowstone.net.message.play.scoreboard.ScoreboardScoreMessage; import org.bukkit.Bukkit; import org.bukkit.OfflinePlayer; import org.bukkit.scoreboard.Objective; import org.bukkit.scoreboard.S...
Remove Debugger Statement From Route Remove a debugger statement in the application route.
import config from '../config/environment'; import { inject as service } from '@ember/service'; import AuthenticateRoute from 'wholetale/routes/authenticate'; export default AuthenticateRoute.extend({ internalState: service(), model: function (params) { // console.log("Called Authenticate, proceeding in Appl...
import config from '../config/environment'; import { inject as service } from '@ember/service'; import AuthenticateRoute from 'wholetale/routes/authenticate'; export default AuthenticateRoute.extend({ internalState: service(), model: function (params) { // console.log("Called Authenticate, proceeding in Appl...
Fix incorrect docstring for NFA class
#!/usr/bin/env python3 import automata.automaton as automaton class NFA(automaton.Automaton): """a nondeterministic finite automaton""" def validate_automaton(self): """returns True if this NFA is internally consistent; raises the appropriate exception if this NFA is invalid""" for ...
#!/usr/bin/env python3 import automata.automaton as automaton class NFA(automaton.Automaton): """a deterministic finite automaton""" def validate_automaton(self): """returns True if this NFA is internally consistent; raises the appropriate exception if this NFA is invalid""" for sta...
Copy CSS from source to dist using Webpack
const webpack = require("webpack"); const path = require("path"); const CopyWebpackPlugin = require("copy-webpack-plugin"); const ExtractTextPlugin = require("extract-text-webpack-plugin"); module.exports = { entry: "./src/com/mendix/widget/StarRating/StarRating.ts", output: { path: path.resolve(__dirn...
const webpack = require("webpack"); const path = require("path"); const CopyWebpackPlugin = require("copy-webpack-plugin"); const ExtractTextPlugin = require("extract-text-webpack-plugin"); module.exports = { entry: "./src/com/mendix/widget/StarRating/StarRating.ts", output: { path: path.resolve(__dirn...
Remove the now-defunct middleware from the test settings
# Settings to be used when running unit tests # python manage.py test --settings=lazysignup.test_settings lazysignup DATABASE_ENGINE = 'sqlite3' # 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'. DATABASE_NAME = '' # Or path to database file if using sqlite3. DATABASE_USER = '...
# Settings to be used when running unit tests # python manage.py test --settings=lazysignup.test_settings lazysignup DATABASE_ENGINE = 'sqlite3' # 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'. DATABASE_NAME = '' # Or path to database file if using sqlite3. DATABASE_USER = '...
Add pretty url pagination support
<?php namespace Zelenin\yii\modules\I18n; use yii\base\BootstrapInterface; use Yii; use yii\data\Pagination; use Zelenin\yii\modules\I18n\console\controllers\I18nController; class Bootstrap implements BootstrapInterface { /** * @inheritdoc */ public function bootstrap($app) { if ($app i...
<?php namespace Zelenin\yii\modules\I18n; use yii\base\BootstrapInterface; use Yii; use yii\data\Pagination; use Zelenin\yii\modules\I18n\console\controllers\I18nController; class Bootstrap implements BootstrapInterface { /** * @inheritdoc */ public function bootstrap($app) { if ($app i...
Fix loader on empty config
var loaderUtils = require('loader-utils'); var postcss = require('postcss'); module.exports = function (source, map) { if ( this.cacheable ) this.cacheable(); var file = loaderUtils.getRemainingRequest(this); var params = loaderUtils.parseQuery(this.query); var opts = { from: file, to...
var loaderUtils = require('loader-utils'); var postcss = require('postcss'); module.exports = function (source, map) { if ( this.cacheable ) this.cacheable(); var file = loaderUtils.getRemainingRequest(this); var params = loaderUtils.parseQuery(this.query); var opts = { from: file, to...
Add Chardet as installation dependency
#!/usr/bin/env python from distutils.core import setup setup( name='freki', version='0.3.0-develop', description='PDF-Extraction helper for RiPLEs pipeline.', author='Michael Goodman, Ryan Georgi', author_email='goodmami@uw.edu, rgeorgi@uw.edu', url='https://github.com/xigt/freki', license=...
#!/usr/bin/env python from distutils.core import setup setup( name='freki', version='0.3.0-develop', description='PDF-Extraction helper for RiPLEs pipeline.', author='Michael Goodman, Ryan Georgi', author_email='goodmami@uw.edu, rgeorgi@uw.edu', url='https://github.com/xigt/freki', license=...
Fix service provider kernel detection
<?php namespace SebastiaanLuca\Router; use Illuminate\Contracts\Http\Kernel as AppKernel; use Illuminate\Foundation\Support\Providers\RouteServiceProvider; use Illuminate\Routing\Router; use SebastiaanLuca\Router\Routers\BootstrapRouter; class RouterServiceProvider extends RouteServiceProvider { /** * Map ...
<?php namespace SebastiaanLuca\Router; use Illuminate\Contracts\Http\Kernel as AppKernel; use Illuminate\Foundation\Support\Providers\RouteServiceProvider; use Illuminate\Routing\Router; use SebastiaanLuca\Router\Routers\BootstrapRouter; class RouterServiceProvider extends RouteServiceProvider { /** * ...
Correct test criteria for time format for scheduled skill. Now matches current behaviour, previous behaviour is not a good idea since it depended on Locale.
from datetime import datetime, timedelta import unittest from mycroft.skills.scheduled_skills import ScheduledSkill from mycroft.util.log import getLogger __author__ = 'eward' logger = getLogger(__name__) class ScheduledSkillTest(unittest.TestCase): skill = ScheduledSkill(name='ScheduledSkillTest') def te...
from datetime import datetime, timedelta import unittest from mycroft.skills.scheduled_skills import ScheduledSkill from mycroft.util.log import getLogger __author__ = 'eward' logger = getLogger(__name__) class ScheduledSkillTest(unittest.TestCase): skill = ScheduledSkill(name='ScheduledSkillTest') def te...
Update to include the TheGame:MapBundle controller
<?php use Symfony\Component\HttpKernel\Kernel; use Symfony\Component\Config\Loader\LoaderInterface; class AppKernel extends Kernel { public function registerBundles() { $bundles = [ new Symfony\Bundle\FrameworkBundle\FrameworkBundle(), new Symfony\Bundle\SecurityBundle\Security...
<?php use Symfony\Component\HttpKernel\Kernel; use Symfony\Component\Config\Loader\LoaderInterface; class AppKernel extends Kernel { public function registerBundles() { $bundles = [ new Symfony\Bundle\FrameworkBundle\FrameworkBundle(), new Symfony\Bundle\SecurityBundle\Security...
Add lang to html tag in example site
import React from 'react' import Document, { Html, Head, Body, App, Footer } from 'react-document' /** * This component is a template for the HTML file. You can add webfonts, meta tags, * or analytics to this file. * * To begin the development, run `npm start`. * To create a static bundle, use `npm run build`. *...
import React from 'react' import Document, { Html, Head, Body, App, Footer } from 'react-document' /** * This component is a template for the HTML file. You can add webfonts, meta tags, * or analytics to this file. * * To begin the development, run `npm start`. * To create a static bundle, use `npm run build`. *...
BAP-4203: Convert doctrine subscribers to listeners, make all doctrine listeners lazy - fixed unit test
<?php namespace Oro\Bundle\PlatformBundle\Tests\Unit\DependencyInjection; use Oro\Bundle\PlatformBundle\DependencyInjection\Compiler\LazyServicesCompilerPass; class LazyServicesCompilerPassTest extends \PHPUnit_Framework_TestCase { public function testProcessLazyServicesTag() { $expectedTags = array(...
<?php namespace Oro\Bundle\PlatformBundle\Tests\Unit\DependencyInjection; use Oro\Bundle\PlatformBundle\DependencyInjection\Compiler\LazyServicesCompilerPass; class LazyServicesCompilerPassTest extends \PHPUnit_Framework_TestCase { public function testProcessLazyServicesTag() { $expectedTags = array(...
Refactor create_card method to take a list of card dictionaries. Rename method accordingly.
from pymongo import MongoClient class Cards: def __init__(self, dbname='cards'): """Instantiate this class. Set up a connection to the given Mongo database. Get to the collection we'll store cards in. Args: dbname (str): Database name. """ s...
from pymongo import MongoClient class Cards: def __init__(self, dbname='cards'): """Instantiate this class. Set up a connection to the given Mongo database. Get to the collection we'll store cards in. Args: dbname (str): Database name. """ s...
Fix CS issue in build
<?php declare(strict_types = 1); namespace App\Service\Speaker; use League\Flysystem\FilesystemInterface; use Psr\Http\Message\UploadedFileInterface; use Ramsey\Uuid\Uuid; final class FlysystemMoveSpeakerHeadshot implements MoveSpeakerHeadshotInterface { /** * @var FilesystemInterface */ private $f...
<?php declare(strict_types = 1); namespace App\Service\Speaker; use League\Flysystem\FilesystemInterface; use Psr\Http\Message\UploadedFileInterface; use Ramsey\Uuid\Uuid; final class FlysystemMoveSpeakerHeadshot implements MoveSpeakerHeadshotInterface { /** * @var FilesystemInterface */ private $f...
Remove upper limit for tornado's version My use case seems to work with tornado 4.0.2.
#!/usr/bin/env python # -*- coding: utf-8 -*- from setuptools import setup, find_packages from tornado_redis_sentinel import __version__ tests_require = [ 'mock', 'nose', 'coverage', 'yanc', 'preggy', 'tox', 'ipdb', 'coveralls', ] setup( name='tornado-redis-sentinel', version=...
#!/usr/bin/env python # -*- coding: utf-8 -*- from setuptools import setup, find_packages from tornado_redis_sentinel import __version__ tests_require = [ 'mock', 'nose', 'coverage', 'yanc', 'preggy', 'tox', 'ipdb', 'coveralls', ] setup( name='tornado-redis-sentinel', version=...
Fix template for docker command line
import os import subprocess def env(image): """Return environment of image. """ out = docker('inspect', '-f', '{{.Config.Env}}', image) return dict(map(lambda x: x.split('='), out.strip()[1:-1].split())) def path(p): """Build the corresponding path `p` inside the container. """ return os.path....
import os import subprocess def env(image): """Return environment of image. """ out = docker('inspect', '-f', '{{.Config.Env}}', image) return dict(map(lambda x: x.split('='), out.strip()[1:-1].split())) def path(p): """Build the corresponding path `p` inside the container. """ return os.path....
Clean up some comments on ConfigTrait
<?php namespace Elasticquent; trait ElasticquentConfigTrait { /** * Get the Elasticquent config * * @param string $key the configuration key * @param string $prefix filename of configuration file * @return array configuration */ public function getElasticConfig($key = 'config', $...
<?php namespace Elasticquent; trait ElasticquentConfigTrait { /** * Get the Elasticquent config * * @param string $key the configuration key * @param string $prefix filename of configuration file * @return array configuration */ public function getElasticConfig($key = 'config', $...
Use https for GitHub issue link
package us.myles.ViaVersion.exception; import java.util.HashMap; import java.util.Map; public class InformativeException extends Exception { private final Map<String, Object> info = new HashMap<>(); private int sources; public InformativeException(Throwable cause) { super(cause); } publi...
package us.myles.ViaVersion.exception; import java.util.HashMap; import java.util.Map; public class InformativeException extends Exception { private final Map<String, Object> info = new HashMap<>(); private int sources; public InformativeException(Throwable cause) { super(cause); } publi...
Make sure country userinfo response is valid.
<?php namespace Northstar\Http\Transformers; use Northstar\Models\User; use League\Fractal\TransformerAbstract; class UserInfoTransformer extends TransformerAbstract { /** * @param User $user * @return array */ public function transform(User $user) { // User data, formatted accordi...
<?php namespace Northstar\Http\Transformers; use Northstar\Models\User; use League\Fractal\TransformerAbstract; class UserInfoTransformer extends TransformerAbstract { /** * @param User $user * @return array */ public function transform(User $user) { // User data, formatted accordi...
Use fat arrow syntax for callbacks.
{ angular.module('meganote.notesForm') .controller('NotesFormController', NotesFormController); NotesFormController.$inject = ['$state', 'Flash', 'NotesService']; function NotesFormController($state, Flash, NotesService) { const vm = this; vm.note = NotesService.find($state.params.noteId); vm.cle...
{ angular.module('meganote.notesForm') .controller('NotesFormController', NotesFormController); NotesFormController.$inject = ['$state', 'Flash', 'NotesService']; function NotesFormController($state, Flash, NotesService) { const vm = this; vm.note = NotesService.find($state.params.noteId); vm.cle...
Remove php 5.4 array tags
<?php namespace Payum\Core\Tests\Mocks\Model; use Payum\Core\Exception\LogicException; class Propel2ModelQuery { const MODEL_CLASS = "Payum\\Core\\Tests\\Mocks\\Model\\Propel2Model"; protected $filters = array(); protected $modelReflection; public function __construct() { $this->modelRe...
<?php namespace Payum\Core\Tests\Mocks\Model; use Payum\Core\Exception\LogicException; class Propel2ModelQuery { const MODEL_CLASS = "Payum\\Core\\Tests\\Mocks\\Model\\Propel2Model"; protected $filters = array(); protected $modelReflection; public function __construct() { $this->modelRe...
Make correct context when select entity in search
'use strict'; angular.module('mean.icu').service('context', function ($injector, $q) { var mainMap = { task: 'tasks', user: 'people', project: 'projects', discussion: 'discussions', officeDocument:'officeDocuments', office: 'offices', templateDoc: 'templateDo...
'use strict'; angular.module('mean.icu').service('context', function ($injector, $q) { var mainMap = { task: 'tasks', user: 'people', project: 'projects', discussion: 'discussions', officeDocument:'officeDocuments', office: 'offices', templateDoc: 'templateDo...
Add play icon to demo button
<?php echo $head; ?> <div class="pure-g centered-row"> <div class="pure-u-1"> <div class="l-box"> <p> <?php echo _('Hey!'); echo ' '; ?> </p> <p> <?php echo ' '; ...
<?php echo $head; ?> <div class="pure-g centered-row"> <div class="pure-u-1"> <div class="l-box"> <p> <?php echo _('Hey!'); echo ' '; ?> </p> <p> <?php echo ' '; ...
Fix transformer errors for undefined source dates
<?php namespace App\Http\Transformers; use Illuminate\Support\Facades\Log; use League\Fractal\TransformerAbstract; class ApiTransformer extends TransformerAbstract { public $excludeIdsAndTitle = false; public $excludeDates = false; /** * Turn this item object into a generic array. * * @...
<?php namespace App\Http\Transformers; use Illuminate\Support\Facades\Log; use League\Fractal\TransformerAbstract; class ApiTransformer extends TransformerAbstract { public $excludeIdsAndTitle = false; public $excludeDates = false; /** * Turn this item object into a generic array. * * @...
Tweak map styles to match theme
angular.module('dplaceMapDirective', []) .directive('dplaceMap', function() { function link(scope, element, attrs) { element.append("<div id='mapdiv' style='width:1140px; height:480px;'></div>"); scope.map = $('#mapdiv').vectorMap({ map: 'world_mill_en', ...
angular.module('dplaceMapDirective', []) .directive('dplaceMap', function() { function link(scope, element, attrs) { element.append("<div id='mapdiv' style='width:1140px; height:480px;'></div>"); scope.map = $('#mapdiv').vectorMap({map: 'world_mill_en'}).vectorMap('get','mapObject');...
Add support for absolute URL in request
from ..darkobject import DarkObject from bs4 import BeautifulSoup import requests import logging import time class Scrubber(DarkObject): def __init__(self): super(Scrubber, self).__init__() def scrub(self): """ Get item metadata. """ return {} # noinspection PyBro...
from ..darkobject import DarkObject from bs4 import BeautifulSoup import logging import time from urllib.request import urlopen class Scrubber(DarkObject): def __init__(self): super(Scrubber, self).__init__() def scrub(self): """ Get item metadata. """ return {} ...
Update in the update function
# Github Tray App import rumps import config import contribs class GithubTrayApp(rumps.App): def __init__(self): super(GithubTrayApp, self).__init__('Github') self.count = rumps.MenuItem('commits') self.username = config.get_username() self.menu = [ self.count, ...
# Github Tray App import rumps import config import contribs class GithubTrayApp(rumps.App): def __init__(self): super(GithubTrayApp, self).__init__('Github') self.count = rumps.MenuItem('commits') self.username = config.get_username() self.menu = [ self.count, ...
Add implementation hasTable to Mysqli schema
<?php namespace DB\Schema; class MySQLi implements ISchema { private $fields = array(); private $cons = array(); public function addField($field) { $this->fields[] = "`$field->name` $field->type".($field->null?'':' NOT NULL '). ($field->autoinc?'...
<?php namespace DB\Schema; class MySQLi implements ISchema { private $fields = array(); private $cons = array(); public function addField($field) { $this->fields[] = "`$field->name` $field->type".($field->null?'':' NOT NULL '). ($field->autoinc?'...
Remove warning from debug toolbar.
import os from .default import * # nopep8 DEBUG = True TEMPLATE_DEBUG = DEBUG if DEBUG: INSTALLED_APPS += ( 'debug_toolbar', ) # debug toolbar settings MIDDLEWARE_CLASSES += ( 'debug_toolbar.middleware.DebugToolbarMiddleware', ) DEBUG_TOOLBAR_PANELS = ( 'debug_toolbar...
import os from .default import * # nopep8 DEBUG = True TEMPLATE_DEBUG = DEBUG if DEBUG: INSTALLED_APPS += ( 'debug_toolbar', ) # debug toolbar settings MIDDLEWARE_CLASSES += ( 'debug_toolbar.middleware.DebugToolbarMiddleware', ) DEBUG_TOOLBAR_PANELS = ( 'debug_toolbar...
Align cfg logo right on larger screens
<footer class="row"> <div class="c-footer col-xs-12 col-md-offset-2 col-md-8"> <div class="row"> <div class="col-xs-6 col-sm-4"> <img src="{{ asset('img/logos/okf.svg') }}" alt="Logo der OpenKnowledge Foundation Deutschland" height=...
<footer class="row"> <div class="c-footer col-xs-12 col-md-offset-2 col-md-8"> <div class="row"> <div class="col-xs-6 col-sm-4"> <img src="{{ asset('img/logos/okf.svg') }}" alt="Logo der OpenKnowledge Foundation Deutschland" height=...
Add quit button functionality in menuView
/** * Package contains all the views required by budgetreporter */ package com.budgetreporter.View; import java.awt.BorderLayout; import java.awt.Container; import java.awt.GridLayout; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import javax.swing.Box; import javax.swing.BoxLayout; impo...
/** * Package contains all the views required by budgetreporter */ package com.budgetreporter.View; import java.awt.BorderLayout; import java.awt.Container; import java.awt.GridLayout; import javax.swing.Box; import javax.swing.BoxLayout; import javax.swing.JButton; import javax.swing.JFrame; import javax.swing.JLa...
Add semantic tags for devsys
import React, {PropTypes} from 'react' import SyntaxHighlighter from 'react-syntax-highlighter' import { docco } from 'react-syntax-highlighter/dist/styles' import Button from '../Button' import Avatar from '../Avatar' export default function Card ({ avatar, message, fullname, username, snippet = {} }) { return ( ...
import React, {PropTypes} from 'react' import SyntaxHighlighter from 'react-syntax-highlighter' import { docco } from 'react-syntax-highlighter/dist/styles' import Button from '../Button' import Avatar from '../Avatar' export default function Card ({ avatar, message, fullname, username, snippet = {} }) { return ( ...
Handle error case for username shortening
'use strict'; /** * @ngdoc function * @name dockstore.ui.controller:NavbarCtrl * @description * # NavbarCtrl * Controller of the dockstore.ui */ angular.module('dockstore.ui') .controller('NavbarCtrl', [ '$scope', '$rootScope', '$auth', '$location', 'UserService', 'NotificationService',...
'use strict'; /** * @ngdoc function * @name dockstore.ui.controller:NavbarCtrl * @description * # NavbarCtrl * Controller of the dockstore.ui */ angular.module('dockstore.ui') .controller('NavbarCtrl', [ '$scope', '$rootScope', '$auth', '$location', 'UserService', 'NotificationService',...
Revert "Revert "Revert "Revert "Reorder operator"""" This reverts commit b24a074dde5c29efee87896bd74183330fea1948.
/* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. */ package tw.edu.npu.mis; /** * The model class of the calculator application. */ public class Calculator { /** * The av...
/* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. */ package tw.edu.npu.mis; /** * The model class of the calculator application. */ public class Calculator { /** * The av...
Add note that Java 8 provides some kind of duck typing
package info.schleichardt.training.java8.lecture2; import java.security.MessageDigest; public class P2_FunctionalInterfacesFirstClassMembers { @FunctionalInterface public interface HashFunction { byte[] hash(final String input) throws Exception; //return type, works also in classes s...
package info.schleichardt.training.java8.lecture2; import java.security.MessageDigest; public class P2_FunctionalInterfacesFirstClassMembers { @FunctionalInterface public interface HashFunction { byte[] hash(final String input) throws Exception; //return type, works also in classes s...
Fix relativ import of package
# -*- coding: utf-8 -*- ''' Copyright (c) 2018 by Tobias Houska This file is part of Statistical Parameter Optimization Tool for Python(SPOTPY). :author: Tobias Houska, Philipp Kraft ''' import unittest import matplotlib matplotlib.use('Agg') import sys if sys.version_info >= (3, 5) and matplotlib.__version__ >= '2....
# -*- coding: utf-8 -*- ''' Copyright (c) 2018 by Tobias Houska This file is part of Statistical Parameter Optimization Tool for Python(SPOTPY). :author: Tobias Houska, Philipp Kraft ''' import unittest import matplotlib matplotlib.use('Agg') import sys if sys.version_info >= (3, 5) and matplotlib.__version__ >= '2....
Update text references in the console version.
#!/usr/bin/python2 from __future__ import print_function from board import Board import sys class GameOfLifeConsole: def __init__(self): print('Welcome to MaGol') print('What board size do you want?') board_size = raw_input() while not board_size.isdigit(): print('...
#!/usr/bin/python2 from __future__ import print_function from board import Board import sys class GameOfLifeConsole: def __init__(self): print('Welcome to PyGol') print('What board size do you want?') board_size = raw_input() while not board_size.isdigit(): print('...
[FIX] product_management_group: Allow superuser to skip that restriction on products closes ingadhoc/product#409 Signed-off-by: Nicolas Mac Rouillon <8d34fe7b7c65100e706828a8c0d03426900ffb59@adhoc.com.ar>
############################################################################## # For copyright and license notices, see __openerp__.py file in module root # directory ############################################################################## from odoo import api, models, tools, exceptions, _ class IrModelAccess(m...
############################################################################## # For copyright and license notices, see __openerp__.py file in module root # directory ############################################################################## from odoo import api, models, tools, exceptions, _ class IrModelAccess(m...
Document new {{import:file.txt}} command for Anki card definitions.
# This Source Code Form is subject to the terms of the Mozilla Public # License, v2.0. If a copy of the MPL was not distributed with this # file, you can obtain one at http://mozilla.org/MPL/2.0/. import os import re import yaml import lib.genanki.genanki as genanki class Anki: def generate_id(): """Gener...
# This Source Code Form is subject to the terms of the Mozilla Public # License, v2.0. If a copy of the MPL was not distributed with this # file, you can obtain one at http://mozilla.org/MPL/2.0/. import os import re import yaml import lib.genanki.genanki as genanki class Anki: def generate_id(): """Gener...
Tweak integration timeout test to match gtest
class ServiceTests(object): def test_bash(self): return self.check( input='bc -q\n1+1\nquit()', type='org.tyrion.service.bash', output='2', error='', code='0', ) def test_python(self): return self.check( input='pr...
class ServiceTests(object): def test_bash(self): return self.check( input='bc -q\n1+1\nquit()', type='org.tyrion.service.bash', output='2', error='', code='0', ) def test_python(self): return self.check( input='pr...
Add --group option to CLI
import argparse import sys def main(raw_args=sys.argv[1:]): """ A tool to automatically request, renew and distribute Let's Encrypt certificates for apps running on Marathon and served by marathon-lb. """ parser = argparse.ArgumentParser( description='Automatically manage ACME certificates...
import argparse import sys def main(raw_args=sys.argv[1:]): """ A tool to automatically request, renew and distribute Let's Encrypt certificates for apps running on Marathon and served by marathon-lb. """ parser = argparse.ArgumentParser( description='Automatically manage ACME certificates...
Add test to check registration button exists on login page
<?php namespace AppBundle\Tests\Functional\Controller; class SecurityControllerTest extends \AppBundle\Tests\Functional\TestCase { public function testRedirectForAnonymous() { $client = static::createClient(); $client->request('GET', '/'); $this->assertTrue($client->getResponse()->is...
<?php namespace AppBundle\Tests\Functional\Controller; class SecurityControllerTest extends \AppBundle\Tests\Functional\TestCase { public function testRedirectForAnonymous() { $client = static::createClient(); $client->request('GET', '/'); $this->assertTrue($client->getResponse()->is...
Revert "fix(client: spec): change jasmine timeout from 120 to 180 s" This reverts commit a5f8f6d08b31d20dfec1cd89ada0b1b0b23c5b36.
'use strict'; //var ScreenShotReporter = require('protractor-screenshot-reporter'); exports.config = { allScriptsTimeout: 30000, baseUrl: 'http://localhost:9090', params: { baseBackendUrl: 'http://localhost:5000/api/', username: 'admin', password: 'admin' }, specs: ['spec/s...
'use strict'; //var ScreenShotReporter = require('protractor-screenshot-reporter'); exports.config = { allScriptsTimeout: 30000, baseUrl: 'http://localhost:9090', params: { baseBackendUrl: 'http://localhost:5000/api/', username: 'admin', password: 'admin' }, specs: ['spec/s...
Use app logging instead of celery
from datetime import datetime from flask import current_app from changes.config import db, queue from changes.models import Repository def sync_repo(repo_id): repo = Repository.query.get(repo_id) if not repo: return vcs = repo.get_vcs() if vcs is None: return repo.last_update_at...
from datetime import datetime from changes.config import db, queue from changes.models import Repository def sync_repo(repo_id): repo = Repository.query.get(repo_id) if not repo: return vcs = repo.get_vcs() if vcs is None: return repo.last_update_attempt = datetime.utcnow() ...
Make tooltip's container the page's body
import Ember from 'ember'; export default Ember.Mixin.create({ /** * Enables the tooltip functionality, based on component's `title` attribute * @method enableTooltip */ enableTooltip: function () { var popoverContent = this.get( 'popover' ); var title = this.get( 'title' ); ...
import Ember from 'ember'; export default Ember.Mixin.create({ /** * Enables the tooltip functionality, based on component's `title` attribute * @method enableTooltip */ enableTooltip: function () { var popoverContent = this.get( 'popover' ); var title = this.get( 'title' ); ...
Add correct $_SESSION[user] variable to Projects Test Class
<?php namespace fennecweb; class ProjectsTest extends \PHPUnit_Framework_TestCase { const NICKNAME = 'listingProjectsTestUser'; const USERID = 'listingProjectsTestUser'; const PROVIDER = 'listingProjectsTestUser'; public function testExecute() { //Test for error returned by user is not lo...
<?php namespace fennecweb; class ProjectsTest extends \PHPUnit_Framework_TestCase { const NICKNAME = 'listingProjectsTestUser'; const USERID = 'listingProjectsTestUser'; const PROVIDER = 'listingProjectsTestUser'; public function testExecute() { //Test for error returned by user is not lo...
Update config for Symfony 4.2 change
<?php namespace Gos\Bundle\PubSubRouterBundle\DependencyInjection; use Gos\Bundle\PubSubRouterBundle\Generator\Generator; use Gos\Bundle\PubSubRouterBundle\Matcher\Matcher; use Gos\Bundle\PubSubRouterBundle\Router\Router; use Symfony\Component\Config\Definition\Builder\TreeBuilder; use Symfony\Component\Config\Defini...
<?php namespace Gos\Bundle\PubSubRouterBundle\DependencyInjection; use Gos\Bundle\PubSubRouterBundle\Generator\Generator; use Gos\Bundle\PubSubRouterBundle\Matcher\Matcher; use Gos\Bundle\PubSubRouterBundle\Router\Router; use Symfony\Component\Config\Definition\Builder\TreeBuilder; use Symfony\Component\Config\Defini...
Add audio/video support and bail on findings
from django.core.management.base import BaseCommand from corehq.apps.domain.models import Domain import csv class Command(BaseCommand): help = 'Find domains with secure submissions and image questions' def check_domain(self, domain, csv_writer): if domain.secure_submissions: for app in do...
from django.core.management.base import BaseCommand from corehq.apps.domain.models import Domain import csv class Command(BaseCommand): help = 'Find domains with secure submissions and image questions' def handle(self, *args, **options): with open('domain_results.csv', 'wb+') as csvfile: ...
Include uncategorised spending in overview pie chart Also, only show last 120 days
from datetime import date, timedelta from django.db.models import Sum from django.views.generic import TemplateView from djofx.forms import OFXForm from djofx.views.base import PageTitleMixin, UserRequiredMixin from djofx import models from operator import itemgetter class HomePageView(PageTitleMixin, UserRe...
from django.db.models import Sum from django.views.generic import TemplateView from djofx.forms import OFXForm from djofx.views.base import PageTitleMixin, UserRequiredMixin from djofx import models class HomePageView(PageTitleMixin, UserRequiredMixin, TemplateView): template_name = "djofx/home.html" ...
Add edit icon for password fields
/*eslint-disable no-unused-vars */ import React from "react"; /*eslint-enable no-unused-vars */ import FieldInput from "./FieldInput"; import IconEdit from "./icons/IconEdit"; const DEFAULT_PASSWORD_TEXT = "••••••"; const METHODS_TO_BIND = ["handleOnFocus"]; export default class FieldPassword extends FieldInput { ...
/*eslint-disable no-unused-vars */ import React from "react"; /*eslint-enable no-unused-vars */ import FieldInput from "./FieldInput"; const DEFAULT_PASSWORD_TEXT = "••••••"; const METHODS_TO_BIND = ["handleOnFocus"]; export default class FieldPassword extends FieldInput { constructor() { super(); METHOD...
Define mocha as testing framework. We don't use jasmine that is the wallaby default.
module.exports = function (wallaby) { 'use strict' return { testFramework: 'mocha', files: [ {pattern: 'node_modules/systemjs/dist/system.js', instrument: false}, {pattern: 'node_modules/es6-shim/es6-shim.js', instrument: false}, {pattern: 'src/jspm.conf.js', instrument: false}, {p...
module.exports = function (wallaby) { 'use strict' return { files: [ {pattern: 'node_modules/systemjs/dist/system.js', instrument: false}, {pattern: 'node_modules/es6-shim/es6-shim.js', instrument: false}, {pattern: 'src/jspm.conf.js', instrument: false}, {pattern: 'src/app/**/*.ts', lo...
Update status results in React app
import React, { Component } from 'react'; class IssueList extends Component { constructor() { super(); this.renderIssue = this.renderIssue.bind(this); } renderIssue(issue) { return ( <div className="col-2" key={issue.key}> <div className={"card card-inverse issue-card mt-3 " + this.car...
import React, { Component } from 'react'; class IssueList extends Component { constructor() { super(); this.renderIssue = this.renderIssue.bind(this); } renderIssue(issue) { return ( <div className="col-2" key={issue.key}> <div className={"card card-inverse issue-card mt-3 " + this.car...
Move flush logic into close
from __future__ import absolute_import from tempfile import NamedTemporaryFile class LogBuffer(object): def __init__(self, chunk_size=4096): self.chunk_size = chunk_size self.fp = NamedTemporaryFile() def fileno(self): return self.fp.fileno() def write(self, chunk): self...
from __future__ import absolute_import from tempfile import NamedTemporaryFile class LogBuffer(object): def __init__(self, chunk_size=4096): self.chunk_size = chunk_size self.fp = NamedTemporaryFile() def fileno(self): return self.fp.fileno() def write(self, chunk): self...
Fix: Use `active_attachments_pro` instead of `active_comments`.
from django.db import models import logging logger = logging.getLogger(__name__) class FMSProxy(models.Model): name = models.CharField(max_length=20, unique=True) def __unicode__(self): return self.name def get_assign_payload(report): creator = report.get_creator() payload = { "appl...
from django.db import models import logging logger = logging.getLogger(__name__) class FMSProxy(models.Model): name = models.CharField(max_length=20, unique=True) def __unicode__(self): return self.name def get_assign_payload(report): creator = report.get_creator() payload = { "appl...
Add Cookiecutter v1.1 to install requirements
#!/usr/bin/env python # -*- coding: utf-8 -*- import os import codecs from setuptools import setup def read(fname): file_path = os.path.join(os.path.dirname(__file__), fname) return codecs.open(file_path, encoding='utf-8').read() setup( name='pytest-cookies', version='0.1.0', author='Raphael Pi...
#!/usr/bin/env python # -*- coding: utf-8 -*- import os import codecs from setuptools import setup def read(fname): file_path = os.path.join(os.path.dirname(__file__), fname) return codecs.open(file_path, encoding='utf-8').read() setup( name='pytest-cookies', version='0.1.0', author='Raphael Pi...
tests.features: Fix OS X test skip.
from __future__ import print_function import sys import subprocess import os @given('a system executable {exe}') def step_impl(context, exe): binary = None if sys.platform.startswith('win'): try: binary = subprocess.check_output(["where", exe]).decode('utf8').strip() except: ...
from __future__ import print_function import sys import subprocess import os @given('a system executable {exe}') def step_impl(context, exe): binary = None if sys.platform.startswith('win'): try: binary = subprocess.check_output(["where", exe]).decode('utf8').strip() except: ...
Add Ctrl-/ shortcut to clear search.
// -------------------------------------------------------------------------- \\ // File: SearchTextView.js \\ // Module: ControlViews \\ // Requires: TextView.js ...
// -------------------------------------------------------------------------- \\ // File: SearchTextView.js \\ // Module: ControlViews \\ // Requires: TextView.js ...
Set pypi development status to Pre-Alpha
from setuptools import find_packages from setuptools import setup setup( name='caravan', version='0.0.3.dev0', description='Light python framework for AWS SWF', long_description=open('README.rst').read(), keywords='AWS SWF workflow distributed background task', author='Pior Bastida', autho...
from setuptools import find_packages from setuptools import setup setup( name='caravan', version='0.0.3.dev0', description='Light python framework for AWS SWF', long_description=open('README.rst').read(), keywords='AWS SWF workflow distributed background task', author='Pior Bastida', autho...
Include the official nydus release
#!/usr/bin/python from setuptools import setup, find_packages tests_require=[ 'nose', 'mock', ] setup( name="sunspear", license='Apache License 2.0', version="0.1.0a", description="Activity streams backed by Riak.", zip_safe=False, long_description=open('README.rst', 'r').read(), ...
#!/usr/bin/python from setuptools import setup, find_packages tests_require=[ 'nose', 'mock', ] setup( name="sunspear", license='Apache License 2.0', version="0.1.0a", description="Activity streams backed by Riak.", zip_safe=False, long_description=open('README.rst', 'r').read(), ...
Use Python importlib instead of sjango.utils.importlib
from django.conf import settings from importlib import import_module class InvalidTemplateFixture(Exception): pass # holds all the fixtures template_fixtures = {} def get_template_fixtures(): """ Return the list of all available template fixtures. Caches the result for faster access. Code modif...
from django.conf import settings from django.utils.importlib import import_module class InvalidTemplateFixture(Exception): pass # holds all the fixtures template_fixtures = {} def get_template_fixtures(): """ Return the list of all available template fixtures. Caches the result for faster access. ...
Make the reply parser for INFO < 2.4 somewhat backwards compatible when used against Redis >= 2.4.
<?php namespace Predis\Commands; class Info extends Command { public function canBeHashed() { return false; } public function getId() { return 'INFO'; } public function parseResponse($data) { $info = array(); $infoLines = explode("\r\n", $data, -1); foreach ($infoLines as $ro...
<?php namespace Predis\Commands; class Info extends Command { public function canBeHashed() { return false; } public function getId() { return 'INFO'; } public function parseResponse($data) { $info = array(); $infoLines = explode("\r\n", $data, -1); foreach ($infoLines as $ro...
Use same tag for exception location
<?php class CM_ExceptionHandling_Formatter_Html extends CM_ExceptionHandling_Formatter_Abstract { public function getHeader(CM_ExceptionHandling_SerializableException $exception) { return '<h1>' . $exception->getClass() . '</h1><h2>' . $exception->getMessage() . '</h2><pre>' . $exception->getFile() . ' on...
<?php class CM_ExceptionHandling_Formatter_Html extends CM_ExceptionHandling_Formatter_Abstract { public function getHeader(CM_ExceptionHandling_SerializableException $exception) { return '<h1>' . $exception->getClass() . '</h1><h2>' . $exception->getMessage() . '</h2><code>' . $exception->getFile() . ' o...
Add container spacing to 404 page
// @flow /** * Part of GDL gdl-frontend. * Copyright (C) 2018 GDL * * See LICENSE */ import * as React from 'react'; import Taken from './Taken'; import { Trans } from '@lingui/react'; import Link from 'next/link'; import { Typography } from '@material-ui/core'; import Container from '../../elements/Container'; ...
// @flow /** * Part of GDL gdl-frontend. * Copyright (C) 2018 GDL * * See LICENSE */ import * as React from 'react'; import Taken from './Taken'; import { Trans } from '@lingui/react'; import Link from 'next/link'; import { Typography } from '@material-ui/core'; import Container from '../../elements/Container'; ...
Use second callback to then instead of catch
import createLocalStorageStore from './storage/localStorage' import { AUTHENTICATE } from './actionTypes' import { authenticateFailed, authenticateSucceeded, restore } from './actions' const createAuthMiddleware = (config = {}) => { const storage = config.storage || createLocalStorageStore() const authenticators =...
import createLocalStorageStore from './storage/localStorage' import { AUTHENTICATE } from './actionTypes' import { authenticateFailed, authenticateSucceeded, restore } from './actions' const createAuthMiddleware = (config = {}) => { const storage = config.storage || createLocalStorageStore() const authenticators =...