text stringlengths 17 1.47k | positive stringlengths 673 4.43k | negative stringlengths 677 2.81k |
|---|---|---|
Fix compilation issue because of latest Forge RB | package org.cyclops.commoncapabilities.core;
import net.minecraftforge.fml.relauncher.ReflectionHelper;
import javax.annotation.Nullable;
import java.lang.reflect.Field;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
/**
* Helper methods.
* @author rubensworks
*/
public class... | package org.cyclops.commoncapabilities.core;
import net.minecraftforge.fml.relauncher.ReflectionHelper;
import javax.annotation.Nullable;
import java.lang.reflect.Field;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
/**
* Helper methods.
* @author rubensworks
*/
public class... |
Work on trailing whitespace in code blocks. | <?php
namespace FluxBB\Markdown\Node;
use FluxBB\Markdown\Common\Collection;
use FluxBB\Markdown\Common\Text;
class CodeBlock extends Block implements NodeInterface, NodeAcceptorInterface
{
/**
* @var Collection
*/
protected $lines;
public function __construct(Text $text)
{
$this... | <?php
namespace FluxBB\Markdown\Node;
use FluxBB\Markdown\Common\Collection;
use FluxBB\Markdown\Common\Text;
class CodeBlock extends Block implements NodeInterface, NodeAcceptorInterface
{
/**
* @var Collection
*/
protected $lines;
public function __construct(Text $text)
{
$this... |
Add @deprecated annotation for getRows() | <?php
namespace PeachySQL;
/**
* Contains rows, affected count, and the query string for a completed SQL query
*/
class SQLResult
{
/**
* An array of rows selected in the query
* @var array
*/
private $rows;
/**
* The number of rows affected by the query
* @var int
*/
... | <?php
namespace PeachySQL;
/**
* Contains rows, affected count, and the query string for a completed SQL query
*/
class SQLResult
{
/**
* An array of rows selected in the query
* @var array
*/
private $rows;
/**
* The number of rows affected by the query
* @var int
*/
... |
[IDS] Fix IDs selector count result | <?php
/*
* This file was delivered to you as part of the Yucca package.
*
* (c) Rémi JANOT <r.janot@gmail.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Yucca\Component\Selector;
class Ids implements SelectorInterf... | <?php
/*
* This file was delivered to you as part of the Yucca package.
*
* (c) Rémi JANOT <r.janot@gmail.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Yucca\Component\Selector;
class Ids implements SelectorInterf... |
Fix syntax error, call authorized function | var app = require('http').createServer(handler),
io = require('socket.io')(app),
socketAuth = require('../lib/socket-handshake-authorization'),
APP_PORT = 8000;
function handler(req, res) {
res.end('Hello World');
};
io.on('connection', function(socket) {
console.log('A new Socket Connected');
... | var app = require('http').createServer(handler),
io = require('socket.io')(app),
socketAuth = require('../lib/socket-handshake-authorization'),
APP_PORT = 8000;
function handler(req, res) {
res.end('Hello World');
};
io.on('connection', function(socket) {
console.log('A new Socket Connected');
... |
Fix when locale is invalid after first guess | <?php
namespace Kunstmaan\LanguageChooserBundle\Controller;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
class LanguageChooserController extends Controller
{
/**
* Handles the language chooser
*
* @return Response the request response
... | <?php
namespace Kunstmaan\LanguageChooserBundle\Controller;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
class LanguageChooserController extends Controller
{
/**
* Handles the language chooser
*
* @return Response the request response
... |
Update reviews model for new added field in 5.5 | import itertools
from django.db import models
import amo
from translations.fields import TranslatedField
from translations.models import Translation
class Review(amo.ModelBase):
version = models.ForeignKey('versions.Version')
user = models.ForeignKey('users.UserProfile')
reply_to = models.ForeignKey('s... | import itertools
from django.db import models
import amo
from translations.fields import TranslatedField
from translations.models import Translation
class Review(amo.ModelBase):
version = models.ForeignKey('versions.Version')
user = models.ForeignKey('users.UserProfile')
reply_to = models.ForeignKey('s... |
Allow meta value to be NULL | <?php
namespace Bolt\Extension\Bolt\Members\Storage\Schema\Table;
use Bolt\Storage\Database\Schema\Table\BaseTable;
/**
* Account meta table.
*
* @author Gawain Lynch <gawain.lynch@gmail.com>
*/
class AccountMeta extends BaseTable
{
/**
* @inheritDoc
*/
protected function addColumns()
{
... | <?php
namespace Bolt\Extension\Bolt\Members\Storage\Schema\Table;
use Bolt\Storage\Database\Schema\Table\BaseTable;
/**
* Account meta table.
*
* @author Gawain Lynch <gawain.lynch@gmail.com>
*/
class AccountMeta extends BaseTable
{
/**
* @inheritDoc
*/
protected function addColumns()
{
... |
Allow embedding groups in groups | import { Immutable } from 'nuclear-js';
import { getters as entityGetters } from '../entity';
const DEFAULT_VIEW_ENTITY_ID = 'group.default_view';
export const currentView = [
'currentView',
];
export const views = [
entityGetters.entityMap,
entities => entities.filter(entity => entity.domain === 'group' &&
... | import { Immutable } from 'nuclear-js';
import { getters as entityGetters } from '../entity';
const DEFAULT_VIEW_ENTITY_ID = 'group.default_view';
export const currentView = [
'currentView',
];
export const views = [
entityGetters.entityMap,
entities => entities.filter(entity => entity.domain === 'group' &&
... |
Fix problem with Python 2 to 3 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import argparse
import gettext
import eventlet
import os
from stand.socketio_events import StandSocketIO
locales_path = os.path.join(os.path.dirname(__file__), '..', 'i18n', 'locales')
if __name__ == '__main__':
parser = argparse.ArgumentParser()
parser.add_argu... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import argparse
import gettext
import eventlet
import os
from stand.socketio_events import StandSocketIO
locales_path = os.path.join(os.path.dirname(__file__), '..', 'i18n', 'locales')
if __name__ == '__main__':
parser = argparse.ArgumentParser()
parser.add_argu... |
Add icalendar stragegy to service manager | <?php
/**
*
* Spork Zend Framework 2 Library
*
* @author Chris Schreiber <chris@sporkcode.com>
*/
return array(
'service_manager' => array(
'abstract_factories' => array(),
'aliases' => array(),
'factories' => array(
'cssLess' => 'Spork\CSS\Less',
'cssSass' => ... | <?php
/**
*
* Spork Zend Framework 2 Library
*
* @author Chris Schreiber <chris@sporkcode.com>
*/
return array(
'service_manager' => array(
'abstract_factories' => array(),
'aliases' => array(),
'factories' => array(
'cssLess' => 'Spork\CSS\Less',
'cssSass' => ... |
Check element before get an innerHTML | /*!
Copyright (C) 2017 Google Inc.
Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file>
*/
(function(can) {
can.extend(can.Control.prototype, {
// Returns a function which will be halted unless `this.element` exists
// - useful for callbacks which depend on the controller's ... | /*!
Copyright (C) 2017 Google Inc.
Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file>
*/
(function(can) {
can.extend(can.Control.prototype, {
// Returns a function which will be halted unless `this.element` exists
// - useful for callbacks which depend on the controller's ... |
Edit view pre-populates with data from user object | from django.shortcuts import render_to_response
from django.contrib.auth.decorators import login_required
from django.template.context import RequestContext
#from google.appengine.ext import db
from july.people.models import Commit
from gae_django.auth.models import User
from django.http import Http404, HttpResponseRed... | from django.shortcuts import render_to_response
from django.contrib.auth.decorators import login_required
from django.template.context import RequestContext
#from google.appengine.ext import db
from july.people.models import Commit
from gae_django.auth.models import User
from django.http import Http404, HttpResponseRed... |
Fix lecturer lecture page being accessible to everyone | (function() {
'use strict';
angular
.module('lecturer')
.config(config);
/* ngInject */
function config($routeProvider, $httpProvider) {
console.log('Ready (Providers)');
$routeProvider
.when('/', {
templateUrl: 'app/login/login.... | (function() {
'use strict';
angular
.module('lecturer')
.config(config);
/* ngInject */
function config($routeProvider, $httpProvider) {
console.log('Ready (Providers)');
$routeProvider
.when('/', {
templateUrl: 'app/login/login.... |
Allow custom theme lib directories using .libcfg | <?php
namespace CupOfTea\WordPress\Foundation\Bootstrap;
use Illuminate\Support\Str;
use Illuminate\Contracts\Container\Container;
class RegisterThemeAutoloader
{
/**
* Bootstrap the given application.
*
* @param \Illuminate\Contracts\Foundation\Application $app
* @return void
*/
p... | <?php
namespace CupOfTea\WordPress\Foundation\Bootstrap;
use Illuminate\Support\Str;
use Illuminate\Contracts\Container\Container;
class RegisterThemeAutoloader
{
/**
* Bootstrap the given application.
*
* @param \Illuminate\Contracts\Foundation\Application $app
* @return void
*/
p... |
Fix where from query builder | <?php
namespace App\Validators;
use Valitron\Validator;
use Illuminate\Database\Capsule\Manager as DB;
abstract class AbstractValidator
{
protected $validator;
public function __construct(Validator $validator)
{
$this->addCustomRules();
$this->validator = $validator;
}
abstract ... | <?php
namespace App\Validators;
use Valitron\Validator;
use Illuminate\Database\Capsule\Manager as DB;
abstract class AbstractValidator
{
protected $validator;
public function __construct(Validator $validator)
{
$this->addCustomRules();
$this->validator = $validator;
}
abstract ... |
Allow "Magic Home" to be hidden
Summary: Ref T12174. Fallback behavior on this already appears to be sensible.
Test Plan:
- Hid "Magic Home".
- Viewed homepage with no dashboards on the menu.
- Saw "Magic Home" content, with no item in the menu selected, which seems reasonable.
{F2557022}
Reviewers: chad
Rev... | <?php
final class PhabricatorHomeProfileMenuItem
extends PhabricatorProfileMenuItem {
const MENUITEMKEY = 'home.dashboard';
public function getMenuItemTypeName() {
return pht('Home');
}
private function getDefaultName() {
return pht('Home');
}
public function canMakeDefault(
PhabricatorPr... | <?php
final class PhabricatorHomeProfileMenuItem
extends PhabricatorProfileMenuItem {
const MENUITEMKEY = 'home.dashboard';
public function getMenuItemTypeName() {
return pht('Home');
}
private function getDefaultName() {
return pht('Home');
}
public function canHideMenuItem(
PhabricatorP... |
Simplify client, remove unneeded init method | <?php
namespace React\Whois;
use React\Async\Util as Async;
use React\Curry\Util as Curry;
use React\Dns\Resolver\Resolver;
class Client
{
private $resolver;
private $connFactory;
public function __construct(Resolver $resolver, $connFactory)
{
$this->resolver = $resolver;
$this->conn... | <?php
namespace React\Whois;
use React\Async\Util as Async;
use React\Curry\Util as Curry;
use React\Dns\Resolver\Resolver;
class Client
{
private $resolver;
private $connFactory;
public function __construct(Resolver $resolver, $connFactory)
{
$this->resolver = $resolver;
$this->conn... |
Add flow to PlayerSelect and clean up | /* @flow */
import React, { Component } from 'react';
import {
Text,
View,
ScrollView,
Image,
Alert
} from 'react-native';
import MyButton from '../../../MyButton';
import Input from '../../../Input';
import List from '../../../List';
export class PlayerSelect extends Component {
static navigationOptions ... | import React, { Component } from 'react';
import {
StyleSheet,
Text,
View,
ScrollView,
Image,
Alert
} from 'react-native';
import MyButton from '../../../MyButton';
import Input from '../../../Input';
import List from '../../../List';
export class PlayerSelect extends Component {
static navigationOptions... |
Fix for test (add mock for CommCareUser) | from datetime import date
from unittest import TestCase
from mock import patch
from corehq.apps.users.models import CommCareUser
from couchforms.models import XFormInstance
from ..constants import *
from ..reports import get_report, BeneficiaryPaymentReport, MetReport
from .case_reports import Report, OPMCase, MockCas... | from datetime import date
from unittest import TestCase
from couchforms.models import XFormInstance
from ..constants import *
from ..reports import get_report, BeneficiaryPaymentReport, MetReport
from .case_reports import Report, OPMCase, MockCaseRow, MockDataProvider
class TestGetReportUtil(TestCase):
def get_... |
Use constants for model configuration | <?php
/**
* This class manages content in the "nails_comment" table.
*
* @package Nails
* @subpackage module-comment
* @category Model
* @author Nails Dev Team
* @link https://docs.nailsapp.co.uk/modules/other/comment
*/
namespace Nails\Comment\Model;
use Nails\Comment\Constants;
use Nail... | <?php
/**
* This class manages content in the "nails_comment" table.
*
* @package Nails
* @subpackage module-comment
* @category Model
* @author Nails Dev Team
* @link https://docs.nailsapp.co.uk/modules/other/comment
*/
namespace Nails\Comment\Model;
use Nails\Comment\Constants;
use Nail... |
Remove route inclusion from service provider | <?php
namespace Sztyup\Authsch;
use Illuminate\Contracts\Container\Container;
use Illuminate\Contracts\Routing\UrlGenerator;
use Illuminate\Support\ServiceProvider;
class AuthschServiceProvider extends ServiceProvider
{
public function register()
{
$this->mergeConfigFrom(
__DIR__.'/../con... | <?php
namespace Sztyup\Authsch;
use Illuminate\Contracts\Container\Container;
use Illuminate\Contracts\Routing\UrlGenerator;
use Illuminate\Support\ServiceProvider;
class AuthschServiceProvider extends ServiceProvider
{
public function register()
{
$this->loadRoutesFrom(__DIR__ . '/../routes/routes.p... |
:bug: Fix Sass syntax final newline rule bug | 'use strict';
var helpers = require('../helpers'),
os = require('os');
module.exports = {
'name': 'final-newline',
'defaults': {
'include': true
},
'detect': function (ast, parser) {
var result = [],
last = ast.content[ast.content.length - 1],
error = {
'ruleId': parser.r... | 'use strict';
var helpers = require('../helpers'),
os = require('os');
module.exports = {
'name': 'final-newline',
'defaults': {
'include': true
},
'detect': function (ast, parser) {
var result = [],
last = ast.content[ast.content.length - 1],
error = {
'ruleId': parser.r... |
Add mock to test extras | from setuptools import setup, find_packages
# Parse the version from the mapbox module.
with open('mapboxcli/__init__.py') as f:
for line in f:
if line.find("__version__") >= 0:
version = line.split("=")[1].strip()
version = version.strip('"')
version = version.strip("'... | from setuptools import setup, find_packages
# Parse the version from the mapbox module.
with open('mapboxcli/__init__.py') as f:
for line in f:
if line.find("__version__") >= 0:
version = line.split("=")[1].strip()
version = version.strip('"')
version = version.strip("'... |
Put classes into config file | <?php
/**
* Config for the connections for the test
*/
return [
'mysql' => [
'type' => 'mysql',
'host' => 'localhost',
'database' => 'sample_database',
'user' => 'sample_user',
'password' => 'sample_password',
'charset' => 'utf8',
'options' =>... | <?php
/**
* Config for the connections for the test
*/
return [
'mysql' => [
'type' => 'mysql',
'host' => 'localhost',
'database' => 'sample_database',
'user' => 'sample_user',
'password' => 'sample_password',
'charset' => 'utf8',
'options' =>... |
FIX matplotlib backend problem in cli tests | """Test neuropycon command line interface"""
# Authors: Dmitrii Altukhov <daltuhov@hse.ru>
#
# License: BSD (3-clause)
import matplotlib # noqa
matplotlib.use('Agg') # noqa; for testing don't use X server
import os
import os.path as op
from ephypype.commands import neuropycon
from click.testing import CliRunner
d... | """Test neuropycon command line interface"""
# Authors: Dmitrii Altukhov <daltuhov@hse.ru>
#
# License: BSD (3-clause)
import os
import os.path as op
from ephypype.commands import neuropycon
from click.testing import CliRunner
def test_input_linear():
"""Test input node with Linear plugin (serial workflow execu... |
Add source map support to CSS | const path = require("path");
const merge = require("webpack-merge");
const webpack = require("webpack");
const common = require("./webpack.common.js");
const postCSSPlugins = [
require("postcss-easy-import")({ prefix: "_" }),
require("postcss-mixins"),
require("postcss-simple-vars"),
require("postcss-nested")... | const path = require("path");
const merge = require("webpack-merge");
const webpack = require("webpack");
const common = require("./webpack.common.js");
const postCSSPlugins = [
require("postcss-easy-import")({ prefix: "_" }),
require("postcss-mixins"),
require("postcss-simple-vars"),
require("postcss-nested")... |
Deal with optional methods too | import {VueComponentFactory} from "./vueComponentFactory";
class VueFrameworkComponentWrapper {
constructor(parent) {
this._parent = parent;
}
wrap(component, methodList, optionalMethods) {
let componentType = VueComponentFactory.getComponentType(this._parent, component);
if (!comp... | import {VueComponentFactory} from "./vueComponentFactory";
class VueFrameworkComponentWrapper {
constructor(parent) {
this._parent = parent;
}
wrap(component, methodList) {
let componentType = VueComponentFactory.getComponentType(this._parent, component);
if (!componentType) {
... |
Add test for list display | var $ = require("jquery");
var List = require("../");
describe('List', function() {
describe('count', function() {
it('should return correct count (without filter)', function() {
var l = new List();
l.collection.reset([
{
'test': 1
... | var List = require("../");
describe('List', function() {
describe('count', function() {
it('should return correct count (without filter)', function() {
var l = new List();
l.collection.reset([
{
'test': 1
},
{
... |
Update benchmarks to Pyton 3. | import re
import urllib.parse
import random
import unittest
from funkload.FunkLoadTestCase import FunkLoadTestCase
class Benchmark(FunkLoadTestCase):
"""This test uses a configuration file Benchmark.conf."""
def setUp(self):
self.server_url = self.conf_get('main', 'url')
def test_simple(self):
... | import re
import urllib
import random
import unittest
from funkload.FunkLoadTestCase import FunkLoadTestCase
class Benchmark(FunkLoadTestCase):
"""This test uses a configuration file Benchmark.conf."""
def setUp(self):
self.server_url = self.conf_get('main', 'url')
def test_simple(self):
... |
Fix spelling error with shutdown | 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) ... | 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) ... |
Use LIMIT_CHARA_LENGTH instead of Magic number | import React, {Component} from 'react'
import {keyStringDetector} from '../registories/registory'
import Tweet from '../../domain/models/Tweet'
export default class Editor extends Component {
constructor(props) {
super(props);
this.state = this.initialState();
}
initialState() {
r... | import React, {Component} from 'react'
import {keyStringDetector} from '../registories/registory'
export default class Editor extends Component {
constructor(props) {
super(props);
this.state = this.initialState();
}
initialState() {
return {text: ''};
}
getRestTextLength... |
Allow a controller to accept non-json data by setting route attribute | <?php
/*
* This file is part of Contao Manager.
*
* (c) Contao Association
*
* @license LGPL-3.0-or-later
*/
namespace Contao\ManagerApi\EventListener;
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
use Symfony\Component\HttpKernel\Event\KernelEvent;
use Symfony\Component\HttpKernel\Exception\... | <?php
/*
* This file is part of Contao Manager.
*
* (c) Contao Association
*
* @license LGPL-3.0-or-later
*/
namespace Contao\ManagerApi\EventListener;
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
use Symfony\Component\HttpKernel\Event\KernelEvent;
use Symfony\Component\HttpKernel\Exception\... |
RESOLVE an error with undefined index | <?php
namespace rrsoacis\component\setting\cluster;
use rrsoacis\manager\ClusterManager;
use ZipArchive;
use rrsoacis\component\common\AbstractController;
use rrsoacis\manager\MapManager;
use rrsoacis\system\Config;
class SettingsClusterUpdateController extends AbstractController
{
public function post()
{
... | <?php
namespace rrsoacis\component\setting\cluster;
use rrsoacis\manager\ClusterManager;
use ZipArchive;
use rrsoacis\component\common\AbstractController;
use rrsoacis\manager\MapManager;
use rrsoacis\system\Config;
class SettingsClusterUpdateController extends AbstractController
{
public function post()
{
... |
Fix rolling over history and write unit test to prevent future bugs | package com.github.games647.lagmonitor;
public class RollingOverHistory {
private final float[] samples;
private float total;
private int currentPosition = 0;
private int currentSize = 1;
public RollingOverHistory(int size, float firstValue) {
this.samples = new float[size];
samp... | package com.github.games647.lagmonitor;
public class RollingOverHistory {
private final float[] samples;
private float total;
private int currentPosition = 1;
private int currentSize = 1;
public RollingOverHistory(int size, float firstValue) {
this.samples = new float[size];
samp... |
Add clearTitleSegments method to seo helper | <?php
namespace Concrete\Core\Html\Service;
class Seo
{
private $siteName = '';
private $titleSegments = array();
private $titleSegmentSeparator = ' :: ';
private $titleFormat = '%1$s :: %2$s';
private $hasCustomTitle = false;
public function setSiteName($name)
{
$this->siteName = ... | <?php
namespace Concrete\Core\Html\Service;
class Seo
{
private $siteName = '';
private $titleSegments = array();
private $titleSegmentSeparator = ' :: ';
private $titleFormat = '%1$s :: %2$s';
private $hasCustomTitle = false;
public function setSiteName($name)
{
$this->siteName = ... |
Send the latest logs by ordering logs descending | <?php
namespace A3020\Centry\Log;
use A3020\Centry\Payload\PayloadAbstract;
use Concrete\Core\Config\Repository\Repository;
use Concrete\Core\Database\Connection\Connection;
final class Payload extends PayloadAbstract
{
/** @var Connection */
private $db;
/** @var Repository */
private $config;
... | <?php
namespace A3020\Centry\Log;
use A3020\Centry\Payload\PayloadAbstract;
use Concrete\Core\Config\Repository\Repository;
use Concrete\Core\Database\Connection\Connection;
final class Payload extends PayloadAbstract
{
/** @var Connection */
private $db;
/** @var Repository */
private $config;
... |
Fix migration file for Python 3.2 (and PEP8) | # encoding: utf8
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
]
operations = [
migrations.CreateModel(
name='Email',
fields=[
('id', models.AutoField(verbose_name='ID', serialize=False,
... | # encoding: utf8
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
]
operations = [
migrations.CreateModel(
name='Email',
fields=[
(u'id', models.AutoField(verbose_name=u'ID', serialize=False, auto_created=Tru... |
Fix error in top navigation not being able to find about us section | (function() {
'use strict';
angular
.module('app.layout')
.directive('pvTopNav', pvTopNav);
/* @ngInject */
function pvTopNav () {
var directive = {
bindToController: true,
controller: TopNavController,
controllerAs: 'vm',
restric... | (function() {
'use strict';
angular
.module('app.layout')
.directive('pvTopNav', pvTopNav);
/* @ngInject */
function pvTopNav () {
var directive = {
bindToController: true,
controller: TopNavController,
controllerAs: 'vm',
restric... |
Make InstanceLaunchFooter functionally disabled instead of just visually | import React from 'react';
export default React.createClass({
propTypes: {
backIsDisabled: React.PropTypes.bool.isRequired,
launchIsDisabled: React.PropTypes.bool.isRequired,
advancedIsDisabled: React.PropTypes.bool.isRequired,
viewAdvanced: React.PropTypes.func,
onSubmitLau... | import React from 'react';
export default React.createClass({
propTypes: {
backIsDisabled: React.PropTypes.bool.isRequired,
launchIsDisabled: React.PropTypes.bool.isRequired,
advancedIsDisabled: React.PropTypes.bool.isRequired,
viewAdvanced: React.PropTypes.func,
onSubmitLau... |
Fix typo in upgrade script
git-svn-id: f68c6b3b1dcd5d00a2560c384475aaef3bc99487@1647 af82e41b-90c4-0310-8c96-b1721e28e2e2 | import os.path
import shutil
sql = """
-- Remove empty values from the milestone list
DELETE FROM milestone WHERE COALESCE(name,'')='';
-- Add a description column to the version table, and remove unnamed versions
CREATE TEMP TABLE version_old AS SELECT * FROM version;
DROP TABLE version;
CREATE TABLE version (
... | import os.path
import shutil
sql = """
-- Remove empty values from the milestone list
DELETE FROM milestone WHERE COALESCE(name,'')='';
-- Add a description column to the version table, and remove unnamed versions
CREATE TEMP TABLE version_old AS SELECT * FROM version;
DROP TABLE version;
CREATE TABLE version (
... |
Load table schema automatically instead of stubbing out | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2011 OpenStack LLC.
#
# 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
#
... | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2011 OpenStack LLC.
#
# 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
#
... |
Add new line print to clearScreen() | import java.util.Scanner;
public class Main {
public static void main(String[] args) {
printTitle();
titleWait();
System.out.println("You wake up on a beach.");
}
private static void printTitle() {
String banner = "___________ .__ ___________ __ \n"... | import java.util.Scanner;
public class Main {
public static void main(String[] args) {
printTitle();
titleWait();
System.out.println("You wake up on a beach.");
}
private static void printTitle() {
String banner = "___________ .__ ___________ __ \n"... |
Refactor the repository generator so we can reuse its methods | <?php
namespace ModuleGenerator\CLI\Console\Generate\Domain;
use ModuleGenerator\CLI\Console\GenerateCommand;
use ModuleGenerator\Domain\Repository\Repository as RepositoryClass;
use ModuleGenerator\Domain\Repository\RepositoryType;
use ModuleGenerator\Module\Backend\Resources\Config\Repositories\Repositories;
use Mo... | <?php
namespace ModuleGenerator\CLI\Console\Generate\Domain;
use ModuleGenerator\CLI\Console\GenerateCommand;
use ModuleGenerator\Domain\Repository\Repository as RepositoryClass;
use ModuleGenerator\Domain\Repository\RepositoryType;
use ModuleGenerator\Module\Backend\Resources\Config\Repositories\Repositories;
use Mo... |
Change 9gag collector longpost detector | import time
import feedparser
from bs4 import BeautifulSoup
import boto3
from PIL import Image
import requests
import logging
NINEGAG_RSS_URL = 'http://www.15minutesoffame.be/9gag/rss/9GAG_-_Trending.atom'
def main():
feed = feedparser.parse(NINEGAG_RSS_URL)['items']
table = boto3.resource('dynamodb', 'eu-w... | import time
import feedparser
from bs4 import BeautifulSoup
import boto3
from PIL import Image
import requests
import logging
NINEGAG_RSS_URL = 'http://www.15minutesoffame.be/9gag/rss/9GAG_-_Trending.atom'
def main():
feed = feedparser.parse(NINEGAG_RSS_URL)['items']
table = boto3.resource('dynamodb', 'eu-w... |
Fix ‘TypeError: Object [object Object] has no method 'addError'’ | /**
* Type
*/
var typeConstructor = function typeConstructor() {
/**
* Types
*/
var types = {
'string': isString,
'number': isNumber,
'function': isFunction,
'boolean': isBoolean,
'object': isObject,
'array': isArray,
'integer': isInteger,
'int': isInteger,
'null': isNul... | /**
* Type
*/
var typeConstructor = function typeConstructor() {
/**
* Types
*/
var types = {
'string': isString,
'number': isNumber,
'function': isFunction,
'boolean': isBoolean,
'object': isObject,
'array': isArray,
'integer': isInteger,
'int': isInteger,
'null': isNul... |
Rename F to Function and f() to apply() | package cells;
import com.jme3.math.ColorRGBA;
import geometry.Position;
import inventory.InventoryItem;
import world.World;
/**
* A cell whose state is known for any given tick
*/
public enum AnimatedCell implements InventoryItem, WorldCell {
OSCILLATOR("Oscillator", (tick) -> {
if (tick % 2 == 0) {
... | package cells;
import com.jme3.math.ColorRGBA;
import geometry.Position;
import inventory.InventoryItem;
import world.World;
/**
* A cell whose state is known for any given tick
*/
public enum AnimatedCell implements InventoryItem, WorldCell {
OSCILLATOR("Oscillator", (tick) -> {
if (tick % 2 == 0) {
... |
Use narrower rows for table | <!-- resources/views/testequipment/show_cal_dates.blade.php -->
@extends('layouts.app')
@section('content')
<h2>Recent Test Equipment Calibration Dates</h2>
<table class="table table-striped table-hover table-sm">
<thead>
<tr>
<th scope="col">ID</th>
<th scope="col">Manufacturer</th>
<th scope="col"... | <!-- resources/views/testequipment/show_cal_dates.blade.php -->
@extends('layouts.app')
@section('content')
<h2>Recent Test Equipment Calibration Dates</h2>
<table class="table table-striped table-hover">
<thead>
<tr>
<th>ID</th>
<th>Manufacturer</th>
<th>Model</th>
<th>SN</th>
<th>Description</th>
... |
Change dict-comprehension for python 2.6 compatibility. | from celery.app import default_app
from celery.app import defaults
def clean_quoted_config(config, key):
# ini doesn't allow quoting, but lets support it to fit with celery
config[key] = config[key].replace('"', '')
TYPES_TO_OBJ = {
'any': (object, None),
'bool': (bool, defaults.str_to_bool),
'di... | from celery.app import default_app
from celery.app import defaults
def clean_quoted_config(config, key):
# ini doesn't allow quoting, but lets support it to fit with celery
config[key] = config[key].replace('"', '')
TYPES_TO_OBJ = {
'any': (object, None),
'bool': (bool, defaults.str_to_bool),
'di... |
Handle 404 on local server | const rewrite = require('connect-modrewrite');
const serveIndex = require('serve-index');
const serveStatic = require('serve-static');
module.exports = function (grunt) {
return {
livereload: {
options: {
hostname : '127.0.0.1',
port : 443,
... | const rewrite = require('connect-modrewrite');
const serveIndex = require('serve-index');
const serveStatic = require('serve-static');
module.exports = function (grunt) {
return {
livereload: {
options: {
hostname : '127.0.0.1',
port : 443,
... |
Fix stability option in config | <?php
namespace Che\BuildGuild;
use Che\BuildGuild\Installer\GuildInstaller;
use Che\BuildGuild\Installer\ScriptRunner;
use Che\BuildGuild\Util\Environment;
use Composer\Config;
use Composer\Downloader\DownloadManager;
use Composer\Downloader;
use Composer\Json\JsonFile;
use Composer\Repository\ComposerRepository;
us... | <?php
namespace Che\BuildGuild;
use Che\BuildGuild\Installer\GuildInstaller;
use Che\BuildGuild\Installer\ScriptRunner;
use Che\BuildGuild\Util\Environment;
use Composer\Config;
use Composer\Downloader\DownloadManager;
use Composer\Downloader;
use Composer\Json\JsonFile;
use Composer\Repository\ComposerRepository;
us... |
fix: Correct text-anchor to textAnchor property | 'use strict';
import React, { Component } from 'react';
const DPCLogo = () => (
<svg
width="570px"
height="275px"
style={{
background: 'rgba(79, 152, 201, 0.75)',
letterSpacing: '3px'
}}>
<text
x="50%"
y="52.5%"
textAnchor="middle"
style={{
font: 'bold ... | 'use strict';
import React, { Component } from 'react';
const DPCLogo = () => (
<svg
width="570px"
height="275px"
style={{
background: 'rgba(79, 152, 201, 0.75)',
letterSpacing: '3px'
}}>
<text
x="50%"
y="52.5%"
text-anchor="middle"
style={{
font: 'bold... |
refactor: Use spread operator to copy notification | const notifications = {
namespaced: true,
state: {
isFetching: false,
isErrored: false,
error: [],
notifications: []
},
computed: {},
getters: {},
mutations: {
setNotifications (state, notifications) {
state.notifications = notifications;
state.isFetching = false;
stat... | const notifications = {
namespaced: true,
state: {
isFetching: false,
isErrored: false,
error: [],
notifications: []
},
computed: {},
getters: {},
mutations: {
setNotifications (state, notifications) {
state.notifications = notifications;
state.isFetching = false;
stat... |
Remove the whitespace in the render method of the ProgressStep component | import React, { PureComponent } from 'react';
import PropTypes from 'prop-types';
import cx from 'classnames';
import theme from './theme.css';
import Box from '../box';
import ProgressStep from './ProgressStep';
class ProgressTracker extends PureComponent {
render() {
const { color, children, currentStep, allS... | import React, { PureComponent } from 'react';
import PropTypes from 'prop-types';
import cx from 'classnames';
import theme from './theme.css';
import Box from '../box';
import ProgressStep from './ProgressStep';
class ProgressTracker extends PureComponent {
render() {
const { color, children, currentStep, allS... |
Fix the path for sort partition list file | package io.dongyue.at15.tree.indexer.mapreduce.sort;
import io.dongyue.at15.tree.indexer.mapreduce.Config;
/**
* Created by at15 on 16-1-1.
*
* @TODO test
*/
public class SortConfig implements Config {
private String input;
private String output;
private String partition;
private String meta;
... | package io.dongyue.at15.tree.indexer.mapreduce.sort;
import io.dongyue.at15.tree.indexer.mapreduce.Config;
/**
* Created by at15 on 16-1-1.
*
* @TODO test
*/
public class SortConfig implements Config {
private String input;
private String output;
private String partition;
private String meta;
... |
Set min value to text field. | import React, { Component } from 'react';
import TextField from 'material-ui/TextField';
import Card, { CardActions, CardContent } from 'material-ui/Card';
import Button from 'material-ui/Button';
import TaxCalculator from '../libs/TaxCalculator';
class TextFields extends Component {
state = {
income: 0,
ex... | import React, { Component } from 'react';
import TextField from 'material-ui/TextField';
import Card, { CardActions, CardContent } from 'material-ui/Card';
import Button from 'material-ui/Button';
import TaxCalculator from '../libs/TaxCalculator';
class TextFields extends Component {
state = {
income: 0,
ex... |
Add redirect route from root to setup | import React, { Component } from 'react'
import { Router, Route, Redirect, hashHistory } from 'react-router'
import './App.css'
import Setup from './Setup'
import SetupWelcome from './SetupWelcome'
import SetupWifiPassword from './SetupWifiPassword'
import SetupWifiSelection from './SetupWifiSelecti... | import React, { Component } from 'react'
import { Router, Route, hashHistory } from 'react-router'
import './App.css'
import Setup from './Setup'
import SetupWelcome from './SetupWelcome'
import SetupWifiPassword from './SetupWifiPassword'
import SetupWifiSelection from './SetupWifiSelection'
import... |
Fix mistake printing wrong HTTP proto | package pewpew
import (
"net/http"
"net/http/httputil"
"time"
)
func runRequest(req http.Request, client *http.Client) (response *http.Response, stat RequestStat) {
reqStartTime := time.Now()
response, responseErr := (*client).Do(&req)
reqEndTime := time.Now()
if responseErr != nil {
stat = RequestStat{
... | package pewpew
import (
"net/http"
"net/http/httputil"
"time"
)
func runRequest(req http.Request, client *http.Client) (response *http.Response, stat RequestStat) {
reqStartTime := time.Now()
response, responseErr := (*client).Do(&req)
reqEndTime := time.Now()
if responseErr != nil {
stat = RequestStat{
... |
Remove `width` and `height` from image service import [WEB-1908] | <?php
namespace App\Console\Commands\Import;
use App\Models\Collections\Image;
class ImportImages extends AbstractImportCommand
{
protected $signature = 'import:images
{page? : Page to begin importing from}';
protected $description = 'Import all image data from data-service-imag... | <?php
namespace App\Console\Commands\Import;
use App\Models\Collections\Image;
class ImportImages extends AbstractImportCommand
{
protected $signature = 'import:images
{page? : Page to begin importing from}';
protected $description = 'Import all image data from data-service-imag... |
Fix ordering bug in NGO edit
Fix issue #126 | class CmsNgosListController{
constructor(NgoService, $filter, $state, DialogService){
'ngInject';
var vm = this;
this.$filter = $filter;
this.$state = $state;
this.DialogService = DialogService;
this.NgoService = NgoService;
this.listOrderByColumn = '-organisa... | class CmsNgosListController{
constructor(NgoService, $filter, $state, DialogService){
'ngInject';
var vm = this;
this.$filter = $filter;
this.$state = $state;
this.DialogService = DialogService;
this.NgoService = NgoService;
this.NgoService.fetchAll().then(fun... |
Use Array.from instead of Array.prototype | chrome.storage.local.get(['pattern', 'case_insensitive', 'color', 'opacity'], function(items) {
var pattern, case_insensitive, color, opacity;
var re, flags;
pattern = items.pattern;
if (!pattern) {
pattern = 'WIP';
}
case_insensitive = !!items.case_insensitive;
if (case_insensitive) {
flags = '... | chrome.storage.local.get(['pattern', 'case_insensitive', 'color', 'opacity'], function(items) {
var pattern, case_insensitive, color, opacity;
var re, flags;
pattern = items.pattern;
if (!pattern) {
pattern = 'WIP';
}
case_insensitive = !!items.case_insensitive;
if (case_insensitive) {
flags = '... |
Change behaviour of onShow / onHide for community video
- set whole html as data | Kwf.onJElementReady('.kwcAdvancedCommunityVideo', function(el, config) {
el.data('config', config);
}, {priority: -1});
Kwf.onJElementWidthChange('.kwcAdvancedCommunityVideo', function(el, config) {
var config = el.data('config');
var iframe = el.find('iframe');
if(config.fullWidth) {
var siz... | Kwf.onJElementReady('.kwcAdvancedCommunityVideo', function(el, config) {
el.data('config', config);
}, {priority: -1});
Kwf.onJElementWidthChange('.kwcAdvancedCommunityVideo', function(el, config) {
var config = el.data('config');
var iframe = el.find('iframe');
if(config.fullWidth) {
var siz... |
Fix bug when locale isn't English. | /**
* @copyright Copyright (c) 2012-2015 2amigOS! Consulting Group LLC
* @link http://2amigos.us
* @license http://www.opensource.org/licenses/bsd-license.php New BSD License
*/
if (typeof dosamigos == "undefined" || !dosamigos) {
var dosamigos = {};
}
dosamigos.ckEditorWidget = (function ($) {
var pub = ... | /**
* @copyright Copyright (c) 2012-2015 2amigOS! Consulting Group LLC
* @link http://2amigos.us
* @license http://www.opensource.org/licenses/bsd-license.php New BSD License
*/
if (typeof dosamigos == "undefined" || !dosamigos) {
var dosamigos = {};
}
dosamigos.ckEditorWidget = (function ($) {
var pub = ... |
Add pubsub dependency for tests | from setuptools import setup, find_packages
import sys, os
here = os.path.abspath(os.path.dirname(__file__))
try:
README = open(os.path.join(here, 'README.rst')).read()
except IOError:
README = ''
version = "0.0.1"
setup(name='tgext.socketio',
version=version,
description="SocketIO support for Tu... | from setuptools import setup, find_packages
import sys, os
here = os.path.abspath(os.path.dirname(__file__))
try:
README = open(os.path.join(here, 'README.rst')).read()
except IOError:
README = ''
version = "0.0.1"
setup(name='tgext.socketio',
version=version,
description="SocketIO support for Tu... |
Add blank line after use | <?php
namespace ClientBundle\Validator\Constraints;
use Symfony\Component\Validator\ConstraintValidator;
use Symfony\Component\Validator\Constraint;
use Doctrine\ORM\EntityRepository;
/**
* Class ContainsCheckHaveAllContactTypesValidator
*/
class ContainsCheckHaveAllContactTypesValidator extends ConstraintValidato... | <?php
namespace ClientBundle\Validator\Constraints;
use Symfony\Component\Validator\ConstraintValidator;
use Symfony\Component\Validator\Constraint;
use Doctrine\ORM\EntityRepository;
/**
* Class ContainsCheckHaveAllContactTypesValidator
*/
class ContainsCheckHaveAllContactTypesValidator extends ConstraintValidator... |
Include shortcode for Google Translate plugin. | <?php
/**
* The main template file.
*
*/
get_header(); ?>
<div class="page-content">
<div class="wrapper">
<div style="float: left; width: 200px;">
<?php get_sidebar(); ?>
</div>
<div style="float: right; width: 600px; text-align: left;">
<script src="//platform.linkedin.com/in.j... | <?php
/**
* The main template file.
*
*/
get_header(); ?>
<div class="page-content">
<div class="wrapper">
<div style="float: left; width: 200px;">
<?php get_sidebar(); ?>
</div>
<div style="float: right; width: 600px; text-align: left;">
<script src="//platform.linkedin.com/in.j... |
Add ability to pass autoNumeric config object to the decorator function | Ractive.decorators.autoNumeric = function (node, relativeKeypath, boundValue, autoNumericCfg) {
var self = this,
$el = $(node),
context = self.getContext(node),
updateModel = function () {
context.set(relativeKeypath, $el.autoNumeric('getNumber'));
};
if (typeof rela... | Ractive.decorators.autoNumeric = function (node, relativeKeypath, boundValue) {
var self = this,
$el = $(node),
context = self.getContext(node),
updateModel = function () {
context.set(relativeKeypath, $el.autoNumeric('getNumber'));
};
if (typeof relativeKeypath !== ... |
Add atlas as an argument for mesh initialisation. | from atlases import BoxAtlas
class RectangularMesh(object):
def __init__(self, atlas, d, meshname='mesh'):
if not isinstance(d, (tuple, list)) or len(d) != 3:
raise ValueError('Cellsize d must be a tuple of length 3.')
elif d[0] <= 0 or d[1] <= 0 or d[2] <= 0:
raise ValueEr... | class RectangularMesh(object):
def __init__(self, d, atlas='atlas', meshname='mesh'):
if not isinstance(d, (tuple, list)) or len(d) != 3:
raise ValueError('Cellsize d must be a tuple of length 3.')
elif d[0] <= 0 or d[1] <= 0 or d[2] <= 0:
raise ValueError('Cellsize dimension... |
[MOD] Use browse record instead of ids | # -*- encoding: utf-8 -*-
##############################################################################
# For copyright and license notices, see __openerp__.py file in root directory
##############################################################################
from openerp import models, api
class StockQuant(model... | # -*- encoding: utf-8 -*-
##############################################################################
# For copyright and license notices, see __openerp__.py file in root directory
##############################################################################
from openerp import models, api
class StockQuant(model... |
Fix time selection modal bug | const $ = require('jquery');
import { getPlayer } from './player/player';
import { insertTimestamp, convertTimestampToSeconds, formatMilliseconds } from './timestamps';
let timeSelectionModalActive = false;
const $timeSelection = $('.controls .time-selection');
const hide = () => {
timeSelectionModalActive = fals... | const $ = require('jquery');
import { getPlayer } from './player/player';
import { insertTimestamp, convertTimestampToSeconds, formatMilliseconds } from './timestamps';
let timeSelectionModalActive = false;
const $timeSelection = $('.controls .time-selection');
const hide = () => {
timeSelectionModalActive = fals... |
Implement default controller to redirect in function of role | <?php
namespace Project\AppBundle\Controller;
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Method;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template;
use JMS\SecurityExtraBundle\An... | <?php
namespace Project\AppBundle\Controller;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Method;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
use Sensio\Bundle\FrameworkExtraBundle\Configur... |
Fix find configuration by prefix | <?php
namespace CommonBundle\Repository\General;
use Doctrine\ORM\EntityRepository;
/**
* Config
*
* This class was generated by the Doctrine ORM. Add your own custom
* repository methods below.
*/
class Config extends EntityRepository
{
public function findAll()
{
$query = $this->_em->createQue... | <?php
namespace CommonBundle\Repository\General;
use Doctrine\ORM\EntityRepository;
/**
* Config
*
* This class was generated by the Doctrine ORM. Add your own custom
* repository methods below.
*/
class Config extends EntityRepository
{
public function findAll()
{
$query = $this->_em->createQue... |
Change default api url to admin.openpension.org.il | var baseUrl = "http://admin.openpension.org.il/";
var quarter2String = {
0: "ראשון",
1: "שני",
2: "שלישי",
3: "רביעי"
};
var Model = function() {
var self = this;
self.name = ko.observable("");
self.quarterId = ko.observable(-1);
self.managingBody = ko.observable("");
self.fund =... | var baseUrl = "http://localhost:4000/";
var quarter2String = {
0: "ראשון",
1: "שני",
2: "שלישי",
3: "רביעי"
};
var Model = function() {
var self = this;
self.name = ko.observable("");
self.quarterId = ko.observable(-1);
self.managingBody = ko.observable("");
self.fund = ko.observ... |
bii: Call fetch_and_import on the right module | # /ciscripts/coverage/bii/coverage.py
#
# Submit coverage totals for a bii project to coveralls
#
# See /LICENCE.md for Copyright information
"""Submit coverage totals for a bii project to coveralls."""
import errno
import os
from contextlib import contextmanager
def _move_ignore_enoent(src, dst):
"""Move src ... | # /ciscripts/coverage/bii/coverage.py
#
# Submit coverage totals for a bii project to coveralls
#
# See /LICENCE.md for Copyright information
"""Submit coverage totals for a bii project to coveralls."""
import errno
import os
from contextlib import contextmanager
def _move_ignore_enoent(src, dst):
"""Move src ... |
Fix mypy error by asserting
Since we just asked `is_panel_active`, the following `find_output_panel`
*must* succeed. So we `assert panel` to tell it mypy. | import sublime
import sublime_plugin
PANEL_NAME = "SublimeLinter Messages"
OUTPUT_PANEL = "output." + PANEL_NAME
def plugin_unloaded():
for window in sublime.windows():
window.destroy_output_panel(PANEL_NAME)
class SublimeLinterDisplayPanelCommand(sublime_plugin.WindowCommand):
def run(self, msg=""... | import sublime
import sublime_plugin
PANEL_NAME = "SublimeLinter Messages"
OUTPUT_PANEL = "output." + PANEL_NAME
def plugin_unloaded():
for window in sublime.windows():
window.destroy_output_panel(PANEL_NAME)
class SublimeLinterDisplayPanelCommand(sublime_plugin.WindowCommand):
def run(self, msg=""... |
Fix checking type of data (array is recognized as an object) | (function () {
'use strict';
var mod = angular.module('components.utils', []);
mod.factory('Utils', ['$window', function Utils($window) {
function stringify(obj, prefix) {
var str = [];
for(var p in obj) {
var k = prefix ? prefix + '[' + p + ']' : p, v = obj[p];
str.push(typeof... | (function () {
'use strict';
var mod = angular.module('components.utils', []);
mod.factory('Utils', ['$window', function Utils($window) {
function stringify(obj, prefix) {
var str = [];
for(var p in obj) {
var k = prefix ? prefix + '[' + p + ']' : p, v = obj[p];
str.push(typeof... |
Set webpack publicPath to /static/ | var path = require("path");
var HTMLPlugin = require("html-webpack-plugin");
var CleanPlugin = require("clean-webpack-plugin");
var config = {
entry: "./src/js/app.js",
module: {
loaders: [
{
test: /\.js$/,
exclude: /(node_modules)/,
loaders... | var path = require("path");
var HTMLPlugin = require("html-webpack-plugin");
var CleanPlugin = require("clean-webpack-plugin");
var config = {
entry: "./src/js/app.js",
module: {
loaders: [
{
test: /\.js$/,
exclude: /(node_modules)/,
loaders... |
Add note about admin review link | <?php
namespace Rogue\Http\Transformers;
use Rogue\Models\Post;
use League\Fractal\TransformerAbstract;
class PhoenixGalleryTransformer extends TransformerAbstract
{
/**
* Transform resource data.
*
* @param \Rogue\Models\Photo $photo
* @return array
*/
public function transform(Post... | <?php
namespace Rogue\Http\Transformers;
use Rogue\Models\Post;
use League\Fractal\TransformerAbstract;
class PhoenixGalleryTransformer extends TransformerAbstract
{
/**
* Transform resource data.
*
* @param \Rogue\Models\Photo $photo
* @return array
*/
public function transform(Post... |
Update `djangorestframework` from 2.4.3 to 2.4.4 | from setuptools import find_packages, setup
version = '6.0.0'
install_requires = (
'djangorestframework>=2.4.4,<3',
'incuna_mail>=2.0.0,<3',
)
extras_require = {
'avatar': [
'django-imagekit>=3.2',
],
'utils': [
'raven>=5.1.1',
],
}
setup(
name='django-user-management',... | from setuptools import find_packages, setup
version = '6.0.0'
install_requires = (
'djangorestframework>=2.4.3,<3',
'incuna_mail>=2.0.0,<3',
)
extras_require = {
'avatar': [
'django-imagekit>=3.2',
],
'utils': [
'raven>=5.1.1',
],
}
setup(
name='django-user-management',... |
Comment out authentification checkker in order to remove failures from PHP tests | <?php
namespace AppBundle\Controller;
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Symfony\Component\Config\Definition\Exception\Exception;
use Symfony\Component\HttpFoundation\ParameterBag;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException... | <?php
namespace AppBundle\Controller;
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Symfony\Component\Config\Definition\Exception\Exception;
use Symfony\Component\HttpFoundation\ParameterBag;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException... |
Remove warning when no configuration is defined | <?php
namespace Ontic\NoFraud\Utils;
use Ontic\NoFraud\Interfaces\IPlugin;
use Symfony\Component\Yaml\Yaml;
class PluginUtils
{
/**
* @return IPlugin[]
*/
public static function loadPlugins()
{
$plugins = [];
$configurationFile = PROJECT_ROOT . '/data/config.yml';
$confi... | <?php
namespace Ontic\NoFraud\Utils;
use Ontic\NoFraud\Interfaces\IPlugin;
use Symfony\Component\Yaml\Yaml;
class PluginUtils
{
/**
* @return IPlugin[]
*/
public static function loadPlugins()
{
$plugins = [];
$configurationFile = PROJECT_ROOT . '/data/config.yml';
$confi... |
Add handlebars to require js config | /* Sitewide require configuration
* This file MUST be loaded asynchronously on all pages for require to work
*/
// These settings are mirrored in build.main.js, if you're going to change them check there too
requirejs.config({
paths: {
jquery: '../lib/jquery-1.10.2.min',
bootstrap: '../lib/bootst... | /* Sitewide require configuration
* This file MUST be loaded asynchronously on all pages for require to work
*/
// These settings are mirrored in build.main.js, if you're going to change them check there too
requirejs.config({
paths: {
jquery: '../lib/jquery-1.10.2.min',
bootstrap: '../lib/bootst... |
Make sure el exists before manipulating it
Otherwise it crashes when the overlay is open in the initial store
state. | // essentials
import React from 'react'
import { connect } from 'react-redux'
// actions
import toggleTracklistWindow from '../actions/toggleTracklistWindow'
import togglePlaylistWindow from '../actions/togglePlaylistWindow'
const Overlay = React.createClass({
getInitialState() {
return {
el... | // essentials
import React from 'react'
import { connect } from 'react-redux'
// actions
import toggleTracklistWindow from '../actions/toggleTracklistWindow'
import togglePlaylistWindow from '../actions/togglePlaylistWindow'
const Overlay = React.createClass({
getInitialState() {
return {
el... |
Fix wrong type (Travis complaint) | <?php
namespace Recruiter;
use MongoDB;
class FactoryTest extends \PHPUnit_Framework_TestCase
{
protected function setUp()
{
$this->factory = new Factory();
$this->dbHost = 'localhost:27017';
$this->dbName = 'recruiter';
}
public function testShouldCreateAMongoDatabaseConnect... | <?php
namespace Recruiter;
use MongoDB;
class FactoryTest extends \PHPUnit_Framework_TestCase
{
protected function setUp()
{
$this->factory = new Factory();
$this->dbHost = 'localhost:27017';
$this->dbName = 'recruiter';
}
public function testShouldCreateAMongoDatabaseConnect... |
Update testing harness to support *.ts files. | 'use strict';
const fs = require('fs');
const path = require('path');
const runInlineTest = require('jscodeshift/dist/testUtils').runInlineTest;
const EmberQUnitTransform = require('../ember-qunit-codemod');
const fixtureFolder = `${__dirname}/../__testfixtures__/ember-qunit-codemod`;
describe('ember-qunit-codemod'... | 'use strict';
const fs = require('fs');
const path = require('path');
const runInlineTest = require('jscodeshift/dist/testUtils').runInlineTest;
const EmberQUnitTransform = require('../ember-qunit-codemod');
const fixtureFolder = `${__dirname}/../__testfixtures__/ember-qunit-codemod`;
describe('ember-qunit-codemod'... |
Fix bug - not node | import Area from './templete'
import {
getRangeAncestorElem,
getRange,
isSelectionInArea,
createSelectionBaseNode,
createRange
} from 'utils/selection'
const sciprt = ({ options, widget, el, __S_ }) => {
$(document).on('selectionchange', () => {
const isInArea = isSelectionInArea(el.$area)
if (isI... | import Area from './templete'
import {
getRangeAncestorElem,
getRange,
isSelectionInArea,
createSelectionBaseNode,
createRange
} from 'utils/selection'
const sciprt = ({ options, widget, el, __S_ }) => {
$(document).on('selectionchange', () => {
const isInArea = isSelectionInArea(el.$area)
if (isI... |
Make pep8 dependency more explicit | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from setuptools import setup
def version():
"""Return version string."""
with open('autopep8.py') as input_file:
for line in input_file:
if line.startswith('__version__'):
import ast
return ast.literal_eval(line... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from setuptools import setup
def version():
"""Return version string."""
with open('autopep8.py') as input_file:
for line in input_file:
if line.startswith('__version__'):
import ast
return ast.literal_eval(line... |
Fix bug associated with bad ABC implementation. | from conans.util.files import save
from conans.errors import ConanException
from abc import ABCMeta, abstractproperty
class Generator(object):
__metaclass__ = ABCMeta
def __init__(self, deps_build_info, build_info):
self._deps_build_info = deps_build_info
self._build_info = build_info
@p... | from conans.util.files import save
from conans.errors import ConanException
from abc import ABCMeta, abstractproperty
class Generator(object):
__metaclass__ = ABCMeta
def __init__(self, deps_build_info, build_info):
self._deps_build_info = deps_build_info
self._build_info = build_info
@a... |
Fix MySQL / PostgreSQL json column compatibility | <?php
declare(strict_types=1);
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateTagsTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up(): void
{
Sc... | <?php
declare(strict_types=1);
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateTagsTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up(): void
{
Sc... |
Remove one last vestage of compressed data chunks
We used to allow data chunks to be up to twice the size of the block
size to allow for incompressible chunks. Since compression is gone,
so can that be. | package com.socrata.ssync;
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
import java.io.*;
public class PatchBuilder {
private final OutputStreamWriteHelper out;
private final int blockSize;
// Does NOT take ownership of the outputstream!
public PatchBuilder(Outpu... | package com.socrata.ssync;
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
import java.io.*;
public class PatchBuilder {
private final OutputStreamWriteHelper out;
private final int maxDataBlockSize;
// Does NOT take ownership of the outputstream!
public PatchBuilde... |
Fix for truncated text 'see more' click triggering text click events. | (function () {
'use strict';
angular
.module('GVA.Common')
.directive('truncatedText', truncatedText);
truncatedText.$inject = ['$parse'];
function truncatedText() {
function truncateText(text, limit) {
var words = text.split(' ');
var truncatedtext... | (function () {
'use strict';
angular
.module('GVA.Common')
.directive('truncatedText', truncatedText);
truncatedText.$inject = ['$parse'];
function truncatedText() {
function truncateText(text, limit) {
var words = text.split(' ');
var truncatedtext... |
Make test names lower case prefix | import unittest
import src
import sys
from io import StringIO
class TestConfigFileLoading(unittest.TestCase):
filepath_prefix = ''
@classmethod
def setUpClass(cls):
if sys.argv[0].endswith('nosetests'):
cls.filepath_prefix = "./resources/config/"
else:
cls.filepat... | import unittest
import src
import sys
from io import StringIO
class TestConfigFileLoading(unittest.TestCase):
filepath_prefix = ''
@classmethod
def setUpClass(cls):
if sys.argv[0].endswith('nosetests'):
cls.filepath_prefix = "./resources/config/"
else:
cls.filepat... |
Set sass output style to compressed | 'use strict';
var gulp = require('gulp'),
browserify = require('browserify'),
transform = require('vinyl-transform'),
uglify = require('gulp-uglify'),
sourcemaps = require('gulp-sourcemaps'),
jasmine = require('gulp-jasmine'),
sass = require('gulp-sass');
gulp.task('default', ['build', 'watch'... | 'use strict';
var gulp = require('gulp'),
browserify = require('browserify'),
transform = require('vinyl-transform'),
uglify = require('gulp-uglify'),
sourcemaps = require('gulp-sourcemaps'),
jasmine = require('gulp-jasmine'),
sass = require('gulp-sass');
gulp.task('default', ['build', 'watch'... |
[read] Deal with the read action. | import { ADD_NOTIFICATION, ADD_NOTIFICATIONS, READ_NOTIFICATION} from '../actions';
import {RECEIVE_NOTIFICATIONS} from '../actions/fetch-notifications';
import generateError from './util/error-generator';
import {isObject, isArray} from 'lodash/lang';
const REDUCER_NAME = 'NOTIFICATION_LIST';
// reducers in charge o... | import { ADD_NOTIFICATION, ADD_NOTIFICATIONS, READ_NOTIFICATION} from '../actions';
import {RECEIVE_NOTIFICATIONS} from '../actions/fetch-notifications';
import generateError from './util/error-generator';
import {isObject, isArray} from 'lodash/lang';
const REDUCER_NAME = 'NOTIFICATION_LIST';
// reducers in charge o... |
Change the pkg url to its github repo | from distutils.core import setup
setup(
name='django-databrowse',
version='1.3',
packages=['django_databrowse', 'django_databrowse.plugins'],
package_dir={'django_databrowse': 'django_databrowse'},
package_data={
'django_databrowse': [
'templates/databrowse/*.html',
... | from distutils.core import setup
setup(
name='django-databrowse',
version='1.3',
packages=['django_databrowse', 'django_databrowse.plugins'],
package_dir={'django_databrowse': 'django_databrowse'},
package_data={
'django_databrowse': [
'templates/databrowse/*.html',
... |
Add Extension .pot for powerpoint | package org.dstadler.commoncrawl;
/**
* Which extensions we are interested in.
*
* @author dominik.stadler
*/
public class Extensions {
private static final String[] EXTENSIONS = new String[] {
// Excel
".xls",
".xlsx",
".xlsm",
".xltx",
".xlsb",
// Wor... | package org.dstadler.commoncrawl;
/**
* Which extensions we are interested in.
*
* @author dominik.stadler
*/
public class Extensions {
private static final String[] EXTENSIONS = new String[] {
// Excel
".xls",
".xlsx",
".xlsm",
".xltx",
".xlsb",
// Wor... |
Use base color when hovering a connector | import React from 'react';
import { Group } from 'react-art';
import Connector from './Connector.js';
import DrawingUtils from '../utils/DrawingUtils.js';
import { getDisplayName } from './Utils.js';
const { PropTypes } = DrawingUtils;
export default CircuitComponent => {
class Connectors extends React.Component {
... | import React from 'react';
import { Group } from 'react-art';
import Connector from './Connector.js';
import DrawingUtils from '../utils/DrawingUtils.js';
import { getDisplayName } from './Utils.js';
const { PropTypes } = DrawingUtils;
export default CircuitComponent => {
class Connectors extends React.Component {
... |
Fix partners not correctly handled. | <?php
namespace Korko\SecretSanta\Http\Controllers;
use Korko\SecretSanta\Http\Requests\RandomFormRequest;
use Korko\SecretSanta\Libs\Randomizer;
use Illuminate\Http\Request;
use Mail;
class RandomFormController extends Controller
{
public function view()
{
return view('randomForm');
}
publi... | <?php
namespace Korko\SecretSanta\Http\Controllers;
use Korko\SecretSanta\Http\Requests\RandomFormRequest;
use Korko\SecretSanta\Libs\Randomizer;
use Illuminate\Http\Request;
use Mail;
class RandomFormController extends Controller
{
public function view()
{
return view('randomForm');
}
publi... |
Enforce working version of svgpathtools | # -*- coding: utf-8 -*-
import setuptools
import versioneer
with open("README.md", "r") as fh:
long_description = fh.read()
setuptools.setup(
name="PcbDraw",
version=versioneer.get_version(),
cmdclass=versioneer.get_cmdclass(),
author="Jan Mrázek",
author_email="email@honzamrazek.cz",
des... | # -*- coding: utf-8 -*-
import setuptools
import versioneer
with open("README.md", "r") as fh:
long_description = fh.read()
setuptools.setup(
name="PcbDraw",
version=versioneer.get_version(),
cmdclass=versioneer.get_cmdclass(),
author="Jan Mrázek",
author_email="email@honzamrazek.cz",
des... |
Add gzip to cx-freeze packages | import importlib
from cx_Freeze import setup, Executable
backend_path = importlib.import_module("bcrypt").__path__[0]
backend_path = backend_path.replace("bcrypt", ".libs_cffi_backend")
# Dependencies are automatically detected, but it might need
# fine tuning.
build_exe_options = {
"include_files": [
("... | import importlib
from cx_Freeze import setup, Executable
backend_path = importlib.import_module("bcrypt").__path__[0]
backend_path = backend_path.replace("bcrypt", ".libs_cffi_backend")
# Dependencies are automatically detected, but it might need
# fine tuning.
build_exe_options = {
"include_files": [
("... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.