text stringlengths 17 1.47k | positive stringlengths 673 4.43k | negative stringlengths 677 2.81k |
|---|---|---|
Update rules property to ba a collection instead of array | <?php
namespace GeniusTS\Preferences\Models;
use Illuminate\Support\Collection;
use Illuminate\Contracts\View\View;
/**
* Class Element
*
* @package GeniusTS\Preferences
* @property string $name
* @property string $namespace
* @property string $rules
* @property View $view
*/
class Element
{
/**
... | <?php
namespace GeniusTS\Preferences\Models;
use Illuminate\Contracts\View\View;
/**
* Class Element
*
* @package GeniusTS\Preferences
* @property string $name
* @property string $namespace
* @property string $rules
* @property View $view
*/
class Element
{
/**
* @var string
*/
protecte... |
Disable source switcher during walkthrough
Closes #4401 -- fixed as proposed in the issue's comments | import {
event as d3_event,
select as d3_select
} from 'd3-selection';
import { t } from '../util/locale';
import { modeBrowse } from '../modes';
export function uiSourceSwitch(context) {
var keys;
function click() {
d3_event.preventDefault();
if (context.inIntro()) return;
... | import {
event as d3_event,
select as d3_select
} from 'd3-selection';
import { t } from '../util/locale';
import { modeBrowse } from '../modes';
export function uiSourceSwitch(context) {
var keys;
function click() {
d3_event.preventDefault();
if (context.history().hasChanges() &&
... |
Set singleRun setting to false | var webpackConfig = require("./webpack.config");
Object.assign(webpackConfig, {
debug: true,
devtool: "inline-source-map"
});
webpackConfig.externals.push("react/lib/ExecutionEnvironment");
webpackConfig.externals.push("react/lib/ReactContext");
webpackConfig.externals.push("react/addons");
webpackConfig.exter... | var webpackConfig = require("./webpack.config");
Object.assign(webpackConfig, {
debug: true,
devtool: "inline-source-map"
});
webpackConfig.externals.push("react/lib/ExecutionEnvironment");
webpackConfig.externals.push("react/lib/ReactContext");
webpackConfig.externals.push("react/addons");
webpackConfig.exter... |
Fix Denite support for vim8. | # -*- coding: utf-8 -*-
from .base import Base
class Source(Base):
def __init__(self, vim):
super().__init__(vim)
self.name = 'vimtex_toc'
self.kind = 'file'
@staticmethod
def format_number(n):
if not n or not type(n) is dict or n['frontmatter'] or n['backmatter']:
... | # -*- coding: utf-8 -*-
from .base import Base
class Source(Base):
def __init__(self, vim):
super().__init__(vim)
self.name = 'vimtex_toc'
self.kind = 'file'
@staticmethod
def format_number(n):
if not n or n['frontmatter'] or n['backmatter']:
return ''
... |
Use list comprehension for mailjet_users list | from django.core.management.base import BaseCommand
from django.db import DEFAULT_DB_ALIAS
from optparse import make_option
class Command(BaseCommand):
option_list = BaseCommand.option_list + (
make_option('--connection',
action='store',
dest='connection',
... | from django.core.management.base import BaseCommand
from django.db import DEFAULT_DB_ALIAS
from optparse import make_option
class Command(BaseCommand):
option_list = BaseCommand.option_list + (
make_option('--connection',
action='store',
dest='connection',
... |
Update for tilelive.js exports change. | var _ = require('underscore')._,
Tile = require('tilelive.js').Tile;
var mapnik = require('mapnik');
mapnik.register_datasources('/usr/local/lib/mapnik2/input');
mapnik.register_fonts('/usr/local/lib/mapnik2/fonts/');
module.exports = function(app, settings) {
app.get('/:scheme/:mapfile_64/:z/:x/:y.*', functi... | var _ = require('underscore')._,
Tile = require('tilelive.js');
var mapnik = require('mapnik');
mapnik.register_datasources('/usr/local/lib/mapnik2/input');
mapnik.register_fonts('/usr/local/lib/mapnik2/fonts/');
module.exports = function(app, settings) {
app.get('/:scheme/:mapfile_64/:z/:x/:y.*', function(re... |
Adjust the settings reset to work with Django 1.4
Django changed the `settings._wrapped` value from `None` to the special
`empty` object. This change maintains backwards compatibility for
1.3.X, while using the new method for all other versions of Django. | import django
import os, sys
DEFAULT_SETTINGS = {
'DATABASE_ENGINE': 'sqlite3',
'DATABASES': {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': 'mydatabase'
}
},
}
class VirtualDjango(object):
def __init__(self,
caller=sys.modules['_... | import os, sys
DEFAULT_SETTINGS = {
'DATABASE_ENGINE': 'sqlite3',
'DATABASES': {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': 'mydatabase'
}
},
}
class VirtualDjango(object):
def __init__(self,
caller=sys.modules['__main__'],
... |
Update Development Status to stable | """ Drupdates setup script. """
try:
from setuptools import setup
except ImportError:
from distutils.core import setup
setup(
name='Drupdates',
description='Drupal updates scripts',
author='Jim Taylor',
url='https://github.com/jalama/drupdates',
download_url='https://github.com/jalama/drupd... | """ Drupdates setup script. """
try:
from setuptools import setup
except ImportError:
from distutils.core import setup
setup(
name='Drupdates',
description='Drupal updates scripts',
author='Jim Taylor',
url='https://github.com/jalama/drupdates',
download_url='https://github.com/jalama/drupd... |
Remove upper case Not Present | from django import forms
from datasets.models import DatasetRelease, CategoryComment
class DatasetReleaseForm(forms.ModelForm):
max_number_of_sounds = forms.IntegerField(required=False)
class Meta:
model = DatasetRelease
fields = ['release_tag', 'type']
class PresentNotPresentUnsureForm(for... | from django import forms
from datasets.models import DatasetRelease, CategoryComment
class DatasetReleaseForm(forms.ModelForm):
max_number_of_sounds = forms.IntegerField(required=False)
class Meta:
model = DatasetRelease
fields = ['release_tag', 'type']
class PresentNotPresentUnsureForm(for... |
Fix test for anonymity in documentation | # -*- coding: utf-8 -*-
from flask import Blueprint, render_template, url_for as base_url_for
from flask.ext.security import current_user
from ..extensions import user_datastore
from ..models.taxis import Taxi
from functools import partial
mod = Blueprint('examples', __name__)
@mod.route('/documentation/examples')
d... | # -*- coding: utf-8 -*-
from flask import Blueprint, render_template, url_for as base_url_for
from flask.ext.security import current_user
from ..extensions import user_datastore
from ..models.taxis import Taxi
from functools import partial
mod = Blueprint('examples', __name__)
@mod.route('/documentation/examples')
d... |
Fix test paths on Mac OS | <?php
namespace AppBundle\ShowUnusedPhpFiles;
/**
* Tests for the CommonPathDeterminator.
*/
final class CommonPathDeterminatorTest extends \PHPUnit_Framework_TestCase
{
/**
* @test
*/
public function returnsEmptyStringForEmptyInput()
{
$result = (new CommonPathDeterminator())->determi... | <?php
namespace AppBundle\ShowUnusedPhpFiles;
/**
* Tests for the CommonPathDeterminator.
*/
final class CommonPathDeterminatorTest extends \PHPUnit_Framework_TestCase
{
/**
* @test
*/
public function returnsEmptyStringForEmptyInput()
{
$result = (new CommonPathDeterminator())->determi... |
Fix gomp library dynamic loading issues
* bug introduce from commit : 4a4676258bfd47a7fbefc51644eb58ffc60ab6ad | '''
OpenMP wrapper using a (user provided) libgomp dynamically loaded library
'''
import sys
import glob
import ctypes
class omp(object):
LD_LIBRARY_PATHS = [
"/usr/lib/x86_64-linux-gnu/",
# MacPorts install gcc in a "non standard" path on OSX
] + glob.glob("/opt/local/lib/gcc*/")
def __... | '''
OpenMP wrapper using a (user provided) libgomp dynamically loaded library
'''
import sys
import glob
import ctypes
class omp(object):
LD_LIBRARY_PATHS = [
"/usr/lib/x86_64-linux-gnu/",
# MacPorts install gcc in a "non standard" path on OSX
] + glob.glob("/opt/local/lib/gcc*/")
def __... |
Stop displaying x as the code | #!/usr/bin/env python3
'''
Given:
1. status code: (0 - OK, other value - BAD)
2. terminal window width
shows red/green bar to visualize return code of previous command
'''
import sys
def main():
if len(sys.argv) >= 2:
code = sys.argv[1]
if code == 'x':
col_char = '3'
cols... | #!/usr/bin/env python3
'''
Given:
1. status code: (0 - OK, other value - BAD)
2. terminal window width
shows red/green bar to visualize return code of previous command
'''
import sys
def main():
if len(sys.argv) >= 2:
code = sys.argv[1]
if code == 'x':
col_char = '3'
cols... |
Clean up ACL code for axo 20483 | <?php
namespace Rcm\Acl\Entity;
use Doctrine\ORM\Mapping as ORM;
/**
* @ORM\Entity
* @ORM\Table(
* name="rcm_acl_user_group",
* indexes={@ORM\Index(name="userIdIndex", columns={"userId"})})
* )
*/
class UserGroup
{
/**
* @var integer
*
* @ORM\GeneratedValue
* @ORM\Id
* @ORM... | <?php
namespace Rcm\Acl\Entity;
use Doctrine\ORM\Mapping as ORM;
/**
* @ORM\Entity
* @ORM\Table(
* name="rcm_acl_user_group",
* indexes={@ORM\Index(name="userIdIndex", columns={"userId"})})
* )
*/
class UserGroup
{
/**
* @var integer
*
* @ORM\GeneratedValue
* @ORM\Id
* @ORM... |
Add missing FROM expression to consent SQL query | <?php
namespace OpenConext\EngineBlock\Authentication\Repository;
use DateTime;
use Doctrine\DBAL\Connection as DbalConnection;
use Doctrine\DBAL\DBALException;
use OpenConext\EngineBlock\Authentication\Entity\Consent;
use PDO;
final class ConsentRepository
{
/**
* @var DbalConnection
*/
private $c... | <?php
namespace OpenConext\EngineBlock\Authentication\Repository;
use DateTime;
use Doctrine\DBAL\Connection as DbalConnection;
use Doctrine\DBAL\DBALException;
use OpenConext\EngineBlock\Authentication\Entity\Consent;
use PDO;
final class ConsentRepository
{
/**
* @var DbalConnection
*/
private $c... |
Fix Trl Form_Dynamic: add missing parent call to getTemplateVars
cssClass was missing | <?php
class Kwc_Form_Dynamic_Trl_Component extends Kwc_Abstract_Composite_Trl_Component
{
public static function getSettings($masterComponentClass)
{
$ret = parent::getSettings($masterComponentClass);
//form nicht übersetzen, sondern die exakt gleiche wie im master verwenden
$g = Kwc_Ab... | <?php
class Kwc_Form_Dynamic_Trl_Component extends Kwc_Abstract_Composite_Trl_Component
{
public static function getSettings($masterComponentClass)
{
$ret = parent::getSettings($masterComponentClass);
//form nicht übersetzen, sondern die exakt gleiche wie im master verwenden
$g = Kwc_Ab... |
Use fixed value in the helper | from __future__ import absolute_import
from ..layer import Layer
def color_category_layer(source, value, top=11, palette='bold', title=''):
return Layer(
source,
style={
'point': {
'color': 'ramp(top(${0}, {1}), {2})'.format(value, top, palette)
},
... | from __future__ import absolute_import
from ..layer import Layer
def color_category_layer(source, value, top=11, palette='bold', title='', othersLabel='Others'):
return Layer(
source,
style={
'point': {
'color': 'ramp(top(${0}, {1}), {2})'.format(value, top, palette)
... |
Add key prop to column containers | import React from "react/addons";
import times from "lodash.times";
const BATCH_SIZE = 2;
class Columns extends React.Component {
constructor(props) {
super(props);
}
convertChildren(children) {
if (children.length === 0) {
return []
}
if (children.length) {
return children;
} ... | import React from "react/addons";
import times from "lodash.times";
const BATCH_SIZE = 2;
class Columns extends React.Component {
constructor(props) {
super(props);
}
convertChildren(children) {
if (children.length === 0) {
return []
}
if (children.length) {
return children;
} ... |
Set migrate to default safe to skip a step when running 'sails lift' in terminal | /**
* Default model configuration
* (sails.config.models)
*
* Unless you override them, the following properties will be included
* in each of your models.
*
* For more info on Sails models, see:
* http://sailsjs.org/#/documentation/concepts/ORM
*/
module.exports.models = {
/*******************************... | /**
* Default model configuration
* (sails.config.models)
*
* Unless you override them, the following properties will be included
* in each of your models.
*
* For more info on Sails models, see:
* http://sailsjs.org/#/documentation/concepts/ORM
*/
module.exports.models = {
/*******************************... |
Allow enter button to trigger login. | var authDialog;
var loadingDialog;
var authDialogPassword;
var authSubmit;
var forwardUrl = QueryString.fu;
function onLoad() {
authDialog = $("#auth_dialog");
loadingDialog = $("#busy_dialog");
authDialogPassword = $("#auth_dialog_password");
authSubmit = $("#auth_submit");
setupDialogs();
... | var authDialog;
var loadingDialog;
var authDialogPassword;
var authSubmit;
var forwardUrl = QueryString.fu;
function onLoad() {
authDialog = $("#auth_dialog");
loadingDialog = $("#busy_dialog");
authDialogPassword = $("#auth_dialog_password");
authSubmit = $("#auth_submit");
setupDialogs();
... |
Fix Doc comment (width => integer) | <?php
/*
* This file is part of PHP-FFmpeg.
*
* (c) Alchemy <info@alchemy.fr>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace FFMpeg\Coordinate;
use FFMpeg\Exception\InvalidArgumentException;
/**
* Dimension object, ... | <?php
/*
* This file is part of PHP-FFmpeg.
*
* (c) Alchemy <info@alchemy.fr>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace FFMpeg\Coordinate;
use FFMpeg\Exception\InvalidArgumentException;
/**
* Dimension object, ... |
Remove polyfill from unit test | var path = require('path')
module.exports = function(config) {
config.set({
singleRun: true,
files: [
'test/index.js',
'test/eventing.js'
],
frameworks: [ 'mocha' ],
preprocessors: {
'test/index.js': [ 'webpack', 'sourcemap' ],
'test/eventing.js': [ 'webpack', 'sourcema... | var path = require('path')
module.exports = function(config) {
config.set({
singleRun: true,
files: [
'./node_modules/babel-polyfill/browser.js',
'test/index.js',
'test/eventing.js'
],
frameworks: [ 'mocha' ],
preprocessors: {
'test/index.js': [ 'webpack', 'sourcemap' ]... |
Send hostname from java client | package com.bugsnag;
import java.net.InetAddress;
import org.json.JSONObject;
import org.json.JSONException;
import com.bugsnag.utils.JSONUtils;
public class Diagnostics {
protected Configuration config;
protected JSONObject deviceData = new JSONObject();
protected JSONObject appData = new JSONObject();... | package com.bugsnag;
import org.json.JSONObject;
import org.json.JSONException;
import com.bugsnag.utils.JSONUtils;
public class Diagnostics {
protected Configuration config;
protected JSONObject deviceData = new JSONObject();
protected JSONObject appData = new JSONObject();
public Diagnostics(Confi... |
Remove old versions with DB versions seeder (+ rename 1.7.10 to 1.7) | <?php
use Illuminate\Database\Seeder;
class MinecraftVersionsSeeder extends Seeder
{
private $versionsByType = [
'PC' => [
5 => '1.7', // 1.7.10 (not 1.7.2)
47 => '1.8',
107 => '1.9',
210 => '1.10',
315 => '1.11',
335 => '1.12',
... | <?php
use Illuminate\Database\Seeder;
class MinecraftVersionsSeeder extends Seeder
{
private $versionsByType = [
'PC' => [
5 => '1.7.10',
47 => '1.8',
107 => '1.9',
210 => '1.10',
315 => '1.11',
335 => '1.12',
],
'P... |
Add service name for service definition initialization manager | <?php
/*
* This file is part of the PcdxParameterEncryptionBundle package.
*
* (c) picodexter <https://picodexter.io/>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Picodexter\ParameterEncryptionBundle\DependencyInjec... | <?php
/*
* This file is part of the PcdxParameterEncryptionBundle package.
*
* (c) picodexter <https://picodexter.io/>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Picodexter\ParameterEncryptionBundle\DependencyInjec... |
Move string formatting onto two lines for readability | import string
import socket
import sys
import time
import threading
class SimpleSocket:
def __init__(self, hostname="localhost", port=8888, timeout=2):
self.access_semaphor = threading.Semaphore(1)
try:
self.sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
except socket... | import string
import socket
import sys
import time
import threading
class SimpleSocket:
def __init__(self, hostname="localhost", port=8888, timeout=2):
self.access_semaphor = threading.Semaphore(1)
try:
self.sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
except socket... |
Remove required from passwordTrait salt. It has a salt generator fallback. | <?php
/**
* @link http://zoopcommerce.github.io/shard
* @package Zoop
* @license MIT
*/
namespace Zoop\Shard\User\DataModel;
use Zoop\Shard\Crypt\SaltGenerator;
use Doctrine\ODM\MongoDB\Mapping\Annotations as ODM;
use Zoop\Shard\Annotation\Annotations as Shard;
/**
* Implementation of Zoop\Common\Us... | <?php
/**
* @link http://zoopcommerce.github.io/shard
* @package Zoop
* @license MIT
*/
namespace Zoop\Shard\User\DataModel;
use Zoop\Shard\Crypt\SaltGenerator;
use Doctrine\ODM\MongoDB\Mapping\Annotations as ODM;
use Zoop\Shard\Annotation\Annotations as Shard;
/**
* Implementation of Zoop\Common\Us... |
Reset key parameter on profile path redirect | <?php
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the GNU Affero General Public License v3.0.
// See the LICENCE file in the repository root for full licence text.
namespace App\Libraries\User;
use App\Exceptions\UserProfilePageLookupException;
use App\Models\User;
class FindForProfilePage
{
p... | <?php
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the GNU Affero General Public License v3.0.
// See the LICENCE file in the repository root for full licence text.
namespace App\Libraries\User;
use App\Exceptions\UserProfilePageLookupException;
use App\Models\User;
class FindForProfilePage
{
p... |
CRM-2511: Access permissions for items in Activity List
- FT fixes | <?php
namespace Oro\Bundle\TestFrameworkBundle\Tests\Functional\Api\Rest;
use Oro\Bundle\TestFrameworkBundle\Test\WebTestCase;
use Oro\Bundle\UserBundle\Entity\User;
/**
* @outputBuffering enabled
* @dbIsolation
*/
class ActivityListRoleControllerTest extends WebTestCase
{
protected function setUp()
{
... | <?php
namespace Oro\Bundle\TestFrameworkBundle\Tests\Functional\Api\Rest;
use Oro\Bundle\TestFrameworkBundle\Test\WebTestCase;
use Oro\Bundle\UserBundle\Entity\User;
/**
* @outputBuffering enabled
* @dbIsolation
*/
class ActivityListRoleControllerTest extends WebTestCase
{
protected function setUp()
{
... |
Add more information to callback matchers exception messages | <?php
namespace PhpSpec\Matcher;
use PhpSpec\Formatter\Presenter\PresenterInterface;
use PhpSpec\Exception\Example\FailureException;
class CallbackMatcher extends BasicMatcher
{
private $name;
private $callback;
private $presenter;
public function __construct($name, $callback, PresenterInterface $p... | <?php
namespace PhpSpec\Matcher;
use PhpSpec\Formatter\Presenter\PresenterInterface;
use PhpSpec\Exception\Example\FailureException;
class CallbackMatcher extends BasicMatcher
{
private $name;
private $callback;
private $presenter;
public function __construct($name, $callback, PresenterInterface $p... |
Allow normaliseData to accept non-array values for the $data argument
- means we can run the method on all data types, including objects, so if the method is overridden we don't have to convert them to arrays beforehand | <?php
namespace Silktide\LazyBoy\Controller;
use Symfony\Component\HttpFoundation\JsonResponse;
/**
* RestControllerTrait
*/
trait RestControllerTrait
{
private $prohibitedKeys = [
"password" => true,
"salt" => true
];
protected function success($data = null, $code = 200)
{
... | <?php
namespace Silktide\LazyBoy\Controller;
use Symfony\Component\HttpFoundation\JsonResponse;
/**
* RestControllerTrait
*/
trait RestControllerTrait
{
private $prohibitedKeys = [
"password" => true,
"salt" => true
];
protected function success($data = null, $code = 200)
{
... |
Fix mute on initial load | function demo($interval, demo) {
return {
restrict: 'E',
template: '<div class=demo-container></div>',
link: function(scope, element) {
demo.setContainer(element[0].children[0]);
setTimeout(function() {
demo.resize();
});
scope.$watch(() => scope.main.fullscreen, function ... | function demo($interval, demo) {
return {
restrict: 'E',
template: '<div class=demo-container></div>',
link: function(scope, element) {
demo.setContainer(element[0].children[0]);
setTimeout(function() {
demo.resize();
});
scope.$watch(() => scope.main.fullscreen, function ... |
Clarify test_containers_to_host not using libnetwork | from subprocess import CalledProcessError
from test_base import TestBase
from tests.st.utils.docker_host import DockerHost
class TestContainerToHost(TestBase):
def test_container_to_host(self):
"""
Test that a container can ping the host.
This function is important for Mesos, since the c... | from subprocess import CalledProcessError
from test_base import TestBase
from tests.st.utils.docker_host import DockerHost
class TestContainerToHost(TestBase):
def test_container_to_host(self):
"""
Test that a container can ping the host. (Without using the docker
network driver, since i... |
Add random_challenge method to choose a challenge to answer | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
import random
from heartbeat import Challenge
import requests
from .utils import urlify
from .exc import DownstreamError
class DownstreamClient(object):
def __init__(self, server_url):
self.server = server_url.strip('/')
self.challenges = [... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
from heartbeat import Challenge
import requests
from .utils import urlify
from .exc import DownstreamError
class DownstreamClient(object):
def __init__(self, server_url):
self.server = server_url.strip('/')
self.challenges = []
def con... |
Fix Travis issue with Karma pt.2 | // const webpack = require('webpack');
module.exports = (config) => {
config.set({
browsers: ['Chrome'], // run in Chrome
singleRun: true, // just run once by default
frameworks: ['mocha', 'chai'], // use the mocha test framework
files: [
'tests.webpack.js', // just load this file
],
pr... | // const webpack = require('webpack');
module.exports = (config) => {
config.set({
browsers: process.env.TRAVIS ? ['Chrome_travis_ci'] : ['Chrome'], // run in Chrome
singleRun: true, // just run once by default
frameworks: ['mocha', 'chai'], // use the mocha test framework
files: [
'tests.webpa... |
Update docstring for the ActiveHref template tag. | from django import template
from bs4 import BeautifulSoup
register = template.Library()
@register.tag(name='activehref')
def do_active_href(parser, token):
nodelist = parser.parse(('endactivehref',))
parser.delete_first_token()
return ActiveHref(nodelist)
class ActiveHref(template.Node):
"""
Thi... | from django import template
from bs4 import BeautifulSoup
register = template.Library()
@register.tag(name='activehref')
def do_active_href(parser, token):
nodelist = parser.parse(('endactivehref',))
parser.delete_first_token()
return ActiveHref(nodelist)
class ActiveHref(template.Node):
"""
Thi... |
Fix for STORE-1330: Remove direct binding of `click` API to `on` | $(function () {
$('.action-container').on(
{
mouseenter: function () {
$(this).find("i").removeClass().addClass("fa fa-remove");
},
mouseleave: function () {
$(this).find("i").removeClass().addClass("fa fa-star");
},
... | $(function () {
$('#btn-add-gadget').click(function () {
var elem = $(this);
asset.process(elem.data('type'), elem.data('aid'), location.href, elem);
});
$('#btn-remove-subscribe').click(function () {
var elem = $(this);
asset.unsubscribeBookmark(elem.data('type'), elem.data... |
Change the static mention of views cache path to the path on the configuration file | <?php namespace Fitztrev\LaravelHtmlMinify;
use Illuminate\Support\ServiceProvider;
use Illuminate\View\Engines\CompilerEngine;
class LaravelHtmlMinifyServiceProvider extends ServiceProvider
{
/**
* Indicates if loading of the provider is deferred.
*
* @var bool
*/
protected $defer = false... | <?php namespace Fitztrev\LaravelHtmlMinify;
use Illuminate\Support\ServiceProvider;
use Illuminate\View\Engines\CompilerEngine;
class LaravelHtmlMinifyServiceProvider extends ServiceProvider
{
/**
* Indicates if loading of the provider is deferred.
*
* @var bool
*/
protected $defer = false... |
Refactor to OOP ish design | /*
* Refresh rendered file through mfr
*/
var $ = require('jquery');
var $osf = require('js/osfHelpers');
function FileRenderer(url, selector) {
var self = this;
self.url = url;
self.tries = 0;
self.selector = selector;
self.ALLOWED_RETRIES = 10;
self.element = $(selector);
self.start... | /*
* Refresh rendered file through mfr
*/
'use strict';
var $ = require('jquery');
var $osf = require('js/osfHelpers');
var FileRenderer = {
start: function(url, selector){
this.url = url;
this.tries = 0;
this.ALLOWED_RETRIES = 10;
this.element = $(selector);
this.getCac... |
Add gyro reset for drift correction | package team498.robot.commands;
import edu.wpi.first.wpilibj.command.Command;
import team498.robot.Helpers;
import team498.robot.Operator;
import team498.robot.subsystems.Drivetrain;
import team498.robot.subsystems.Gyro;
public class Drive extends Command {
private static final double CORRECTION_GAIN = 0.03;
... | package team498.robot.commands;
import edu.wpi.first.wpilibj.command.Command;
import team498.robot.Helpers;
import team498.robot.Operator;
import team498.robot.subsystems.Drivetrain;
import team498.robot.subsystems.Gyro;
public class Drive extends Command {
private static final double CORRECTION_GAIN = 0.03;
... |
Add missing "new" when raising an InvaludArgumentException | <?php
class CSRF
{
/** @var string */
const HMAC_ALGORITHM = 'sha1';
/** @var string */
const SESSION_KEY_NAME = '_csrf_key';
/**
* Ensure that a CSRF token is valid for a given action.
*
* @param string $token
* @param string $action
* @return bool
*/
public s... | <?php
class CSRF
{
/** @var string */
const HMAC_ALGORITHM = 'sha1';
/** @var string */
const SESSION_KEY_NAME = '_csrf_key';
/**
* Ensure that a CSRF token is valid for a given action.
*
* @param string $token
* @param string $action
* @return bool
*/
public s... |
Update list of HTML5 tags shived by html5shiv | module.exports = function(options){
var page = options.page;
var next = options.next;
page.evaluate(
function () {
var tags = [
'abbr',
'article',
'aside',
'bdi',
'canvas',
'data',
'datalist',
'details',
'dialog',
'figcapti... | module.exports = function(options){
var page = options.page;
var next = options.next;
page.evaluate(
function () {
var tags = [
'article',
'aside',
'bdi',
'details',
'dialog',
'figcaption',
'figure',
'footer',
'header',
'ma... |
Fix WeDo extension chip wording | const EXTENSION_INFO = {
microbit: {
name: 'micro:bit',
icon: 'extension-microbit.svg',
hasStatus: true
},
music: {
l10nId: 'project.musicExtensionChip',
icon: 'extension-music.svg'
},
pen: {
l10nId: 'project.penExtensionChip',
icon: 'extension... | const EXTENSION_INFO = {
microbit: {
name: 'micro:bit',
icon: 'extension-microbit.svg',
hasStatus: true
},
music: {
l10nId: 'project.musicExtensionChip',
icon: 'extension-music.svg'
},
pen: {
l10nId: 'project.penExtensionChip',
icon: 'extension... |
Create a circle or square | function(args) {
/*
is_app(true)
control_type("VB")
display_name("Shapes control")
description("This will return the shapes control")
base_component_id("shapes_control")
load_once_from_file(true)
visibility("PRIVATE")
read_only(true)
properties(
[
{
id: "text",
name: "Text",
... | function(args) {
/*
is_app(true)
control_type("VB")
display_name("Shapes control")
description("This will return the shapes control")
base_component_id("shapes_control")
load_once_from_file(true)
visibility("PRIVATE")
read_only(true)
properties(
[
{
id: "text",
name: "Text",
... |
Fix pagination when fetching submission lists | "use strict";
const fs = require("fs");
const path = require("path");
const builder = require("xmlbuilder");
const settings = require("../../../settings");
const SUBMISSIONS_DIR = path.join(settings.dataDir, "submissions");
module.exports = (req, res, next) => {
const formPath = path.join(SUBMISSIONS_DIR, req.qu... | "use strict";
const fs = require("fs");
const path = require("path");
const builder = require("xmlbuilder");
const settings = require("../../../settings");
const SUBMISSIONS_DIR = path.join(settings.dataDir, "submissions");
module.exports = (req, res, next) => {
const formPath = path.join(SUBMISSIONS_DIR, req.qu... |
Fix SMS ES test after not-and rewrite | from django.test.testcases import SimpleTestCase
from corehq.apps.es.sms import SMSES
from corehq.apps.es.tests.utils import ElasticTestMixin
from corehq.elastic import SIZE_LIMIT
class TestSMSES(ElasticTestMixin, SimpleTestCase):
def test_processed_or_incoming(self):
json_output = {
"query":... | from django.test.testcases import SimpleTestCase
from corehq.apps.es.sms import SMSES
from corehq.apps.es.tests.utils import ElasticTestMixin
from corehq.elastic import SIZE_LIMIT
class TestSMSES(ElasticTestMixin, SimpleTestCase):
def test_processed_or_incoming(self):
json_output = {
"query":... |
Add class comment for kafkaTransportDetails class | package org.wso2.carbon.sp.jobmanager.core.bean;
import java.util.List;
/**
* Bean class for kafkaTransport Details.
*/
public class KafkaTransportDetails {
private String appName;
private String siddhiApp;
private String deployedHost;
private String deployedPort;
private List<String> sourceList... | package org.wso2.carbon.sp.jobmanager.core.bean;
import java.util.List;
/**
*
*/
public class KafkaTransportDetails {
private String appName;
private String siddhiApp;
private String deployedHost;
private String deployedPort;
private List<String> sourceList;
private List<String> sinkList;
... |
Fix test to pass also with Firefox 13 | function runTest()
{
FBTest.sysout("issue5525.START");
FBTest.openNewTab(basePath + "script/breakpoints/5525/issue5525.html", function(win)
{
FBTest.openFirebug();
FBTest.enableScriptPanel()
FBTest.enableConsolePanel()
FBTest.selectPanel("console");
var config = {tag... | function runTest()
{
FBTest.sysout("issue5525.START");
FBTest.openNewTab(basePath + "script/breakpoints/5525/issue5525.html", function(win)
{
FBTest.openFirebug();
FBTest.enableScriptPanel()
FBTest.enableConsolePanel()
FBTest.selectPanel("console");
var config = {tag... |
Reduce white-space to trim down filesize | ---
layout: null
---
var store = [
{%- for c in site.collections -%}
{%- if forloop.last -%}
{%- assign l = true -%}
{%- endif -%}
{%- assign docs = c.docs | where_exp:'doc','doc.search != false' -%}
{%- for doc in docs -%}
{%- if doc.header.teaser -%}
{%- capture teaser -%}{{ doc... | ---
layout: null
---
var store = [
{% for c in site.collections %}
{% if forloop.last %}
{% assign l = true %}
{% endif %}
{% assign docs = c.docs | where_exp:'doc','doc.search != false' %}
{% for doc in docs %}
{% if doc.header.teaser %}
{% capture teaser %}{{ doc.header.teaser }... |
Change join button colour to blue. | import '../css/ListItem.css';
import React, { Component, PropTypes } from 'react';
import Button from './Button';
export default class ListItem extends Component {
render() {
const {
id,
title,
right,
peopleNames,
outingJoined,
onClickJoin,
onClickLeave
} = this.prop... | import '../css/ListItem.css';
import React, { Component, PropTypes } from 'react';
import Button from './Button';
export default class ListItem extends Component {
render() {
const {
id,
title,
right,
peopleNames,
outingJoined,
onClickJoin,
onClickLeave
} = this.prop... |
Fix for missing username and clear the social_auth to force re-authentication at next login. | # -*- coding: utf-8 -*-
import logging
#import datetime
from celery import task
from django.contrib.auth import get_user_model
LOGGER = logging.getLogger(__name__)
User = get_user_model()
#ftstamp = datetime.datetime.fromtimestamp
#now = datetime.datetime.now
@task
def celery_beat_test():
LOGGER.info(u... | # -*- coding: utf-8 -*-
import logging
#import datetime
from celery import task
from django.contrib.auth import get_user_model
LOGGER = logging.getLogger(__name__)
User = get_user_model()
#ftstamp = datetime.datetime.fromtimestamp
#now = datetime.datetime.now
@task
def celery_beat_test():
LOGGER.info(u... |
Check csrf token before restoring a deleted user | <?php
namespace Backend\Modules\Users\Actions;
use Backend\Core\Engine\Base\Action as BackendBaseAction;
use Backend\Core\Engine\Model as BackendModel;
use Backend\Core\Engine\User as BackendUser;
use Backend\Modules\Users\Engine\Model as BackendUsersModel;
/**
* This is the undo-delete-action, it will restore a de... | <?php
namespace Backend\Modules\Users\Actions;
use Backend\Core\Engine\Base\Action as BackendBaseAction;
use Backend\Core\Engine\Model as BackendModel;
use Backend\Core\Engine\User as BackendUser;
use Backend\Modules\Users\Engine\Model as BackendUsersModel;
/**
* This is the undo-delete-action, it will restore a de... |
Fix refresh session on navigate | <?php
class Session
{
const SESSION_STARTED = TRUE;
const SESSION_STOPED = FALSE;
private $sessionStatus = self::SESSION_STOPED;
private static $instance;
private function __construct() {}
public static function getInstance()
{
if (!isset(self::$instance))... | <?php
class Session
{
const SESSION_STARTED = TRUE;
const SESSION_STOPED = FALSE;
private $sessionStatus = self::SESSION_STOPED;
private static $instance;
private function __construct() {}
public static function getInstance()
{
if (!isset(self::$instance))... |
Fix of dummymovement form to use product.move instead of api.move | from __future__ import unicode_literals
from django.core.urlresolvers import reverse_lazy
from django.views.generic import FormView
from braces.views import LoginRequiredMixin
from ..mixins import BazaarPrefixMixin
from . import api
from .forms import MovementForm
class MovementMixin(LoginRequiredMixin, BazaarPref... | from __future__ import unicode_literals
from django.core.urlresolvers import reverse_lazy
from django.views.generic import FormView
from braces.views import LoginRequiredMixin
from ..mixins import BazaarPrefixMixin
from . import api
from .forms import MovementForm
class MovementMixin(LoginRequiredMixin, BazaarPref... |
Clean out the _key from the data, no need to double entry | '''
Create a stock database with a built in nesting key index
'''
# Import maras libs
import maras.database
import maras.tree_index
# We can likely build these out as mixins, making it easy to apply high level
# constructs to multiple unerlying database implimentations
class NestDB(maras.database.Database):
'''
... | '''
Create a stock database with a built in nesting key index
'''
# Import maras libs
import maras.database
import maras.tree_index
# We can likely build these out as mixins, making it easy to apply high level
# constructs to multiple unerlying database implimentations
class NestDB(maras.database.Database):
'''
... |
Fix kwargs usage to work with other auth backends. |
from django.contrib.auth.backends import ModelBackend
from django.contrib.auth.models import User
from django.contrib.auth.tokens import default_token_generator
from django.db.models import Q
from django.utils.http import base36_to_int
class MezzanineBackend(ModelBackend):
"""
Extends Django's ``ModelBackend... |
from django.contrib.auth.backends import ModelBackend
from django.contrib.auth.models import User
from django.contrib.auth.tokens import default_token_generator
from django.db.models import Q
from django.utils.http import base36_to_int
class MezzanineBackend(ModelBackend):
"""
Extends Django's ``ModelBackend... |
Upgrade ldap3 1.0.2 => 1.0.3 | 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... |
Change requirement dateutil to python-dateutil. | #!/usr/bin/env python
from setuptools import setup, find_packages
setup(
name = "py-trello",
version = "0.2.3",
description = 'Python wrapper around the Trello API',
long_description = open('README.rst').read(),
author = 'Richard Kolkovich',
author_email = 'richard@sig... | #!/usr/bin/env python
from setuptools import setup, find_packages
setup(
name = "py-trello",
version = "0.2.3",
description = 'Python wrapper around the Trello API',
long_description = open('README.rst').read(),
author = 'Richard Kolkovich',
author_email = 'richard@sig... |
Fix error on words beginning with '-' | import re
from abc import abstractmethod
from denite_gtags import GtagsBase # pylint: disable=locally-disabled, wrong-import-position
class TagsBase(GtagsBase):
TAG_PATTERN = re.compile('([^\t]+)\t(\\d+)\t(.*)')
@abstractmethod
def get_search_flags(self):
return []
def get_search_word(self, ... | import re
from abc import abstractmethod
from denite_gtags import GtagsBase # pylint: disable=locally-disabled, wrong-import-position
class TagsBase(GtagsBase):
TAG_PATTERN = re.compile('([^\t]+)\t(\\d+)\t(.*)')
def __init__(self, vim):
super().__init__(vim)
@abstractmethod
def get_search_fl... |
Set name explicitly in the command itself, too | <?php
namespace Becklyn\AssetsBundle\Command;
use Becklyn\AssetsBundle\Cache\CacheWarmer;
use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Output\OutputInterface;
use Symfony\Component\Con... | <?php
namespace Becklyn\AssetsBundle\Command;
use Becklyn\AssetsBundle\Cache\CacheWarmer;
use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Output\OutputInterface;
use Symfony\Component\Con... |
Correct some issues with the stats methods | from django.template.defaultfilters import slugify
from debug_toolbar.middleware import DebugToolbarMiddleware
class DebugPanel(object):
"""
Base class for debug panels.
"""
# name = Base
has_content = False # If content returns something, set to true in subclass
# We'll maintain a local ... | from django.template.defaultfilters import slugify
from debug_toolbar.middleware import DebugToolbarMiddleware
class DebugPanel(object):
"""
Base class for debug panels.
"""
# name = Base
has_content = False # If content returns something, set to true in subclass
# We'll maintain a local ... |
Set ember/no-jquery lint rule to warn as we upgrade Ember CLI to address it later | 'use strict';
module.exports = {
root: true,
parser: 'babel-eslint',
parserOptions: {
ecmaVersion: 2018,
sourceType: 'module',
ecmaFeatures: {
legacyDecorators: true,
},
},
plugins: ['ember'],
extends: [
'eslint:recommended',
'plugin:ember/recommended',
'plugin:prettier/re... | 'use strict';
module.exports = {
root: true,
parser: 'babel-eslint',
parserOptions: {
ecmaVersion: 2018,
sourceType: 'module',
ecmaFeatures: {
legacyDecorators: true,
},
},
plugins: ['ember'],
extends: [
'eslint:recommended',
'plugin:ember/recommended',
'plugin:prettier/re... |
Fix to show 404 for deleted user | <?php
namespace Concrete\Controller\SinglePage\Members;
use Concrete\Core\Page\Controller\PublicProfilePageController;
use Loader;
use User;
use UserInfo;
use Exception;
class Profile extends PublicProfilePageController
{
public function view($userID = 0)
{
$html = Loader::helper('html');
$can... | <?php
namespace Concrete\Controller\SinglePage\Members;
use Concrete\Core\Page\Controller\PublicProfilePageController;
use Loader;
use User;
use UserInfo;
use Exception;
class Profile extends PublicProfilePageController
{
public function view($userID = 0)
{
$html = Loader::helper('html');
$can... |
Fix authorisation checking when 'roles' is empty | <?php
namespace Gl3n\SerializationGroupBundle;
use Symfony\Component\Security\Core\Authorization\AuthorizationCheckerInterface;
use Symfony\Component\Security\Core\Exception\AccessDeniedException;
/**
* Resolves groups and permissions
*/
class Resolver
{
/**
* @var AuthorizationCheckerInterface
*/
... | <?php
namespace Gl3n\SerializationGroupBundle;
use Symfony\Component\Security\Core\Authorization\AuthorizationCheckerInterface;
use Symfony\Component\Security\Core\Exception\AccessDeniedException;
/**
* Resolves groups and permissions
*/
class Resolver
{
/**
* @var AuthorizationCheckerInterface
*/
... |
Fix “reload convrsation” button’s state | import React, { Component, PropTypes } from 'react';
import { connect } from 'react-redux';
import { loadConversation } from 'redux/modules/conversationModule';
// COMPONENTS
import CommentsList from './CommentsList';
import { LoadingScreen } from 'components';
const mappedState = ({ conversation }) => ({
conversati... | import React, { Component, PropTypes } from 'react';
import { connect } from 'react-redux';
import { loadConversation } from 'redux/modules/conversationModule';
// COMPONENTS
import CommentsList from './CommentsList';
import { LoadingScreen } from 'components';
const mappedState = ({ conversation }) => ({
conversati... |
Fix inverted longitude and latitude when saving the coordinates to the DB | <?php
namespace geotime\helpers;
use geotime\models\CalibrationPoint;
use geotime\models\CoordinateLatLng;
use geotime\models\CoordinateXY;
use Logger;
Logger::configure("lib/geotime/logger.xml");
class CalibrationPointHelper
{
/** @var \Logger */
static $log;
/**
* @param $calibrationPoint \stdClas... | <?php
namespace geotime\helpers;
use geotime\models\CalibrationPoint;
use geotime\models\CoordinateLatLng;
use geotime\models\CoordinateXY;
use Logger;
Logger::configure("lib/geotime/logger.xml");
class CalibrationPointHelper
{
/** @var \Logger */
static $log;
/**
* @param $calibrationPoint \stdClas... |
Fix log spam for mute/unmute | module.exports = function (bot) {
bot.on('modMute', function (data) {
if (config.verboseLogging) {
console.log('[EVENT] modMute ', JSON.stringify(data, null, 2));
}
var duration = 'unknown';
switch (data.duration) {
case 'Short':
duration = '1... | module.exports = function (bot) {
bot.on('modMute', function (data) {
if (config.verboseLogging) {
console.log('[EVENT] modMute ', JSON.stringify(data, null, 2));
}
var duration = 'unknown';
switch (data.d) {
case 's':
duration = '15';
... |
Fix reading wrong keys from config form response | package com.speedledger.measure.jenkins;
import hudson.Plugin;
import hudson.model.Descriptor;
import hudson.model.Items;
import net.sf.json.JSONObject;
import org.kohsuke.stapler.StaplerRequest;
import javax.servlet.ServletException;
import java.io.IOException;
/**
* Elasticsearch plugin to Jenkins.
* Reports bui... | package com.speedledger.measure.jenkins;
import hudson.Plugin;
import hudson.model.Descriptor;
import hudson.model.Items;
import net.sf.json.JSONObject;
import org.kohsuke.stapler.StaplerRequest;
import javax.servlet.ServletException;
import java.io.IOException;
/**
* Elasticsearch plugin to Jenkins.
* Reports bui... |
Remove fade effect for navbar | /*!
* Start Bootstrap - Grayscale Bootstrap Theme (http://startbootstrap.com)
* Code licensed under the Apache License v2.0.
* For details, see http://www.apache.org/licenses/LICENSE-2.0.
*/
/*jslint browser: true*/
/*global $, jQuery, alert, google, init*/
/*jshint strict: true */
//jQuery to hide menu on load... | /*!
* Start Bootstrap - Grayscale Bootstrap Theme (http://startbootstrap.com)
* Code licensed under the Apache License v2.0.
* For details, see http://www.apache.org/licenses/LICENSE-2.0.
*/
/*jslint browser: true*/
/*global $, jQuery, alert, google, init*/
/*jshint strict: true */
//jQuery to hide menu on load... |
Use a hint for the suggested text | package com.google.code.quandary;
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.EditText;
import android.widget.Toast;
import com.google.code.quandar... | package com.google.code.quandary;
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.EditText;
import android.widget.Toast;
import com.google.code.quandar... |
Change title of designer index page. | @extends('layout.app', [
'title' => 'Designers',
'body_id' => 'designer-index-page',
'body_class' => 'designer-index index',
'active_nav' => 'designer',
])
@section('main')
<div class="container">
<div class="row">
@foreach ($designers as $designer)
<article id="story-{{ $design... | @extends('layout.app', [
'title' => 'Design Stories',
'body_id' => 'designer-index-page',
'body_class' => 'designer-index index',
'active_nav' => 'designer',
])
@section('main')
<div class="container">
<div class="row">
@foreach ($designers as $designer)
<article id="story-{{ $d... |
Reduce overhead trying to shorten line | var angularMeteorTemplate = angular.module('angular-blaze-template', []);
// blaze-template adds Blaze templates to Angular as directives
angularMeteorTemplate.directive('blazeTemplate', [
'$compile',
function ($compile) {
return {
restrict: 'AE',
scope: false,
link: function (scope, element,... | var angularMeteorTemplate = angular.module('angular-blaze-template', []);
// blaze-template adds Blaze templates to Angular as directives
angularMeteorTemplate.directive('blazeTemplate', [
'$compile',
function ($compile) {
return {
restrict: 'AE',
scope: false,
link: function (scope, element,... |
fix: Change 'dest' address for built css files
concatenated and minified css files are saved in 'dist/css/' folder instead of 'dist'
[ticket: #5] | module.exports = function(grunt) {
// Do grunt-related things in here.
grunt.initConfig({
// Project configuration
pkg: grunt.file.readJSON('package.json'),
jshint: {
files: ['gruntfile.js'],
},
concat: {
css: {
src: ['node_module... | module.exports = function(grunt) {
// Do grunt-related things in here.
grunt.initConfig({
// Project configuration
pkg: grunt.file.readJSON('package.json'),
jshint: {
files: ['gruntfile.js'],
},
concat: {
css: {
src: ['node_module... |
Add check for images property length | (function (env) {
'use strict';
env.ddg_spice_spotify = function(api_result){
var query = DDG.get_query();
query = query.replace(/on spotify/, '');
if (!api_result || api_result.tracks.items.length === 0) {
return Spice.failed('spotify');
}
Spice.add({
... | (function (env) {
'use strict';
env.ddg_spice_spotify = function(api_result){
var query = DDG.get_query();
query = query.replace(/on spotify/, '');
if (!api_result || api_result.tracks.items.length === 0) {
return Spice.failed('spotify');
}
Spice.add({
... |
Add dummy param to break caching | require.config({
paths: {
jquery: "/static/js/libs/jquery-min",
underscore: "/static/js/libs/underscore-min",
backbone: "/static/js/libs/backbone-min",
mustache: "/static/js/libs/mustache",
},
shim: {
jquery: {
exports: "$"
},
underscore: {... | require.config({
paths: {
jquery: "/static/js/libs/jquery-min",
underscore: "/static/js/libs/underscore-min",
backbone: "/static/js/libs/backbone-min",
mustache: "/static/js/libs/mustache",
},
shim: {
jquery: {
exports: "$"
},
underscore: {... |
Validate the presence of CONTENT_STORE. | # -*- coding: utf-8 -*-
from __future__ import print_function
import argparse
import sys
import os
from builder import DeconstJSONBuilder
from sphinx.application import Sphinx
from sphinx.builders import BUILTIN_BUILDERS
def build(argv):
"""
Invoke Sphinx with locked arguments to generate JSON content.
... | # -*- coding: utf-8 -*-
import argparse
import sys
from os import path
from builder import DeconstJSONBuilder
from sphinx.application import Sphinx
from sphinx.builders import BUILTIN_BUILDERS
def build(argv):
"""
Invoke Sphinx with locked arguments to generate JSON content.
"""
parser = argparse.A... |
Fix property names to be related to response from riot valorant api | package no.stelar7.api.r4j.pojo.val.matchlist;
import java.io.Serializable;
import java.util.Objects;
public class MatchReference implements Serializable
{
private static final long serialVersionUID = -5301457261872587385L;
private String matchId;
private Long gameStartTimeMillis;
private String qu... | package no.stelar7.api.r4j.pojo.val.matchlist;
import java.io.Serializable;
import java.util.Objects;
public class MatchReference implements Serializable
{
private static final long serialVersionUID = -5301457261872587385L;
private String matchId;
private Long gameStartTime;
private String team... |
Set slider value when adding a new congestion battery
This would work when editing an existing battery, but without triggering
the event manually it would default to 0% when adding a new battery. | var BatteryTemplateUpdater = (function () {
'use strict';
var defaultPercentage = 20.0,
batteryToggles = ".editable.profile",
batteries = [
"congestion_battery",
"households_flexibility_p2p_electricity"
],
sliderSettings = {
tooltip: 'hide',
... | var BatteryTemplateUpdater = (function () {
'use strict';
var defaultPercentage = 20.0,
batteryToggles = ".editable.profile",
batteries = [
"congestion_battery",
"households_flexibility_p2p_electricity"
],
sliderSettings = {
tooltip: 'hide',
... |
Sort for testing. Fix for test failures introduced in r3557. | package edu.northwestern.bioinformatics.studycalendar.dao.reporting;
import edu.northwestern.bioinformatics.studycalendar.dao.StudyCalendarDao;
import gov.nih.nci.cabig.ctms.domain.DomainObject;
import org.hibernate.Criteria;
import org.hibernate.HibernateException;
import org.hibernate.Session;
import org.hibernate.c... | package edu.northwestern.bioinformatics.studycalendar.dao.reporting;
import edu.northwestern.bioinformatics.studycalendar.dao.StudyCalendarDao;
import gov.nih.nci.cabig.ctms.domain.DomainObject;
import org.hibernate.Criteria;
import org.hibernate.HibernateException;
import org.hibernate.Session;
import org.springframe... |
Set default-value in the testcontroller | from src.data.TestSuite import TestSuite
from src.service.FileHandler import FileHandler
from src.service.Runner import Runner
from src.service.Evaluator import Evaluator
from src.service.salt_api_wrapper import SaltApi
class TestController:
def __init__(self, test_file, max_iterations=25):
self.test_sui... | from src.data.TestSuite import TestSuite
from src.service.FileHandler import FileHandler
from src.service.Runner import Runner
from src.service.Evaluator import Evaluator
from src.service.salt_api_wrapper import SaltApi
class TestController:
def __init__(self, test_file, max_iterations):
self.test_suite ... |
Rename componentWillMount to componentDidMount for search page refreshing | import React, { PureComponent } from "react";
import PropTypes from "prop-types";
import { Button, NonIdealState } from "@blueprintjs/core";
import styled from "styled-components";
import SearchBar from "../containers/SearchBar.js";
import SearchResults from "../containers/SearchResults.js";
import DialogFrame from "./... | import React, { PureComponent } from "react";
import PropTypes from "prop-types";
import { Button, NonIdealState } from "@blueprintjs/core";
import styled from "styled-components";
import SearchBar from "../containers/SearchBar.js";
import SearchResults from "../containers/SearchResults.js";
import DialogFrame from "./... |
Make it clearer when import could be a bad idea | from distutils.core import setup
import skyfield # safe, because __init__.py contains no import statements
setup(
name='skyfield',
version=skyfield.__version__,
description=skyfield.__doc__.split('\n', 1)[0],
long_description=open('README.rst').read(),
license='MIT',
author='Brandon Rhodes',
... | from distutils.core import setup
import skyfield # to learn the version
setup(
name='skyfield',
version=skyfield.__version__,
description=skyfield.__doc__.split('\n', 1)[0],
long_description=open('README.rst').read(),
license='MIT',
author='Brandon Rhodes',
author_email='brandon@rhodesmill... |
Remove form delete_empty legacy BC | <?php
namespace EasyCorp\Bundle\EasyAdminBundle\Form\Type\Configurator;
use EasyCorp\Bundle\EasyAdminBundle\Form\Util\LegacyFormHelper;
use Symfony\Component\Form\FormConfigInterface;
/**
* This configurator is applied to any form field of type 'collection' and is
* used to allow adding/removing elements from the ... | <?php
namespace EasyCorp\Bundle\EasyAdminBundle\Form\Type\Configurator;
use EasyCorp\Bundle\EasyAdminBundle\Form\Util\LegacyFormHelper;
use Symfony\Component\Form\FormConfigInterface;
/**
* This configurator is applied to any form field of type 'collection' and is
* used to allow adding/removing elements from the ... |
Remove post start as TOSCA agreed to remove it. | package alien4cloud.paas.plan;
import static alien4cloud.paas.plan.ToscaNodeLifecycleConstants.*;
import static alien4cloud.paas.plan.ToscaRelationshipLifecycleConstants.*;
import alien4cloud.paas.model.PaaSNodeTemplate;
/**
* Generates the default tosca build plan.
*/
public class BuildPlanGenerator extends Abstra... | package alien4cloud.paas.plan;
import static alien4cloud.paas.plan.ToscaNodeLifecycleConstants.*;
import static alien4cloud.paas.plan.ToscaRelationshipLifecycleConstants.*;
import alien4cloud.paas.model.PaaSNodeTemplate;
/**
* Generates the default tosca build plan.
*/
public class BuildPlanGenerator extends Abstr... |
Fix encryption issue when creating new nodes | <?php
namespace Pterodactyl\Services\Nodes;
use Illuminate\Support\Str;
use Pterodactyl\Models\Node;
use Illuminate\Encryption\Encrypter;
use Pterodactyl\Contracts\Repository\NodeRepositoryInterface;
class NodeCreationService
{
/**
* @var \Pterodactyl\Contracts\Repository\NodeRepositoryInterface
*/
... | <?php
namespace Pterodactyl\Services\Nodes;
use Illuminate\Support\Str;
use Pterodactyl\Models\Node;
use Illuminate\Encryption\Encrypter;
use Pterodactyl\Contracts\Repository\NodeRepositoryInterface;
class NodeCreationService
{
/**
* @var \Pterodactyl\Contracts\Repository\NodeRepositoryInterface
*/
... |
Add Secure Info to Domain Index | @extends('layouts.app')
@section('pageTitle', 'Current Domains')
@section('content')
<h1>Current Domains <a class="btn btn-success" href="{{ route('domain.create') }}"><span class="glyphicon glyphicon-plus"></span></a></h1>
<table class="table table-bordered table-responsive">
<thea... | @extends('layouts.app')
@section('pageTitle', 'Current Domains')
@section('content')
<h1>Current Domains <a class="btn btn-success" href="{{ route('domain.create') }}"><span class="glyphicon glyphicon-plus"></span></a></h1>
<table class="table table-bordered table-responsive">
<thea... |
Use new pymongo API in MongoDBStorage | # -*- coding: utf-8 -*-
from werobot.session import SessionStorage
from werobot.utils import json_loads, json_dumps
class MongoDBStorage(SessionStorage):
"""
MongoDBStorage 会把你的 Session 数据储存在一个 MongoDB Collection 中 ::
import pymongo
import werobot
from werobot.session.mongodbstorage ... | # -*- coding: utf-8 -*-
from werobot.session import SessionStorage
from werobot.utils import json_loads, json_dumps
class MongoDBStorage(SessionStorage):
"""
MongoDBStorage 会把你的 Session 数据储存在一个 MongoDB Collection 中 ::
import pymongo
import werobot
from werobot.session.mongodbstorage ... |
Upgrade boto3facade: not setting signature version v4 globally | """Setuptools entrypoint."""
import codecs
import os
from setuptools import setup
from s3keyring import __version__, __author__
dirname = os.path.dirname(__file__)
long_description = (
codecs.open(os.path.join(dirname, "README.rst"), encoding="utf-8").read() + "\n" + # noqa
codecs.open(os.path.join(dirnam... | """Setuptools entrypoint."""
import codecs
import os
from setuptools import setup
from s3keyring import __version__, __author__
dirname = os.path.dirname(__file__)
long_description = (
codecs.open(os.path.join(dirname, "README.rst"), encoding="utf-8").read() + "\n" + # noqa
codecs.open(os.path.join(dirnam... |
fix(form): Update placeholder language in location field to reflect new mouse/tap interaction
Refs conveyal/trimet-mod-otp#131 | import React, { Component } from 'react'
import PropTypes from 'prop-types'
import LocationField from './location-field'
import SwitchButton from './switch-button'
import TabbedFormPanel from './tabbed-form-panel'
export default class DefaultSearchForm extends Component {
static propTypes = {
icons: PropTypes.o... | import React, { Component } from 'react'
import PropTypes from 'prop-types'
import LocationField from './location-field'
import SwitchButton from './switch-button'
import TabbedFormPanel from './tabbed-form-panel'
export default class DefaultSearchForm extends Component {
static propTypes = {
icons: PropTypes.o... |
Fix a bug - tests pass |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from __future__ import division
from __future__ import absolute_import
from __future__ import print_function
from ...trajectories import Trajectories
__all__ = []
class AbstractSolver(object):
"""
Parameters
----------
trajs : :cla... |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from __future__ import division
from __future__ import absolute_import
from __future__ import print_function
from ...trajectories import Trajectories
__all__ = []
class AbstractSolver(object):
"""
Parameters
----------
trajs : :cla... |
Use `id` instead of `lake_guid` for asset import [WEB-1870] | <?php
namespace App\Transformers\Inbound\Collections;
use App\Transformers\Datum;
use App\Transformers\Inbound\CollectionsTransformer;
class Asset extends CollectionsTransformer
{
protected function getIds(Datum $datum)
{
return [
'lake_guid' => $datum->id,
];
}
protect... | <?php
namespace App\Transformers\Inbound\Collections;
use App\Transformers\Datum;
use App\Transformers\Inbound\CollectionsTransformer;
class Asset extends CollectionsTransformer
{
protected function getIds(Datum $datum)
{
return [
'lake_guid' => $datum->lake_guid,
];
}
... |
Modify round-trip test to use new function name.
We've temporarily settled on `fromdap()` for importing from `__distarray__` interfaces. | import unittest
import distarray as da
from distarray.mpi.mpibase import create_comm_of_size, InvalidCommSizeError
class TestDistributedArrayProtocol(unittest.TestCase):
def setUp(self):
try:
comm = create_comm_of_size(4)
except InvalidCommSizeError:
raise unittest.SkipTes... | import unittest
import distarray as da
from distarray.mpi.mpibase import create_comm_of_size, InvalidCommSizeError
class TestDistributedArrayProtocol(unittest.TestCase):
def setUp(self):
try:
comm = create_comm_of_size(4)
except InvalidCommSizeError:
raise unittest.SkipTes... |
Change main thread to support upstart | package org.endeavourhealth.hl7receiver;
import org.endeavourhealth.core.data.config.ConfigManagerException;
import org.endeavourhealth.hl7receiver.hl7.HL7Service;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
public class Main {
private static final String PROGRAM_DISPLAY_NAME = "EDS HL7 receiver";
pri... | package org.endeavourhealth.hl7receiver;
import org.endeavourhealth.core.data.config.ConfigManagerException;
import org.endeavourhealth.hl7receiver.hl7.HL7Service;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
public class Main {
private static final String PROGRAM_DISPLAY_NAME = "EDS HL7 receiver";
pri... |
Make sure config merging takes place | <?php
namespace Laravel\Tinker;
use Illuminate\Foundation\Application as LaravelApplication;
use Illuminate\Support\ServiceProvider;
use Laravel\Lumen\Application as LumenApplication;
use Laravel\Tinker\Console\TinkerCommand;
class TinkerServiceProvider extends ServiceProvider
{
/**
* Indicates if loading o... | <?php
namespace Laravel\Tinker;
use Illuminate\Foundation\Application as LaravelApplication;
use Illuminate\Support\ServiceProvider;
use Laravel\Lumen\Application as LumenApplication;
use Laravel\Tinker\Console\TinkerCommand;
class TinkerServiceProvider extends ServiceProvider
{
/**
* Indicates if loading o... |
Include DB and JoinClause in the template factory generator view | <?= '<?php' ?>
namespace {{$namespace}};
use Chalcedonyt\QueryBuilderTemplate\Templates\Factory\AbstractTemplateFactory;
use DB;
use Illuminate\Database\Query\JoinClause;
class {{$classname}} extends AbstractTemplateFactory
{
@if (count($parameters))
@foreach( $parameters as $param)
/**
* @var {{$param['clas... | <?= '<?php' ?>
namespace {{$namespace}};
use Chalcedonyt\QueryBuilderTemplate\Templates\Factory\AbstractTemplateFactory;
class {{$classname}} extends AbstractTemplateFactory
{
@if (count($parameters))
@foreach( $parameters as $param)
/**
* @var {{$param['class']}}
*/
protected ${{camel_case($param['... |
Tidy up this test - still quite bad & useless. | '''
System tests for `jenkinsapi.jenkins` module.
'''
import re
import time
import unittest
from jenkinsapi_tests.systests.base import BaseSystemTest
from jenkinsapi_tests.systests.job_configs import MATRIX_JOB
from jenkinsapi_tests.test_utils.random_strings import random_string
class TestMatrixJob(BaseSystemTest):
... | '''
System tests for `jenkinsapi.jenkins` module.
'''
import re
import time
import unittest
from jenkinsapi_tests.systests.base import BaseSystemTest
from jenkinsapi_tests.systests.job_configs import MATRIX_JOB
from jenkinsapi_tests.test_utils.random_strings import random_string
class TestMatrixJob(BaseSystemTest):
... |
Change xrange for range for py3 |
# From http://stackoverflow.com/questions/2687173/django-how-can-i-get-a-block-from-a-template
from django.template import Context
from django.template.loader_tags import BlockNode, ExtendsNode
class BlockNotFound(Exception):
pass
def _iter_nodes(template, context, name, block_lookups):
for node in templat... |
# From http://stackoverflow.com/questions/2687173/django-how-can-i-get-a-block-from-a-template
from django.template import Context
from django.template.loader_tags import BlockNode, ExtendsNode
class BlockNotFound(Exception):
pass
def _iter_nodes(template, context, name, block_lookups):
for node in templat... |
Use new jquery jqXHR API. | define([
'jquery'
], function($) {
var Auth = function () {};
Auth.prototype = {
init: function (authconfig) {
navigator.id.watch({
loggedInUser: authconfig.currentUser,
onlogin: function (assertion) {
$.ajax({
... | define([
'jquery'
], function($) {
var Auth = function () {};
Auth.prototype = {
init: function (authconfig) {
navigator.id.watch({
loggedInUser: authconfig.currentUser,
onlogin: function (assertion) {
$.ajax({
... |
Add the possibility to follow or not a symlink | const fs = require('fs')
const util = require('util')
const path = require('path')
class FsUtils {
static get chmod() {
return util.promisify(fs.chmod)
}
static get readFile() {
return util.promisify(fs.readFile)
}
static get symlink() {
return util.promisify(fs.symlink)
}
static get write... | const fs = require('fs')
const util = require('util')
const path = require('path')
class FsUtils {
static get chmod() {
return util.promisify(fs.chmod)
}
static get readFile() {
return util.promisify(fs.readFile)
}
static get symlink() {
return util.promisify(fs.symlink)
}
static get write... |
Fix typo in console message | import React from 'react';
export let IntercomAPI = window.Intercom || function() { console.warn('Intercom not initialized yet') };
export default class Intercom extends React.Component {
static propTypes = {
appID: React.PropTypes.string.isRequired
}
static displayName = 'Intercom'
constructor(props) {... | import React from 'react';
export let IntercomAPI = window.Intercom || function() { console.warn('Intercome not initialized yet') };
export default class Intercom extends React.Component {
static propTypes = {
appID: React.PropTypes.string.isRequired
}
static displayName = 'Intercom'
constructor(props) ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.