text
stringlengths
17
1.47k
positive
stringlengths
673
4.43k
negative
stringlengths
677
2.81k
Enable animateScreenLights only for devices running 4.2+ animateScreenLights is needed for CRT effect which is not currently available for 4.1 devices, anyway... This fixes some weird display on/off issues on these devices.
package com.ceco.gm2.gravitybox; import android.content.res.XModuleResources; import android.content.res.XResources; import android.os.Build; import de.robv.android.xposed.XSharedPreferences; import de.robv.android.xposed.XposedBridge; public class SystemWideResources { public static void initResources...
package com.ceco.gm2.gravitybox; import android.content.res.XModuleResources; import android.content.res.XResources; import de.robv.android.xposed.XSharedPreferences; import de.robv.android.xposed.XposedBridge; public class SystemWideResources { public static void initResources(final XSharedPreferences ...
Add forgotten JS for VK like button.
// Заменяем MSN_ID на текстовые описания. function set_userlist_msn(){ $('tr td:nth-child(2)', '.uTable').each(function(i){ var $this = $(this); var h = $this.html(); if (~~h) $this.addClass('fraction-name' + h).html(' '); }); } $(function () { // Ссылки на профили...
// Заменяем MSN_ID на текстовые описания. function set_userlist_msn(){ $('tr td:nth-child(2)', '.uTable').each(function(i){ var $this = $(this); var h = $this.html(); if (~~h) $this.addClass('fraction-name' + h).html(' '); }); } $(function () { // Ссылки на профили...
Use the version constant, and fixed comments
<?php /** * This file is part of the ImboClientCli package * * (c) Christer Edvartsen <cogo@starzinger.net> * * For the full copyright and license information, please view the LICENSE file that was * distributed with this source code. */ namespace ImboClientCli; use ImboClientCli\Command, Symfony\Component...
<?php /** * This file is part of the Imbo package * * (c) Christer Edvartsen <cogo@starzinger.net> * * For the full copyright and license information, please view the LICENSE file that was * distributed with this source code. */ namespace ImboClientCli; use ImboClientCli\Command, Symfony\Component\Console;...
Improve versions page to show plain text of multiple languages.
@extends('folio::admin.layout') <?php $settings_title = config('settings.title'); if($settings_title == '') { $settings_title = "Folio"; } $site_title = 'Versions of Item '.$item->id.' | '. $settings_title; ?> @section('title', 'Versions of Item '.$item->id) @section('floating.menu') {!! view('folio::par...
@extends('folio::admin.layout') <?php $settings_title = config('settings.title'); if($settings_title == '') { $settings_title = "Folio"; } $site_title = 'Versions of Item '.$item->id.' | '. $settings_title; ?> @section('title', 'Versions of Item '.$item->id) @section('floating.menu') {!! view('folio::par...
Allow inside behaviors inside auth controller
<?php namespace frenna\auth\controllers; use Yii; use yii\web\Controller; use yii\filters\VerbFilter; use yii\filters\AccessControl; use frenna\auth\models\LoginForm; class AuthController extends Controller { public function behaviors() { return [ 'access' => [ 'class'...
<?php namespace frenna\auth\controllers; use Yii; use yii\web\Controller; use yii\filters\VerbFilter; use yii\filters\AccessControl; use frenna\auth\models\LoginForm; class AuthController extends Controller { public function behaviors() { return [ 'access' => [ 'class'...
Return value of get_result is a pair of (task, result data)
import pymw import pymw.interfaces import artgraph.plugins.infobox from artgraph.node import NodeTypes from artgraph.node import Node class Miner(object): nodes = [] relationships = [] master = None task_queue = [] def __init__(self, debug=False): mwinterface = pymw.interfaces.Generi...
import pymw import pymw.interfaces import artgraph.plugins.infobox from artgraph.node import NodeTypes from artgraph.node import Node class Miner(object): nodes = [] relationships = [] master = None task_queue = [] def __init__(self, debug=False): mwinterface = pymw.interfaces.Generi...
Return 501 on pip search requests
"""Simple blueprint.""" import os from flask import Blueprint, current_app, make_response, render_template blueprint = Blueprint('simple', __name__, url_prefix='/simple', template_folder='templates') @blueprint.route('', methods=['POST']) def search_simple(): """Handling pip search.""" re...
"""Simple blueprint.""" import os from flask import Blueprint, current_app, render_template blueprint = Blueprint('simple', __name__, url_prefix='/simple', template_folder='templates') @blueprint.route('', methods=['GET']) def get_simple(): """List all packages.""" packages = os.listdir(c...
Check id in attributes before remove
import Backbone from 'backbone'; export default Backbone.Model.extend({ build(model, opts = {}) { const models = model.components(); const htmlOpts = {}; const { em } = opts; // Remove unnecessary IDs if (opts.cleanId && em) { const rules = em.get('CssComposer').getAll(); const idRul...
import Backbone from 'backbone'; export default Backbone.Model.extend({ build(model, opts = {}) { const models = model.components(); const htmlOpts = {}; const { em } = opts; // Remove unnecessary IDs if (opts.cleanId && em) { const rules = em.get('CssComposer').getAll(); const idRul...
Add hint if no keywords found
const fs = require('fs') const lang = process.argv[2] const promptly = require('promptly') const data = require('unicode-emoji-json') if (!lang) { const files = fs.readdirSync('dist') const langs = files.map(tag => tag.match(/-(.+)\./)[1]) console.log(`Please provide a langage tag: ${langs.join(', ')}`) } else { ...
const fs = require('fs') const lang = process.argv[2] const promptly = require('promptly') if (!lang) { const files = fs.readdirSync('dist') const langs = files.map(tag => tag.match(/-(.+)\./)[1]) console.log(`Please provide a langage tag: ${langs.join(', ')}`) } else { start() } async function start() { con...
Add data setter and getter for Plot
from PyOpenWorm import * class Plot(DataObject): """ Object for storing plot data in PyOpenWorm. Must be instantiated with a 2D list of coordinates. """ def __init__(self, data=False, *args, **kwargs): DataObject.__init__(self, **kwargs) Plot.DatatypeProperty('_data_string', self...
from PyOpenWorm import * class Plot(DataObject): """ Object for storing plot data in PyOpenWorm. Must be instantiated with a 2D list of coordinates. """ def __init__(self, data=False, *args, **kwargs): DataObject.__init__(self, **kwargs) Plot.DatatypeProperty('_data_string', self...
Update naming convention to fix bug
(function(){ "use strict" $(document).ready(init); function init(){ $(".sort").on('click', sortActivities); $(".user-activities").on('click', ".card", showDescription); } function sortActivities() { var type = $(this).text().toLowerCase(), $activities = $(".user-activity"), order...
(function(){ "use strict" $(document).ready(init); function init(){ $(".sort").on('click', sortActivities); $(".user-activities").on('click', ".card", showDescription); } function sortActivities() { var type = $(this).text().toLowerCase(), $activities = $(".dashboard__activity"), ...
Use a versioned filename for the PCL profiles.
import glob import os import shutil class PCLReferenceAssembliesPackage(Package): def __init__(self): Package.__init__(self, name='mono-pcl-profiles-2013-10-25', version='2013-10-25', sources=['http://storage.bos.xamarin.com/bot-pr...
import glob import os import shutil class PCLReferenceAssembliesPackage(Package): def __init__(self): Package.__init__(self, name='mono-pcl-profiles', version='2013-10-23', sources=['http://storage.bos.xamarin.com/mono-pcl/58/5825e...
Use super() instead of super(classname, self)
# Copyright 2019 Akretion France <https://akretion.com/> # @author: Alexis de Lattre <alexis.delattre@akretion.com> # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). from odoo import _, models from odoo.exceptions import UserError class AccountMove(models.Model): _inherit = "account.move" def ...
# Copyright 2019 Akretion France <https://akretion.com/> # @author: Alexis de Lattre <alexis.delattre@akretion.com> # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). from odoo import _, models from odoo.exceptions import UserError class AccountMove(models.Model): _inherit = "account.move" def ...
Remove before and beforeEach functions in leiu of a getHub function
var _ = require( 'lodash' ); var should = require( 'should' ); var sinon = require( 'sinon' ); var pequire = require( 'proxyquire' ); var TYPES = [ String, Number, Boolean, Object, Array, null, undefined ]; var getHub = function ( overrides ) { overrides = _.assign( {}, overrides ) return pequire( '....
var _ = require( 'lodash' ); var should = require( 'should' ); var sinon = require( 'sinon' ); var pequire = require( 'proxyquire' ); var TYPES = [ String, Number, Boolean, Object, Array, null, undefined ]; describe( 'gulp-hub', function () { before( function () { this.getTestModule = function (...
grunt: Update glob for files to lint with ESLint Now linting .js files in benchmark/
/* eslint-disable camelcase, global-require */ 'use strict'; module.exports = function(grunt) { require('jit-grunt')(grunt); grunt.initConfig({ pkg: grunt.file.readJSON('package.json'), jsonlint: { all: ['*.json'], }, eslint: { all: { src: '**/*.js', ignore: '**/node...
/* eslint-disable camelcase, global-require */ 'use strict'; module.exports = function(grunt) { require('jit-grunt')(grunt); grunt.initConfig({ pkg: grunt.file.readJSON('package.json'), jsonlint: { all: ['*.json'], }, eslint: { all: { src: ['*.js', 'test/*.js'], igno...
Allow end-user to force `isWindowFocused` prop
import React, { Component } from 'react'; import PropTypes from 'prop-types'; import Close from './Close'; import Minimize from './Minimize'; import Resize from './Resize'; var styles = { controls: { WebkitUserSelect: 'none', userSelect: 'none', cursor: 'default', display: 'flex', width: '61px' ...
import React, { Component } from 'react'; import PropTypes from 'prop-types'; import Close from './Close'; import Minimize from './Minimize'; import Resize from './Resize'; var styles = { controls: { WebkitUserSelect: 'none', userSelect: 'none', cursor: 'default', display: 'flex', width: '61px' ...
Add option to delayer plugin to start disabled It's useful to add the delayer plugin to have it available, but without enabling by default. Thus, add an option to disable it by default on startup.
var robohydra = require("robohydra"), heads = robohydra.heads, RoboHydraHead = heads.RoboHydraHead; exports.getBodyParts = function(conf) { "use strict"; var delayMilliseconds = conf.delaymillis || 2000, delayPath = conf.delaypath || '/.*', delayDisabled = !!conf.delaydisab...
var robohydra = require("robohydra"), heads = robohydra.heads, RoboHydraHead = heads.RoboHydraHead; exports.getBodyParts = function(conf) { "use strict"; var delayMilliseconds = conf.delaymillis || 2000, delayPath = conf.delaypath || '/.*'; conf.robohydra.registerDynamicHead(n...
Make directory listing exclude LICENSE file and IntelliJ project files
<?php return array( // Basic settings 'hide_dot_files' => true, 'list_folders_first' => true, 'list_sort_order' => 'natcasesort_reverse', 'theme_name' => 'bootstrap', 'external_links_new_window' => true, // Hidden files 'hidden_files' => arra...
<?php return array( // Basic settings 'hide_dot_files' => true, 'list_folders_first' => true, 'list_sort_order' => 'natcasesort_reverse', 'theme_name' => 'bootstrap', 'external_links_new_window' => true, // Hidden files 'hidden_files' => arra...
Upgrade ldap3 0.9.9.2 => 1.0.2
import sys from setuptools import find_packages, setup VERSION = '2.0.dev0' install_requires = [ 'django-local-settings>=1.0a10', 'stashward', ] if sys.version_info[:2] < (3, 4): install_requires.append('enum34') setup( name='django-arcutils', version=VERSION, url='https://github.com/PSU...
import sys from setuptools import find_packages, setup VERSION = '2.0.dev0' install_requires = [ 'django-local-settings>=1.0a10', 'stashward', ] if sys.version_info[:2] < (3, 4): install_requires.append('enum34') setup( name='django-arcutils', version=VERSION, url='https://github.com/PSU...
Update image upload button styling
import React, { Component } from 'react'; import { connect } from 'react-redux'; import actions from '../actions/index.js'; import { fetchFPKey } from '../utils/utils'; const filepicker = require('filepicker-js'); // import '../scss/_createRecipe.scss'; class ImageUpload extends Component { render() { const { re...
import React, { Component } from 'react'; import { connect } from 'react-redux'; import actions from '../actions/index.js'; import { fetchFPKey } from '../utils/utils'; const filepicker = require('filepicker-js'); import '../scss/_createRecipe.scss'; class ImageUpload extends Component { render() { const { recip...
Fix test failures on py3.
# vim: set ts=4 sw=4 et: coding=UTF-8 from rpmsection import Section class RpmInstall(Section): ''' Remove commands that wipe out the build root. Replace %makeinstall (suse-ism). ''' def add(self, line): install_command = 'make DESTDIR=%{buildroot} install %{?_smp_mflags}' ...
# vim: set ts=4 sw=4 et: coding=UTF-8 import string from rpmsection import Section class RpmInstall(Section): ''' Remove commands that wipe out the build root. Replace %makeinstall (suse-ism). ''' def add(self, line): install_command = 'make DESTDIR=%{buildroot} install %{?_smp_...
Update minimum support boto version. boto 2.20.0 introduces kinesis. alternatively, this requirement could be relaxed by using conditional imports.
#!/usr/bin/env python from __future__ import unicode_literals from setuptools import setup, find_packages install_requires = [ "Jinja2", "boto>=2.20.0", "flask", "httpretty>=0.6.1", "requests", "xmltodict", "six", "werkzeug", ] import sys if sys.version_info < (2, 7): # No buildin...
#!/usr/bin/env python from __future__ import unicode_literals from setuptools import setup, find_packages install_requires = [ "Jinja2", "boto", "flask", "httpretty>=0.6.1", "requests", "xmltodict", "six", "werkzeug", ] import sys if sys.version_info < (2, 7): # No buildint Ordere...
Correct concat helper separator handler
/* * Fugerit Java Library is distributed under the terms of : Apache License Version 2.0, January 2004 http://www.apache.org/licenses/ Full license : http://www.apache.org/licenses/LICENSE-2.0 Project site: ...
/* * Fugerit Java Library is distributed under the terms of : Apache License Version 2.0, January 2004 http://www.apache.org/licenses/ Full license : http://www.apache.org/licenses/LICENSE-2.0 Project site: ...
Use MessageInterface for reading constants.
<?php namespace Retrinko\CottonTail\Message; use PhpAmqpLib\Message\AMQPMessage; use Retrinko\CottonTail\Message\Messages\BasicMessage; use Retrinko\CottonTail\Message\Messages\RpcRequestMessage; use Retrinko\CottonTail\Message\Messages\RpcResponseMessage; class MessageFactory { /** * @param AMQPMessage $...
<?php namespace Retrinko\CottonTail\Message; use PhpAmqpLib\Message\AMQPMessage; use Retrinko\CottonTail\Message\Messages\BasicMessage; use Retrinko\CottonTail\Message\Messages\RpcRequestMessage; use Retrinko\CottonTail\Message\Messages\RpcResponseMessage; class MessageFactory { /** * @param AMQPMessage $...
Use button instead of NavbarToggler
import './header.scss'; import React from 'react'; import {Link} from 'react-router'; import FontAwesome from 'react-fontawesome'; import { Navbar, NavbarBrand, Nav, NavItem, NavLink, NavbarToggler, Collapse } from 'reactstrap'; class Header extends React.Component { constructor(props){ super(props); thi...
import './header.scss'; import React from 'react'; import {Link} from 'react-router'; import FontAwesome from 'react-fontawesome'; import { Navbar, NavbarBrand, Nav, NavItem, NavLink, NavbarToggler, Collapse } from 'reactstrap'; class Header extends React.Component { constructor(props){ super(props); thi...
Fix js config caching issue
/** * Module dependencies. */ var Promise = require('bluebird'); var yaml = require('js-yaml'); var _ = require('lodash'); var path = require('path'); var logger = require('winston'); var fs = Promise.promisifyAll(require('fs')); /* * Export the data object. */ module.exports = { /* *...
/** * Module dependencies. */ var Promise = require('bluebird'); var yaml = require('js-yaml'); var _ = require('lodash'); var path = require('path'); var logger = require('winston'); var fs = Promise.promisifyAll(require('fs')); /* * Export the data object. */ module.exports = { /* *...
[Security] Delete old session on auth strategy migrate
<?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\Security\Http\Session; use Symfony\Component\Security...
<?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\Security\Http\Session; use Symfony\Component\Security...
AEIV-175: Integrate column management with grid view functionality - fixed review issues
define(function(require) { 'use strict'; var ColumnManagerItemView; var $ = require('jquery'); var BaseView = require('oroui/js/app/views/base/view'); ColumnManagerItemView = BaseView.extend({ template: require('tpl!orodatagrid/templates/column-manager/column-manager-item.html'), t...
define(function(require) { 'use strict'; var ColumnManagerItemView; var $ = require('jquery'); var BaseView = require('oroui/js/app/views/base/view'); ColumnManagerItemView = BaseView.extend({ template: require('tpl!orodatagrid/templates/column-manager/column-manager-item.html'), t...
Fix webworker ES6 syntax to ES5
importScripts('/static/vendor/scripts/highlight.pack.js'); var unescape = { '&amp;': '&', '&lt;': '<', '&gt;': '>', '&quot;': '"', '&apos;': '\'', }; var regex = new RegExp(Object.keys(unescape).join('|'), 'g'); function unescapeFn(match) { return unescape[match]; } function highlightBlockHT...
importScripts('/static/vendor/scripts/highlight.pack.js'); var unescape = { '&amp;': '&', '&lt;': '<', '&gt;': '>', '&quot;': '"', '&apos;': '\'', }; var regex = new RegExp(Object.keys(unescape).join('|'), 'g'); function unescapeFn(match) { return unescape[match]; } function highlightBlockHT...
Allow message field to be deselected
CRM.$(function($) { var $messageField = $('#customData .custom-group-Letter_To input[data-crm-custom="Letter_To:Message_Field"]'); $messageField.attr({ placeholder: '- Select Field -', allowClear: 'true', }); createEntityRef($messageField, $('#profile_id').val()); $('#profile_id').change( function() ...
CRM.$(function($) { var $messageField = $('#customData .custom-group-Letter_To input[data-crm-custom="Letter_To:Message_Field"]') createEntityRef($messageField, $('#profile_id').val()); $('#profile_id').change( function() { $messageField.crmEntityRef('destroy'); $messageField.val(''); createEntityRef...
Add method to get complete Authorization Header for adorsys
package de.fau.amos.virtualledger.server.auth; import org.keycloak.KeycloakPrincipal; import org.keycloak.KeycloakSecurityContext; import org.keycloak.representations.AccessToken; import org.springframework.security.core.context.SecurityContextHolder; import org.springframework.stereotype.Component; @Component public...
package de.fau.amos.virtualledger.server.auth; import org.keycloak.KeycloakPrincipal; import org.keycloak.KeycloakSecurityContext; import org.keycloak.representations.AccessToken; import org.springframework.security.core.context.SecurityContextHolder; import org.springframework.stereotype.Component; @Component public...
Add check whether $cancellable is an object
<?php namespace React\Promise\Internal; /** * @internal */ final class CancellationQueue { private $started = false; private $queue = []; public function __invoke(): void { if ($this->started) { return; } $this->started = true; $this->drain(); } ...
<?php namespace React\Promise\Internal; /** * @internal */ final class CancellationQueue { private $started = false; private $queue = []; public function __invoke(): void { if ($this->started) { return; } $this->started = true; $this->drain(); } ...
Fix mailing all validators even when they have their students validated
<?php namespace App\Console\Commands; use Illuminate\Console\Command; use App\Models\ValidationRequest; use App\Models\ValidatorInvite; use App\Models\Company; use App\Models\Validator; use App\Models\Alert; use App\Notifications\NewAlerts; use App\Notifications\ValidationsPending; class Cleanup extends Command { ...
<?php namespace App\Console\Commands; use Illuminate\Console\Command; use App\Models\ValidationRequest; use App\Models\ValidatorInvite; use App\Models\Company; use App\Models\Validator; use App\Models\Alert; use App\Notifications\NewAlerts; use App\Notifications\ValidationsPending; class Cleanup extends Command { ...
Add convenience methods to get a client config.
package com.afrozaar.wordpress.wpapi.v2.util; import org.yaml.snakeyaml.Yaml; import java.io.InputStream; public class ClientConfig { Wordpress wordpress; boolean debug; public ClientConfig() { } private ClientConfig(boolean debug, Wordpress wordpress) { this.debug = debug; thi...
package com.afrozaar.wordpress.wpapi.v2.util; import org.yaml.snakeyaml.Yaml; import java.io.InputStream; public class ClientConfig { Wordpress wordpress; boolean debug; public ClientConfig() { } public boolean isDebug() { return debug; } public void setDebug(boolean debug) { ...
Change 'password_reset_done' URL name to 'password_reset_complete' The built-in password reset views use a different name for the last page in the flow than we did before, and somehow we never noticed this until recently. Trivial fix. Fixes bug 3345.
from __future__ import unicode_literals from django.conf.urls import patterns, url from reviewboard.accounts.views import MyAccountView urlpatterns = patterns( "reviewboard.accounts.views", url(r'^register/$', 'account_register', {'next_url': 'dashboard'}, name="register"), url(r'^preferences/$...
from __future__ import unicode_literals from django.conf.urls import patterns, url from reviewboard.accounts.views import MyAccountView urlpatterns = patterns( "reviewboard.accounts.views", url(r'^register/$', 'account_register', {'next_url': 'dashboard'}, name="register"), url(r'^preferences/$...
Store default value in root.
function Supersede (value) { this._root = { '.value': value } } Supersede.prototype.set = function (path, value) { var node = this._root for (var i = 0, I = path.length; i < I; i++) { if (!node[path[i]]) { node[path[i]] = {} } node = node[path[i]] } node['.valu...
function Supersede (value) { this._root = {} this._value = value } Supersede.prototype.set = function (path, value) { var node = this._root for (var i = 0, I = path.length; i < I; i++) { if (!node[path[i]]) { node[path[i]] = {} } node = node[path[i]] } node...
Fix - namespace in test
<?php use JakubOnderka\PhpVarDumpCheck; class ZendTest extends PHPUnit_Framework_TestCase { protected $uut; public function __construct() { $settings = new PhpVarDumpCheck\Settings(); $settings->functionsToCheck = array_merge($settings->functionsToCheck, array( PhpVarDumpChec...
<?php use JakubOnderka\PhpVarDumpCheck; class ZendTest extends PHPUnit_Framework_TestCase { protected $uut; public function __construct() { $settings = new PhpVarDumpCheck\Settings(); $settings->functionsToCheck = array_merge($settings->functionsToCheck, array( PhpVarDumpChec...
IFS-5895: Add support for totals to other costs rows
package org.innovateuk.ifs.project.grantofferletter.viewmodel; import java.math.BigDecimal; import java.util.Collection; import java.util.List; import java.util.Map; import static java.util.Collections.singletonList; /* * Holder of values for the other costs rows on GOL finance tables, which are handled differently...
package org.innovateuk.ifs.project.grantofferletter.viewmodel; import java.math.BigDecimal; import java.util.Collection; import java.util.List; import java.util.Map; import static java.util.Collections.singletonList; /* * Holder of values for the other costs rows on GOL finance tables, which are handled differently...
747: Handle setting values of '' and ' '
from __future__ import unicode_literals from django.db import migrations, connection def set_default_news_items(apps, schema_editor): Plugin = apps.get_model("utils", "Plugin") Journal = apps.get_model("journal", "Journal") PluginSetting = apps.get_model("utils", "PluginSetting") PluginSettingValue =...
from __future__ import unicode_literals from django.db import migrations, connection def set_default_news_items(apps, schema_editor): Plugin = apps.get_model("utils", "Plugin") Journal = apps.get_model("journal", "Journal") PluginSetting = apps.get_model("utils", "PluginSetting") PluginSettingValue =...
Annotate return types of Model properties
import _pybinding from scipy.sparse import csr_matrix as _csrmatrix from .system import System as _System from .hamiltonian import Hamiltonian as _Hamiltonian from .solver.solver_ex import SolverEx as _Solver class Model(_pybinding.Model): def __init__(self, *params): super().__init__() self.add(*...
import _pybinding from scipy.sparse import csr_matrix as _csrmatrix class Model(_pybinding.Model): def __init__(self, *params): super().__init__() self.add(*params) def add(self, *params): for param in params: if param is None: continue if isin...
Fix bad comment on header
/** + * Korean translation for bootstrap-markdown + * WoongBi Kim <ssinss@gmail.com> + */ ;(function($){ $.fn.markdown.messages['kr'] = { 'Bold': "진하게", 'Italic': "이탤릭체", 'Heading': "머리글", 'URL/Link': "링크주소", 'Image': "이미지", 'List': "리스트", 'Preview': "미리보기", 'strong text': "강한 강조 텍스...
+/** + * Korean translation for bootstrap-markdown + * WoongBi Kim <ssinss@gmail.com> + */ ;(function($){ $.fn.markdown.messages['kr'] = { 'Bold': "진하게", 'Italic': "이탤릭체", 'Heading': "머리글", 'URL/Link': "링크주소", 'Image': "이미지", 'List': "리스트", 'Preview': "미리보기", 'strong text': "강한 강조 텍...
Fix constantine death on integers
Constants = (function() { var CONSTANTS_URI = 'http://constantine.teaisaweso.me/json'; var gotConstants = new Bacon.Bus(); var constants = gotConstants.toProperty().skipDuplicates(_.isEqual); var getAll = function(callback) { constants.onValue(callback); }; var reload = function() { ...
Constants = (function() { var CONSTANTS_URI = 'http://constantine.teaisaweso.me/json'; var gotConstants = new Bacon.Bus(); var constants = gotConstants.toProperty().skipDuplicates(_.isEqual); var getAll = function(callback) { constants.onValue(callback); }; var reload = function() { ...
Allow canary to fail without failing all tests
/*jshint node:true*/ module.exports = { scenarios: [ { name: 'default', bower: { dependencies: { } } }, { name: 'ember-1.13', bower: { dependencies: { 'ember': '~1.13.0' }, resolutions: { 'ember': '~1.13.0' } }...
/*jshint node:true*/ module.exports = { scenarios: [ { name: 'default', bower: { dependencies: { } } }, { name: 'ember-1.13', bower: { dependencies: { 'ember': '~1.13.0' }, resolutions: { 'ember': '~1.13.0' } }...
Use https ONLY in development
/** * @file lib/index.js * @description Runs a single server instance to run the application. * @author Karim Alibhai * @license MIT * @copyright Karim Alibhai 2017 */ import fs from 'fs' import path from 'path' import express from 'express' import autocomplete from './search/autocomplete' import nearby from './...
/** * @file lib/index.js * @description Runs a single server instance to run the application. * @author Karim Alibhai * @license MIT * @copyright Karim Alibhai 2017 */ import fs from 'fs' import path from 'path' import express from 'express' import autocomplete from './search/autocomplete' import nearby from './...
Remove useless return in exec() callback
var fs = require('fs') , findExec = require('find-exec') , child_process = require('child_process') , players = [ 'mplayer', 'afplay', 'mpg123', 'mpg321', 'play...
var fs = require('fs') , findExec = require('find-exec') , child_process = require('child_process') , players = [ 'mplayer', 'afplay', 'mpg123', 'mpg321', 'play...
Add missing api key in product picker. Fixes #6185
$.fn.productAutocomplete = function (options) { 'use strict'; // Default options options = options || {}; var multiple = typeof(options.multiple) !== 'undefined' ? options.multiple : true; this.select2({ minimumInputLength: 3, multiple: multiple, initSelection: function (element, callback) { ...
$.fn.productAutocomplete = function (options) { 'use strict'; // Default options options = options || {}; var multiple = typeof(options.multiple) !== 'undefined' ? options.multiple : true; this.select2({ minimumInputLength: 3, multiple: multiple, initSelection: function (element, callback) { ...
Enable fuzziness + AND phrases when searching text
const fp = require('lodash/fp') const elastic = require('./index') const toBody = message => fp.pick([ 'timestamp', 'from', 'to', 'text', ], message) const indexMessage = message => { return elastic.index({ index: 'messages', type: 'message', id: message.id, body: toBody(message...
const fp = require('lodash/fp') const elastic = require('./index') const toBody = message => fp.pick([ 'timestamp', 'from', 'to', 'text', ], message) const indexMessage = message => { return elastic.index({ index: 'messages', type: 'message', id: message.id, body: toBody(message...
Fix scope when setting up multiprocessing with coverage
import os import sys def patch_process_for_coverage(): # patch multiprocessing module to get coverage # https://bitbucket.org/ned/coveragepy/issue/117/enable-coverage-measurement-of-code-run-by from coverage.collector import Collector from coverage import coverage import multiprocessing # dete...
import os import sys def patch_process_for_coverage(): # patch multiprocessing module to get coverage # https://bitbucket.org/ned/coveragepy/issue/117/enable-coverage-measurement-of-code-run-by from coverage.collector import Collector from coverage import coverage import multiprocessing # dete...
Make timeout error an assertion error, not just any old exception This means that timeout failures are considered to be test failures, where a specific assertion (i.e. 'this function takes less than N seconds') has failed, rather than being a random error in the test that may indicate a bug.
#!/usr/bin/env python # -*- coding: utf-8 -*- """ :copyright: (c) 2012-2013 by PN. :license: MIT, see LICENSE for more details. """ from __future__ import print_function from __future__ import unicode_literals from __future__ import division import signal from functools import wraps ########################...
#!/usr/bin/env python # -*- coding: utf-8 -*- """ :copyright: (c) 2012-2013 by PN. :license: MIT, see LICENSE for more details. """ from __future__ import print_function from __future__ import unicode_literals from __future__ import division import signal from functools import wraps ########################...
Watch task on *all* scss files now.
'use strict'; var gulp = require('gulp'); var sass = require('gulp-sass'); var minifyCss = require('gulp-minify-css'); var rename = require('gulp-rename'); var autoprefixer = require('gulp-autoprefixer'); //gulp.task('sass', function () { // gulp.src('./sass/**/*.scss') // .pipe(sass().on('error', sass.logE...
'use strict'; var gulp = require('gulp'); var sass = require('gulp-sass'); var minifyCss = require('gulp-minify-css'); var rename = require('gulp-rename'); var autoprefixer = require('gulp-autoprefixer'); //gulp.task('sass', function () { // gulp.src('./sass/**/*.scss') // .pipe(sass().on('error', sass.logE...
Allow for switching to default context
if (browser.contextualIdentities !== undefined) { browser.contextualIdentities.query({}) .then((contexts) => { const parentId = chrome.contextMenus.create({ id: "moveContext", title: "Move to context", contexts: ["tab"] }); const contextStore = contexts.reduce((store, co...
if (browser.contextualIdentities !== undefined) { browser.contextualIdentities.query({}) .then((contexts) => { const parentId = chrome.contextMenus.create({ id: "moveContext", title: "Move to context", contexts: ["tab"] }); const contextStore = contexts.reduce((store, co...
Fix security context annotation return type
<?php /** * * @author Andriy Oblivantsev <eslider@gmail.com> * @copyright 19.02.2015 by WhereGroup GmbH & Co. KG */ namespace Mapbender\CoreBundle\Component; use FOM\UserBundle\Entity\User; /** * Class SecurityContext * * @package FOM\UserBundle\Component * @author Andriy Oblivantsev <es...
<?php /** * * @author Andriy Oblivantsev <eslider@gmail.com> * @copyright 19.02.2015 by WhereGroup GmbH & Co. KG */ namespace Mapbender\CoreBundle\Component; use FOM\UserBundle\Component\User\UserEntityInterface; use FOM\UserBundle\Entity\User; /** * Class SecurityContext * * @package FOM\Us...
Fix issue with toggling in queries with dropdown menu
import { inject, bindable } from 'aurelia-framework'; import { EventAggregator } from 'aurelia-event-aggregator'; @inject(EventAggregator, Element) export class UiDropdownMenuItemCustomElement { @bindable icon; @bindable toggle; @bindable toggleSource; constructor(eventAggregator, element) { t...
import { inject, bindable } from 'aurelia-framework'; import { EventAggregator } from 'aurelia-event-aggregator'; @inject(EventAggregator, Element) export class UiDropdownMenuItemCustomElement { @bindable icon; @bindable toggle; @bindable toggleSource; constructor(eventAggregator, element) { t...
Improve the schema for classes to store hours and minutes separately
package com.satsumasoftware.timetable.db; public final class ClassesSchema { public static final String TABLE_NAME = "classes"; public static final String COL_ID = "id"; public static final String COL_SUBJECT_ID = "subject_id"; public static final String COL_DAY = "day"; public static final String...
package com.satsumasoftware.timetable.db; public final class ClassesSchema { public static final String TABLE_NAME = "classes"; public static final String COL_ID = "id"; public static final String COL_SUBJECT_ID = "subject_id"; public static final String COL_DAY = "day"; public static final String...
Remove GET options in url
from flask import Flask from flask import request from flask import jsonify from y_text_recommender_system.recommender import recommend app = Flask(__name__) class InvalidUsage(Exception): status_code = 400 def __init__(self, message, payload=None): Exception.__init__(self) self.message = m...
from flask import Flask from flask import request from flask import jsonify from y_text_recommender_system.recommender import recommend app = Flask(__name__) class InvalidUsage(Exception): status_code = 400 def __init__(self, message, payload=None): Exception.__init__(self) self.message = m...
Use standardized S3 environment variables.
<?php return [ /* |-------------------------------------------------------------------------- | Default Filesystem Disk |-------------------------------------------------------------------------- | | Here you may specify the default filesystem disk that should be used | by the framework. A...
<?php return [ /* |-------------------------------------------------------------------------- | Default Filesystem Disk |-------------------------------------------------------------------------- | | Here you may specify the default filesystem disk that should be used | by the framework. A...
Fix code to follow eslint rules
'use babel'; /* global atom */ import { exec } from 'child-process-promise'; import { dirname } from 'path'; export default { config: { vhdlCompiler: { title: 'VHDL Compiler', description: 'Path to your vhdl compiler', type: 'string', default: 'ghdl', }, }, provideLinter() { ...
'use babel'; /* global atom */ import { exec } from 'child-process-promise'; import { dirname } from 'path'; export default { config: { vhdlCompiler: { title: 'VHDL Compiler', description: 'Path to your vhdl compiler', type: 'string', default: 'ghdl', }, }, provideLinter() { ...
Fix height checks by switching to use dirty flag instead of setting height -1
import React from 'react'; import {shouldComponentUpdate} from 'react-addons-pure-render-mixin'; const ReactHeight = React.createClass({ propTypes: { children: React.PropTypes.node.isRequired, onHeightReady: React.PropTypes.func.isRequired, hidden: React.PropTypes.bool }, getDefaultProps() { r...
import React from 'react'; import {shouldComponentUpdate} from 'react-addons-pure-render-mixin'; const ReactHeight = React.createClass({ propTypes: { children: React.PropTypes.node.isRequired, onHeightReady: React.PropTypes.func.isRequired, hidden: React.PropTypes.bool }, getDefaultProps() { r...
Trim to avoid // at home page domain redirect.
<?php namespace Anomaly\RedirectsModule\Http\Middleware; use Closure; use Illuminate\Http\Request; /** * Class RedirectDomains * * @link http://pyrocms.com/ * @author PyroCMS, Inc. <support@pyrocms.com> * @author Ryan Thompson <ryan@pyrocms.com> */ class RedirectDomains { /** * Handle an incoming r...
<?php namespace Anomaly\RedirectsModule\Http\Middleware; use Closure; use Illuminate\Http\Request; /** * Class RedirectDomains * * @link http://pyrocms.com/ * @author PyroCMS, Inc. <support@pyrocms.com> * @author Ryan Thompson <ryan@pyrocms.com> */ class RedirectDomains { /** * Handle an incoming r...
Use distinct() when getting section items
from django.db.models import Q from .utils import get_section_relations, get_item_model_class class ItemFilter(object): manager_attr = 'objects' def get_manager(self, model): """Return the desired manager for the item model.""" return getattr(model, self.manager_attr) def get_section_re...
from django.db.models import Q from .utils import get_section_relations, get_item_model_class class ItemFilter(object): manager_attr = 'objects' def get_manager(self, model): """Return the desired manager for the item model.""" return getattr(model, self.manager_attr) def get_section_re...
[MySQL] Use NUMERIC as a string generation strategy
package sqlancer.dbms; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assumptions.assumeTrue; import org.junit.jupiter.api.Test; import sqlancer.Main; public class TestMySQL { String mysqlAvailable = System.getenv("MYSQL_AVAILABLE"); boolean mysqlIsAvailabl...
package sqlancer.dbms; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assumptions.assumeTrue; import org.junit.jupiter.api.Test; import sqlancer.Main; public class TestMySQL { String mysqlAvailable = System.getenv("MYSQL_AVAILABLE"); boolean mysqlIsAvailabl...
Add speech to text and send text to server
const sendBtn = document.getElementById(`sendBtn`) const input = document.getElementById(`input`) const initSpeech = document.getElementById(`initSpeech`) const speechOutput = document.getElementById(`speechOutput`) let transcript = null function postToServer(message) { console.log(`Sending ...
const sendBtn = document.getElementById(`sendBtn`) const input = document.getElementById(`input`) const initSpeech = document.getElementById(`initSpeech`) function sendPost(event) { event.preventDefault() var message = input.value console.log(`Sending to server: ` + message) var reque...
Fix required Django version (doesnt support 1.8 yet)
from setuptools import setup setup( name='django-simpleimages', version='1.2.0', author='Saul Shanabrook', author_email='s.shanabrook@gmail.com', packages=[ 'simpleimages', 'simpleimages.management', 'simpleimages.management.commands', ], url='https://www.github.com...
from setuptools import setup setup( name='django-simpleimages', version='1.2.0', author='Saul Shanabrook', author_email='s.shanabrook@gmail.com', packages=[ 'simpleimages', 'simpleimages.management', 'simpleimages.management.commands', ], url='https://www.github.com...
Implement a write test for Locket.
#!/usr/bin/env node var Locket = require('../') var cadence = require('cadence') var path = require('path') var crypto = require('crypto') var seedrandom = require('seedrandom') var random = (function () { var random = seedrandom(0) return function (max) { return Math.floor(random() * max) } })()...
#!/usr/bin/env node var Locket = require('../') var cadence = require('cadence') var path = require('path') var crypto = require('crypto') var seedrandom = require('seedrandom') function pseudo (max) { var random = seedrandom()() while (random > max) { random = seedrandom()() } return random ...
Apply consistent code style as used in other tests.
<?php namespace Tests\Feature; use App\Actions\VerifyDependencies; use Exception; use Symfony\Component\Process\ExecutableFinder; use Tests\TestCase; class VerifyDependenciesTest extends TestCase { private $executableFinder; public function setUp(): void { parent::setUp(); // TODO: Change the au...
<?php namespace Tests\Feature; use App\Actions\VerifyDependencies; use Exception; use Symfony\Component\Process\ExecutableFinder; use Tests\TestCase; class VerifyDependenciesTest extends TestCase { /** @test */ function it_checks_that_required_dependencies_are_available() { $this->mock(Executable...
Rename variable elephpant as druplicon
<?php /** * @file * Contains \Drupal\Console\Command\Autowire\ElephpantCommand. */ namespace Drupal\Console\Command\Autowire; use Symfony\Component\Console\Input\InputArgument; use Symfony\Component\Console\Input\InputOption; use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Output...
<?php /** * @file * Contains \Drupal\Console\Command\Autowire\ElephpantCommand. */ namespace Drupal\Console\Command\Autowire; use Symfony\Component\Console\Input\InputArgument; use Symfony\Component\Console\Input\InputOption; use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Output...
Fix comment in sort example
import React from 'react'; import { TacoTable, DataType, SortDirection, Formatters } from 'react-taco-table'; import cellLinesData from '../data/cell_lines.json'; /** * An example demonstrating sort configurations */ const columns = [ { id: 'name', type: DataType.String, value: rowData => rowData.cell...
import React from 'react'; import { TacoTable, DataType, SortDirection, Formatters } from 'react-taco-table'; import cellLinesData from '../data/cell_lines.json'; /** * An example demonstrating various formatters */ const columns = [ { id: 'name', type: DataType.String, value: rowData => rowData.cellL...
:art: Refactor & remove workaround for extends-before-declaration rule
'use strict'; var helpers = require('../helpers'); module.exports = { 'name': 'extends-before-declarations', 'defaults': {}, 'detect': function (ast, parser) { var result = [], error; ast.traverseByType('block', function (block) { var lastDeclaration = null; block.forEach(function ...
'use strict'; var helpers = require('../helpers'); module.exports = { 'name': 'extends-before-declarations', 'defaults': {}, 'detect': function (ast, parser) { var result = [], error; ast.traverseByType('block', function (block) { var lastDeclaration = null; block.forEach(function ...
Add a name to the runner
package wumpus; import java.util.ArrayList; import java.util.Iterator; import java.util.NoSuchElementException; import wumpus.Environment.*; /** * The iteration of plays that the player can take until reaches its end. */ public class Runner implements Iterable<Player>, Iterator<Player> { private static final i...
package wumpus; import java.util.ArrayList; import java.util.Iterator; import java.util.NoSuchElementException; import wumpus.Environment.*; /** * The iteration of plays that the player can take until reaches its end. */ public class Runner implements Iterable<Player>, Iterator<Player> { private static final i...
Fix for Cannot read property 'excludeFinished' of null
angular.module('14all', ['ui.bootstrap','ngAnimate', 'auth', /* Modules */ 'manga','movie','serie','anime','game','book', '14all.templates']) .config(['RestangularProvider',function(RestangularProvider){ RestangularProvider.setRestangularFields({ id: "_id" }); Res...
angular.module('14all', ['ui.bootstrap','ngAnimate', 'auth', /* Modules */ 'manga','movie','serie','anime','game','book', '14all.templates']) .config(['RestangularProvider',function(RestangularProvider){ RestangularProvider.setRestangularFields({ id: "_id" }); Res...
Use client_name instead of schema_name
import json from rest_framework.authtoken.models import Token from django.contrib.contenttypes.models import ContentType from django.core.management.base import BaseCommand from bluebottle.clients import properties from bluebottle.clients.models import Client from bluebottle.clients.utils import LocalTenant class C...
import json from rest_framework.authtoken.models import Token from django.contrib.contenttypes.models import ContentType from django.core.management.base import BaseCommand from bluebottle.clients import properties from bluebottle.clients.models import Client from bluebottle.clients.utils import LocalTenant class C...
Set the byline to either the display name or the username We don't need both in the comment email. We'd rather have the display name, but if it's not available, then the username is fine.
<?php class TalkCommentEmailService extends EmailBaseService { protected $talk; protected $comment; public function __construct($config, $recipients, $talk, $comment) { // set up the common stuff first parent::__construct($config, $recipients); // this email needs talk and co...
<?php class TalkCommentEmailService extends EmailBaseService { protected $talk; protected $comment; public function __construct($config, $recipients, $talk, $comment) { // set up the common stuff first parent::__construct($config, $recipients); // this email needs talk and co...
Make codes being close to React style
var ContribBox = React.createClass({ handleLoad: function(user) { alert(user); }, render: function() { return <div>asdf</div>; } }); var SearchBox = React.createClass({ getInitialState: function() { return { user: this.props.user || '' }; }, s...
var ContribBox = React.createClass({ render: function() { return <div />; } }); var SearchBox = React.createClass({ getInitialState: function () { console.log(this.props); return { user: this.props.user || '' }; }, handleSubmit: function() { }, ...
Return the command array in createCommand
<?php namespace BryanCrowe; class Growl { public function __construct() {} public function growl($message = null, $options = []) {} public function createCommand() { switch (PHP_OS) { case 'Darwin': if (exec('which growlnotify')) { return [ ...
<?php namespace BryanCrowe; class Growl { public function __construct() {} public function growl($message = null, $options = []) {} public function createCommand() { switch (PHP_OS) { case 'Darwin': if (exec('which growlnotify')) { $command = [ ...
Add missing save statement in update script without this save nothing at all will be updated
<?php class Kwc_List_ChildPages_Teaser_Update_20150309Legacy00002 extends Kwf_Update { public function postUpdate() { $cmps = Kwf_Component_Data_Root::getInstance() ->getComponentsByClass('Kwc_List_ChildPages_Teaser_Component', array('ignoreVisible'=>true) ...
<?php class Kwc_List_ChildPages_Teaser_Update_20150309Legacy00002 extends Kwf_Update { public function postUpdate() { $cmps = Kwf_Component_Data_Root::getInstance() ->getComponentsByClass('Kwc_List_ChildPages_Teaser_Component', array('ignoreVisible'=>true) ...
Check mtime to see if we need to write out new db file.
#!/usr/bin/python # Edit an AES encrypted json/pickle file. import os import sys import json import getpass import tempfile import subprocess import aespckfile import aesjsonfile def editfile(fn, password): filetype = aespckfile if ".json" in fn: filetype = aesjsonfile db = filetype.load(fn, passwo...
#!/usr/bin/python # Edit an AES encrypted json/pickle file. import os import sys import json import getpass import tempfile import subprocess import aespckfile import aesjsonfile def editfile(fn, password): filetype = aespckfile if ".json" in fn: filetype = aesjsonfile db = filetype.load(fn, passwo...
Remove imports in Orange, except data
from __future__ import absolute_import from importlib import import_module try: from .import version # Always use short_version here (see PEP 386) __version__ = version.short_version __git_revision__ = version.git_revision except ImportError: __version__ = "unknown" __git_revision__ = "unknown"...
from __future__ import absolute_import from importlib import import_module try: from .import version # Always use short_version here (see PEP 386) __version__ = version.short_version __git_revision__ = version.git_revision except ImportError: __version__ = "unknown" __git_revision__ = "unknown"...
Drop the wrapper, clone the element and apply the class instead
import React, { PureComponent } from 'react'; import PropTypes from 'prop-types'; import Box from '../box'; import { ButtonGroup } from '../button'; import cx from 'classnames'; import theme from './theme.css'; class Message extends PureComponent { static propTypes = { className: PropTypes.string, children: ...
import React, { PureComponent } from 'react'; import PropTypes from 'prop-types'; import Box from '../box'; import { ButtonGroup } from '../button'; import cx from 'classnames'; import theme from './theme.css'; class Message extends PureComponent { static propTypes = { className: PropTypes.string, children: ...
Remove ACME bundle (default one in symfony)
<?php use Symfony\Component\HttpKernel\Kernel; use Symfony\Component\Config\Loader\LoaderInterface; class AppKernel extends Kernel { public function registerBundles() { $bundles = array( new Symfony\Bundle\FrameworkBundle\FrameworkBundle(), new Symfony\Bundle\SecurityBundle\Sec...
<?php use Symfony\Component\HttpKernel\Kernel; use Symfony\Component\Config\Loader\LoaderInterface; class AppKernel extends Kernel { public function registerBundles() { $bundles = array( new Symfony\Bundle\FrameworkBundle\FrameworkBundle(), new Symfony\Bundle\SecurityBundle\Sec...
Include dummy filter value to the config
/** * Storage (save data to localStorage) */ var config = {}; var storage = { set : function (key, value, stringify) { var isChanged = config.hasOwnProperty(key) && (config[key] !== value); if(isChanged) { config[key] = value; value = stringify ? JSON.stringify(value) : value; localSto...
/** * Storage (save data to localStorage) */ var config = {}; var storage = { set : function (key, value, stringify) { var isChanged = config.hasOwnProperty(key) && (config[key] !== value); if(isChanged) { config[key] = value; value = stringify ? JSON.stringify(value) : value; localSto...
Replace deprecated share method with singleton
<?php namespace Alexpechkarev\GoogleGeocoder; use Illuminate\Foundation\AliasLoader; use Illuminate\Support\ServiceProvider; use Illuminate\Support\Facades\Config; class GoogleGeocoderServiceProvider extends ServiceProvider { /** * Indicates if loading of the provider is deferred. * * @var bool ...
<?php namespace Alexpechkarev\GoogleGeocoder; use Illuminate\Foundation\AliasLoader; use Illuminate\Support\ServiceProvider; use Illuminate\Support\Facades\Config; class GoogleGeocoderServiceProvider extends ServiceProvider { /** * Indicates if loading of the provider is deferred. * * @var bool ...
Fix the namespace of Exception
<?php namespace Pum\Bundle\TypeExtraBundle\Model; /** * The value of a coordinate object should NEVER change. You should instead use * new objects. */ class Coordinate { protected $lat; protected $lng; public function __construct($lat = null, $lng = null) { $this->lat = $lat; $this...
<?php namespace Pum\Bundle\TypeExtraBundle\Model; /** * The value of a coordinate object should NEVER change. You should instead use * new objects. */ class Coordinate { protected $lat; protected $lng; public function __construct($lat = null, $lng = null) { $this->lat = $lat; $this...
Add parallel capability for running the map
''' Read in a vm map file. The map file contains a mapping of profiles to names allowing for individual vms to be created in a more stateful way ''' # Import python libs import os import copy import multiprocessing # Import salt libs import saltcloud.cloud import salt.client # Import third party libs import yaml c...
''' Read in a vm map file. The map file contains a mapping of profiles to names allowing for individual vms to be created in a more stateful way ''' # Import python libs import os import copy # Import salt libs import saltcloud.cloud import salt.client # Import third party libs import yaml class Map(object): '...
Set Mocha timout to 5 seconds
module.exports = function(grunt) { grunt.initConfig({ jshint: { files: ['Gruntfile.js', 'src/**/*.js', 'test/**/*.js'], options: { node: true, globals: {}, white: true, indent: 2, camelcase: true, ...
module.exports = function(grunt) { grunt.initConfig({ jshint: { files: ['Gruntfile.js', 'src/**/*.js', 'test/**/*.js'], options: { node: true, globals: {}, white: true, indent: 2, camelcase: true, ...
Disable notification test for now
require.config({ baseUrl: '.', paths: { jquery: 'js/vendor/jquery', underscore: 'js/vendor/underscore', backbone: 'js/vendor/backbone', localstorage: 'js/vendor/backbone.localStorage', foundation: 'js/vendor/foundation', reveal: 'js/vendor/foundation.reveal', ...
require.config({ baseUrl: '.', paths: { jquery: 'js/vendor/jquery', underscore: 'js/vendor/underscore', backbone: 'js/vendor/backbone', localstorage: 'js/vendor/backbone.localStorage', foundation: 'js/vendor/foundation', reveal: 'js/vendor/foundation.reveal', ...
Update smoke test compiler pass
<?php namespace Smartbox\Integration\FrameworkBundle\DependencyInjection\CompilerPasses; use Smartbox\Integration\FrameworkBundle\Tools\SmokeTests\ConnectivityCheckSmokeTest; use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface; use Symfony\Component\DependencyInjection\ContainerBuilder; use Symfo...
<?php namespace Smartbox\Integration\FrameworkBundle\DependencyInjection\CompilerPasses; use Smartbox\Integration\FrameworkBundle\Tools\SmokeTests\ConnectivityCheckSmokeTest; use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface; use Symfony\Component\DependencyInjection\ContainerBuilder; use Symfo...
Change imports in user registration test.
from django.contrib.auth import get_user_model from django.test import TestCase from django.urls import reverse from factory import fuzzy from faker import Faker class UserRegistrationTestCase(TestCase): def test_registration_view(self): """Verify that user registration view loads properly.""" re...
from factory import Faker, fuzzy from django.contrib.auth import get_user_model from django.test import TestCase from django.urls import reverse class UserRegistrationTestCase(TestCase): def test_registration_view(self): """Verify that user registration view loads properly.""" response = self.cli...
Fix pinging in chat throwing errors
import logging from notify.models import Notification logger = logging.getLogger(__name__) def ping_filter(message, users, sending_user, notify_text, notify_type, notify_url=None): for user in users: if username_in_message(message, user.username): # Create notification ...
import logging from notify.models import Notification logger = logging.getLogger(__name__) def ping_filter(message, users, sending_user, notify_text, notify_type, notify_url=None): for user in users: if username_in_message(message, user.username): # Create notification ...
Update notes migration to use examiner and startDate
var config = require('../config.js'); var nano = require('nano')(config.couchAuthDbURL); var maindb = nano.use('main'); var uuid = require('node-uuid'); var recordsToUpdate = []; maindb.list({startkey: 'visit_', endkey: 'visit_\uffff', include_docs: true}, function(err, results) { if (!err) { results.rows.forEa...
var config = require('../config.js'); var nano = require('nano')(config.couchAuthDbURL); var maindb = nano.use('main'); var uuid = require('node-uuid'); var recordsToUpdate = []; maindb.list({startkey: 'visit_', endkey: 'visit_\uffff', include_docs: true}, function(err, results) { if (!err) { results.rows.forEa...
Fix scope issues in CommentsRetriever
"use strict"; angular.module('arethusa.comments').factory('CommentsRetriever', [ 'configurator', 'idHandler', function(configurator, idHandler) { var comments = {}; var alreadyLoaded; function splitIdAndComment(comment) { var regexp = new RegExp('^##(.*?)##\n\n(.*)$'); var match = regexp...
"use strict"; angular.module('arethusa.comments').factory('CommentsRetriever', [ 'configurator', 'idHandler', function(configurator, idHandler) { var comments = {}; function splitIdAndComment(comment) { var regexp = new RegExp('^##(.*?)##\n\n(.*)$'); var match = regexp.exec(comment); r...
Move of autoload into on_start
<?php namespace Concrete\Package\CommunityStoreStripe; use Package; use Whoops\Exception\ErrorException; use \Concrete\Package\CommunityStore\Src\CommunityStore\Payment\Method as PaymentMethod; defined('C5_EXECUTE') or die(_("Access Denied.")); class Controller extends Package { protected $pkg...
<?php namespace Concrete\Package\CommunityStoreStripe; use Package; use Whoops\Exception\ErrorException; use \Concrete\Package\CommunityStore\Src\CommunityStore\Payment\Method as PaymentMethod; defined('C5_EXECUTE') or die(_("Access Denied.")); require 'vendor/autoload.php'; class Controller exte...
Add comments about what other elements need support.
<?php namespace ComplexPie\RSS20; class Item extends \ComplexPie\XML\Entry { protected static $static_ext = array(); protected static $aliases = array( 'summary' => 'description', 'published' => 'pubDate', ); protected static $elements = array( // XXX: author // XX...
<?php namespace ComplexPie\RSS20; class Item extends \ComplexPie\XML\Entry { protected static $static_ext = array(); protected static $aliases = array( 'summary' => 'description', 'published' => 'pubDate', ); protected static $elements = array( 'description' => array( ...
Resolve concurency on the same object.
package benchmarking; import converters.JsonConverter; import datamodel.PerformanceSelfMonitoring; import mongo.MongoManager; public class Monitoring { CpuMonitoring cpuMonitor = new CpuMonitoring(); long startTime = -1, endTime = -1, totalTime = -1; public void startMonitoring() { cpuMonitor.st...
package benchmarking; import converters.JsonConverter; import datamodel.PerformanceSelfMonitoring; import mongo.MongoManager; public class Monitoring { CpuMonitoring cpuMonitor = new CpuMonitoring(); long startTime = -1, endTime = -1, totalTime = -1; private PerformanceSelfMonitoring perfSelf = new Perfo...
Fix typo - XML<->YAML configuration
""" Plugin manager is Checker's main module. Plugin Manager is using Yapsy to find and load plugins from a directory and loads them via PluginRunner. """ from yapsy.PluginManager import PluginManager from pluginRunner import PluginRunner from configLoader import ConfigLoader from down import Scraper import lo...
""" Plugin manager is Checker's main module. Plugin Manager is using Yapsy to find and load plugins from a directory and loads them via PluginRunner. """ from yapsy.PluginManager import PluginManager from pluginRunner import PluginRunner from configLoader import ConfigLoader from down import Scraper import lo...
Change log level to warning
import logging import time from functools import wraps from . import compat compat.patch() # monkey-patch time.perf_counter log = logging.getLogger('amqpy') def synchronized(lock_name): """Decorator for automatically acquiring and releasing lock for method call This decorator accesses the `lock_name` :cl...
import logging import time from functools import wraps from . import compat compat.patch() # monkey-patch time.perf_counter log = logging.getLogger('amqpy') def synchronized(lock_name): """Decorator for automatically acquiring and releasing lock for method call This decorator accesses the `lock_name` :cl...
Make sudo pfctl error check Python 3 compatible In Python 3, subprocess.check_output() returns a sequence of bytes. This change ensures that it will be converted to a string, so the substring test for the sudo error message does not raise a TypeError. This fixes the code in Python 3 while remaining compatible with Pyt...
import subprocess from . import pf """ Doing this the "right" way by using DIOCNATLOOK on the pf device turns out to be a pain. Apple has made a number of modifications to the data structures returned, and compiling userspace tools to test and work with this turns out to be a pain in the ass. Parsing ...
import subprocess from . import pf """ Doing this the "right" way by using DIOCNATLOOK on the pf device turns out to be a pain. Apple has made a number of modifications to the data structures returned, and compiling userspace tools to test and work with this turns out to be a pain in the ass. Parsing ...
Change note trigger to tell, and make it reply
# -*- coding: utf-8 -*- # vim: set ts=4 et import sqlite3 from plugin import * class Plugin(BasePlugin): def on_load(self, reloading): self.db = sqlite3.connect('data/notes.db') c = self.db.cursor() c.execute('''CREATE TABLE IF NOT EXISTS notes (channel text, sender ...
# -*- coding: utf-8 -*- # vim: set ts=4 et import sqlite3 from plugin import * class Plugin(BasePlugin): def on_load(self, reloading): self.db = sqlite3.connect('data/notes.db') c = self.db.cursor() c.execute('''CREATE TABLE IF NOT EXISTS notes (channel text, sender ...
[FIX] hw_drivers: Fix issue with printer device-id When we print a ticket status with a thermal printer we need printer's device-id But if we add manually a printer this device-id doesn't exist So now we update de devices list with a supported = True if printer are manually added closes odoo/odoo#53043 Signed-off-by...
from cups import Connection as cups_connection from re import sub from threading import Lock from odoo.addons.hw_drivers.controllers.driver import Interface conn = cups_connection() PPDs = conn.getPPDs() cups_lock = Lock() # We can only make one call to Cups at a time class PrinterInterface(Interface): _loop_de...
from cups import Connection as cups_connection from re import sub from threading import Lock from odoo.addons.hw_drivers.controllers.driver import Interface conn = cups_connection() PPDs = conn.getPPDs() cups_lock = Lock() # We can only make one call to Cups at a time class PrinterInterface(Interface): _loop_de...
Allow "Home" to be active menu item
from ..models import Block from django.template import Library register = Library() @register.simple_tag def show_block(name): try: return Block.objects.get(name=name).content except Block.DoesNotExist: return '' except Block.MultipleObjectsReturned: return 'Error: Multiple blocks ...
from ..models import Block from django.template import Library register = Library() @register.simple_tag def show_block(name): try: return Block.objects.get(name=name).content except Block.DoesNotExist: return '' except Block.MultipleObjectsReturned: return 'Error: Multiple blocks ...
Fix error from removed api after upgrading jquery
define([], function() { 'use strict'; return withAsyncQueue; function withAsyncQueue() { this.before('initialize', function() { var self = this, deferreds = {}, stacks = {}; this.setupAsyncQueue = function(name) { var stac...
define([], function() { 'use strict'; return withAsyncQueue; function withAsyncQueue() { this.before('initialize', function() { var self = this, deferreds = {}, stacks = {}; this.setupAsyncQueue = function(name) { var stac...