text stringlengths 17 1.47k | positive stringlengths 673 4.43k | negative stringlengths 677 2.81k |
|---|---|---|
Support more than on path when building a DirScanner | import os
import zope.interface
import mutagen
import jukebox.song
class IScanner(zope.interface.Interface):
def scan():
"""
Start the scanning process. It is expected to be called at startup and
can block.
"""
def watch():
"""
Starts an async watcher that can... | import os
import zope.interface
import mutagen
import jukebox.song
class IScanner(zope.interface.Interface):
def scan():
"""
Start the scanning process. It is expected to be called at startup and
can block.
"""
def watch():
"""
Starts an async watcher that can... |
BB-4210: Add validation functionality to RuleEditorComponent
- temp commit (polish of suggestion output) | define(function(require) {
'use strict';
var $ = require('jquery');
require('bootstrap');
/**
* This customization allows to define own functions for Typeahead
*/
var Typeahead;
var origTypeahead = $.fn.typeahead.Constructor;
var origFnTypeahead = $.fn.typeahead;
Typeahead =... | define(function(require) {
'use strict';
var $ = require('jquery');
require('bootstrap');
/**
* This customization allows to define own focus, click, render, show, lookup functions for Typeahead
*/
var Typeahead;
var origTypeahead = $.fn.typeahead.Constructor;
var origFnTypeahead... |
Use inout proxy script for log. | import neovim
import os, subprocess
import json
@neovim.plugin
class LanguageServerClient:
def __init__(self, nvim):
self.nvim = nvim
self.server = subprocess.Popen(
["/bin/bash", "/opt/rls/wrapper.sh"],
# ["cargo", "run", "--manifest-path=/opt/rls/Cargo.toml"],
... | import neovim
import os, subprocess
import json
@neovim.plugin
class LanguageServerClient:
def __init__(self, nvim):
self.nvim = nvim
self.server = subprocess.Popen(
["cargo", "run", "--manifest-path=/opt/rls/Cargo.toml"],
# ['langserver-go', '-trace', '-logfile', '/tmp/lan... |
Fix id for scaffolded objects | import ApolloClient, { createNetworkInterface } from 'apollo-client';
import { printRequest } from 'apollo-client/transport/networkInterface';
import qs from 'qs';
function buildApolloClient(baseUrl) {
const networkInterface = createNetworkInterface({
uri: `${baseUrl}graphql/`,
opts: {
credentials: 'sa... | import ApolloClient, { createNetworkInterface } from 'apollo-client';
import { printRequest } from 'apollo-client/transport/networkInterface';
import qs from 'qs';
function buildApolloClient(baseUrl) {
const networkInterface = createNetworkInterface({
uri: `${baseUrl}graphql/`,
opts: {
credentials: 'sa... |
Use relative path to mock data | function findStations(callback) {
$.ajax({
type: 'GET',
url: 'mockdata/veturilo.xml',
dataType: 'xml',
success: function (xml) {
var stations = [];
$(xml).find('place').each(function () {
var place = $(this);
var station = {
... | function findStations(callback) {
$.ajax({
type: 'GET',
url: 'http://localhost:8765/mockdata/veturilo.xml',
dataType: 'xml',
success: function (xml) {
var stations = [];
$(xml).find('place').each(function () {
var place = $(this);
... |
Add starfield to battle scene. | define(function(require){
var scene = new THREE.Object3D();
var camera = new THREE.PerspectiveCamera(75, 16 / 9, 0.1, 5000);
var loader = new THREE.JSONLoader(true);
var origin = new THREE.Vector3();
var StarSystem = require("component/starfield");
var starfield = StarSystem.create(33, 100... | define(function(require){
var scene = new THREE.Object3D();
var camera = new THREE.PerspectiveCamera(75, 16 / 9, 0.1, 5000);
var loader = new THREE.JSONLoader(true);
var origin = new THREE.Vector3();
var StarSystem = require("component/starfield");
var starfield = StarSystem.create(33);
... |
Add id attribute to posts wrap
The same id is already added to posts wrap in other templates. | <?php
declare (strict_types = 1);
\Jentil()->utilities->loader->loadPartial('header');
\the_post(); ?>
<div id="main-query" class="posts-wrap show-content big singular-post">
<article data-post-id="<?php
\the_ID();
?>" id="post-<?php \the_ID(); ?>" <?php
\post_class(['post-wrap']);
?> ite... | <?php
declare (strict_types = 1);
\Jentil()->utilities->loader->loadPartial('header');
\the_post(); ?>
<div class="posts-wrap show-content big singular-post">
<article data-post-id="<?php
\the_ID();
?>" id="post-<?php \the_ID(); ?>" <?php
\post_class(['post-wrap']);
?> itemscope itemtype=... |
Simplify detection of keys already bound | class Bindings(object):
def __init__(self):
self._bindings = {}
def bind(self, key, provider=None):
if key in self:
raise AlreadyBoundException("Cannot rebind key: %s" % key)
if provider is None:
return Binder(key, self)
else:
... | class Bindings(object):
def __init__(self):
self._bindings = {}
def bind(self, key):
if key in self:
raise AlreadyBoundException("Cannot rebind key: %s" % key)
return Binder(key, self._bindings)
def copy(self):
copy = Bindings()
copy._bindings = ... |
Exclude non-confirmed accounts from stats
In future simple User.count() would likely contain also spambots etc.
Will show up as a slight drop in numbers at [statistics
page](https://www.trustroots.org/#!/statistics). | 'use strict';
/**
* Module dependencies.
*/
var mongoose = require('mongoose'),
errorHandler = require('./errors'),
async = require('async'),
git = require('git-rev'),
Offer = mongoose.model('Offer'),
User = mongoose.model('User');
/**
* Get all statistics
*/
exports.get = function(req, res) {... | 'use strict';
/**
* Module dependencies.
*/
var mongoose = require('mongoose'),
errorHandler = require('./errors'),
async = require('async'),
git = require('git-rev'),
Offer = mongoose.model('Offer'),
User = mongoose.model('User');
/**
* Get all statistics
*/
exports.get = function(req, res) {... |
Make sure button is before all other children | HNSpecial.settings.registerModule("mark_as_read", function () {
function editLinks() {
var subtexts = _.toArray(document.getElementsByClassName("subtext"));
subtexts.forEach(function (subtext) {
if (!subtext.getAttribute("data-hnspecial-mark-as-read")) {
subtext.setAttribute("data-hnspecial-mar... | HNSpecial.settings.registerModule("mark_as_read", function () {
function editLinks() {
var subtexts = _.toArray(document.getElementsByClassName("subtext"));
subtexts.forEach(function (subtext) {
if (!subtext.getAttribute("data-hnspecial-mark-as-read")) {
subtext.setAttribute("data-hnspecial-mar... |
Make pagination wrappers conditional for author template | <?php
$pagination_wrapper_start = '<div class="row"><div class="col-md-8 col-md-offset-2">';
$pagination_wrapper_end = '</div></div>';
if (is_author()):
$pagination_wrapper_start = '';
$pagination_wrapper_end = '';
endif;
get_header();
if (!is_front_page()) :
if (have_posts()) :
?>
<di... | <?php
get_header();
if (!is_front_page()) :
if (have_posts()) :
?>
<div class="container">
<div id="primary" class="content-area">
<?php get_template_part(SNIPPETS_DIR . '/header/page-header'); ?>
<main id="main" class="site-main" role="main">
... |
Implement clickdown and clickup to function correctly | /*
* @module Clickable
* @namespace component
* @desc Used to make a game component perfom an action when she's clicked
* @copyright (C) SpilGames
* @author Jeroen Reurings
* @license BSD 3-Clause License (see LICENSE file in project root)
*/
glue.module.create(
'glue/component/clickable',
[
... | /*
* @module Clickable
* @namespace component
* @desc Used to make a game component perfom an action when she's clicked
* @copyright (C) SpilGames
* @author Jeroen Reurings
* @license BSD 3-Clause License (see LICENSE file in project root)
*/
glue.module.create(
'glue/component/clickable',
[
... |
Add support for nested lists in the excel renderer | import xlsxwriter
import os
from django.conf import settings
from rest_framework import renderers
def _write_excel_file(data):
result = data.get('results')
work_book_name = 'download.xlsx'
workbook = xlsxwriter.Workbook(work_book_name)
worksheet = workbook.add_worksheet()
row... | import xlsxwriter
import os
from django.conf import settings
from rest_framework import renderers
def _write_excel_file(data):
result = data.get('results')
work_book_name = 'human.xlsx'
workbook = xlsxwriter.Workbook(work_book_name)
worksheet = workbook.add_worksheet()
row = ... |
Use an arrow function to get rid of ctrl = this | let defaultSnippet = `
from player_map import playerPositions
print playerPositions()`;
export default class Controller {
constructor($log, $rootScope, connection, $mdToast) {
this.$log = $log;
this.$rootScope = $rootScope;
this.connection = connection;
this.$mdToast = $mdToast;
... | let defaultSnippet = `
from player_map import playerPositions
print playerPositions()`;
export default class Controller {
constructor($log, $rootScope, connection, $mdToast) {
var ctrl = this;
this.$log = $log;
this.$rootScope = $rootScope;
this.connection = connection;
this... |
Add null check for scope | package com.github.ferstl.depgraph;
import org.apache.maven.artifact.Artifact;
import org.apache.maven.shared.dependency.graph.DependencyNode;
import com.github.ferstl.depgraph.dot.NodeRenderer;
import com.google.common.base.Joiner;
enum NodeRenderers implements NodeRenderer {
ARTIFACT_ID_LABEL {
@Override
... | package com.github.ferstl.depgraph;
import org.apache.maven.artifact.Artifact;
import org.apache.maven.shared.dependency.graph.DependencyNode;
import com.github.ferstl.depgraph.dot.NodeRenderer;
import com.google.common.base.Joiner;
enum NodeRenderers implements NodeRenderer {
ARTIFACT_ID_LABEL {
@Override
... |
Refactor logging in celery router
Send logging for celery router tasks to the 'rapidsms' logger rather than the 'celery' logger, and make sure celery knows the task failed by re-raising the exception. | import celery
import logging
from rapidsms.errors import MessageSendingError
logger = logging.getLogger(__name__)
@celery.task
def receive_async(text, connection_id, message_id, fields):
"""Task used to send inbound message through router phases."""
from rapidsms.models import Connection
from rapidsms.r... | import celery
from celery.utils.log import get_task_logger
from rapidsms.errors import MessageSendingError
logger = get_task_logger(__name__)
@celery.task
def receive_async(text, connection_id, message_id, fields):
"""Task used to send inbound message through router phases."""
from rapidsms.models import Co... |
[Fixture] Set EUR as base currency in fixtures | <?php
/*
* This file is part of the Sylius package.
*
* (c) Paweł Jędrzejewski
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Sylius\Bundle\FixturesBundle\DataFixtures\ORM;
use Doctrine\Common\Persistence\ObjectManage... | <?php
/*
* This file is part of the Sylius package.
*
* (c) Paweł Jędrzejewski
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Sylius\Bundle\FixturesBundle\DataFixtures\ORM;
use Doctrine\Common\Persistence\ObjectManage... |
Add description attr to Change | import uuid
import jsonschema
import changeling.exception
class Change(object):
schema = {
'name': 'change',
'properties': {
'id': {'type': 'string'},
'name': {'type': 'string'},
'description': {'type': 'string'},
},
'additionalProperties': Fa... | import uuid
import jsonschema
import changeling.exception
class Change(object):
schema = {
'name': 'change',
'properties': {
'id': {'type': 'string'},
'name': {'type': 'string'},
},
'additionalProperties': False,
}
def __init__(self, id=None, nam... |
Switch test runtime widget to show runtime by classes. Not only was information overflow, also optimizing runtime by slowest class first should bring most change (instead of slowest test) | (function (widget, zoomableSunburst) {
// Following http://bl.ocks.org/metmajer/5480307
var diameter = 600;
var svg = widget.create("Avg test runtime by class",
"Color: Job/Test Suite, Arc size: duration",
"/testclasses.csv")
.svg(diameter... | (function (widget, zoomableSunburst) {
// Following http://bl.ocks.org/metmajer/5480307
var diameter = 600;
var svg = widget.create("Avg test runtime",
"Color: Job/Test Suite, Arc size: duration",
"/testsuites.csv")
.svg(diameter);
va... |
Update meta-info, first public package exposed | import os
import shutil
import sys
from setuptools import setup
from setuptools.command.install import install
import bzt
class InstallWithHook(install, object):
"""
Command adding post-install hook to setup
"""
def run(self):
"""
Do the command's job!
"""
install.run... | import os
import shutil
import sys
from setuptools import setup
from setuptools.command.install import install
import bzt
class InstallWithHook(install, object):
"""
Command adding post-install hook to setup
"""
def run(self):
"""
Do the command's job!
"""
install.run... |
Update search:reindex to populate set of indices | <?php
namespace App\Console\Commands;
use Illuminate\Console\Command;
use Elasticsearch;
use App\Console\Helpers\Indexer;
class ReindexSearch extends Command
{
use Indexer;
protected $signature = 'search:reindex
{dest : The name of the index to copy documents to}
... | <?php
namespace App\Console\Commands;
use Illuminate\Console\Command;
use Elasticsearch;
use App\Console\Helpers\Indexer;
class ReindexSearch extends Command
{
use Indexer;
protected $signature = 'search:reindex
{source : The name of the index to copy documents from}
... |
Add method for raising not supported error | def notsupported(mode):
raise NotImplementedError("Operation not supported for mode '%s'" % mode)
def check_spark():
SparkContext = False
try:
from pyspark import SparkContext
finally:
return SparkContext
def check_path(path, credentials=None):
"""
Check that specified output ... | def check_spark():
SparkContext = False
try:
from pyspark import SparkContext
finally:
return SparkContext
def check_path(path, credentials=None):
"""
Check that specified output path does not already exist
The ValueError message will suggest calling with overwrite=True; this f... |
Fix bounds element touch area incorrect issue. | package com.mocircle.cidrawing.element;
import android.graphics.Matrix;
import android.graphics.Path;
import android.graphics.RectF;
/**
* A kind of element which is surrounded by the bounds.
*/
public abstract class BoundsElement extends DrawElement {
protected transient RectF originalBoundingBox;
protect... | package com.mocircle.cidrawing.element;
import android.graphics.Matrix;
import android.graphics.Path;
import android.graphics.RectF;
/**
* A kind of element which is surrounded by the bounds.
*/
public abstract class BoundsElement extends DrawElement {
protected transient RectF originalBoundingBox;
protect... |
Add the eslint-pragma for AMD to be more in context | (function (name, definition) {
if (typeof define === 'function') {
// AMD
/* eslint-env amd */
define(definition)
} else if (typeof module !== 'undefined' && module.exports) {
// Node.js
module.exports = definition()
} else {
// Browser
window[name] = definition()
}
})('nullPrune', f... | /* eslint-env amd */
(function (name, definition) {
if (typeof define === 'function') {
// AMD
define(definition)
} else if (typeof module !== 'undefined' && module.exports) {
// Node.js
module.exports = definition()
} else {
// Browser
window[name] = definition()
}
})('nullPrune', funct... |
Send the data in the functions | "use strict";
// Dependencies
const readJson = require("r-json")
, writeJson = require("w-json")
, mapO = require("map-o")
, ul = require("ul")
, findValue = require("find-value")
;
/**
* packy
* Sets the default fields in the package.json file.
*
* @name packy
* @function
* @param {String} ... | "use strict";
// Dependencies
const readJson = require("r-json")
, writeJson = require("w-json")
, mapO = require("map-o")
, ul = require("ul")
, findValue = require("find-value")
;
/**
* packy
* Sets the default fields in the package.json file.
*
* @name packy
* @function
* @param {String} ... |
Use ENJAZACESSS when is access is provided | import twitter
from django.core.management.base import BaseCommand
from django.conf import settings
from core.models import Tweet
class Command(BaseCommand):
help = "Send out tweets."
def handle(self, *args, **options):
for tweet in Tweet.objects.filter(was_sent=False, failed_trials__lte=5):
... | import twitter
from django.core.management.base import BaseCommand
from django.conf import settings
from core.models import Tweet
class Command(BaseCommand):
help = "Send out tweets."
def handle(self, *args, **options):
for tweet in Tweet.objects.filter(was_sent=False, failed_trials__lte=5):
... |
Use select method to filter return data when retrieving a user's stats. | 'use strict';
const Promise = require('bluebird');
const UserStats = require('../models/UserStats');
module.exports = function() {
const create = function(userId) {
return new Promise((resolve, reject) => {
UserStats.create({ userId: userId })
.then((newUserStats) => {
resolve(newUserSta... | 'use strict';
const Promise = require('bluebird');
const UserStats = require('../models/UserStats');
module.exports = function() {
const create = function(userId) {
return new Promise((resolve, reject) => {
UserStats.create({ userId: userId })
.then((newUserStats) => {
resolve(newUserSta... |
Replace deprecated class (since Symphony 2.6) | <?php
if (!defined('ENMDIR')) define('ENMDIR', EXTENSIONS . "/email_newsletter_manager");
if (!defined('ENVIEWS')) define('ENVIEWS', ENMDIR . "/content/templates");
class contentExtensionemail_newsletter_managerpublishfield extends XMLPage
{
public function view()
{
$this->addHeaderToPage('Content-Typ... | <?php
if (!defined('ENMDIR')) define('ENMDIR', EXTENSIONS . "/email_newsletter_manager");
if (!defined('ENVIEWS')) define('ENVIEWS', ENMDIR . "/content/templates");
class contentExtensionemail_newsletter_managerpublishfield extends AjaxPage
{
public function view()
{
$this->addHeaderToPage('Content-Ty... |
Unplug unit tests before moving them. | #!/usr/bin/env node
"use strict";
// TODO: This script is duplicated in mlproj-core, do we want to change that?
var chproc = require('child_process');
var proc = require('process');
function run(tests, callback)
{
if ( ! tests.length ) {
// nothing else to do
}
else if ( tests[0].msg ) {
... | #!/usr/bin/env node
"use strict";
var chproc = require('child_process');
var proc = require('process');
function run(tests, callback)
{
if ( ! tests.length ) {
// nothing else to do
}
else if ( tests[0].msg ) {
let test = tests.shift();
console.log(test.msg);
proc.chdir(... |
Add required author_email to package metadata | import re
from setuptools import find_packages, setup
with open('netsgiro/__init__.py') as fh:
metadata = dict(re.findall("__([a-z]+)__ = '([^']+)'", fh.read()))
with open('README.rst') as fh:
long_description = fh.read()
setup(
name='netsgiro',
version=metadata['version'],
description='File ... | import re
from setuptools import find_packages, setup
with open('netsgiro/__init__.py') as fh:
metadata = dict(re.findall("__([a-z]+)__ = '([^']+)'", fh.read()))
with open('README.rst') as fh:
long_description = fh.read()
setup(
name='netsgiro',
version=metadata['version'],
description='File ... |
Disable debug output, add missing var | include('helma/webapp/response');
include('helma/engine');
include('helma/jsdoc');
require('core/array');
exports.index = function index(req, module) {
var repo = new ScriptRepository(getRepositories()[1]);
if (module && module != "/") {
var jsdoc = [];
var res = repo.getScriptResource(module);... | include('helma/webapp/response');
include('helma/engine');
include('helma/jsdoc');
require('core/array');
exports.index = function index(req, module) {
var repo = new ScriptRepository(getRepositories()[1]);
if (module && module != "/") {
var jsdoc = [];
res = repo.getScriptResource(module);
... |
Use the new django management commands definition (ArgumentParser) | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from optparse import make_option
from django.core.management.base import BaseCommand
from django.utils.translation import ugettext_lazy as _
class Command(BaseCommand):
help = _("Collect information about all customers which accessed this shop.")
... | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from optparse import make_option
from django.core.management.base import BaseCommand
from django.utils.translation import ugettext_lazy as _
class Command(BaseCommand):
help = _("Collect information about all customers which accessed this shop.")
... |
Fix other tests with same regexp issue | import unittest, sys
from HARK.validators import non_empty
class ValidatorsTests(unittest.TestCase):
'''
Tests for validator decorators which validate function arguments
'''
def test_non_empty(self):
@non_empty('list_a')
def foo(list_a, list_b):
pass
try:
... | import unittest, sys
from HARK.validators import non_empty
class ValidatorsTests(unittest.TestCase):
'''
Tests for validator decorators which validate function arguments
'''
def test_non_empty(self):
@non_empty('list_a')
def foo(list_a, list_b):
pass
try:
... |
Fix vendor bundle example with polyfills | 'use strict';
module.exports = {
modify(defaultConfig, { target, dev }, webpack) {
const config = defaultConfig; // stay immutable here
// Change the name of the server output file in production
if (target === 'web') {
// modify filenaming to account for multiple entry files
config.output.fi... | 'use strict';
module.exports = {
modify(defaultConfig, { target, dev }, webpack) {
const config = defaultConfig; // stay immutable here
// Change the name of the server output file in production
if (target === 'web') {
// modify filenaming to account for multiple entry files
config.output.fi... |
Fix problem with translation sanitation (Danish characters appear as HTML entities on the page): we don't need to sanitize our translations themselves, just the parameters substituted in. | (function() {
'use strict';
angular
.module('openeApp.translations', [
'pascalprecht.translate'
])
.factory('availableLanguages', AvailableLanguages)
.config(config);
var availableLanguages = {
keys: ['en', 'da'],
localesKeys: {
'... | (function() {
'use strict';
angular
.module('openeApp.translations', [
'pascalprecht.translate'
])
.factory('availableLanguages', AvailableLanguages)
.config(config);
var availableLanguages = {
keys: ['en', 'da'],
localesKeys: {
'... |
Clean up access checker interface | <?php
namespace Ordermind\LogicalPermissions;
interface AccessCheckerInterface
{
/**
* Sets the permission type collection.
*
* @param PermissionTypeCollectionInterface $permissionTypeCollection
*
* @return AccessCheckerInterface
*/
public function setPermissionTypeCollection(Per... | <?php
namespace Ordermind\LogicalPermissions;
interface AccessCheckerInterface {
/**
* Sets the permission type collection.
*
* @param \Ordermind\LogicalPermissions\PermissionTypeCollectionInterface $permissionTypeCollection
*
* @return \Ordermind\LogicalPermissions\AccessCheckerInterface
*/
pub... |
Mark as requiring at least Python 3.6 | #!/usr/bin/env python3
import os
import re
from setuptools import setup
with open(os.path.join(os.path.dirname(__file__), 'README.rst')) as readme:
long_description = readme.read()
with open(os.path.join(os.path.dirname(__file__), 'pyhdfs', '__init__.py')) as py:
version_match = re.search(r"__version__ = '(.+... | #!/usr/bin/env python3
import os
import re
from setuptools import setup
with open(os.path.join(os.path.dirname(__file__), 'README.rst')) as readme:
long_description = readme.read()
with open(os.path.join(os.path.dirname(__file__), 'pyhdfs', '__init__.py')) as py:
version_match = re.search(r"__version__ = '(.+... |
Add postgresql extra to sqlalchemy
Was implicitly being installed with testcontainers | import re
from setuptools import setup, find_packages
INIT_FILE = 'pg_grant/__init__.py'
init_data = open(INIT_FILE).read()
metadata = dict(re.findall("__([a-z]+)__ = '([^']+)'", init_data))
VERSION = metadata['version']
LICENSE = metadata['license']
DESCRIPTION = metadata['description']
AUTHOR = metadata['author'... | import re
from setuptools import setup, find_packages
INIT_FILE = 'pg_grant/__init__.py'
init_data = open(INIT_FILE).read()
metadata = dict(re.findall("__([a-z]+)__ = '([^']+)'", init_data))
VERSION = metadata['version']
LICENSE = metadata['license']
DESCRIPTION = metadata['description']
AUTHOR = metadata['author'... |
Solve data undefined in error event | /**
* @author Marcelo G.
*/
(function ($) {
$.viaAjaxLite = {
sendForm: function(selector, callback) {
var jqElement = $(selector);
var self = this;
$(selector + ' input[type="submit"], ' +
selector + ' button[type="submit"]' ).bind('click', function(eve... | /**
* @author Marcelo G.
*/
(function ($) {
$.viaAjaxLite = {
sendForm: function(selector, callback) {
var jqElement = $(selector);
var self = this;
$(selector + ' input[type="submit"], ' +
selector + ' button[type="submit"]' ).bind('click', function(eve... |
Add a flag on the yaml resources loader to parse custom tags | <?php
namespace LAG\AdminBundle\Resource\Loader;
use Exception;
use Symfony\Component\Filesystem\Exception\FileNotFoundException;
use Symfony\Component\Filesystem\Filesystem;
use Symfony\Component\Finder\Finder;
use Symfony\Component\Yaml\Yaml;
class ResourceLoader
{
/**
* Load admins configuration in the y... | <?php
namespace LAG\AdminBundle\Resource\Loader;
use Exception;
use Symfony\Component\Filesystem\Exception\FileNotFoundException;
use Symfony\Component\Filesystem\Filesystem;
use Symfony\Component\Finder\Finder;
use Symfony\Component\Yaml\Yaml;
class ResourceLoader
{
/**
* Load admins configuration in the y... |
Fix possible undefined methods in inherited classes | <?php
/**
* Zend Framework (http://framework.zend.com/)
*
* @link http://github.com/zendframework/zf2 for the canonical source repository
* @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
... | <?php
/**
* Zend Framework (http://framework.zend.com/)
*
* @link http://github.com/zendframework/zf2 for the canonical source repository
* @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
... |
Make the description field much bigger | <?php
namespace AppBundle\Admin;
use Sonata\AdminBundle\Admin\Admin;
use Sonata\AdminBundle\Datagrid\DatagridMapper;
use Sonata\AdminBundle\Datagrid\ListMapper;
use Sonata\AdminBundle\Form\FormMapper;
class ServiceAdmin extends Admin
{
protected function configureFormFields(FormMapper $formMapper)
{
... | <?php
namespace AppBundle\Admin;
use Sonata\AdminBundle\Admin\Admin;
use Sonata\AdminBundle\Datagrid\DatagridMapper;
use Sonata\AdminBundle\Datagrid\ListMapper;
use Sonata\AdminBundle\Form\FormMapper;
class ServiceAdmin extends Admin
{
protected function configureFormFields(FormMapper $formMapper)
{
... |
Update a helper class to perform a one-shot task. Add retry logic. | package org.deviceconnect.android.deviceplugin.alljoyn;
import android.content.Context;
import android.os.Bundle;
import android.support.annotation.NonNull;
public class OneShotSessionHandler {
private static final int JOIN_RETRY_MAX = 5;
private OneShotSessionHandler() {
}
public static void run(... | package org.deviceconnect.android.deviceplugin.alljoyn;
import android.content.Context;
import android.os.Bundle;
import android.support.annotation.NonNull;
public class OneShotSessionHandler {
private OneShotSessionHandler() {
}
public static void run(@NonNull final Context context, @NonNull final Stri... |
Update floating sublayout to use floatDimensions | from base import SubLayout, Rect
from Xlib import Xatom
class TopLevelSubLayout(SubLayout):
'''
This class effectively wraps a sublayout, and automatically adds a floating sublayout,
'''
def __init__(self, sublayout_data, clientStack, theme):
WrappedSubLayout, args = sublayout_data
S... | from base import SubLayout, Rect
from Xlib import Xatom
class TopLevelSubLayout(SubLayout):
'''
This class effectively wraps a sublayout, and automatically adds a floating sublayout,
'''
def __init__(self, sublayout_data, clientStack, theme):
WrappedSubLayout, args = sublayout_data
S... |
Fix fenced code blocks rendering without language
- Closes #19 | <?php
namespace allejo\stakx\Engines;
use Highlight\Highlighter;
class MarkdownEngine extends \Parsedown
{
protected $highlighter;
public function __construct ()
{
$this->highlighter = new Highlighter();
}
protected function blockHeader($Line)
{
$Block = parent::blockHeader(... | <?php
namespace allejo\stakx\Engines;
use Highlight\Highlighter;
class MarkdownEngine extends \Parsedown
{
protected $highlighter;
public function __construct ()
{
$this->highlighter = new Highlighter();
}
protected function blockHeader($Line)
{
$Block = parent::blockHeader(... |
Add Python 3 trove classifier | #-*- encoding: utf-8 -*-
from setuptools import setup
from setuptools.command.test import test as TestCommand
import sys
class Tox(TestCommand):
def finalize_options(self):
TestCommand.finalize_options(self)
self.test_args = []
self.test_suite = True
def run_tests(self):
#impor... | #-*- encoding: utf-8 -*-
from setuptools import setup
from setuptools.command.test import test as TestCommand
import sys
class Tox(TestCommand):
def finalize_options(self):
TestCommand.finalize_options(self)
self.test_args = []
self.test_suite = True
def run_tests(self):
#impor... |
[SofaPython] FIX crash in python script when visualizing advanced timer output | import os
import sys
import Sofa
# ploting
import matplotlib.pyplot as plt
# JSON deconding
from collections import OrderedDict
import json
# argument parser: usage via the command line
import argparse
def measureAnimationTime(node, timerName, timerInterval, timerOutputType, resultFileName, simulationDeltaTime, itera... | import os
import sys
import Sofa
# ploting
import matplotlib.pyplot as plt
# JSON deconding
from collections import OrderedDict
import json
# argument parser: usage via the command line
import argparse
def measureAnimationTime(node, timerName, timerInterval, timerOutputType, resultFileName, simulationDeltaTime, itera... |
Put all syntax highlighting setup on the UI thread
Fixes #13 | package collabode.hilite;
import org.eclipse.jdt.internal.ui.JavaPlugin;
import org.eclipse.jdt.internal.ui.javaeditor.SemanticHighlightingManager;
import org.eclipse.jdt.internal.ui.text.JavaColorManager;
import org.eclipse.jdt.ui.PreferenceConstants;
import org.eclipse.jdt.ui.text.IJavaPartitions;
import org.eclipse... | package collabode.hilite;
import org.eclipse.jdt.internal.ui.JavaPlugin;
import org.eclipse.jdt.internal.ui.javaeditor.SemanticHighlightingManager;
import org.eclipse.jdt.internal.ui.text.JavaColorManager;
import org.eclipse.jdt.ui.PreferenceConstants;
import org.eclipse.jdt.ui.text.IJavaPartitions;
import org.eclipse... |
Use view_list icon for dashboard | export default class {
constructor($scope, auth, toast) {
'ngInject';
$scope.buttons = [
{
name: 'View Code',
icon: 'code',
show: true,
href: 'https://github.com/mjhasbach/material-qna'
},
{
... | export default class {
constructor($scope, auth, toast) {
'ngInject';
$scope.buttons = [
{
name: 'View Code',
icon: 'code',
show: true,
href: 'https://github.com/mjhasbach/material-qna'
},
{
... |
Use full pathname to perf_expectations in test.
BUG=none
TEST=none
Review URL: http://codereview.chromium.org/266055
git-svn-id: de016e52bd170d2d4f2344f9bf92d50478b649e0@28770 0039d316-1c4b-4281-b951-d872f2087c98 | #!/usr/bin/python
# Copyright (c) 2009 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Presubmit script for perf_expectations.
See http://dev.chromium.org/developers/how-tos/depottools/presubmit-scripts for
details on ... | #!/usr/bin/python
# Copyright (c) 2009 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Presubmit script for perf_expectations.
See http://dev.chromium.org/developers/how-tos/depottools/presubmit-scripts for
details on ... |
Use toFixed for bigjs filter | 'use strict';
angular.module('omniFilters', [])
.filter('bigjs', ['$sce', function ($sce) {
return function (input, format, noZerosTrimming) {
var dropFraction = false;
if (input == null || format == null)
return input;
if (format === '')
... | 'use strict';
angular.module('omniFilters', [])
.filter('bigjs', ['$sce', function ($sce) {
return function (input, format, noZerosTrimming) {
var dropFraction = false;
if (input == null || format == null)
return input;
if (format === '')
... |
Use Object.getOwnPropertyNames for compatibility with native promises | 'use strict';
var Promise = require('bluebird');
var sinon = require('sinon');
function thenable (promiseFactory) {
return Object.getOwnPropertyNames(Promise.prototype)
.filter(function (method) {
return method !== 'then';
})
.reduce(function (acc, method) {
acc[method] = function () {
... | 'use strict';
var Promise = require('bluebird');
var sinon = require('sinon');
function thenable (promiseFactory) {
return Object.keys(Promise.prototype)
.filter(function (method) {
return Promise.prototype.hasOwnProperty(method) && method !== 'then';
})
.reduce(function (acc, method) {
ac... |
Stop reactor and find files | from twisted.internet.protocol import DatagramProtocol
from twisted.internet import reactor
from twisted.application.internet import MulticastServer
from BeautifulSoup import BeautifulSoup, SoupStrainer
import requests
fileserver = ''
urls = []
def get_file_urls(self, url):
f = requests.get("http://" + url)
... | from twisted.internet.protocol import DatagramProtocol
from twisted.internet import reactor
from twisted.application.internet import MulticastServer
from BeautifulSoup import BeautifulSoup, SoupStrainer
import requests
fileserver = ''
urls = []
def get_file_urls(self, url):
f = requests.get("http://" + url)
... |
Make scorer accept instances of model and desc. gen. | import numpy as np
from sklearn.cross_validation import cross_val_score
from sklearn.externals import joblib as pickle
class scorer(object):
def __init__(self, model_instance, descriptor_generator_instance):
self.model = model_instance
self.descriptor_generator = descriptor_generator_instance
... | import numpy as np
from sklearn.cross_validation import cross_val_score
from sklearn.externals import joblib as pickle
class scorer(object):
def __init__(self, model, descriptor_generator, model_opts = {}, desc_opts = {}):
self.model = model()
self.descriptor_generator = descriptor_generator(**desc... |
Remove distribution bundle from the loaded bundles.
We only need distribution bundle when updating dependencies.
No need to load it in the kernel. | <?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... |
chore: Add TODO for more IAM Policy testing
See also: PSOBAT-1482 | """Test IAM Policies for correctness."""
import json
from foremast.iam.construct_policy import construct_policy
ANSWER1 = {
'Version': '2012-10-17',
'Statement': [
{
'Effect': 'Allow',
'Action': [
's3:GetObject',
's3:ListObject'
],
... | """Test IAM Policies for correctness."""
import json
from foremast.iam.construct_policy import construct_policy
ANSWER1 = {
'Version': '2012-10-17',
'Statement': [
{
'Effect': 'Allow',
'Action': [
's3:GetObject',
's3:ListObject'
],
... |
Add comment to explain pagination handling | from future.standard_library import install_aliases
install_aliases() # noqa
from urllib.parse import urlparse
from celery.task import Task
from django.conf import settings
from seed_services_client import IdentityStoreApiClient
from .models import Parish
class SyncLocations(Task):
"""
Has a look at all th... | from future.standard_library import install_aliases
install_aliases() # noqa
from urllib.parse import urlparse
from celery.task import Task
from django.conf import settings
from seed_services_client import IdentityStoreApiClient
from .models import Parish
class SyncLocations(Task):
"""
Has a look at all th... |
Remove redundant case property check | from casexml.apps.case.util import get_datetime_case_property_changed
from custom.enikshay.const import ENROLLED_IN_PRIVATE
class PrivateNikshayNotifiedDateSetter(object):
"""Sets the date_private_nikshay_notification property for use in reports
"""
def __init__(self, domain, person, episode):
se... | from casexml.apps.case.util import get_datetime_case_property_changed
from custom.enikshay.const import (
ENROLLED_IN_PRIVATE,
REAL_DATASET_PROPERTY_VALUE,
)
class PrivateNikshayNotifiedDateSetter(object):
"""Sets the date_private_nikshay_notification property for use in reports
"""
def __init__(... |
Update location of files on service provider. | <?php namespace Nobox\LazyStrings;
use Illuminate\Support\ServiceProvider;
use Illuminate\Filesystem\Filesystem;
use Nobox\LazyStrings\Commands\LazyDeployCommand;
class LazyStringsServiceProvider extends ServiceProvider
{
/**
* Perform post-registration booting of services.
*
* @return void
... | <?php namespace Nobox\LazyStrings;
use Illuminate\Support\ServiceProvider;
use Illuminate\Filesystem\Filesystem;
use Nobox\LazyStrings\Commands\LazyDeployCommand;
class LazyStringsServiceProvider extends ServiceProvider
{
/**
* Perform post-registration booting of services.
*
* @return void
... |
Change shares to singleton in service provider | <?php
namespace Coreplex\Navigator;
use ReflectionClass;
use Illuminate\Support\ServiceProvider;
class NavigatorServiceProvider extends ServiceProvider
{
public function boot()
{
$this->publishes([
__DIR__ . '/../config/navigator.php' => config_path('navigator.php'),
]);
... | <?php
namespace Coreplex\Navigator;
use ReflectionClass;
use Illuminate\Support\ServiceProvider;
class NavigatorServiceProvider extends ServiceProvider
{
public function boot()
{
$this->publishes([
__DIR__ . '/../config/navigator.php' => config_path('navigator.php'),
]);
... |
Make the validation query constant private | package com.github.arteam.jdbi3;
import com.codahale.metrics.health.HealthCheck;
import io.dropwizard.db.TimeBoundHealthCheck;
import io.dropwizard.util.Duration;
import org.jdbi.v3.core.Handle;
import org.jdbi.v3.core.Jdbi;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.util.concurrent.Executor... | package com.github.arteam.jdbi3;
import com.codahale.metrics.health.HealthCheck;
import io.dropwizard.db.TimeBoundHealthCheck;
import io.dropwizard.util.Duration;
import org.jdbi.v3.core.Handle;
import org.jdbi.v3.core.Jdbi;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.util.concurrent.Executor... |
EDIT prevent default submit behaviour, add redirect | {% extends 'backend/layout.twig.php' %}
{% block content %}
<article class="container itemCenter center column">
{% if message.content is defined %}
<div class="item alert {{ message.type }}">
{{ message.content }}
</div>
{% endif %}
<header>
<h1>Register a new user</h1>
</... | {% extends 'backend/layout.twig.php' %}
{% block content %}
<article class="container itemCenter center column">
{% if message.content is defined %}
<div class="item alert {{ message.type }}">
{{ message.content }}
</div>
{% endif %}
<header>
<h1>Register a new user</h1>
</... |
Check that there are no uninstalled modules | <?php
namespace Backend\Modules\ContentBlocks\Tests\Action;
use Common\WebTestCase;
class ModulesTest extends WebTestCase
{
public function testAuthenticationIsNeeded(): void
{
$client = static::createClient();
$this->logout($client);
$client->setMaxRedirects(1);
$client->req... | <?php
namespace Backend\Modules\ContentBlocks\Tests\Action;
use Common\WebTestCase;
class ModulesTest extends WebTestCase
{
public function testAuthenticationIsNeeded(): void
{
$client = static::createClient();
$this->logout($client);
$client->setMaxRedirects(1);
$client->req... |
Send email to acadoffice when user acknowledge his AWS. | <?php
include_once( "header.php" );
include_once( "methods.php" );
include_once( 'tohtml.php' );
include_once( "check_access_permissions.php" );
mustHaveAnyOfTheseRoles( Array( 'USER' ) );
echo userHTML( );
$user = $_SESSION[ 'user' ];
if( $_POST )
{
$data = array( 'speaker' => $user );
$data = array_merge( ... | <?php
include_once( "header.php" );
include_once( "methods.php" );
include_once( 'tohtml.php' );
include_once( "check_access_permissions.php" );
mustHaveAnyOfTheseRoles( Array( 'USER' ) );
echo userHTML( );
$user = $_SESSION[ 'user' ];
if( $_POST )
{
$data = array( 'speaker' => $user );
$data = array_merge( ... |
Use the correct class name in the jobs widget | import _ from 'underscore';
import { getCurrentUser } from 'girder/auth';
import JobListWidget from 'girder_plugins/jobs/views/JobListWidget';
import events from '../events';
import Panel from './Panel';
var JobsPanel = Panel.extend({
events: _.extend(Panel.prototype.events, {
'g:login': 'render',
... | import _ from 'underscore';
import { getCurrentUser } from 'girder/auth';
import JobListWidget from 'girder_plugins/jobs/views/JobListWidget';
import events from '../events';
import Panel from './Panel';
var JobsPanel = Panel.extend({
events: _.extend(Panel.prototype.events, {
'g:login': 'render',
... |
Fix $this usage when in Closure | <?php namespace Krucas\Notification;
use Illuminate\Support\ServiceProvider;
class NotificationServiceProvider extends ServiceProvider
{
/**
* Indicates if loading of the provider is deferred.
*
* @var bool
*/
protected $defer = false;
/**
* Bootstrap the applicatio... | <?php namespace Krucas\Notification;
use Illuminate\Support\ServiceProvider;
class NotificationServiceProvider extends ServiceProvider
{
/**
* Indicates if loading of the provider is deferred.
*
* @var bool
*/
protected $defer = false;
/**
* Bootstrap the applicatio... |
Change constructor of Vehicle to accept an Interface instead of just Source. | from .measurements import Measurement
from .sinks.base import MeasurementNotifierSink
class Vehicle(object):
def __init__(self, interface=None):
self.sources = set()
self.sinks = set()
self.measurements = {}
if interface is not None:
self.add_source(interface)
... | from .measurements import Measurement
from .sinks.base import MeasurementNotifierSink
class Vehicle(object):
def __init__(self, source=None):
self.sources = set()
self.sinks = set()
self.measurements = {}
self.add_source(source)
self.notifier = MeasurementNotifierSink()
... |
Add missing method to interface | from nevow.compy import Interface
class IType(Interface):
def validate(self, value):
pass
class IStructure(Interface):
pass
class IWidget(Interface):
def render(self, ctx, key, args, errors):
pass
def renderImmutable(self, ctx, key, args, errors):
... | from nevow.compy import Interface
class IType(Interface):
def validate(self, value):
pass
class IStructure(Interface):
pass
class IWidget(Interface):
def render(self, ctx, key, args, errors):
pass
def processInput(self, ctx, key, args):
pass
clas... |
Remove requests dependency upper version constraint
Removes the undocumented and outdated upper version constraint
for the requests dependency. | # coding=utf-8
import sys
cmdclass = {}
try:
from setuptools import setup
except ImportError:
from distutils.core import setup
else:
from setuptools.command.test import test as TestCommand
class PyTest(TestCommand):
def initialize_options(self):
TestCommand.initialize_options(self... | # coding=utf-8
import sys
cmdclass = {}
try:
from setuptools import setup
except ImportError:
from distutils.core import setup
else:
from setuptools.command.test import test as TestCommand
class PyTest(TestCommand):
def initialize_options(self):
TestCommand.initialize_options(self... |
Revert "Remove IF EXISTS from DROP TABLE when resetting the db."
This reverts commit 271668a20a2262fe6211b9f61146ad90d8096486 [formerly a7dce25964cd740b0d0db86b255ede60c913e73d].
Former-commit-id: 08199327c411663a199ebf36379e88a514935399 | import sqlite3
DB_FILENAME = 'citationhunt.sqlite3'
def init_db():
return sqlite3.connect(DB_FILENAME)
def reset_db():
db = init_db()
with db:
db.execute('''
DROP TABLE IF EXISTS categories
''')
db.execute('''
DROP TABLE IF EXISTS articles
''')
... | import sqlite3
DB_FILENAME = 'citationhunt.sqlite3'
def init_db():
return sqlite3.connect(DB_FILENAME)
def reset_db():
db = init_db()
with db:
db.execute('''
DROP TABLE categories
''')
db.execute('''
DROP TABLE articles
''')
db.execute('''
... |
Change perms to use specific validator for badge awarding | 'use strict';
module.exports = function () {
return {
'cd-badges': {
'listBadges': [{
role: 'none'
}],
// NOTE: Must be defined by visibility ?
'getBadge': [{
role: 'none'
}],
'sendBadgeApplication': [{
role: 'basic-user',
customValidator: [{... | 'use strict';
module.exports = function () {
return {
'cd-badges': {
'listBadges': [{
role: 'none'
}],
// NOTE: Must be defined by visibility ?
'getBadge': [{
role: 'none'
}],
'sendBadgeApplication': [{
role: 'basic-user',
customValidator: [{... |
Add provenance type as item to reset. | Application.Services.factory('toggleDragButton', [toggleDragButton]);
function toggleDragButton() {
var service = {
addToReview: {
'samples': false,
'notes': false,
'files': false,
'provenance': false
},
addToProv: {
samples: false... | Application.Services.factory('toggleDragButton', [toggleDragButton]);
function toggleDragButton() {
var service = {
addToReview: {
'samples': false,
'notes': false,
'files': false,
'provenance': false
},
toggle: function (type, button) {
... |
Use the method available in Java 7 instead of the one in Java 8
Change-Id: I1f2dcd2420eb0b06141f15a1d99d287bdb299361 | // Copyright 2016 Google Inc. All Rights Reserved.
package com.google.copybara;
import com.google.common.truth.Truth;
import com.google.copybara.config.Config;
import com.beust.jcommander.internal.Nullable;
import org.junit.Test;
import java.io.IOException;
import java.nio.charset.StandardCharsets;
import java.nio.... | // Copyright 2016 Google Inc. All Rights Reserved.
package com.google.copybara;
import com.google.common.truth.Truth;
import com.google.copybara.config.Config;
import com.google.copybara.config.Config.Yaml;
import com.beust.jcommander.internal.Nullable;
import org.junit.Test;
import java.io.IOException;
import java... |
Use alternate GitHub download URL | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
from setuptools import find_packages, setup
VERSION = "1.0.0"
with open("requirements.txt", "rt") as f:
requirements= f.read().splitlines()
setup(name="sacad",
version=VERSION,
author="desbma",
packages=find_packages(),
entry_points={"console... | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
from setuptools import find_packages, setup
VERSION = "1.0.0"
with open("requirements.txt", "rt") as f:
requirements= f.read().splitlines()
setup(name="sacad",
version=VERSION,
author="desbma",
packages=find_packages(),
entry_points={"console... |
Fix id of first organisation. | <?php
use Illuminate\Database\Seeder;
class OrganisationsTableSeeder extends Seeder
{
/**
* Run the database seeds.
*
* @return void
*/
public function run()
{
DB::table('organisations')->insert([
'id' => 1,
'name' ... | <?php
use Illuminate\Database\Seeder;
class OrganisationsTableSeeder extends Seeder
{
/**
* Run the database seeds.
*
* @return void
*/
public function run()
{
DB::table('organisations')->insert([
'name' => 'Wellington Gliding Club',
... |
Use dot reporter for mocha | module.exports = function(grunt) {
'use strict';
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
// !jshint all code
jshint: {
options: {
jshintrc: true
},
all: ['Gruntfile.js', 'src/*.js', 'test/*.js']
},
// Mocha tests
mochaTest: {
options: {
... | module.exports = function(grunt) {
'use strict';
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
// !jshint all code
jshint: {
options: {
jshintrc: true
},
all: ['Gruntfile.js', 'src/*.js', 'test/*.js']
},
// Mocha tests
mochaTest: {
options: {
... |
Switch left/right mouse buttons, remove zoom on middle | 'use strict';
define(
['three', 'OrbitControls'],
function(THREE) {
return class Camera {
// ##############################################
// # Constructor ################################
// ##############################################
co... | 'use strict';
define(
['three', 'OrbitControls'],
function(THREE) {
return class Camera {
// ##############################################
// # Constructor ################################
// ##############################################
co... |
Make missing password and error
If the URL is set but no password
this is clearly a config error. | package io.quarkus.vertx.http.deployment.devmode;
import java.util.Optional;
import org.jboss.logging.Logger;
import io.quarkus.deployment.dev.remote.RemoteDevClient;
import io.quarkus.deployment.dev.remote.RemoteDevClientProvider;
import io.quarkus.runtime.LiveReloadConfig;
import io.quarkus.runtime.configuration.C... | package io.quarkus.vertx.http.deployment.devmode;
import java.util.Optional;
import org.jboss.logging.Logger;
import io.quarkus.deployment.dev.remote.RemoteDevClient;
import io.quarkus.deployment.dev.remote.RemoteDevClientProvider;
import io.quarkus.runtime.LiveReloadConfig;
import io.quarkus.runtime.configuration.C... |
Change from Date.now to performance.now for time delta extension | /*global Engine2D*/
/**
* @author jackdalton
*/
;(function() {
/**
* Delta timer constructor.
*
* @param {boolean} [true] autoInit - Automatically initialize timer.
*/
if (typeof Engine2D == "undefined") throw new Error("engine2d.js must be included before engine2d.collision.js");
Eng... | /*global Engine2D*/
/**
* @author jackdalton
*/
;(function() {
/**
* Delta timer constructor.
*
* @param {boolean} [true] autoInit - Automatically initialize timer.
*/
if (typeof Engine2D == "undefined") throw new Error("engine2d.js must be included before engine2d.collision.js");
Eng... |
[examples] Use `action` provided by storybook | import React from 'react';
import { action } from '@kadira/storybook';
import Button from 'src/Button';
import FlexRow from '../FlexRow';
function BasicButtonExample() {
return (
<FlexRow>
<Button
basic="Blue Button"
aside="Default color"
tag="Ta... | import React from 'react';
import Button from 'src/Button';
import FlexRow from '../FlexRow';
function handleButtonClick() {
// eslint-disable-next-line no-console
console.log('Button clicked');
}
function BasicButtonExample() {
return (
<FlexRow>
<Button
basic="Blue B... |
Remove regular expression as condition for new reminder | const { IntentDialog, DialogAction, EntityRecognizer } = require('botbuilder');
const consts = require('../helpers/consts');
const config = require('../../config');
const utils = require('../helpers/utils');
const { witRecognizer } = require('../helpers/witRecognizer');
module.exports = new IntentDialog({ recognizers:... | const { IntentDialog, DialogAction, EntityRecognizer } = require('botbuilder');
const consts = require('../helpers/consts');
const config = require('../../config');
const utils = require('../helpers/utils');
const { witRecognizer } = require('../helpers/witRecognizer');
module.exports = new IntentDialog({ recognizers:... |
Fix to correctly use per-widget taks source. | package org.andstatus.todoagenda.task;
import android.app.Activity;
import android.content.Context;
import org.andstatus.todoagenda.EventProvider;
import org.andstatus.todoagenda.task.dmfs.DmfsOpenTasksProvider;
import org.andstatus.todoagenda.task.samsung.SamsungTasksProvider;
import java.util.List;
public class T... | package org.andstatus.todoagenda.task;
import android.app.Activity;
import android.content.Context;
import org.andstatus.todoagenda.EventProvider;
import org.andstatus.todoagenda.prefs.ApplicationPreferences;
import org.andstatus.todoagenda.task.dmfs.DmfsOpenTasksProvider;
import org.andstatus.todoagenda.task.samsung... |
Change register response access_token to scalar_token | /*
Copyright 2016 OpenMarket Ltd
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
... | /*
Copyright 2016 OpenMarket Ltd
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
... |
Make sure prior article is in prior month when seeding | <?php
namespace Database\Seeders;
use App\Models\Article;
use Illuminate\Support\Carbon;
use Illuminate\Database\Seeder;
use Illuminate\Support\Facades\DB;
class ArticlesTableSeeder extends Seeder
{
/**
* Run the database seeds.
*
* @return void
*/
public function run()
{
$now... | <?php
namespace Database\Seeders;
use App\Models\Article;
use Illuminate\Support\Carbon;
use Illuminate\Database\Seeder;
use Illuminate\Support\Facades\DB;
class ArticlesTableSeeder extends Seeder
{
/**
* Run the database seeds.
*
* @return void
*/
public function run()
{
$now... |
Add process_id into the $state.go statements. Have chooseExistingProcess make a REST call to get the list of processes. | (function (module) {
module.controller('ProjectHomeController', ProjectHomeController);
ProjectHomeController.$inject = ["project", "mcmodal", "templates", "$state", "Restangular"];
function ProjectHomeController(project, mcmodal, templates, $state, Restangular) {
var ctrl = this;
ctrl.pro... | (function (module) {
module.controller('ProjectHomeController', ProjectHomeController);
ProjectHomeController.$inject = ["project", "mcmodal", "templates", "$state"];
function ProjectHomeController(project, mcmodal, templates, $state) {
var ctrl = this;
ctrl.project = project;
ctrl... |
Use singleton() for service binding as Laravel 5.4 depreciated share() method | <?php namespace MartinLindhe\VueInternationalizationGenerator;
use Illuminate\Support\ServiceProvider;
class GeneratorProvider extends ServiceProvider
{
/**
* Indicates if loading of the provider is deferred.
*
* @var bool
*/
protected $defer = false;
/**
* Perform post-registrat... | <?php namespace MartinLindhe\VueInternationalizationGenerator;
use Illuminate\Support\ServiceProvider;
class GeneratorProvider extends ServiceProvider
{
/**
* Indicates if loading of the provider is deferred.
*
* @var bool
*/
protected $defer = false;
/**
* Perform post-registrat... |
Use a better undefined check | var Delegator = require('dom-delegator')
module.exports = BaseEvent
function BaseEvent(lambda) {
return EventHandler;
function EventHandler(fn, data, opts) {
var handler = {
fn: fn,
data: data !== undefined ? data : {},
opts: opts || {},
handleEvent: ha... | var Delegator = require('dom-delegator')
module.exports = BaseEvent
function BaseEvent(lambda) {
return EventHandler;
function EventHandler(fn, data, opts) {
var handler = {
fn: fn,
data: typeof data != 'undefined' ? data : {},
opts: opts || {},
handleE... |
Fix changelist footer fixed transition | var $ = require('jquery');
var ActionsUpdater = function($changelist) {
this.$changelist = $changelist;
};
ActionsUpdater.prototype = {
removeLabel: function($actions) {
var $input = $actions.find('[name="action"]').first();
if ($input.length == 0) {
return;
}
var... | var $ = require('jquery');
var ActionsUpdater = function($changelist) {
this.$changelist = $changelist;
};
ActionsUpdater.prototype = {
removeLabel: function($actions) {
var $input = $actions.find('[name="action"]').first();
if ($input.length == 0) {
return;
}
var... |
Put higher level functions first | (function(){
var mod = angular.module('caspy.api', ['ngResource', 'caspy.server']);
mod.config(['$resourceProvider',
function($resourceProvider) {
$resourceProvider.defaults.stripTrailingSlashes = false;
}]
);
mod.factory('caspyAPI',
['$q', '$http', '$resource', 'Constants',
function($q, $htt... | (function(){
var mod = angular.module('caspy.api', ['ngResource', 'caspy.server']);
mod.config(['$resourceProvider',
function($resourceProvider) {
$resourceProvider.defaults.stripTrailingSlashes = false;
}]
);
mod.factory('caspyAPI',
['$q', '$http', '$resource', 'Constants',
function($q, $htt... |
Change script run message output | import os
import sys
from optparse import OptionParser
from conda_verify.errors import RecipeError
from conda_verify.verify import Verify
from conda_verify.utilities import render_metadata, iter_cfgs
def cli():
p = OptionParser(
usage="usage: %prog [options] <path to recipes or packages>",
descr... | import os
import sys
from optparse import OptionParser
from conda_verify.errors import RecipeError
from conda_verify.verify import Verify
from conda_verify.utilities import render_metadata, iter_cfgs
def cli():
p = OptionParser(
usage="usage: %prog [options] <path to recipes or packages>",
descr... |
Fix stupid git app committing unwanted stuff~ | # coding: utf-8
"""
Created on 2016-08-23
@author: naoey
"""
VERSION = "0.0.3"
BOT_PREFIX = ","
PATHS = {
"logs_dir": "./../logs/",
"database": "./../slash_bot.db",
"discord_creds": "./../private/discord.json",
"rito_creds": "./../private/rito.json",
"assets": "./../assets/",
}
MODULES = {
... | # coding: utf-8
"""
Created on 2016-08-23
@author: naoey
"""
VERSION = "0.0.3"
BOT_PREFIX = ":"
PATHS = {
"logs_dir": "./../logs/",
"database": "./../slash_bot.db",
"discord_creds": "./../private/discord.json",
"rito_creds": "./../private/rito.json",
"assets": "./../assets/",
}
MODULES = {
... |
Make sequence editor text area | $(function() {
var dt = {sPaginationType: 'full_numbers',
bProcessing: true,
bServerSide: true,
sAjaxSource: '/sample/ajax/pid/'+pid+'/',
bAutoWidth:false ,
aaSorting: [[ 0, 'desc' ]],
//fnDrawCallback: _map_callbacks(),
fnServerData:... | $(function() {
var dt = {sPaginationType: 'full_numbers',
bProcessing: true,
bServerSide: true,
sAjaxSource: '/sample/ajax/pid/'+pid+'/',
bAutoWidth:false ,
aaSorting: [[ 0, 'desc' ]],
//fnDrawCallback: _map_callbacks(),
fnServerData:... |
Add \r\n to the end of each header too | """
Module for a Response object.
A Response is returned by Routes when the underlying coroutine is done.
"""
from http_parser.util import IOrderedDict
from .util import HTTP_CODES
class Response(object):
"""
A response is responsible (no pun intended) for delivering data to the client, again.
The meth... | """
Module for a Response object.
A Response is returned by Routes when the underlying coroutine is done.
"""
from http_parser.util import IOrderedDict
from .util import HTTP_CODES
class Response(object):
"""
A response is responsible (no pun intended) for delivering data to the client, again.
The meth... |
Fix running bower on non-windows | var join = require('path').join;
var execFileSync = require('child_process').execFileSync;
var cache = {};
var originalWhich = require('which');
var isWin = process.platform === 'win32';
function which(name, opt, cb) {
if (typeof opt === 'function') {
cb = opt;
opt = {};
}
if... | var join = require('path').join;
var execFileSync = require('child_process').execFileSync;
var WHERE_PATH = join(process.env.WINDIR, 'System32', 'where.exe');
var cache = {};
var originalWhich = require('which');
var isWin = process.platform === 'win32';
function which(name, opt, cb) {
if (typeof opt ===... |
Rename summernote to context in module. | define([], function () {
var HelpDialog = function (context) {
var self = this;
var ui = $.summernote.ui;
var $editor = context.layoutInfo.editor;
var options = context.options;
var lang = options.langInfo;
this.initialize = function () {
var $container = options.dialogsInBody ? $(docu... | define([], function () {
var HelpDialog = function (summernote) {
var self = this;
var ui = $.summernote.ui;
var $editor = summernote.layoutInfo.editor;
var options = summernote.options;
var lang = options.langInfo;
this.initialize = function () {
var $container = options.dialogsInBody... |
Allow to override request fingerprint call. | import time
from scrapy.dupefilters import BaseDupeFilter
from scrapy.utils.request import request_fingerprint
from . import connection
class RFPDupeFilter(BaseDupeFilter):
"""Redis-based request duplication filter"""
def __init__(self, server, key):
"""Initialize duplication filter
Parame... | import time
from scrapy.dupefilters import BaseDupeFilter
from scrapy.utils.request import request_fingerprint
from . import connection
class RFPDupeFilter(BaseDupeFilter):
"""Redis-based request duplication filter"""
def __init__(self, server, key):
"""Initialize duplication filter
Parame... |
Update openfisca-core requirement from <33.0,>=27.0 to >=27.0,<35.0
Updates the requirements on [openfisca-core](https://github.com/openfisca/openfisca-core) to permit the latest version.
- [Release notes](https://github.com/openfisca/openfisca-core/releases)
- [Changelog](https://github.com/openfisca/openfisca-core/b... | # -*- coding: utf-8 -*-
from setuptools import setup, find_packages
setup(
name = "OpenFisca-Country-Template",
version = "3.9.5",
author = "OpenFisca Team",
author_email = "contact@openfisca.org",
classifiers=[
"Development Status :: 5 - Production/Stable",
"License :: OSI Approve... | # -*- coding: utf-8 -*-
from setuptools import setup, find_packages
setup(
name = "OpenFisca-Country-Template",
version = "3.9.5",
author = "OpenFisca Team",
author_email = "contact@openfisca.org",
classifiers=[
"Development Status :: 5 - Production/Stable",
"License :: OSI Approve... |
Exclude htdocs, because that just takes way too long to scan. | #!/usr/bin/env python
#
# Utility script to run pyflakes with the modules we care about and
# exclude errors we know to be fine.
import os
import subprocess
import sys
module_exclusions = [
'djblets',
'django_evolution',
'dist',
'ez_setup.py',
'htdocs',
'settings_local.py',
'ReviewBoard.e... | #!/usr/bin/env python
#
# Utility script to run pyflakes with the modules we care about and
# exclude errors we know to be fine.
import os
import subprocess
import sys
module_exclusions = [
'djblets',
'django_evolution',
'dist',
'ez_setup.py',
'settings_local.py',
'ReviewBoard.egg-info',
]
... |
Use an if statement for rounding delay counter rather than modulo | /**
* @depends ../core/AudioletNode.js
*/
var Delay = new Class({
Extends: AudioletNode,
initialize: function(audiolet, maximumDelayTime, delayTime) {
AudioletNode.prototype.initialize.apply(this, [audiolet, 2, 1]);
this.maximumDelayTime = maximumDelayTime;
this.delayTime = new Audiol... | /**
* @depends ../core/AudioletNode.js
*/
var Delay = new Class({
Extends: AudioletNode,
initialize: function(audiolet, maximumDelayTime, delayTime) {
AudioletNode.prototype.initialize.apply(this, [audiolet, 2, 1]);
this.maximumDelayTime = maximumDelayTime;
this.delayTime = new Audiol... |
Refactor @listeningTo to use dependency cache | import React, {Component, PropTypes} from 'react';
import lodash from 'lodash';
export function listeningTo(storeTokens, getter) {
return decorator;
function decorator(ChildComponent) {
class ListeningContainerComponent extends Component {
static contextTypes = {
dependency... | import React, {Component, PropTypes} from 'react';
import lodash from 'lodash';
export function listeningTo(storeNames, getter) {
return decorator;
function decorator(ChildComponent) {
class ListeningContainerComponent extends Component {
static contextTypes = {
dependencie... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.