text
stringlengths
17
1.47k
positive
stringlengths
673
4.43k
negative
stringlengths
677
2.81k
Fix for reverse sorting. Styling fixes
ko.bindingHandlers.sortBy = { init: function(element, valueAccessor, allBindingsAccessor, viewModel, bindingContext) { var asc = true; element.style.cursor = 'pointer'; element.onclick = function(){ var value = valueAccessor(); var data = value.array; var sortBy = value.sortBy; i...
ko.bindingHandlers.sortBy = { init: function(element, valueAccessor, allBindingsAccessor, viewModel, bindingContext) { var asc = true; element.style.cursor = 'pointer'; element.onclick = function(){ var value = valueAccessor(); var data = value.array; var sortBy = value.sortBy; i...
Add incoming number for the project and attutude
# -*- encoding:utf-8 -*- from django.db import models class Project(models.Model): STATUS = ( ('unrevised', u'Неразгледан'), ('returned', u'Върнат за корекция'), ('pending', u'Предстои да бъде разгледан на СИС'), ('approved', u'Разгледан и одобрен на СИС'), ('rejected', u'Р...
# -*- encoding:utf-8 -*- from django.db import models class Project(models.Model): STATUS = ( ('unrevised', u'Неразгледан'), ('returned', u'Върнат за корекция'), ('pending', u'Предстои да бъде разгледан на СИС'), ('approved', u'Разгледан и одобрен на СИС'), ('rejected', u'Р...
Set stations as started when loading fixtures.
<?php declare(strict_types=1); namespace App\Entity\Fixture; use App\Entity; use App\Radio\Enums\BackendAdapters; use App\Radio\Enums\FrontendAdapters; use Doctrine\Common\DataFixtures\AbstractFixture; use Doctrine\Persistence\ObjectManager; final class Station extends AbstractFixture { public function load(Obj...
<?php declare(strict_types=1); namespace App\Entity\Fixture; use App\Entity; use App\Radio\Enums\BackendAdapters; use App\Radio\Enums\FrontendAdapters; use Doctrine\Common\DataFixtures\AbstractFixture; use Doctrine\Persistence\ObjectManager; final class Station extends AbstractFixture { public function load(Obj...
Use ugettext_lazy instead of ugettext to make it compatible with Django 1.7 https://docs.djangoproject.com/en/dev/ref/applications/#applications-troubleshooting
# -*- coding: utf-8 -*- __author__ = 'sandlbn' from django.db import models from django.utils.translation import ugettext_lazy as _ from utils import datetime_to_timestamp class CalendarEvent(models.Model): """ Calendar Events """ CSS_CLASS_CHOICES = ( ('', _('Normal')), ('event-warni...
# -*- coding: utf-8 -*- __author__ = 'sandlbn' from django.db import models from django.utils.translation import ugettext as _ from utils import datetime_to_timestamp class CalendarEvent(models.Model): """ Calendar Events """ CSS_CLASS_CHOICES = ( ('', _('Normal')), ('event-warning', ...
[FIX] Add source and sourceId to db model
'use strict'; module.exports = { up: function(queryInterface, Sequelize) { return queryInterface.createTable('Activities', { id: { type: Sequelize.INTEGER, allowNull: false, unique: true, autoIncrement:true, primaryKey: true }, name: { type: Sequel...
'use strict'; module.exports = { up: function(queryInterface, Sequelize) { return queryInterface.createTable('Activities', { id: { type: Sequelize.INTEGER, allowNull: false, unique: true, autoIncrement:true, primaryKey: true }, name: { type: Sequel...
Change mark item schema to be oneOf group or non-group mark
var parseMark = require('./mark'); function parseRootMark(model, spec, width, height) { return { type: "group", width: width, height: height, scales: spec.scales || [], axes: spec.axes || [], legends: spec.legends || [], marks: (spec.marks || []).map(function(m) { return parseMark(model, ...
var parseMark = require('./mark'); function parseRootMark(model, spec, width, height) { return { type: "group", width: width, height: height, scales: spec.scales || [], axes: spec.axes || [], legends: spec.legends || [], marks: (spec.marks || []).map(function(m) { return parseMark(model, ...
Add a navigation item to go to the tools section
import React from "react"; import styled from "styled-components"; import Link from "gatsby-link"; import Headroom from "react-headroom"; const StyledMenu = styled.div` .headroom { background: white; nav { display: flex; flex-direction: row; justify-content: flex-end; align-items: ce...
import React from "react"; import styled from "styled-components"; import Link from "gatsby-link"; import Headroom from "react-headroom"; const StyledMenu = styled.div` .headroom { background: white; nav { display: flex; flex-direction: row; justify-content: flex-end; align-items: ce...
Change email validator regexp. Previous one was too dummy :)
angular.module('codebrag.invitations') .service('invitationService', function($http, $q) { this.loadRegisteredUsers = function() { return $http.get('rest/users/all').then(function(response) { return response.data.registeredUsers; }); }; this.loadInv...
angular.module('codebrag.invitations') .service('invitationService', function($http, $q) { this.loadRegisteredUsers = function() { return $http.get('rest/users/all').then(function(response) { return response.data.registeredUsers; }); }; this.loadInv...
Update exception handling syntax for python 3 compatibility.
# -*- coding: utf-8 -*- from __future__ import absolute_import, unicode_literals try: from faker import Factory as FakerFactory except ImportError as error: message = '{0}. Try running `pip install fake-factory`.'.format(error) raise ImportError(message) try: import factory except ImportError as error...
# -*- coding: utf-8 -*- from __future__ import absolute_import, unicode_literals try: from faker import Factory as FakerFactory except ImportError, error: message = '{0}. Try running `pip install fake-factory`.'.format(error) raise ImportError(message) try: import factory except ImportError, error: ...
Configure `UserClass` field and validator
<?php namespace Emergence\People; use HandleBehavior; class Invitation extends \ActiveRecord { public static $tableName = 'invitations'; public static $singularNoun = 'invitation'; public static $pluralNoun = 'invitations'; public static $fields = [ 'RecipientID' => [ 'type' => '...
<?php namespace Emergence\People; use HandleBehavior; class Invitation extends \ActiveRecord { public static $tableName = 'invitations'; public static $singularNoun = 'invitation'; public static $pluralNoun = 'invitations'; public static $fields = [ 'RecipientID' => [ 'type' => '...
Change `bind('click', ...` to `on('click', ...`
(function() { 'use strict'; angular .module('semantic.ui.elements.checkbox', []) .directive('smCheckbox', smCheckbox); function smCheckbox() { return { restrict: 'E', require: '?ngModel', transclude: true, replace: true, scope: { ngDisabled: '=' }, ...
(function() { 'use strict'; angular .module('semantic.ui.elements.checkbox', []) .directive('smCheckbox', smCheckbox); function smCheckbox() { return { restrict: 'E', require: '?ngModel', transclude: true, replace: true, scope: { ngDisabled: '=' }, ...
Add group id, now required for fifo
'use strict'; const AWS = require('aws-sdk'); module.exports = {}; module.exports.generic = generic; module.exports.minuteAggregation = minuteAggregation; function generic(queue, body) { const sqs = new AWS.SQS(); return new Promise((resolve, reject) => { sqs.sendMessage({ QueueUrl: queu...
'use strict'; const AWS = require('aws-sdk'); module.exports = {}; module.exports.generic = generic; module.exports.minuteAggregation = minuteAggregation; function generic(queue, body) { const sqs = new AWS.SQS(); return new Promise((resolve, reject) => { sqs.sendMessage({ QueueUrl: queu...
Remove manual setting of application environment
/* ************************************************************************ coretest Copyright: 2010 Deutsche Telekom AG, Germany, http://telekom.com ************************************************************************ */ /* ************************************************************************ #...
/* ************************************************************************ coretest Copyright: 2010 Deutsche Telekom AG, Germany, http://telekom.com ************************************************************************ */ /* ************************************************************************ #...
Remove unused section of SettingsForm
from django.contrib.auth.models import User from django import forms from account.models import UserProfile attributes = {"class": "required"} class RegistrationForm(forms.Form): username = forms.RegexField(regex=r'^[\w.@+-]+$', max_length=30, wid...
from django.contrib.auth.models import User from django import forms from account.models import UserProfile attributes = {"class": "required"} class RegistrationForm(forms.Form): username = forms.RegexField(regex=r'^[\w.@+-]+$', max_length=30, wid...
Use prop-types package in vulcan-voting
import React, { Component } from 'react'; import PropTypes from 'prop-types'; import { graphql } from 'react-apollo'; import gql from 'graphql-tag'; import { performVoteClient } from '../modules/vote.js'; import { VoteableCollections } from '../modules/make_voteable.js'; export const withVote = component => { retur...
import React, { PropTypes, Component } from 'react'; import { graphql } from 'react-apollo'; import gql from 'graphql-tag'; import { performVoteClient } from '../modules/vote.js'; import { VoteableCollections } from '../modules/make_voteable.js'; export const withVote = component => { return graphql(gql` mutati...
Fix path to static files
module.exports = function (grunt) { 'use strict'; grunt.initConfig({ pkg: grunt.file.readJSON('package.json'), uglify: { dist: { files: { 'src/scripts/dist/<%%= pkg.name %>.js': [ 'src/scripts/**/*.js', ...
module.exports = function (grunt) { 'use strict'; grunt.initConfig({ pkg: grunt.file.readJSON('package.json'), uglify: { dist: { files: { 'static/scripts/dist/<%%= pkg.name %>.js': [ 'static/scripts/**/*.js', ...
Return an error in ChannelRequest library
var ChannelRequest, Promise, refreshProviderObject, stopLongPolling, timeoutID; Promise = require('bluebird'); refreshProviderObject = null; ChannelRequest = (function() { function ChannelRequest(channelName1, callback1) { this.channelName = channelName1; this.callback = callback1; this.stopLongPollin...
var ChannelRequest, Promise, refreshProviderObject, stopLongPolling, timeoutID; Promise = require('bluebird'); refreshProviderObject = null; ChannelRequest = (function() { function ChannelRequest(channelName1, callback1) { this.channelName = channelName1; this.callback = callback1; this.stopLongPollin...
[NodeBundle] Set correct typehints on methods and properties
<?php namespace Kunstmaan\NodeBundle\Event; use Kunstmaan\AdminBundle\Event\BcEvent; use Kunstmaan\NodeBundle\Entity\HasNodeInterface; use Kunstmaan\NodeBundle\Entity\Node; use Kunstmaan\NodeBundle\Entity\NodeTranslation; use Symfony\Component\HttpFoundation\Request; final class SlugSecurityEvent extends BcEvent { ...
<?php namespace Kunstmaan\NodeBundle\Event; use Kunstmaan\AdminBundle\Event\BcEvent; final class SlugSecurityEvent extends BcEvent { private $node; private $nodeTranslation; private $entity; private $request; /** * @return mixed */ public function getNode() { return ...
Fix module controller view instantiation example.
define([ 'spoon', './{{name}}View' ], function (spoon, {{name}}View) { 'use strict'; return spoon.Controller.extend({ $name: '{{name}}Controller', /*_defaultState: 'index', _states: { 'index': '_indexState' }*/ _view: null, ///////////////...
define([ 'spoon', './{{name}}View' ], function (spoon, {{name}}View) { 'use strict'; return spoon.Controller.extend({ $name: '{{name}}Controller', /*_defaultState: 'index', _states: { 'index': '_indexState' }*/ _view: null, ///////////////...
Add suppressing warnings for preferences activity. Change-Id: I7808e8bbc080b65017dc273e423db51c9151d9f7
/* -*- Mode: Java; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /* * This file is part of the LibreOffice project. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozi...
/* -*- Mode: Java; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /* * This file is part of the LibreOffice project. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozi...
Edit grunt command: Add --url parameter
module.exports = function (grunt) { var url = grunt.option('url') || 'http://localhost:3000'; // Project configuration. grunt.initConfig({ bowercopy: { options: { clean: true }, js: { options: { destPrefix: 'js...
module.exports = function (grunt) { var url = grunt.option('url') || 'http://localhost:3000'; // Project configuration. grunt.initConfig({ bowercopy: { options: { clean: false }, js: { options: { destPrefix: 'j...
Change count item per page
<?php namespace stepancher\content\widgets; use stepancher\content\models\Content; use yii\base\Widget; use yii\data\ActiveDataProvider; use yii\helpers\Html; /** * Class ContentOutput * отображает созданные ContentModule статьи двумя способами, * если $onlyLinks задан true то отображаются только ссылки на статьи ...
<?php namespace stepancher\content\widgets; use stepancher\content\models\Content; use yii\base\Widget; use yii\data\ActiveDataProvider; use yii\helpers\Html; /** * Class ContentOutput * отображает созданные ContentModule статьи двумя способами, * если $onlyLinks задан true то отображаются только ссылки на статьи ...
Add explicit reasoning for session sniff From https://vip.wordpress.com/documentation/code-review-what-we-look-for/#session_start-and-other-session-related-functions, linked in #75
<?php /** * WordPress_Sniffs_VIP_SessionVariableUsageSniff * * Discourages the use of the session variable. * Creating a session writes a file to the server and is unreliable in a multi-server environment. * * @category PHP * @package PHP_CodeSniffer * @author Shady Sharaf <shady@x-team.com> * @link htt...
<?php /** * WordPress_Sniffs_VIP_SessionVariableUsageSniff * * Discourages the use of the session variable * * @category PHP * @package PHP_CodeSniffer * @author Shady Sharaf <shady@x-team.com> * @link https://github.com/WordPress-Coding-Standards/WordPress-Coding-Standards/issues/75 */ class WordPress_...
Handle the --cocorico-url command line option.
# -*- coding: utf-8 -*- from AbstractVisitor import AbstractVisitor from duralex.alinea_parser import * import requests class AddCocoricoVoteVisitor(AbstractVisitor): def __init__(self, args): self.url = args.cocorico_url if not self.url: self.url = 'https://cocorico.cc' r =...
# -*- coding: utf-8 -*- from AbstractVisitor import AbstractVisitor from duralex.alinea_parser import * import requests class AddCocoricoVoteVisitor(AbstractVisitor): def __init__(self, args): self.url = 'https://local.cocorico.cc' r = requests.post( self.url + '/api/oauth/token', ...
Tweak comment about 202 response
"""Implement a server to check if a contribution is covered by a CLA(s).""" from aiohttp import web from . import abc from . import ContribHost from . import ServerHost from . import CLAHost class Handler: """Handle requests from the contribution host.""" def __init__(self, server: ServerHost, cla_records:...
"""Implement a server to check if a contribution is covered by a CLA(s).""" from aiohttp import web from . import abc from . import ContribHost from . import ServerHost from . import CLAHost class Handler: """Handle requests from the contribution host.""" def __init__(self, server: ServerHost, cla_records:...
Set up dummy bot response
<?php namespace App\Http\Controllers; use App\Http\Middleware\EventsMiddleware; use GuzzleHttp\Client; use Illuminate\Http\Request; use Storage; class BotController extends Controller { /** * Ensures the app has been verified and the token is correct */ function __construct() { $this->m...
<?php namespace App\Http\Controllers; use App\Http\Middleware\EventsMiddleware; use Illuminate\Http\Request; class BotController extends Controller { /** * Ensures the app has been verified and the token is correct */ function __construct() { $this->middleware(EventsMiddleware::class); ...
Use fancy spelling of resume
<?php Loader::load('controller', '/PageController'); abstract class DefaultPageController extends PageController { public function __construct() { parent::__construct(); $this->add_css('reset'); $this->add_css('portfolio'); } protected function set_body_data() { ...
<?php Loader::load('controller', '/PageController'); abstract class DefaultPageController extends PageController { public function __construct() { parent::__construct(); $this->add_css('reset'); $this->add_css('portfolio'); } protected function set_body_data() { ...
Fix typo in template definition
function maReferenceManyField(ReferenceRefresher) { 'use strict'; return { scope: { 'field': '&', 'value': '=', 'entry': '=?', 'datastore': '&?' }, restrict: 'E', link: function(scope) { var field = scope.field(); ...
function maReferenceManyField(ReferenceRefresher) { 'use strict'; return { scope: { 'field': '&', 'value': '=', 'entry': '=?', 'datastore': '&?' }, restrict: 'E', link: function(scope) { var field = scope.field(); ...
Add environment support and tuneup Finder
<?php namespace Knp\RadBundle\DataFixtures\ORM; use Knp\RadBundle\DataFixtures\AbstractFixture; use Symfony\Component\Finder\Finder; use Doctrine\Common\Persistence\ObjectManager; use Nelmio\Alice\Fixtures; class LoadAliceFixtures extends AbstractFixture { public function load(ObjectManager $manager) { ...
<?php namespace Knp\RadBundle\DataFixtures\ORM; use Knp\RadBundle\DataFixtures\AbstractFixture; use Symfony\Component\Finder\Finder; use Doctrine\Common\Persistence\ObjectManager; use Nelmio\Alice\Fixtures; class LoadAliceFixtures extends AbstractFixture { public function load(ObjectManager $manager) { ...
Remove upper case Not Present
from django import forms from datasets.models import DatasetRelease, CategoryComment class DatasetReleaseForm(forms.ModelForm): max_number_of_sounds = forms.IntegerField(required=False) class Meta: model = DatasetRelease fields = ['release_tag', 'type'] class PresentNotPresentUnsureForm(for...
from django import forms from datasets.models import DatasetRelease, CategoryComment class DatasetReleaseForm(forms.ModelForm): max_number_of_sounds = forms.IntegerField(required=False) class Meta: model = DatasetRelease fields = ['release_tag', 'type'] class PresentNotPresentUnsureForm(for...
Update task 5.3 lesson 1
package ru.spoddubnyak; public class ArrayRemovingDuplicates { public String[] sourceArray; public ArrayRemovingDuplicates(String[] sourceArray){ this.sourceArray = sourceArray; } public int removeDuplicates () { int countDuplication = 0; for (int i = 0; i < this.sourceA...
package ru.spoddubnyak; public class ArrayRemovingDuplicates { public String[] sourceArray; public ArrayRemovingDuplicates(String[] sourceArray){ this.sourceArray = sourceArray; } public int removeDuplicates () { int countDuplication = 0; for (int i = 0; i < this.sourceA...
Fix template path getter syntax Test #1208 git-svn-id: 28fe03dfd74dd77dcc8ecfe99fabcec8eed81bba@3763 8555b757-d854-4b86-925a-82fd84c90ff4
<!DOCTYPE html> <html xmlns="http://www.w3.org/1999/xhtml" lang="<?php echo Lang::getCode() ?>" xml:lang="<?php echo Lang::getCode() ?>"> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> <title><?php echo htmlspecialchars(Config::get('site_name')); ?></title> ...
<!DOCTYPE html> <html xmlns="http://www.w3.org/1999/xhtml" lang="<?php echo Lang::getCode() ?>" xml:lang="<?php echo Lang::getCode() ?>"> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> <title><?php echo htmlspecialchars(Config::get('site_name')); ?></title> ...
Fix imports for the ListMessagesFiltered example.
import com.messagebird.MessageBirdClient; import com.messagebird.MessageBirdService; import com.messagebird.MessageBirdServiceImpl; import com.messagebird.exceptions.GeneralException; import com.messagebird.exceptions.UnauthorizedException; import com.messagebird.objects.MessageList; import java.util.LinkedHashMap; imp...
import com.messagebird.MessageBirdClient; import com.messagebird.MessageBirdService; import com.messagebird.MessageBirdServiceImpl; import com.messagebird.exceptions.GeneralException; import com.messagebird.exceptions.UnauthorizedException; import com.messagebird.objects.MessageList; public class ExampleListMessagesF...
Put .tabs__panels on correct element
import React, { Component, PropTypes } from 'react'; import Panel from './Panel'; import idSafeName from '../helpers/idSafeName'; class Panels extends Component { render () { const { data, selectedIndex } = this.props; if (!data.length) { return null; } return ( ...
import React, { Component, PropTypes } from 'react'; import Panel from './Panel'; import idSafeName from '../helpers/idSafeName'; class Panels extends Component { render () { const { data, selectedIndex } = this.props; if (!data.length) { return null; } return ( ...
Add all javascript sources to server-watcher.
module.exports = function(grunt) { "use strict"; // Project configuration. grunt.initConfig({ pkg: '<json:package.json>', test: { files: ['test/**/*.js'] }, lint: { files: ['grunt.js', 'lib/**/*.js', 'test/**/*.js'] }, watch: { files: '<config:lint.files...
module.exports = function(grunt) { "use strict"; // Project configuration. grunt.initConfig({ pkg: '<json:package.json>', test: { files: ['test/**/*.js'] }, lint: { files: ['grunt.js', 'lib/**/*.js', 'test/**/*.js'] }, watch: { files: '<config:lint.files...
Use actual value in queries rather than object-cast-to-string
<?php namespace OpenConext\EngineBlockBundle\Authentication\Repository; use Doctrine\ORM\EntityRepository; use OpenConext\EngineBlock\Authentication\Value\CollabPersonId; use OpenConext\EngineBlockBundle\Authentication\Entity\User; /** * */ class UserRepository extends EntityRepository { /** * @param User...
<?php namespace OpenConext\EngineBlockBundle\Authentication\Repository; use Doctrine\ORM\EntityRepository; use OpenConext\EngineBlock\Authentication\Value\CollabPersonId; use OpenConext\EngineBlockBundle\Authentication\Entity\User; /** * */ class UserRepository extends EntityRepository { /** * @param User...
Add handling for multi-tenancy in sitemap.xml
from django.contrib.sitemaps import Sitemap from django.contrib.sites.models import Site from django.db.models import get_models from mezzanine.conf import settings from mezzanine.core.models import Displayable from mezzanine.utils.sites import current_site_id from mezzanine.utils.urls import home_slug blog_install...
from django.contrib.sitemaps import Sitemap from django.db.models import get_models from mezzanine.conf import settings from mezzanine.core.models import Displayable from mezzanine.utils.urls import home_slug blog_installed = "mezzanine.blog" in settings.INSTALLED_APPS if blog_installed: from mezzanine.blog.mod...
Simplify existing day 1 loop
package day01; import common.BaseSolution; import common.InputReader; public class Solution extends BaseSolution implements common.Solution { public static void main(String[] args) { new Solution().run(); } class BaseFuelCalculator { public int calculateFuel() { int mass, tot...
package day01; import common.BaseSolution; import common.InputReader; public class Solution extends BaseSolution implements common.Solution { public static void main(String[] args) { new Solution().run(); } class BaseFuelCalculator { public int calculateFuel() { int mass, tot...
Make stories a little more consistent
import React from 'react'; import { storiesOf } from '@storybook/react'; import { action } from '@storybook/addon-actions'; import { checkA11y } from 'storybook-addon-a11y'; import { withInfo } from '@storybook/addon-info'; import { withKnobs, boolean } from '@storybook/addon-knobs/react'; import styles from '@sambego/...
import React from 'react'; import { storiesOf } from '@storybook/react'; import { action } from '@storybook/addon-actions'; import { checkA11y } from 'storybook-addon-a11y'; import { withInfo } from '@storybook/addon-info'; import { withKnobs, boolean } from '@storybook/addon-knobs/react'; import styles from '@sambego/...
Enable debug logging via server.log(tags,...) when NODE_ENV=dev
'use strict'; const Config = require('./config'); // Glue manifest module.exports = { server: { app: { config: Config } }, connections: [ { host: Config.server.boilerplateApi.host, port: Config.server.boilerplateApi.port, labels: 'b...
'use strict'; const Config = require('./config'); // Glue manifest module.exports = { server: { app: { config: Config } }, connections: [ { host: Config.server.boilerplateApi.host, port: Config.server.boilerplateApi.port, labels: 'b...
Make version format PEP 440 compatible
import collections import re import sys __version__ = '0.1.2' version = __version__ + ' , Python ' + sys.version VersionInfo = collections.namedtuple('VersionInfo', 'major minor micro releaselevel serial') def _parse_version(ver): RE = (r'^(?P<major>\d+)\.(?P<minor>\d+)\....
import collections import re import sys __version__ = '0.1.2' version = __version__ + ' , Python ' + sys.version VersionInfo = collections.namedtuple('VersionInfo', 'major minor micro releaselevel serial') def _parse_version(ver): RE = (r'^(?P<major>\d+)\.(?P<minor>\d+)\....
[caps] Mark CAPA= as None instead of True
#!/usr/bin/env python3 # Written by Daniel Oaks <daniel@danieloaks.net> # Released under the ISC license from .utils import CaseInsensitiveDict, CaseInsensitiveList class Capabilities: """Ingests sets of client capabilities and provides access to them.""" def __init__(self, wanted=[]): self.available ...
#!/usr/bin/env python3 # Written by Daniel Oaks <daniel@danieloaks.net> # Released under the ISC license from .utils import CaseInsensitiveDict, CaseInsensitiveList class Capabilities: """Ingests sets of client capabilities and provides access to them.""" def __init__(self, wanted=[]): self.available ...
Use Facade to access method instead of creating a new instance.
<?php namespace DvK\Laravel\Vat; use Illuminate\Contracts\Container\Container; use Illuminate\Support\ServiceProvider; use Illuminate\Support\Facades\Validator as RequestValidator; use DvK\Laravel\Vat\Facades\Validator as ValidatorFacade; class VatServiceProvider extends ServiceProvider { /** * Boot the s...
<?php namespace DvK\Laravel\Vat; use Illuminate\Contracts\Container\Container; use Illuminate\Support\ServiceProvider; use Illuminate\Support\Facades\Validator as RequestValidator; class VatServiceProvider extends ServiceProvider { /** * Boot the service provider. * * @return void */ publ...
Make watcher a class rule to shutdown cluster after class fail.
package org.apache.mesos.elasticsearch.systemtest.base; import com.containersol.minimesos.MesosCluster; import com.containersol.minimesos.mesos.MesosClusterConfig; import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; import org.apache.mesos.elasticsearch.systemtest.Configuration; import org.apache.mesos.elastics...
package org.apache.mesos.elasticsearch.systemtest.base; import com.containersol.minimesos.MesosCluster; import com.containersol.minimesos.mesos.MesosClusterConfig; import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; import org.apache.mesos.elasticsearch.systemtest.Configuration; import org.apache.mesos.elastics...
Use regex instead of replace for Mako template preprocess
""" Module providing standard output classes """ import re from abc import ABCMeta, abstractmethod from mako.template import Template from mako.lookup import TemplateLookup class Output(object): """ Abstract class base for output classes """ __metaclass__ = ABCMeta @abstractmethod def ren...
""" Module providing standard output classes """ from abc import ABCMeta, abstractmethod from mako.template import Template from mako.lookup import TemplateLookup class Output(object): """ Abstract class base for output classes """ __metaclass__ = ABCMeta @abstractmethod def render(self, d...
Change a couple of defaults
class GenomeException(Exception): pass class Genome(object): def __init__(self, name): defaults = { "name": name, "use_openings_book": True, # Search params "max_depth": 6, "max_depth_boost": 0, "mmpdl": 9, "narrowing"...
class GenomeException(Exception): pass class Genome(object): def __init__(self, name): defaults = { "name": name, "use_openings_book": True, # Search params "max_depth": 6, "max_depth_boost": 0, "mmpdl": 9, "narrowing"...
Enhance Business Unit Test coverage Separate tests responsibilities
<?php use App\Business; use App\Presenters\BusinessPresenter; use Illuminate\Foundation\Testing\DatabaseTransactions; class BusinessUnitTest extends TestCase { use DatabaseTransactions; /** * @covers \App\Business::__construct */ public function testCreateBusiness() { $bus...
<?php use App\Business; use App\Presenters\BusinessPresenter; use Illuminate\Foundation\Testing\DatabaseTransactions; class BusinessUnitTest extends TestCase { use DatabaseTransactions; /** * @covers \App\Business::create */ public function testCreatedBusinessGetsStoredInDatabase() ...
Fix crash in FAB background tint Caused by moving the base class to AppCompatImageButton. That class's functionality interferes with FAB. BUG: 25302006 Change-Id: I283508caa8ddf5664a5b15209cfff06c464ec187
/* * Copyright (C) 2015 The Android Open Source Project * * 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 app...
/* * Copyright (C) 2014 The Android Open Source Project * * 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 app...
Add "batched" flag to config
<?php namespace Ftrrtf\RollbarBundle\DependencyInjection; use Symfony\Component\Config\Definition\Builder\TreeBuilder; use Symfony\Component\Config\Definition\ConfigurationInterface; /** * This is the class that validates and merges configuration from your app/config files * * To learn more see {@link http://symf...
<?php namespace Ftrrtf\RollbarBundle\DependencyInjection; use Symfony\Component\Config\Definition\Builder\TreeBuilder; use Symfony\Component\Config\Definition\ConfigurationInterface; /** * This is the class that validates and merges configuration from your app/config files * * To learn more see {@link http://symf...
Fix register syntax. Also, prepare to implement the Firebase utility functions.
var React = require('react'); var firebaseUtils = require('../../utils/firebaseUtils'); var Router = require('react-router'); var Register = React.createClass({ mixins: [ Router.Navigation ], render: function(){ return ( <div className="col-sm-6 col-sm-offset-3"> <form onSubmit={this.handleSubmit...
var React = require('react'); var firebaseUtils = require('../../utils/firebaseUtils'); var Router = require('react-router'); var Register = React.createClass({ mixins: [ Router.Navigation ], render: function(){ return ( <div className="col-sm-6 col-sm-offset-3"> <form onSubmit={this.handleSubmit...
Change ucldc-iiif back to barbara's repo
import os from setuptools import setup def read(fname): return open(os.path.join(os.path.dirname(__file__), fname)).read() # allow setup.py to be run from any path os.chdir(os.path.normpath(os.path.join(os.path.abspath(__file__), os.pardir))) setup( name = "UCLDC Deep Harvester", version = "0.0.3", d...
import os from setuptools import setup def read(fname): return open(os.path.join(os.path.dirname(__file__), fname)).read() # allow setup.py to be run from any path os.chdir(os.path.normpath(os.path.join(os.path.abspath(__file__), os.pardir))) setup( name = "UCLDC Deep Harvester", version = "0.0.3", d...
Fix failing reconnects; add quit IRC command
from p1tr.helpers import clean_string from p1tr.plugin import * @meta_plugin class Irc(Plugin): """Provides commands for basic IRC operations.""" @command @require_master def nick(self, server, channel, nick, params): """Usage: nick NEW_NICKNAME - changes the bot's nickname.""" if len(...
from p1tr.helpers import clean_string from p1tr.plugin import * @meta_plugin class Irc(Plugin): """Provides commands for basic IRC operations.""" @command @require_master def nick(self, server, channel, nick, params): """Usage: nick NEW_NICKNAME - changes the bot's nickname.""" if len(...
Allow to access id through
<?php namespace Gitlab\Model; use Gitlab\Client; /** * Class Note * * @property-read User $author * @property-read string $body * @property-read string $created_at * @property-read string $updated_at * @property-read string $parent_type * @property-read Issue|MergeRequest $parent * @property-read string $att...
<?php namespace Gitlab\Model; use Gitlab\Client; /** * Class Note * * @property-read User $author * @property-read string $body * @property-read string $created_at * @property-read string $updated_at * @property-read string $parent_type * @property-read Issue|MergeRequest $parent * @property-read string $att...
Build fix for syntax error in test files.
import unittest from nose.tools import (assert_is_not_none, assert_false, assert_raises, assert_equal) import numpy as np from sknn.mlp import MultiLayerPerceptronRegressor as MLPR class TestLearningRules(unittest.TestCase): def test_default(self): self._run(MLPR(layers=[("Linear",)], ...
import unittest from nose.tools import (assert_is_not_none, assert_false, assert_raises, assert_equal) import numpy as np from sknn.mlp import MultiLayerPerceptronRegressor as MLPR class TestLearningRules(unittest.TestCase): def test_default(self): self._run(MLPR(layers=[("Linear",)], ...
Correct a typo in a describe block title
/* global angular */ describe('ng-json2js preprocessor', function () { 'use strict'; beforeEach(module('test/fixtures/empty.json')); beforeEach(module('test/fixtures/complex.json')); it('should work on an empty object', function () { var testFixturesEmpty; inject(function (_testFixture...
/* global angular */ describe('json2j preprocessor', function () { 'use strict'; beforeEach(module('test/fixtures/empty.json')); beforeEach(module('test/fixtures/complex.json')); it('should work on an empty object', function () { var testFixturesEmpty; inject(function (_testFixturesEmp...
Disable SSL warnings by default.
# As a hack, disable SSL warnings. import urllib3 urllib3.disable_warnings() import sys def format_cols(cols): widths = [0] * len(cols[0]) for i in cols: for idx, val in enumerate(i): widths[idx] = max(len(val), widths[idx]) f = "" t = [] for i in widths: t.append("%...
import sys def format_cols(cols): widths = [0] * len(cols[0]) for i in cols: for idx, val in enumerate(i): widths[idx] = max(len(val), widths[idx]) f = "" t = [] for i in widths: t.append("%%-0%ds" % (i,)) return " ".join(t) def column_report(title, fields, c...
BAP-11410: Add CRUD controller for Language entity - cr updates
<?php namespace Oro\Bundle\TranslationBundle\EventListener\Datagrid; use Oro\Bundle\DataGridBundle\Datasource\ResultRecord; use Oro\Bundle\DataGridBundle\Event\OrmResultAfter; use Oro\Bundle\TranslationBundle\Provider\TranslationStatisticProvider; class LanguageListener { const DATA_NAME = 'translationCompleten...
<?php namespace Oro\Bundle\TranslationBundle\EventListener\Datagrid; use Oro\Bundle\DataGridBundle\Datasource\ResultRecord; use Oro\Bundle\DataGridBundle\Event\OrmResultAfter; use Oro\Bundle\TranslationBundle\Provider\TranslationStatisticProvider; class LanguageListener { const DATA_NAME = 'translationCompleten...
Update auth token form layout
@extends('layouts.app') @section('content') <div class="container"> <div class="row justify-content-center"> <div class="col-md-8"> <div class="card"> <div class="card-header">@lang('twofactor-auth::twofactor-auth.title')</div> <div class="card-body"> ...
@extends('layouts.app') @section('content') <div class="container"> <div class="row"> <div class="col-md-8 col-md-offset-2"> <div class="panel panel-default"> <div class="panel-heading">@lang('twofactor-auth::twofactor-auth.title')</div> <div class="panel-body"> ...
Update class docs and renamed dump() to dumpFiles()
<?php /* * \Moharrum\LaravelGeoIPWorldCities for Laravel 5 * * Copyright (c) 2015 - 2016 LaravelGeoIPWorldCities * * @copyright Copyright (c) 2015 - 2016 \Moharrum\LaravelGeoIPWorldCities * * @license http://opensource.org/licenses/MIT MIT license */ use Illuminate\Database\Seeder; use Illuminate\Support\Fa...
<?php use Illuminate\Database\Seeder; use Illuminate\Support\Facades\DB; use Illuminate\Support\Facades\File; use Moharrum\LaravelGeoIPWorldCities\Helpers\Config; class CitiesTableSeeder extends Seeder { /** * Run the database seeds. * * @return void */ public function run() { ...
Add options attribute to pass a complete options list to directive The option attribute must contains an object with the additional options you want to pass to the justgage object. Normal option are still use but will be overload by object if declared twice. Here's a sample to use levelColors and levelGradiant. All j...
angular.module("ngJustGage", []) .directive('justGage', ['$timeout', function ($timeout) { return { restrict: 'EA', scope: { id: '@', class: '@', min: '=', max: '=', title: '@', value: '=', options: '=' }, template: '<div id="{{id}}-j...
angular.module("ngJustGage", []) .directive('justGage', ['$timeout', function ($timeout) { return { restrict: 'EA', scope: { id: '@', class: '@', min: '=', max: '=', title: '@', value: '=' }, template: '<div id="{{id}}-justgage" class="{{clas...
Add anchor tag props for transferring
/** * Copyright 2014, Yahoo! Inc. * Copyrights licensed under the New BSD License. See the accompanying LICENSE file for terms. */ 'use strict'; var React = require('react/addons'), NavLink, navigateAction = require('../actions/navigate'), debug = require('debug')('NavLink'); NavLink = React.createClas...
/** * Copyright 2014, Yahoo! Inc. * Copyrights licensed under the New BSD License. See the accompanying LICENSE file for terms. */ 'use strict'; var React = require('react/addons'), NavLink, navigateAction = require('../actions/navigate'), debug = require('debug')('NavLink'); NavLink = React.createClas...
Add option to Button messages to hide buttons on click
<?php namespace actsmart\actsmart\Actuators\WebChat; class WebChatButtonMessage extends WebChatMessage { protected $messageType = 'button'; /** The message buttons. @var WebChatButton[] */ private $buttons = []; private $clearAfterInteraction = true; /** * @param $clearAfterInteraction ...
<?php namespace actsmart\actsmart\Actuators\WebChat; class WebChatButtonMessage extends WebChatMessage { protected $messageType = 'button'; /** The message buttons. @var WebChatButton[] */ private $buttons = []; /** * @param WebChatButton $button * @return $this */ public function...
Add 'no cover' pragma to hide bogus missing code coverage
try: from txampext import axiomtypes; axiomtypes from axiom import attributes except ImportError: # pragma: no cover axiomtypes = None from twisted.protocols import amp from twisted.trial import unittest class TypeForTests(unittest.TestCase): skip = axiomtypes is None def _test_typeFor(self, at...
try: from txampext import axiomtypes; axiomtypes from axiom import attributes except ImportError: axiomtypes = None from twisted.protocols import amp from twisted.trial import unittest class TypeForTests(unittest.TestCase): skip = axiomtypes is None def _test_typeFor(self, attr, expectedType, **...
Swap order of commonjs and resolve
import commonjs from '@rollup/plugin-commonjs'; import glslify from 'rollup-plugin-glslify'; import resolve from '@rollup/plugin-node-resolve'; import copy from "rollup-plugin-copy"; export default { input: ['source/gltf-sample-viewer.js'], output: [ { file: 'dist/gltf-viewer.js', ...
import commonjs from '@rollup/plugin-commonjs'; import glslify from 'rollup-plugin-glslify'; import resolve from '@rollup/plugin-node-resolve'; import copy from "rollup-plugin-copy"; export default { input: ['source/gltf-sample-viewer.js'], output: [ { file: 'dist/gltf-viewer.js', ...
Add execute hook to allow wrapping handler calls
from cgi import parse_header import json from django.http import HttpResponse, Http404 RPC_MARKER = '_rpc' class Resource(object): def __init__(self, request, *args, **kwargs): self.request = request self.args = args self.kwargs = kwargs @classmethod def as_view(cls): ...
from cgi import parse_header import json from django.http import HttpResponse, Http404 RPC_MARKER = '_rpc' class Resource(object): def __init__(self, request, *args, **kwargs): self.request = request self.args = args self.kwargs = kwargs @classmethod def as_view(cls): ...
Improve phrasing of note and wrap at 80 chars
<?php namespace Sil\SilAuth\saml; class User { public static function convertToSamlFieldNames( string $employeeId, string $firstName, string $lastName, string $username, string $email, string $uuid, string $idpDomainName, $passwordExpirationDate, ...
<?php namespace Sil\SilAuth\saml; class User { public static function convertToSamlFieldNames( string $employeeId, string $firstName, string $lastName, string $username, string $email, string $uuid, string $idpDomainName, $passwordExpirationDate, ...
Fix undefined quotes causing error
// @flow import React, { Component } from 'react'; import Quote from './Quote'; type Props = { quotes: Array<Object>, approve: number => Promise<*>, deleteQuote: number => Promise<*>, unapprove: number => Promise<*>, actionGrant: Array<string>, currentUser: any, loggedIn: boolean, comments: Object }; ...
// @flow import React, { Component } from 'react'; import Quote from './Quote'; type Props = { quotes: Array<Object>, approve: number => Promise<*>, deleteQuote: number => Promise<*>, unapprove: number => Promise<*>, actionGrant: Array<string>, currentUser: any, loggedIn: boolean, comments: Object }; ...
Allow grunt-jekyll to build drafts
module.exports = function (grunt) { // load all grunt tasks matching the `grunt-*` pattern require('load-grunt-tasks')(grunt); grunt.initConfig({ autoprefixer: { build: { src: 'public/css/style.css' } }, csscomb: { options: { config: 'public/c...
module.exports = function (grunt) { // load all grunt tasks matching the `grunt-*` pattern require('load-grunt-tasks')(grunt); grunt.initConfig({ autoprefixer: { build: { src: 'public/css/style.css' } }, csscomb: { options: { config: 'public/c...
Remove default config path (development.ini) Towards #1
# -*- coding: utf-8 -*- # ### # Copyright (c) 2015, Rice University # This software is subject to the provisions of the GNU Affero General # Public License version 3 (AGPLv3). # See LICENCE.txt for details. # ### import argparse import os import sys from . import commands, utils DEFAULTS = { } def main(argv=s...
# -*- coding: utf-8 -*- # ### # Copyright (c) 2015, Rice University # This software is subject to the provisions of the GNU Affero General # Public License version 3 (AGPLv3). # See LICENCE.txt for details. # ### import argparse import os import sys from . import commands, utils DEFAULTS = { 'migrations_directo...
Revert "keep .java on mainFile"
/* * Run the code contained in the file manager, by compiling everything and * executing the main class, then display the result. */ /* global FileManager */ function runCodeCheerp() { // Get the main class's actual name.. // drop the .java extension var mainName = FileManager.getMainFile().name.replace...
/* * Run the code contained in the file manager, by compiling everything and * executing the main class, then display the result. */ /* global FileManager */ function runCodeCheerp() { // Get the main class's actual name.. // drop the .java extension var mainFile = FileManager.getMainFile().name; va...
Use Config constructor instead of deprecated named one
<?php $config = new PhpCsFixer\Config(); return $config ->setRiskyAllowed(true) ->setRules([ '@Symfony' => true, '@Symfony:risky' => true, 'array_syntax' => [ 'syntax' => 'short' ], 'combine_consecutive_unsets' => true, 'heredoc_to_nowdoc' => true, ...
<?php return PhpCsFixer\Config::create() ->setRiskyAllowed(true) ->setRules([ '@Symfony' => true, '@Symfony:risky' => true, 'array_syntax' => [ 'syntax' => 'short' ], 'combine_consecutive_unsets' => true, 'heredoc_to_nowdoc' => true, 'no_extra...
Remove implementation of final method Related to #4
<?php namespace Bolt\Extension\royallthefourth\CodeHighlightBolt; use Bolt\Asset\File\JavaScript; use Bolt\Asset\Snippet\Snippet; use Bolt\Asset\File\Stylesheet; use Bolt\Asset\Target; use Bolt\Extension\SimpleExtension; /** * CodeHighlightBolt extension class. * * @author Royall Spence <royall@royall.us> */ cla...
<?php namespace Bolt\Extension\royallthefourth\CodeHighlightBolt; use Bolt\Asset\File\JavaScript; use Bolt\Asset\Snippet\Snippet; use Bolt\Asset\File\Stylesheet; use Bolt\Asset\Target; use Bolt\Extension\SimpleExtension; /** * CodeHighlightBolt extension class. * * @author Royall Spence <royall@royall.us> */ cla...
Fix buglet in compact testing
"""Tests for the PythonPoint tool. """ import os, sys, string from reportlab.test import unittest from reportlab.test.utils import makeSuiteForClasses, outputfile import reportlab class PythonPointTestCase(unittest.TestCase): "Some very crude tests on PythonPoint." def test0(self): "Test if pythonp...
"""Tests for the PythonPoint tool. """ import os, sys, string from reportlab.test import unittest from reportlab.test.utils import makeSuiteForClasses, outputfile import reportlab class PythonPointTestCase(unittest.TestCase): "Some very crude tests on PythonPoint." def test0(self): "Test if pythonp...
Add 'host_node' and 'host_cluster' properties to container profile Add 'host_node' and 'host_cluster' properties to container profile, in a container profile, either 'host_node' or 'host_cluster' will be assigned a value for a container node creation or a container cluster creation. blueprint container-profile-suppor...
# Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed unde...
# Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed unde...
Update URL to github repository.
from __future__ import unicode_literals import re from setuptools import find_packages, setup def get_version(filename): content = open(filename).read() metadata = dict(re.findall("__([a-z]+)__ = '([^']+)'", content)) return metadata['version'] setup( name='Mopidy-MusicBox-Webclient', version=...
from __future__ import unicode_literals import re from setuptools import find_packages, setup def get_version(filename): content = open(filename).read() metadata = dict(re.findall("__([a-z]+)__ = '([^']+)'", content)) return metadata['version'] setup( name='Mopidy-MusicBox-Webclient', version=...
Fix return types for update and remove
import { NativeModules } from 'react-native'; const NativeRnRecord = NativeModules.RnRecord; export default class RnRecord { id: Number; save(): Promise<Number> { return NativeRnRecord.save(this.constructor.name, this._getProperties()).then(id => { this.id = id; return id; ...
import { NativeModules } from 'react-native'; const NativeRnRecord = NativeModules.RnRecord; export default class RnRecord { id: Number; save(): Promise<Number> { return NativeRnRecord.save(this.constructor.name, this._getProperties()); } update(): Promise<Boolean> { return NativeRn...
:bug: Change id_lvrs_internt to string. Test if there's only one created
import unittest from flask import current_app, url_for, get_flashed_messages from app import create_app, db from app.models import * class TestCreateAdmissionView(unittest.TestCase): def setUp(self): self.app = create_app('testing') self.app_context = self.app.app_context() self.app_contex...
import unittest from flask import current_app, url_for, get_flashed_messages from app import create_app, db from app.models import * class TestCreateAdmissionView(unittest.TestCase): def setUp(self): self.app = create_app('testing') self.app_context = self.app.app_context() self.app_contex...
fix: Add x-frigg-worker-token header to hq requests This will in time be to remove the FRIGG_WORKER_TOKEN header.
# -*- coding: utf-8 -*- import logging import socket import requests logger = logging.getLogger(__name__) class APIWrapper(object): def __init__(self, options): self.token = options['hq_token'] self.url = options['hq_url'] @property def headers(self): return { 'cont...
# -*- coding: utf-8 -*- import logging import socket import requests logger = logging.getLogger(__name__) class APIWrapper(object): def __init__(self, options): self.token = options['hq_token'] self.url = options['hq_url'] @property def headers(self): return { 'cont...
Reset prefs that are not explicitly passed into setPrefs git-svn-id: 6772fbf0389af6646c0263f7120f2a1d688953ed@5182 e969d3be-0e28-0410-a27f-dd5c76401a8b
/* See license.txt for terms of usage */ var Format = {}; Components.utils.import("resource://fireformat/formatters.jsm", Format); var Firebug = FW.Firebug; var FBTestFireformat = { PrefHandler: function(prefs) { var original = [], globals = {}; for (var i = 0; i < prefs.length; i++) { origina...
/* See license.txt for terms of usage */ var Format = {}; Components.utils.import("resource://fireformat/formatters.jsm", Format); var Firebug = FW.Firebug; var FBTestFireformat = { PrefHandler: function(prefs) { var original = [], globals = {}; for (var i = 0; i < prefs.length; i++) { origina...
Remove "sh" command from script execution
package x1125io.initdlight; import android.content.BroadcastReceiver; import android.content.Context; import android.content.Intent; import android.util.Log; public class BootReceiver extends BroadcastReceiver { final String TAG = "initdlight"; @Override public void onReceive(Context context, Intent int...
package x1125io.initdlight; import android.content.BroadcastReceiver; import android.content.Context; import android.content.Intent; import android.util.Log; public class BootReceiver extends BroadcastReceiver { final String TAG = "initdlight"; @Override public void onReceive(Context context, Intent int...
Use getShortCode() instead of enum name()
package com.alexstyl.specialdates.events.namedays; import android.support.annotation.RawRes; import com.alexstyl.specialdates.R; import com.novoda.notils.exception.DeveloperError; public enum NamedayLocale { GREEK("gr", true, R.raw.gr_namedays), ROMANIAN("ro", false, R.raw.ro_namedays), RUSSIAN("ru", fal...
package com.alexstyl.specialdates.events.namedays; import android.support.annotation.RawRes; import com.alexstyl.specialdates.R; import com.novoda.notils.exception.DeveloperError; public enum NamedayLocale { GREEK("gr", true, R.raw.gr_namedays), ROMANIAN("ro", false, R.raw.ro_namedays), RUSSIAN("ru", fal...
Allow space,dash,apostrophe in name searches
'use strict'; let content = require('./content.js'); function validateInputs(err, obj) { err.items = []; let errCount = 0; if (obj.forename && !isString(obj.forename)) { err.items[errCount++] = {forename: 'Correct the forename'}; } if (obj.forename2 && !isString(obj.forename2)) { ...
'use strict'; let content = require('./content.js'); function validateInputs(err, obj) { err.items = []; let errCount = 0; if (obj.forename && !isString(obj.forename)) { err.items[errCount++] = {forename: 'Correct the forename'}; } if (obj.forename2 && !isString(obj.forename2)) { ...
Make blockArrayList static Make setBlockArray static method
package model; import java.util.ArrayList; /** * Created by ano on 2016. 5. 18.. */ public class Line { private String content;//이 라인이 가지고 있는 컨텐츠 private int blockIndex; // 이 라인이 속해있는 블럭의 index. -1이면 속하는 블럭이 없다는 것 private boolean isWhitespace;//compare로 생긴 공백 줄이면 true; private static ArrayList<Block>...
package model; import java.util.ArrayList; /** * Created by ano on 2016. 5. 18.. */ public class Line { private String content;//이 라인이 가지고 있는 컨텐츠 private int blockIndex; // 이 라인이 속해있는 블럭의 index. -1이면 속하는 블럭이 없다는 것 private boolean isWhitespace;//compare로 생긴 공백 줄이면 true; private static ArrayList<Block>...
Add file-loader for image resources
const path = require('path'); const ExtractTextPlugin = require('extract-text-webpack-plugin'); const webpack = require('webpack'); module.exports = { entry: { vendor: './src/vendor/index.js', mb: './src/mb/index.jsx' }, output: { filename: 'assets/js/[name].js', chunkFilename: 'assets/js/chunk....
const path = require('path'); const ExtractTextPlugin = require('extract-text-webpack-plugin'); const webpack = require('webpack'); module.exports = { entry: { vendor: './src/vendor.js', mb: './src/mb/index.jsx' }, output: { filename: 'assets/js/[name].js', chunkFilename: 'assets/js/chunk.[id].j...
Add a demo for wwpp
test = { 'name': 'Question 1', 'points': 3, 'suites': [ { 'type': 'concept', 'cases': [ { 'answer': 'Domain is numbers. Range is numbers', 'choices': [ 'Domain is numbers. Range is numbers', 'Domain is numbers. Range is strings', 'Dom...
test = { 'name': 'Question 1', 'points': 3, 'suites': [ { 'cases': [ { 'answer': 'Domain is numbers. Range is numbers', 'choices': [ 'Domain is numbers. Range is numbers', 'Domain is numbers. Range is strings', 'Domain is strings. Range is ...
Correct argparse dependency - argparse already is a part of base python as of 2.7 and 3.2.
import os from setuptools import setup install_requires = [ 'mysql-python>=1.2.3', 'psycopg2>=2.4.2', 'pyyaml>=3.10.0', 'pytz', ] if os.name == 'posix': install_requires.append('termcolor>=1.1.0') if version < (2,7) or (3,0) <= version <= (3,1): install_requires += ['argparse'] setup( ...
import os from setuptools import setup install_requires = [ 'mysql-python>=1.2.3', 'psycopg2>=2.4.2', 'pyyaml>=3.10.0', 'argparse', 'pytz', ] if os.name == 'posix': install_requires.append('termcolor>=1.1.0') setup( name='py-mysql2pgsql', version='0.1.6', description='Tool fo...
Fix export_csv_response function to take generator
from django.utils import six from django.http import StreamingHttpResponse def export_csv_response(generator, name='export.csv'): response = StreamingHttpResponse(generator, content_type='text/csv') response['Content-Disposition'] = 'attachment; filename="%s"' % name return response class FakeFile(objec...
from django.utils import six from django.http import StreamingHttpResponse def export_csv_response(queryset, fields, name='export.csv'): response = StreamingHttpResponse(export_csv(queryset, fields), content_type='text/csv') response['Content-Disposition'] = 'attachment; filen...
Remove window refernece in UMD build
var webpack = require("webpack"); var libraryName = require("./package.json").name; var withLocalesSuffix = "-i18n"; const UglifyJsPlugin = require('uglifyjs-webpack-plugin'); module.exports = { mode: "production", entry: { [libraryName]: "./src/cronstrue.ts", [libraryName + ".min"]: "./src/cronstrue.ts",...
var webpack = require("webpack"); var libraryName = require("./package.json").name; var withLocalesSuffix = "-i18n"; const UglifyJsPlugin = require('uglifyjs-webpack-plugin'); module.exports = { mode: "production", entry: { [libraryName]: "./src/cronstrue.ts", [libraryName + ".min"]: "./src/cronstrue.ts",...
Allow iterable in tag helper
<?php declare(strict_types=1); namespace Becklyn\RadBundle\Tags; use Becklyn\RadBundle\Exception\TagNormalizationException; class TagHelper { /** * @param iterable<string|TagInterface|mixed> $tags * * @return string[] */ public static function getTagLabels (iterable $tags) : array { ...
<?php declare(strict_types=1); namespace Becklyn\RadBundle\Tags; use Becklyn\RadBundle\Exception\TagNormalizationException; class TagHelper { /** * @param array<string|TagInterface|mixed> $tags * * @return string[] */ public static function getTagLabels (array $tags) : array { ...
[Mailer] Fix SmtpEnvelope renaming to Envelope
<?php /* * This file is part of the Symfony package. * * (c) Fabien Potencier <fabien@symfony.com> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Symfony\Component\Mailer\Event; use Symfony\Component\EventDispatcher\E...
<?php /* * This file is part of the Symfony package. * * (c) Fabien Potencier <fabien@symfony.com> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Symfony\Component\Mailer\Event; use Symfony\Component\EventDispatcher\E...
Use environment variable for URL base
import React from "react"; // eslint-disable-line no-unused-vars class CountryMap extends React.Component { constructor(props) { super(props); this.state = { SVG: "" }; } componentWillMount() { let component = this; // TODO move to country-specific bucket or at least folder fetch(process.env....
import React from "react"; // eslint-disable-line no-unused-vars class CountryMap extends React.Component { constructor(props) { super(props); this.state = { SVG: "" }; } componentWillMount() { let component = this; // TODO move to country-specific bucket or at least folder fetch( "http...
CBPS-186: Fix condition for FTS stats collection Currently, stats collection for processes such as indexer and cbq-engine is disabled due to a wrong "if" statement. The "settings object" always has "fts_server" attribute. We should check its boolean value instead. Change-Id: I017f4758f3603e674f094af27b6293716796418a...
from cbagent.collectors import Collector from cbagent.collectors.libstats.psstats import PSStats class PS(Collector): COLLECTOR = "atop" # Legacy KNOWN_PROCESSES = ("beam.smp", "memcached", "indexer", "projector", "cbq-engine") def __init__(self, settings): super(PS, sel...
from cbagent.collectors import Collector from cbagent.collectors.libstats.psstats import PSStats class PS(Collector): COLLECTOR = "atop" # Legacy KNOWN_PROCESSES = ("beam.smp", "memcached", "indexer", "projector", "cbq-engine") def __init__(self, settings): super(PS, sel...
Handle error bags as well as single messaged errors
<?php declare(strict_types=1); namespace Cortex\Foundation\Http\Middleware; use Closure; use Illuminate\Support\ViewErrorBag; use Krucas\Notification\Middleware\NotificationMiddleware as Middleware; class NotificationMiddleware extends Middleware { /** * Handle an incoming request. * * @param \Il...
<?php declare(strict_types=1); namespace Cortex\Foundation\Http\Middleware; use Closure; use Krucas\Notification\Middleware\NotificationMiddleware as Middleware; class NotificationMiddleware extends Middleware { /** * Handle an incoming request. * * @param \Illuminate\Http\Request $request *...
Install Python Markdown when installing cmsplugin-simple-markdown.
from setuptools import setup setup( name='cmsplugin-simple-markdown', version=".".join(map(str, __import__('cmsplugin_simple_markdown').__version__)), packages=['cmsplugin_simple_markdown', 'cmsplugin_simple_markdown.migrations'], package_dir={'cmsplugin_simple_markdown': 'cmsplugin_simple_markdown'}, ...
from distutils.core import setup setup( name='cmsplugin-simple-markdown', version=".".join(map(str, __import__('cmsplugin_simple_markdown').__version__)), packages=['cmsplugin_simple_markdown', 'cmsplugin_simple_markdown.migrations'], package_dir={'cmsplugin_simple_markdown': 'cmsplugin_simple_markdown...
Fix issue with startup of admin-web
package io.fundrequest.platform.admin; import io.fundrequest.common.FundRequestCommon; import io.fundrequest.common.infrastructure.IgnoreDuringComponentScan; import io.fundrequest.core.FundRequestCore; import io.fundrequest.platform.github.FundRequestGithub; import io.fundrequest.platform.keycloak.FundRequestKeycloak;...
package io.fundrequest.platform.admin; import io.fundrequest.common.infrastructure.IgnoreDuringComponentScan; import io.fundrequest.core.FundRequestCore; import io.fundrequest.platform.github.FundRequestGithub; import io.fundrequest.platform.keycloak.FundRequestKeycloak; import io.fundrequest.platform.profile.ProfileA...
[TASK] Fix cache commands for old Magento CE 1.4
<?php namespace N98\Magento\Command\Cache; use N98\Magento\Command\AbstractMagentoCommand; class AbstractCacheCommand extends AbstractMagentoCommand { /** * @return Mage_Core_Model_Cache * @throws \Exception */ protected function _getCacheModel() { if ($this->_magentoMajorVersion =...
<?php namespace N98\Magento\Command\Cache; use N98\Magento\Command\AbstractMagentoCommand; class AbstractCacheCommand extends AbstractMagentoCommand { /** * @return Mage_Core_Model_Cache * @throws \Exception */ protected function _getCacheModel() { if ($this->_magentoMajorVersion =...
Convert to array, then use Dumpy.
<?php namespace LessCompiler; /** * An AST dumper. */ class TreeDumper { /** * @param \LessCompiler\AbstractSyntaxTree $tree * @return string */ public function dumpTree(AbstractSyntaxTree $tree) { $dumpy = new \PhpPackages\Dumpy\Dumpy; $dumped = []; foreach ($tr...
<?php namespace LessCompiler; /** * An AST dumper. */ class TreeDumper { /** * @param \LessCompiler\AbstractSyntaxTree $tree * @return string */ public function dumpTree(AbstractSyntaxTree $tree) { $output = ""; foreach ($tree as $node) { $output .= $this->dum...
Handle built state tracking on versions
import logging from django import forms from readthedocs.builds.models import VersionAlias, Version from readthedocs.core.utils import trigger_build from readthedocs.projects.models import Project from readthedocs.projects.tasks import clear_artifacts log = logging.getLogger(__name__) class AliasForm(forms.ModelF...
import logging from django import forms from readthedocs.builds.models import VersionAlias, Version from readthedocs.core.utils import trigger_build from readthedocs.projects.models import Project from readthedocs.projects.tasks import clear_artifacts log = logging.getLogger(__name__) class AliasForm(forms.ModelF...
Fix feate manage news category
<?php namespace App\Http\Controllers\Admin; use Illuminate\Support\Facades\Input; use App\Http\Controllers\Controller; class NewsCategoryController extends Controller { public function index() { $newscategories = \App\NewsCategory::All(); return view('admin/newscategory/index')->with('news...
<?php namespace App\Http\Controllers\Admin; use Illuminate\Support\Facades\Input; use App\Http\Controllers\Controller; class NewsCategoryController extends Controller { public function index() { $newscategories = \App\NewsCategory::All(); return view('admin/newscategory/index')->with('news...
Fix datatables export to export all coumns if no visible columns requested
<?php declare(strict_types=1); namespace Cortex\Foundation\Transformers; use Illuminate\Support\Arr; use Illuminate\Support\Collection; use Yajra\DataTables\Transformers\DataArrayTransformer as BaseDataArrayTransformer; class DataArrayTransformer extends BaseDataArrayTransformer { /** * Transform row colum...
<?php declare(strict_types=1); namespace Cortex\Foundation\Transformers; use Illuminate\Support\Arr; use Illuminate\Support\Collection; use Yajra\DataTables\Transformers\DataArrayTransformer as BaseDataArrayTransformer; class DataArrayTransformer extends BaseDataArrayTransformer { /** * Transform row colum...