text stringlengths 17 1.47k | positive stringlengths 673 4.43k | negative stringlengths 677 2.81k |
|---|---|---|
Fix typo (OCA => OCP) | <?php
/**
* ownCloud - ImgCrawl
*
* @author Ackinty Strappa <ackinty@gmail.com>
* @copyright 2014 Ackinty
* @license This file is licensed under the Affero General Public License version 3 or later. See the COPYING file.
*/
namespace OCA\ImgCrawl\Controller;
use \OCP\AppFramework\APIController;
use \OCP\AppFra... | <?php
/**
* ownCloud - ImgCrawl
*
* @author Ackinty Strappa <ackinty@gmail.com>
* @copyright 2014 Ackinty
* @license This file is licensed under the Affero General Public License version 3 or later. See the COPYING file.
*/
namespace OCA\ImgCrawl\Controller;
use \OCP\AppFramework\APIController;
use \OCP\AppFra... |
Update FancyScrollBar to use arrow properties | import React, {Component, PropTypes} from 'react'
import classnames from 'classnames'
import {Scrollbars} from 'react-custom-scrollbars'
class FancyScrollbar extends Component {
constructor(props) {
super(props)
}
static defaultProps = {
autoHide: true,
autoHeight: false,
}
handleMakeDiv = clas... | import React, {Component, PropTypes} from 'react'
import classnames from 'classnames'
import {Scrollbars} from 'react-custom-scrollbars'
class FancyScrollbar extends Component {
constructor(props) {
super(props)
}
static defaultProps = {
autoHide: true,
autoHeight: false,
}
render() {
const... |
Change property for painting element | /**
* Class for drawing elements in canvas
* @param {object} canvasElem handler of canvas
*/
var CanvasScreen = function ( canvasElem ) {
const SIZE = 40; //size of square
let ctx = canvasElem.getContext( "2d" ),
currentX = 0,
currentY = 0;
let = drawSingleSquare = ( obj ) => {
ct... | /**
* Class for drawing elements in canvas
* @param {object} canvasElem handler of canvas
*/
var CanvasScreen = function ( canvasElem ) {
const SIZE = 40; //size of square
let ctx = canvasElem.getContext( "2d" ),
currentX = 0,
currentY = 0;
let = drawSingleSquare = ( obj ) => {
ct... |
Update for current version of ZF2 tutorial. | <?php
namespace Album;
return array(
'controllers' => array(
'invokables' => array(
'Album\Controller\Album' => 'Album\Controller\AlbumController',
),
),
// The following section is new and should be added to your file
'router' => array(
'routes' => array(
... | <?php
return array(
'controllers' => array(
'invokables' => array(
'Album\Controller\Album' => 'Album\Controller\AlbumController',
),
),
// The following section is new and should be added to your file
'router' => array(
'routes' => array(
'album... |
Use the same colour for all activities | <?php
namespace AppBundle\Services;
use Symfony\Bridge\Doctrine\Form\Type\EntityType;
use Symfony\Component\Form\Extension\Core\Type\CheckboxType;
use CMEN\GoogleChartsBundle\GoogleCharts\Charts\Timeline;
use AppBundle\Entity\MemberRegistration;
class PersonReportService
{
private $em;
private $formFactory;
... | <?php
namespace AppBundle\Services;
use Symfony\Bridge\Doctrine\Form\Type\EntityType;
use Symfony\Component\Form\Extension\Core\Type\CheckboxType;
use CMEN\GoogleChartsBundle\GoogleCharts\Charts\Timeline;
use AppBundle\Entity\MemberRegistration;
class PersonReportService
{
private $em;
private $formFactory;
... |
Remove request membership feature from project
- add in euth.memberships app | from django.shortcuts import redirect
from django.views import generic
from rules.contrib import views as rules_views
from . import mixins, models
class ProjectDetailView(rules_views.PermissionRequiredMixin,
mixins.PhaseDispatchMixin,
generic.DetailView):
model = ... | from django.shortcuts import redirect
from django.views import generic
from rules.contrib import views as rules_views
from . import mixins, models
class ProjectDetailView(rules_views.PermissionRequiredMixin,
mixins.PhaseDispatchMixin,
generic.DetailView):
model = ... |
Fix up a typo in utilities | class ConfigItem(object):
"""The configuration item which may be bound with a instance.
:param name: the property name.
:param namespace: optional. the name of the attribute which contains all
configuration nested in the instance.
:param default: optional. the value which be provi... | class ConfigItem(object):
"""The configuration item which may be bound with a instance.
:param name: the property name.
:param namespace: optional. the name of the attribute which contains all
configuration nested in the instance.
:param default: optional. the value which be provi... |
Add links to Github for source and bug tracker | import io
from setuptools import setup
AUTHOR = "Brian Curtin"
EMAIL = "brian@python.org"
setup(name="deprecation",
version="2.0.1",
description="A library to handle automated deprecations",
license="Apache 2",
url="http://deprecation.readthedocs.io/",
author=AUTHOR,
author_email=... | import io
from setuptools import setup
AUTHOR = "Brian Curtin"
EMAIL = "brian@python.org"
setup(name="deprecation",
version="2.0",
description="A library to handle automated deprecations",
license="Apache 2",
url="http://deprecation.readthedocs.io/",
author=AUTHOR,
author_email=EM... |
Update FAQ from 1.0 -> 4.0 | <?php
namespace CodeDay\Http\Controllers;
use Symfony\Component\Yaml\Yaml;
class FaqController extends Controller
{
public function getAll()
{
$result = '';
foreach (glob(resource_path('faq/*.yaml')) as $file) {
$yaml = Yaml::parse(file_get_contents($file));
foreach ($... | <?php
namespace CodeDay\Http\Controllers;
use Symfony\Component\Yaml\Yaml;
class FaqController extends Controller
{
public function getAll()
{
$result = '';
foreach (glob(resource_path('faq/*.yaml')) as $file) {
$yaml = Yaml::parse(file_get_contents($file));
foreach ($... |
Improve finding onElementReady Dependencies autmatically | <?php
class Kwf_Assets_Provider_KwfUtils extends Kwf_Assets_Provider_Abstract
{
public function getDependenciesForDependency(Kwf_Assets_Dependency_Abstract $dependency)
{
if ($dependency instanceof Kwf_Assets_Dependency_File_Js) {
$deps = array();
$c = $dependency->getContents('e... | <?php
class Kwf_Assets_Provider_KwfUtils extends Kwf_Assets_Provider_Abstract
{
public function getDependenciesForDependency(Kwf_Assets_Dependency_Abstract $dependency)
{
if ($dependency instanceof Kwf_Assets_Dependency_File_Js) {
$deps = array();
$c = $dependency->getContents('e... |
Fix extension detection in JSON generation | #!/usr/bin/python3
import os
import json
import glob
data = {}
data['comparisonfiles'] = {}
for subset in next(os.walk("comparisonfiles/"))[1]:
data['comparisonfiles'][subset] = {}
data['comparisonfiles'][subset]["format"] = []
format_list = [
format
for format in next(os.walk("comparison... | #!/usr/bin/python3
import os
import json
import glob
data = {}
data['comparisonfiles'] = {}
for subset in next(os.walk("comparisonfiles/"))[1]:
data['comparisonfiles'][subset] = {}
data['comparisonfiles'][subset]["format"] = []
format_list = [
format
for format in next(os.walk("comparison... |
Fix bug when generating random values with multiple editors | import { commands, window, Position, Selection } from 'vscode'
import { extensionCommands, extensionCommandsWithInput } from './commands'
import { MSG_NO_ACTIVE_TEXT_EDITOR } from './constants'
export const activate = (context) => {
extensionCommands.map(cmd => {
context.subscriptions.push(
commands.regist... | import { commands, window, Position, Selection } from 'vscode'
import { extensionCommands, extensionCommandsWithInput } from './commands'
import { MSG_NO_ACTIVE_TEXT_EDITOR } from './constants'
export const activate = (context) => {
extensionCommands.map(cmd => {
context.subscriptions.push(
commands.regist... |
Fix opps template engine (name list) on DetailView | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from django.views.generic.detail import DetailView as DjangoDetailView
from django.contrib.sites.models import get_current_site
from django.utils import timezone
from opps.views.generic.base import View
class DetailView(View, DjangoDetailView):
def get_template_name... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from django.core.exceptions import ImproperlyConfigured
from django.views.generic.detail import DetailView as DjangoDetailView
from django.contrib.sites.models import get_current_site
from django.utils import timezone
from opps.views.generic.base import View
class Detail... |
Add sleep before new Chatbot instance is created on crash | import ConfigParser
import threading
import time
import chatbot
def runbot(t):
config = ConfigParser.ConfigParser()
config.readfp(open('./config.ini'))
ws = chatbot.Chatbot(config.get('Chatbot', 'server'),
protocols=['http-only', 'chat'])
try:
ws.connect()
ws... | import ConfigParser
import threading
import time
import chatbot
def runbot(t):
config = ConfigParser.ConfigParser()
config.readfp(open('./config.ini'))
ws = chatbot.Chatbot(config.get('Chatbot', 'server'),
protocols=['http-only', 'chat'])
try:
ws.connect()
ws... |
Add documentation for Permutations class | from .misc import DancingLinks
from .permutation import Permutation
import random
class Permutations(object):
"""Class for iterating through all Permutations of length n"""
def __init__(self, n):
"""Returns an object giving all permutations of length n"""
assert 0 <= n
self.n = n
... | from .misc import DancingLinks
from .permutation import Permutation
import random
class Permutations(object):
def __init__(self, n):
assert 0 <= n
self.n = n
def __iter__(self):
left = DancingLinks(range(1, self.n+1))
res = []
def gen():
if len(left) == 0:
... |
Set abandoned clause in osio_topic_publisher. | """
Created on 9 Nov 2016
@author: Bruno Beloff (bruno.beloff@southcoastscience.com)
"""
from scs_core.data.json import JSONify
from scs_core.data.path_dict import PathDict
# --------------------------------------------------------------------------------------------------------------------
class TopicClient(objec... | """
Created on 9 Nov 2016
@author: Bruno Beloff (bruno.beloff@southcoastscience.com)
"""
from scs_core.data.json import JSONify
from scs_core.data.path_dict import PathDict
# --------------------------------------------------------------------------------------------------------------------
class TopicClient(objec... |
Fix check for content type | "use strict";
function abortRequest(res) {
res.statusCode = 415;
res.end();
}
function checkContentType(acceptedTypes, encoding) {
var actualType,
acceptedType,
i, l;
for (i = 0, l = acceptedTypes.length; i < l; i++) {
acceptedTypes[i] = acceptedTypes[i].toLowerCase();
}
... | "use strict";
function abortRequest(res) {
res.statusCode = 415;
res.end();
}
function checkContentType(acceptedTypes, encoding) {
var actualType,
acceptedType,
i, l;
for (i = 0, l = acceptedTypes.length; i < l; i++) {
acceptedTypes[i] = acceptedTypes[i].toLowerCase();
}
... |
Add an option to retrieve all fields, not only visible | <?php
namespace Gloomy\PagerBundle\DataGrid;
use Gloomy\PagerBundle\Pager\Wrapper;
class DataGrid
{
protected $_request;
protected $_router;
protected $_pager;
protected $_config;
protected $_title;
public function __construct($request, $router, $pager, array $config = array(), $title = ... | <?php
namespace Gloomy\PagerBundle\DataGrid;
use Gloomy\PagerBundle\Pager\Wrapper;
class DataGrid
{
protected $_request;
protected $_router;
protected $_pager;
protected $_config;
protected $_title;
public function __construct($request, $router, $pager, array $config = array(), $title = ... |
Fix creating link with prefix system | <?php
use Ouzo\ControllerUrl;
use OuzoBreadcrumb\Breadcrumb;
class BreadcrumbHelper
{
public static function showBreadcrumbs($options = array())
{
$options['class'] = isset($options['class']) ? $options['class'] : 'breadcrumb';
$attr = self::_prepareAttributes($options);
$breadcrumbs = ... | <?php
use OuzoBreadcrumb\Breadcrumb;
class BreadcrumbHelper
{
public static function showBreadcrumbs($options = array())
{
$options['class'] = isset($options['class']) ? $options['class'] : 'breadcrumb';
$attr = self::_prepareAttributes($options);
$breadcrumbs = '<ol '.$attr.'>';
... |
Use the value directly cause it's carbon from the model | <?php namespace Anomaly\Streams\Addon\FieldType\Datetime;
use Anomaly\Streams\Platform\Addon\FieldType\FieldTypePresenter;
use Carbon\Carbon;
/**
* Class DatetimeFieldTypePresenter
*
* @link http://anomaly.is/streams-platform
* @author AnomalyLabs, Inc. <hello@anomaly.is>
* @author Ryan Th... | <?php namespace Anomaly\Streams\Addon\FieldType\Datetime;
use Anomaly\Streams\Platform\Addon\FieldType\FieldTypePresenter;
use Carbon\Carbon;
/**
* Class DatetimeFieldTypePresenter
*
* @link http://anomaly.is/streams-platform
* @author AnomalyLabs, Inc. <hello@anomaly.is>
* @author Ryan Th... |
Use with to open file in read_stru | """Theses functions read the legacy DISCUS stru file format in ASE Atoms."""
from __future__ import absolute_import
from ase.atoms import Atoms
from javelin.utils import unit_cell_to_vectors
def read_stru(filename):
with open(filename) as f:
lines = f.readlines()
a = b = c = alpha = beta = gamma = 0... | """Theses functions read the legacy DISCUS stru file format in ASE Atoms."""
from __future__ import absolute_import
from ase.atoms import Atoms
from javelin.utils import unit_cell_to_vectors
def read_stru(filename):
f = open(filename)
lines = f.readlines()
f.close()
a = b = c = alpha = beta = gamma ... |
Add TODO to send these to quasar when tagging happens | <?php
namespace Rogue\Console\Commands;
use Rogue\Models\Tag;
use Rogue\Models\Post;
use Illuminate\Console\Command;
class TagPosts extends Command
{
/**
* The name and signature of the console command.
*
* @var string
*/
protected $signature = 'rogue:tagposts {--tag=: The id of the tag t... | <?php
namespace Rogue\Console\Commands;
use Rogue\Models\Tag;
use Rogue\Models\Post;
use Illuminate\Console\Command;
class TagPosts extends Command
{
/**
* The name and signature of the console command.
*
* @var string
*/
protected $signature = 'rogue:tagposts {--tag=: The id of the tag t... |
Enable requests on fixture station. | <?php
namespace App\Entity\Fixture;
use App\Radio\Adapters;
use Doctrine\Common\DataFixtures\AbstractFixture;
use Doctrine\Common\Persistence\ObjectManager;
use App\Entity;
class Station extends AbstractFixture
{
public function load(ObjectManager $em)
{
$station = new Entity\Station;
$station... | <?php
namespace App\Entity\Fixture;
use App\Radio\Adapters;
use Doctrine\Common\DataFixtures\AbstractFixture;
use Doctrine\Common\Persistence\ObjectManager;
use App\Entity;
class Station extends AbstractFixture
{
public function load(ObjectManager $em)
{
$station = new Entity\Station;
$station... |
Fix FeatureBrowser Accordion example tab captions
svn changeset:8011/svn branch:6.0 | package com.vaadin.demo.featurebrowser;
import com.vaadin.ui.Accordion;
import com.vaadin.ui.CustomComponent;
import com.vaadin.ui.Label;
import com.vaadin.ui.TextField;
import com.vaadin.ui.VerticalLayout;
/**
* Accordion is a derivative of TabSheet, a vertical tabbed layout that places
* the tab contents between ... | package com.vaadin.demo.featurebrowser;
import com.vaadin.ui.Accordion;
import com.vaadin.ui.CustomComponent;
import com.vaadin.ui.Label;
import com.vaadin.ui.TextField;
import com.vaadin.ui.VerticalLayout;
/**
* Accordion is a derivative of TabSheet, a vertical tabbed layout that places
* the tab contents between ... |
Fix an issue where .focus() is scrolling the page, same as in UrlUI | const LoaderView = require('./Loader')
const { h, Component } = require('preact')
class AuthBlock extends Component {
componentDidMount () {
setTimeout(() => {
this.connectButton.focus({ preventScroll: true })
}, 150)
}
render () {
return <div class="uppy-Provider-auth">
<div class="uppy... | const LoaderView = require('./Loader')
const { h, Component } = require('preact')
class AuthBlock extends Component {
componentDidMount () {
this.connectButton.focus()
}
render () {
return <div class="uppy-Provider-auth">
<div class="uppy-Provider-authIcon">{this.props.pluginIcon()}</div>
<h... |
Copy facebook image on deployment | var webpack = require('webpack');
var path = require('path');
var HtmlWebpackPlugin = require('html-webpack-plugin');
var CopyWebpackPlugin = require('copy-webpack-plugin');
var BUILD_DIR = path.resolve(__dirname, 'out');
var APP_DIR = path.resolve(__dirname, 'src');
var config = {
entry: APP_DIR + '/index.jsx',
... | var webpack = require('webpack');
var path = require('path');
var HtmlWebpackPlugin = require('html-webpack-plugin');
var CopyWebpackPlugin = require('copy-webpack-plugin');
var BUILD_DIR = path.resolve(__dirname, 'out');
var APP_DIR = path.resolve(__dirname, 'src');
var config = {
entry: APP_DIR + '/index.jsx',
... |
Use all lower pypi keywords and add command-line | # -*- coding: utf-8 -*-
import pathlib
from setuptools import setup
def read(file_name):
file_path = pathlib.Path(__file__).parent / file_name
return file_path.read_text('utf-8')
setup(
name='cibopath',
version='0.1.0',
author='Raphael Pierzina',
author_email='raphael@hackebrot.de',
ma... | # -*- coding: utf-8 -*-
import pathlib
from setuptools import setup
def read(file_name):
file_path = pathlib.Path(__file__).parent / file_name
return file_path.read_text('utf-8')
setup(
name='cibopath',
version='0.1.0',
author='Raphael Pierzina',
author_email='raphael@hackebrot.de',
ma... |
Add missing behaviour in StripeJS mock | class Element {
mount(el) {
if (typeof el === "string") {
el = document.querySelector(el);
}
el.classList.add('StripeElement');
el.innerHTML = `
<input id="stripe-cardnumber" name="cardnumber" placeholder="Card number" size="16" type="text">
<input name="exp-date" placeholder="MM /... | class Element {
mount(el) {
if (typeof el === "string") {
el = document.querySelector(el);
}
el.innerHTML = `
<input id="stripe-cardnumber" name="cardnumber" placeholder="Card number" size="16" type="text">
<input name="exp-date" placeholder="MM / YY" size="6" type="text">
<input ... |
BLD: Use PEP 508 version markers.
So that environment tooling, e.g. `pipenv` can use the python version markers
when determining dependencies. | #!/usr/bin/env python
from setuptools import setup, find_packages
import sys
long_description = ''
if 'upload' in sys.argv:
with open('README.rst') as f:
long_description = f.read()
def extras_require():
return {
'test': [
'tox>=2.0',
'pytest>=2.8.5',
'pyt... | #!/usr/bin/env python
from setuptools import setup, find_packages
import sys
long_description = ''
if 'upload' in sys.argv:
with open('README.rst') as f:
long_description = f.read()
def extras_require():
return {
'test': [
'tox>=2.0',
'pytest>=2.8.5',
'pyt... |
Use assertIn instead of assertTrue to test membership. | from __future__ import unicode_literals
import unittest
from mopidy.core import History
from mopidy.models import Artist, Track
class PlaybackHistoryTest(unittest.TestCase):
def setUp(self):
self.tracks = [
Track(uri='dummy1:a', name='foo',
artists=[Artist(name='foober'), A... | from __future__ import unicode_literals
import unittest
from mopidy.core import History
from mopidy.models import Artist, Track
class PlaybackHistoryTest(unittest.TestCase):
def setUp(self):
self.tracks = [
Track(uri='dummy1:a', name='foo',
artists=[Artist(name='foober'), A... |
Change single quotes to double | #!/usr/bin/env python
import unittest
import ghstats
class TestStats(unittest.TestCase):
def test_cli(self):
"""
Test command line arguments.
"""
count = ghstats.main_cli(["kefir500/apk-icon-editor", "-q", "-d"])
self.assertTrue(count > 0)
def test_releases(self):
... | #!/usr/bin/env python
import unittest
import ghstats
class TestStats(unittest.TestCase):
def test_cli(self):
"""
Test command line arguments.
"""
count = ghstats.main_cli(["kefir500/apk-icon-editor", "-q", "-d"])
self.assertTrue(count > 0)
def test_releases(self):
... |
THEATRE-113: Sort employees by group if it passed as a parameter | <?php
namespace App\Repository;
use App\Entity\Employee;
use App\Entity\EmployeeGroup;
use Doctrine\Common\Persistence\ManagerRegistry;
use Symfony\Contracts\Translation\TranslatorInterface;
class EmployeeRepository extends AbstractRepository
{
private TranslatorInterface $translator;
public function __cons... | <?php
namespace App\Repository;
use App\Entity\Employee;
use Doctrine\Common\Persistence\ManagerRegistry;
use Symfony\Contracts\Translation\TranslatorInterface;
class EmployeeRepository extends AbstractRepository
{
private TranslatorInterface $translator;
public function __construct(ManagerRegistry $registr... |
Revert "Ensure store[uniqueId].path is defined" | 'use strict';
var through = require('through2');
var stream = require('stream');
var File = require('vinyl');
module.exports = new NgStore();
function NgStore() {
this.store = {};
}
NgStore.prototype.register =
function register(type) {
if (!this.store[type]) {
this.store[type] = [];
}
... | 'use strict';
var through = require('through2');
var stream = require('stream');
var File = require('vinyl');
module.exports = new NgStore();
function NgStore() {
this.store = {};
}
NgStore.prototype.register =
function register(type) {
if (!this.store[type]) {
this.store[type] = [];
}
... |
Add --config "ui.merge=internal:fail" to merge call | /*******************************************************************************
* Copyright (c) 2008 VecTrace (Zingo Andersen) and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribu... | /*******************************************************************************
* Copyright (c) 2008 VecTrace (Zingo Andersen) and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribu... |
Improve all migrations command output formatting | <?php
/*
* This file is part of the Active Collab DatabaseMigrations project.
*
* (c) A51 doo <info@activecollab.com>. All rights reserved.
*/
namespace ActiveCollab\DatabaseMigrations\Command;
use ActiveCollab\DatabaseMigrations\MigrationsInterface;
use Symfony\Component\Console\Input\InputInterface;
use Symfon... | <?php
/*
* This file is part of the Active Collab DatabaseMigrations project.
*
* (c) A51 doo <info@activecollab.com>. All rights reserved.
*/
namespace ActiveCollab\DatabaseMigrations\Command;
use ActiveCollab\DatabaseMigrations\MigrationsInterface;
use Symfony\Component\Console\Input\InputInterface;
use Symfon... |
Add schema comparator to diff command. | <?php
namespace LazyRecord\Command;
use Exception;
use CLIFramework\Command;
use LazyRecord\Schema;
use LazyRecord\Schema\SchemaFinder;
use LazyRecord\ConfigLoader;
class DiffCommand extends Command
{
public function brief()
{
return 'diff database schema.';
}
public function options($opts)
... | <?php
namespace LazyRecord\Command;
use Exception;
use CLIFramework\Command;
use LazyRecord\Schema;
use LazyRecord\Schema\SchemaFinder;
use LazyRecord\ConfigLoader;
class DiffCommand extends Command
{
public function brief()
{
return 'diff database schema.';
}
public function options($opts)
... |
scripts: Fix MySQL command executing (MySQL commit). | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#==============================================================================
# Script for creating MySQL user
#==============================================================================
import os
import sys
import mysql.connector
from mysql.connector import errorco... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#==============================================================================
# Script for creating MySQL user
#==============================================================================
import os
import sys
import mysql.connector
from mysql.connector import errorco... |
Make endpoints api cors friendly | <?php
namespace OParl\Website\API\Controllers;
use App\Model\Endpoint;
use Illuminate\Http\Request;
class EndpointApiController
{
/**
* @SWG\Get(
* path="/endpoints",
* tags={ "endpoints" },
* summary="list endpoints",
* @SWG\Response(
* response="200",
... | <?php
namespace OParl\Website\API\Controllers;
use App\Model\Endpoint;
use Illuminate\Http\Request;
class EndpointApiController
{
/**
* @SWG\Get(
* path="/endpoints",
* tags={ "endpoints" },
* summary="list endpoints",
* @SWG\Response(
* response="200",
... |
Add validation before Add To Cart | <?php
namespace hipanel\actions;
use hiqdev\hiart\Collection;
use Yii;
use yii\base\Action;
class AddToCartAction extends Action
{
public $productClass;
public $bulkLoad = false;
public function run()
{
$data = null;
$collection = new Collection([
'model' => new $this->... | <?php
namespace hipanel\actions;
use hiqdev\hiart\Collection;
use Yii;
use yii\base\Action;
class AddToCartAction extends Action
{
public $productClass;
public $bulkLoad = false;
public function run()
{
$data = null;
$collection = new Collection([
'model' => new $this->... |
Remove JSX element left by mistake | var React = require('react');
var Header = require('./header');
var Feed = require('./feed');
var App = React.createClass({
getInitialState: function() {
return { requests: [] }
},
render: function() {
return (
<div>
<Header
clearHandler={t... | var React = require('react');
var Header = require('./header');
var Feed = require('./feed');
var App = React.createClass({
getInitialState: function() {
return { requests: [] }
},
render: function() {
return (
<div>
<Header
Header clearHan... |
Throw an error for unrecoverable exceptions. | package com.cjmalloy.torrentfs.server;
import org.eclipse.jetty.server.Server;
import org.eclipse.jetty.servlet.ServletContextHandler;
import org.eclipse.jetty.servlet.ServletHolder;
import org.glassfish.jersey.servlet.ServletContainer;
public class Entry
{
public static final int DEFAULT_PORT = 8080;
public... | package com.cjmalloy.torrentfs.server;
import org.eclipse.jetty.server.Server;
import org.eclipse.jetty.servlet.ServletContextHandler;
import org.eclipse.jetty.servlet.ServletHolder;
import org.glassfish.jersey.servlet.ServletContainer;
public class Entry
{
public static final int DEFAULT_PORT = 8080;
public... |
Add return types to internal & magic methods when possible | <?php
/*
* This file is part of the Symfony package.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Component\Workflow;
/**
* A list of transition blockers.
*
*... | <?php
/*
* This file is part of the Symfony package.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Component\Workflow;
/**
* A list of transition blockers.
*
*... |
Revert to ES search results | <?php
namespace makeandship\elasticsearch\transformer;
use makeandship\elasticsearch\Config;
class SearchTransformer
{
public function transform($response)
{
$val = array(
'total' => $response->getTotalHits(),
'facets' => array(),
'ids' => array(),
'res... | <?php
namespace makeandship\elasticsearch\transformer;
use makeandship\elasticsearch\Config;
class SearchTransformer {
public function transform($response)
{
$val = array(
'total' => $response->getTotalHits(),
'facets' => array(),
'ids' => array()
);
... |
Update to using Request::current() method | <?php defined('SYSPATH') or die('No direct script access.');
class Prophet {
public static function exception_handler(Exception $e)
{
if (Kohana::$environment === Kohana::DEVELOPMENT)
{
Kohana_Exception::handler($e);
}
// It's a nice time to log :)
... | <?php defined('SYSPATH') or die('No direct script access.');
class Prophet {
public static function exception_handler(Exception $e)
{
if (Kohana::$environment === Kohana::DEVELOPMENT)
{
Kohana_Exception::handler($e);
}
// It's a nice time to log :)
... |
Replace php 5.4 array notation | <?php
/*
* This file is part of the Sonata package.
*
* (c) Thomas Rabaix <thomas.rabaix@sonata-project.org>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Sonata\Bundle\DemoBundle\Admin;
use Sonata\AdminBundle\Admin\... | <?php
/*
* This file is part of the Sonata package.
*
* (c) Thomas Rabaix <thomas.rabaix@sonata-project.org>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Sonata\Bundle\DemoBundle\Admin;
use Sonata\AdminBundle\Admin\... |
Include README to data_files properly | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import websitepoller
from setuptools import setup
description = "Polls specified websites and alerts using system notifications."
try:
from pypandoc import convert
long_description = convert('README.md', 'rst')
except (ImportError, IOError, OSError):
print 'ch... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import websitepoller
from setuptools import setup
description = "Polls specified websites and alerts using system notifications."
try:
from pypandoc import convert
long_description = convert('README.md', 'rst')
except (ImportError, IOError, OSError):
print 'ch... |
Modify the start_date to date. | // GraphQL types
import {
GraphQLObjectType,
GraphQLString,
GraphQLID,
GraphQLInt,
GraphQLFloat
} from 'graphql';
const WorkLog_TYPE = new GraphQLObjectType({
name: 'worklog',
descriptyion: 'An bug object',
fields: () => ({
'id': {
type: GraphQLID,
description: 'w... | // GraphQL types
import {
GraphQLObjectType,
GraphQLString,
GraphQLID,
GraphQLInt,
GraphQLFloat
} from 'graphql';
const WorkLog_TYPE = new GraphQLObjectType({
name: 'worklog',
descriptyion: 'An bug object',
fields: () => ({
'id': {
type: GraphQLID,
description: 'w... |
Update the namespace during inflection | <?php
namespace Cerbero\FluentApi\Inflectors;
/**
* Resource inflector using the PSR-4 standard.
*
* @author Andrea Marco Sartori
*/
class Psr4ResourceInflector implements ResourceInflectorInterface
{
/**
* The base namespace.
*
* @author Andrea Marco Sartori
* @var string
*/
... | <?php
namespace Cerbero\FluentApi\Inflectors;
/**
* Resource inflector using the PSR-4 standard.
*
* @author Andrea Marco Sartori
*/
class Psr4ResourceInflector implements ResourceInflectorInterface
{
/**
* The base namespace.
*
* @author Andrea Marco Sartori
* @var string
*/
... |
Check that map isn't being called passing in null arguments.
(This seems wrong; see JIRA entry GSA-211)
git-svn-id: 4561c0a8f080806b19201efb9525134c00b76d40@1907 348d0f76-0448-11de-a6fe-93d51630548a | package org.broadinstitute.sting.gatk.walkers.fasta;
import org.broadinstitute.sting.gatk.contexts.AlignmentContext;
import org.broadinstitute.sting.gatk.contexts.ReferenceContext;
import org.broadinstitute.sting.gatk.refdata.RefMetaDataTracker;
import org.broadinstitute.sting.gatk.refdata.ReferenceOrderedDatum;
impor... | package org.broadinstitute.sting.gatk.walkers.fasta;
import org.broadinstitute.sting.gatk.contexts.AlignmentContext;
import org.broadinstitute.sting.gatk.contexts.ReferenceContext;
import org.broadinstitute.sting.gatk.refdata.RefMetaDataTracker;
import org.broadinstitute.sting.gatk.refdata.ReferenceOrderedDatum;
impor... |
Remove request-payload as a dependency | /*
* Server
*
*/
// Define dependencies
const http = require('http');
const StringDecoder = require('string_decoder').StringDecoder;
// Create module object
var server = {};
// Is listening already
server.isListening = false;
// Listen
server.listen = function(){
if(!server.isListening){
server.htt... | /*
* Server
*
*/
// Define dependencies
const http = require('http');
const payload = require('request-payload');
// Create module object
var server = {};
// Is listening already
server.isListening = false;
// Listen
server.listen = function(){
if(!server.isListening){
server.httpServer = http.crea... |
Make test ignore JSON semantics | <?php
/*
* This file is part of the Silex framework.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* This source file is subject to the MIT license that is bundled
* with this source code in the file LICENSE.
*/
namespace Silex\Tests;
use Silex\Application;
/**
* JSON test cases.
*
* @author Igor Wiedle... | <?php
/*
* This file is part of the Silex framework.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* This source file is subject to the MIT license that is bundled
* with this source code in the file LICENSE.
*/
namespace Silex\Tests;
use Silex\Application;
/**
* JSON test cases.
*
* @author Igor Wiedle... |
Store local IP address for next call | /*
* UG Name Util for Syndicate
*/
package SyndicateHadoop.util;
import java.net.Inet4Address;
import java.net.InetAddress;
import java.net.NetworkInterface;
import java.net.SocketException;
import java.util.Enumeration;
/**
*
* @author iychoi
*/
public class UGNameUtil {
private static String ipAddress... | /*
* UG Name Util for Syndicate
*/
package SyndicateHadoop.util;
import java.net.Inet4Address;
import java.net.InetAddress;
import java.net.NetworkInterface;
import java.net.SocketException;
import java.util.Enumeration;
import org.apache.hadoop.conf.Configuration;
/**
*
* @author iychoi
*/
public class UGNameUt... |
Add UUID on user update | package br.com.alura.agenda.modelo;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.io.Serializable;
public class Aluno implements Serializable {
@JsonProperty("idCliente")
private Long id;
private String nome;
private String endereco;
private String telefone;
private Strin... | package br.com.alura.agenda.modelo;
import java.io.Serializable;
/**
* Created by alura on 12/08/15.
*/
public class Aluno implements Serializable {
private Long id;
private String nome;
private String endereco;
private String telefone;
private String site;
private Double nota;
private S... |
Remove @ from user on Dab command | package com.nincraft.ninbot.command;
import com.nincraft.ninbot.util.MessageUtils;
import lombok.val;
import net.dv8tion.jda.core.entities.Message;
import net.dv8tion.jda.core.events.message.MessageReceivedEvent;
public class DabCommand extends AbstractCommand {
public DabCommand() {
length = 3;
... | package com.nincraft.ninbot.command;
import com.nincraft.ninbot.util.MessageUtils;
import lombok.val;
import net.dv8tion.jda.core.entities.Message;
import net.dv8tion.jda.core.events.message.MessageReceivedEvent;
public class DabCommand extends AbstractCommand {
public DabCommand() {
length = 3;
... |
Use \Page instead of Concrete\Core\Page\Page | <?php
namespace Concrete\Core\Page\Type\Composer\Control\CorePageProperty;
use Core;
use UserInfo;
use Page;
class UserCorePageProperty extends CorePageProperty
{
public function __construct()
{
$this->setCorePagePropertyHandle('user');
$this->setPageTypeComposerControlName(tc('PageTypeCompos... | <?php
namespace Concrete\Core\Page\Type\Composer\Control\CorePageProperty;
use Core;
use UserInfo;
use Concrete\Core\Page\Page;
class UserCorePageProperty extends CorePageProperty
{
public function __construct()
{
$this->setCorePagePropertyHandle('user');
$this->setPageTypeComposerControlName... |
Fix concurrency bug in ls tests | from tests.framework.cli_testcase import CliTestCase
from tests.framework.constants import GO_EP1_ID
class LsTests(CliTestCase):
"""
Tests globus ls command
"""
def test_path(self):
"""
Does an ls on EP1:/, confirms expected results.
"""
path = "/"
output = sel... | from tests.framework.cli_testcase import CliTestCase
from tests.framework.constants import GO_EP1_ID
class LsTests(CliTestCase):
"""
Tests globus ls command
"""
def test_path(self):
"""
Does an ls on EP1:/, confirms expected results.
"""
path = "/"
output = sel... |
Fix opening links in browser on Windows | 'use strict'
var opn = require('open')
var http = require('http')
var fs = require('fs')
var url = require('url')
var path = require('path')
var Promise = require('bluebird')
function hostLogin (domain, options) {
return new Promise(function (resolve) {
var server = http
.createServer(function (req, res) {... | 'use strict';
var opn = require('open');
var http = require('http');
var fs = require('fs');
var url = require('url');
var path = require('path');
var Promise = require('bluebird');
function hostLogin(domain, options) {
return new Promise(function(resolve) {
var server = http.createServer(function(req, res... |
Remove me from the debug e-mail recipient. | '''
Simple module to aid in command-line debugging of notification related issues.
'''
from django.core.management.base import BaseCommand, CommandError
from django.conf import settings
from django.core.mail import EmailMessage
from timetracker.overtime.models import PendingApproval, Tbluser
def send_approval_digest... | '''
Simple module to aid in command-line debugging of notification related issues.
'''
from django.core.management.base import BaseCommand, CommandError
from django.conf import settings
from django.core.mail import EmailMessage
from timetracker.overtime.models import PendingApproval, Tbluser
def send_approval_digest... |
ref: Simplify query plan for repo tests | from datetime import timedelta
from sqlalchemy.sql import func
from zeus.config import db
from zeus.constants import Result, Status
from zeus.models import Repository, TestCase, Job
from zeus.utils import timezone
from .base_repository import BaseRepositoryResource
from ..schemas import TestCaseStatisticsSchema
test... | from datetime import timedelta
from sqlalchemy.sql import func
from zeus.config import db
from zeus.constants import Result, Status
from zeus.models import Repository, TestCase, Job
from zeus.utils import timezone
from .base_repository import BaseRepositoryResource
from ..schemas import TestCaseStatisticsSchema
test... |
Fix active locale method call | <?php
namespace rkgrep\Locales;
use Illuminate\Support\ServiceProvider;
class LocalesServiceProvider extends ServiceProvider
{
/**
* Register the service provider.
*
* @return void
*/
public function register()
{
// merge default config
$this->mergeConfigFrom(
... | <?php
namespace rkgrep\Locales;
use Illuminate\Support\ServiceProvider;
class LocalesServiceProvider extends ServiceProvider
{
/**
* Register the service provider.
*
* @return void
*/
public function register()
{
// merge default config
$this->mergeConfigFrom(
... |
Revise flow of 'start' method | /* *\
** SICU Stress Measurement System **
** Project P04 | C380 Team A **
** EBME 380: Biomedical Engineering Design Experience **
** ... | /* *\
** SICU Stress Measurement System **
** Project P04 | C380 Team A **
** EBME 380: Biomedical Engineering Design Experience **
** ... |
Update stats daemon to update ZSets and memoization as necessary | #!/usr/bin/env python3
import api
import api.group
from api.stats import (get_all_team_scores, get_group_scores,
get_problem_solves, get_registration_count,
get_top_teams_score_progressions)
def run():
"""Run the stat caching daemon."""
with api.create_app().app... | #!/usr/bin/env python3
import api
import api.group
import api.stats
def run():
"""Run the stat caching daemon."""
with api.create_app().app_context():
def cache(f, *args, **kwargs):
result = f(reset_cache=True, *args, **kwargs)
return result
print("Caching registrati... |
Refactor channel override to environment variable. | package com.playlist;
import net.sf.json.JSONObject;
import org.apache.commons.lang.StringUtils;
import org.apache.http.client.methods.CloseableHttpResponse;
import org.apache.http.client.methods.HttpPost;
import org.apache.http.entity.StringEntity;
import org.apache.http.impl.client.CloseableHttpClient;
import org.ap... | package com.playlist;
import net.sf.json.JSONObject;
import org.apache.http.client.methods.CloseableHttpResponse;
import org.apache.http.client.methods.HttpPost;
import org.apache.http.entity.StringEntity;
import org.apache.http.impl.client.CloseableHttpClient;
import org.apache.http.impl.client.HttpClients;
import or... |
Trim the email before logging-in | var TopLevelView = require('ui/common/components/TopLevelView');
var NetworkHelper = require('helpers/NetworkHelper');
function LoginView() {
var loginUrl = Ti.App.Properties.getString('server_url') + '/api/login';
var self = new TopLevelView('Login');
var emailField = Ti.UI.createTextField({
width : '80%... | var TopLevelView = require('ui/common/components/TopLevelView');
var NetworkHelper = require('helpers/NetworkHelper');
function LoginView() {
var loginUrl = Ti.App.Properties.getString('server_url') + '/api/login';
var self = new TopLevelView('Login');
var emailField = Ti.UI.createTextField({
width : '80%... |
Make MpdFrontend ignore unknown messages | import logging
from mopidy.frontends.base import BaseFrontend
from mopidy.frontends.mpd.dispatcher import MpdDispatcher
from mopidy.frontends.mpd.process import MpdProcess
from mopidy.utils.process import unpickle_connection
logger = logging.getLogger('mopidy.frontends.mpd')
class MpdFrontend(BaseFrontend):
"""
... | import logging
from mopidy.frontends.base import BaseFrontend
from mopidy.frontends.mpd.dispatcher import MpdDispatcher
from mopidy.frontends.mpd.process import MpdProcess
from mopidy.utils.process import unpickle_connection
logger = logging.getLogger('mopidy.frontends.mpd')
class MpdFrontend(BaseFrontend):
"""
... |
Check for callback before execution | 'use strict';
var fs = require('fs');
var request = require('request');
var USER_AGENT_STRING = 'SubDB/1.0 (subfil/1.1; '
+ 'https://github.com/divijbindlish/subfil)';
var download = function (hash, language, destination, callback) {
callback = arguments[arguments.length - 1];
if (typeof callback !== 'function'... | 'use strict';
var fs = require('fs');
var request = require('request');
var USER_AGENT_STRING = 'SubDB/1.0 (subfil/1.1; '
+ 'https://github.com/divijbindlish/subfil)';
var download = function (hash, language, destination, callback) {
request({
url: 'http://api.thesubdb.com',
qs: {
action: 'download'... |
Add semicolon and rewrite line to be more readable | var command = {
command: "help",
description: "Display information about a given command",
userHelp: {
usage: "truffle help <command>",
parameters: [],
},
builder: {},
run: function (options, callback) {
var commands = require("./index");
if (options._.length === 0) {
this.displayHelpI... | var command = {
command: "help",
description: "Display information about a given command",
userHelp: {
usage: "truffle help <command>",
parameters: [],
},
builder: {},
run: function (options, callback) {
var commands = require("./index");
if (options._.length === 0) {
this.displayHelpI... |
Change sha fetching to use --parent-only and removed ref parameter |
import collections
import contextlib
import shutil
import subprocess
import tempfile
from util.iter import chunk_iter
Commit = collections.namedtuple('Commit', ['sha', 'date', 'name'])
class RepoParser(object):
def __init__(self, git_repo):
self.git_repo = git_repo
self.tempdir = None
@con... |
import collections
import contextlib
import shutil
import subprocess
import tempfile
from util.iter import chunk_iter
Commit = collections.namedtuple('Commit', ['sha', 'date', 'name'])
class RepoParser(object):
def __init__(self, git_repo, ref):
self.git_repo = git_repo
self.ref = ref
s... |
Simplify extended error number parsing. | <?php
/**
* This file is part of the LdapTools package.
*
* (c) Chad Sikorra <Chad.Sikorra@gmail.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace LdapTools\Connection\AD;
use LdapTools\Connection\ADResponseCodes;
us... | <?php
/**
* This file is part of the LdapTools package.
*
* (c) Chad Sikorra <Chad.Sikorra@gmail.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace LdapTools\Connection\AD;
use LdapTools\Connection\ADResponseCodes;
us... |
Fix where db name should be used in db operations (name conflict!) | import discord
from modules.botModule import BotModule
class Karma(BotModule):
name = 'karma'
description = 'Monitors messages for reactions and adds karma accordingly.'
help_text = 'This module has no callable functions'
trigger_string = '!reddit'
module_db = 'karma.json'
... | import discord
from modules.botModule import BotModule
class Karma(BotModule):
name = 'karma'
description = 'Monitors messages for reactions and adds karma accordingly.'
help_text = 'This module has no callable functions'
trigger_string = '!reddit'
module_db = 'karma.json'
... |
Update tags for new syntax | from .utils import TemplateTestCase, Mock
class BlockTagTest(TemplateTestCase):
def test_block_parse(self):
self.assertRendered('{% block name %}%{% endblock %}', '%')
class ForTagTest(TemplateTestCase):
def test_simple_for(self):
self.assertRendered(
'{% for item in seq %}{{ it... | from .utils import TemplateTestCase, Mock
class BlockTagTest(TemplateTestCase):
def test_block_parse(self):
self.assertRendered('{% block name %}%{% endblock %}', '%')
class ForTagTest(TemplateTestCase):
def test_simple_for(self):
self.assertRendered(
'{% for _in=seq %}{{ item }... |
Add support for income accounts via a -1 polarity. | <?php
return function(MongoDB $db) {
$collection = $db->budgets;
$findOne = function($id) use($collection) {
return $collection->findOne(['_id' => new MongoID($id)]);
};
return [
'find' => function(array $conditions = array()) use($collection) {
return array_map(function($b... | <?php
return function(MongoDB $db) {
$collection = $db->budgets;
$findOne = function($id) use($collection) {
return $collection->findOne(['_id' => new MongoID($id)]);
};
return [
'find' => function(array $conditions = array()) use($collection) {
return array_map(function($b... |
Rename person to item in TestItem class | package seedu.address.testutil;
import seedu.address.commons.exceptions.IllegalValueException;
import seedu.address.model.item.*;
import seedu.address.model.tag.Tag;
/**
*
*/
public class ItemBuilder {
private TestItem item;
public ItemBuilder() {
this.item = new TestItem();
}
public Item... | package seedu.address.testutil;
import seedu.address.commons.exceptions.IllegalValueException;
import seedu.address.model.item.*;
import seedu.address.model.tag.Tag;
/**
*
*/
public class ItemBuilder {
private TestItem person;
public ItemBuilder() {
this.person = new TestItem();
}
public ... |
Enable console api and remove warning | var axsPath = require.resolve('../vendor/axs_testing')
exports.addCommand = function (client, requireName) {
client.addCommand('auditAccessibility', function () {
return this.execute(function (axsPath, requireName) {
var axs = window[requireName](axsPath)
var config = {
withConsoleApi: true,
... | var axsPath = require.resolve('../vendor/axs_testing')
exports.addCommand = function (client, requireName) {
client.addCommand('auditAccessibility', function () {
return this.execute(function (axsPath, requireName) {
var axs = window[requireName](axsPath)
var failures = axs.Audit.run().filter(functio... |
Add the output_frame_size parameter to PitchgramTransformer.
Without it the deserialization via jsonpickle fails. | from sklearn.base import BaseEstimator, TransformerMixin
from .signal import SignalFrames
from .reassignment import pitchgram
class PitchgramTransformer(BaseEstimator, TransformerMixin):
def __init__(self, sample_rate=44100, frame_size=4096, hop_size=2048,
output_frame_size=None,
bin_range=[-48, ... | from sklearn.base import BaseEstimator, TransformerMixin
from .signal import SignalFrames
from .reassignment import pitchgram
class PitchgramTransformer(BaseEstimator, TransformerMixin):
def __init__(self, sample_rate=44100, frame_size=4096, hop_size=2048,
bin_range=[-48, 67], bin_division=1):
se... |
Sort blog entries by date. | import React from 'react'
import Link from 'gatsby-link'
import './index.scss'
export default ({ data }) => {
return (
<section>
<div className="container">
<header className="major">
<h2>Blog</h2>
</header>
{data.allMarkdownRemark.edges.map(({ node }) => (
<sect... | import React from 'react'
import Link from 'gatsby-link'
import './index.scss'
export default ({ data }) => {
return (
<section>
<div className="container">
<header className="major">
<h2>Blog</h2>
</header>
{data.allMarkdownRemark.edges.map(({ node }) => (
<sect... |
Set browserStack timeout in an attempt to fix failing CI builds | module.exports = function (config) {
config.set({
frameworks: ['mocha'],
exclude: ['build/test/external.spec.js'],
files: [
'vendor/rsvp.js',
'vendor/unexpected-magicpen.min.js',
'build/test/promisePolyfill.js',
'unexpected.js',
'build/test/common.js',
'build/test/**/... | module.exports = function (config) {
config.set({
frameworks: ['mocha'],
exclude: ['build/test/external.spec.js'],
files: [
'vendor/rsvp.js',
'vendor/unexpected-magicpen.min.js',
'build/test/promisePolyfill.js',
'unexpected.js',
'build/test/common.js',
'build/test/**/... |
Replace header dashboard links with new post button | import React from 'react';
import { Link } from 'react-router';
class HeaderDashboard extends React.Component {
shouldComponentUpdate(nextProps, nextState, nextContext) {
const { location: key, currentUser } = this.context;
return key !== nextContext.location.key || currentUser !== nextContext.currentUser;
... | import React from 'react';
import { Link } from 'react-router';
class HeaderDashboard extends React.Component {
shouldComponentUpdate(nextProps, nextState, nextContext) {
const { location: key, currentUser } = this.context;
return key !== nextContext.location.key || currentUser !== nextContext.currentUser;
... |
Add some global tpl vars | Template.login.events({
'submit .login-user': function(event) {
var email = event.target.email.value;
var password = event.target.password.value;
Meteor.loginWithPassword(email, password, function(err) {
if (err) {
event.target.email.value = email;
... | Template.login.events({
'submit .login-user': function(event) {
var email = event.target.email.value;
var password = event.target.password.value;
Meteor.loginWithPassword(email, password, function(err) {
if (err) {
event.target.email.value = email;
... |
Add hotkey info to placeholder text | import React from 'react'
import debounce from 'lodash/debounce'
const searchFor = debounce(term => window.routerHistory.push(`/search/${term}`), 500)
export default class SearchBox extends React.Component {
static defaultProps = {
className: '',
placeholder: 'Search... (Ctrl+Shift+F)',
term: '',
}
... | import React from 'react'
import debounce from 'lodash/debounce'
const searchFor = debounce(term => window.routerHistory.push(`/search/${term}`), 500)
export default class SearchBox extends React.Component {
static defaultProps = {
className: '',
placeholder: 'Search...',
term: '',
}
constructor(pr... |
Add bullet hit function to destroy self. | from tkinter import Label
import threading
class Bullet(Label):
def __init__(self, x, y, space):
self.space = space
self.bullet_timer = 0.01
self.bullet_indicator = "'"
self.damage = -100
Label.__init__(self, text=self.bullet_indicator)
self.pack()
self._x =... | from tkinter import Label
import threading
class Bullet(Label):
def __init__(self, x, y, space):
self.space = space
self.bullet_timer = 0.01
self.bullet_indicator = "'"
self.damage = -100
Label.__init__(self, text=self.bullet_indicator)
self.pack()
self._x =... |
Add support for smart transactional emails | <?php
namespace Casinelli\CampaignMonitor;
class CampaignMonitor
{
protected $app;
public function __construct($app)
{
$this->app = $app;
}
public function campaigns($campaignId = null)
{
return new \CS_REST_Campaigns($campaignId, $this->getAuthTokens());
}
public fu... | <?php
namespace Casinelli\CampaignMonitor;
class CampaignMonitor
{
protected $app;
public function __construct($app)
{
$this->app = $app;
}
public function campaigns($campaignId = null)
{
return new \CS_REST_Campaigns($campaignId, $this->getAuthTokens());
}
public fu... |
Test DictionaryObjectModel: correct usage of property
'_' instead of '-' in property names, this fixes the build. | const Eknc = imports.gi.EosKnowledgeContent;
const InstanceOfMatcher = imports.tests.InstanceOfMatcher;
describe('Dictionary Object Model', function() {
let dictionaryObject, jsonld;
beforeEach(function() {
jasmine.addMatchers(InstanceOfMatcher.customMatchers);
jsonld = {
'@id': ... | const Eknc = imports.gi.EosKnowledgeContent;
const InstanceOfMatcher = imports.tests.InstanceOfMatcher;
describe('Dictionary Object Model', function() {
let dictionaryObject, jsonld;
beforeEach(function() {
jasmine.addMatchers(InstanceOfMatcher.customMatchers);
jsonld = {
'@id': ... |
Update the text to match | @extends('layout')
@section('content')
@include('partials.standardHeader')
<section class="section home">
<div class="container">
<div class="column is-half is-offset-one-quarter">
<div class="box">
<form action="/upload" class="dropzone" id="that-zone">... | @extends('layout')
@section('content')
@include('partials.standardHeader')
<section class="section home">
<div class="container">
<div class="column is-half is-offset-one-quarter">
<div class="box">
<form action="/upload" class="dropzone" id="that-zone">... |
git: Fix top level hook to not use renames | #!/usr/bin/env python3
import os
import subprocess
import sys
if __name__ == '__main__':
ref_name = sys.argv[1]
old_commit = sys.argv[2]
new_commit = sys.argv[3]
# no need to check if old_commit or new_commit are 0, master can't be deleted or created
if ref_name == 'refs/heads/master' and os.envi... | #!/usr/bin/env python3
import os
import subprocess
import sys
if __name__ == '__main__':
ref_name = sys.argv[1]
old_commit = sys.argv[2]
new_commit = sys.argv[3]
# no need to check if old_commit or new_commit are 0, master can't be deleted or created
if ref_name == 'refs/heads/master' and os.envi... |
Fix bad method name in test task | <?php
namespace Amp\Test\Thread;
use Amp\Promise;
use Amp\Future;
use Amp\Thread\Thread;
use Amp\Thread\Dispatcher;
function multiply($x, $y) {
return $x * $y;
}
function exception() {
throw new \Exception('test');
}
function fatal() {
$nonexistentObj->nonexistentMethod();
}
class FatalStackable exten... | <?php
namespace Amp\Test\Thread;
use Amp\Promise;
use Amp\Future;
use Amp\Thread\Thread;
use Amp\Thread\Dispatcher;
function multiply($x, $y) {
return $x * $y;
}
function exception() {
throw new \Exception('test');
}
function fatal() {
$nonexistentObj->nonexistentMethod();
}
class FatalStackable exten... |
Replace older BooleanTransform to ValueTransform | <?php
namespace AdobeConnectClient\Commands;
use AdobeConnectClient\Command;
use AdobeConnectClient\Converter\Converter;
use AdobeConnectClient\Helpers\StatusValidate;
use AdobeConnectClient\Helpers\ValueTransform as VT;
use AdobeConnectClient\Helpers\StringCaseTransform as SCT;
/**
* Set a feature
*
* @link http... | <?php
namespace AdobeConnectClient\Commands;
use AdobeConnectClient\Command;
use AdobeConnectClient\Converter\Converter;
use AdobeConnectClient\Helpers\StatusValidate;
use AdobeConnectClient\Helpers\BooleanTransform as BT;
use AdobeConnectClient\Helpers\StringCaseTransform as SCT;
/**
* Set a feature
*
* @link ht... |
Change group function to string | var ipc = window.require('ipc');
var _ = require('underscore');
var Reflux = require('reflux');
var Actions = require('../actions/actions');
var AuthStore = require('../stores/auth');
var apiRequests = require('../utils/api-requests');
var NotificationsStore = Reflux.createStore({
listenables: Actions,
init: fun... | var ipc = window.require('ipc');
var _ = require('underscore');
var Reflux = require('reflux');
var Actions = require('../actions/actions');
var AuthStore = require('../stores/auth');
var apiRequests = require('../utils/api-requests');
var NotificationsStore = Reflux.createStore({
listenables: Actions,
init: fun... |
Handle values to be compared being `None`. | # -*- coding: utf-8 -*-
"""
byceps.blueprints.snippet_admin.service
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
:Copyright: 2006-2016 Jochen Kupperschmidt
:License: Modified BSD, see LICENSE for details.
"""
from difflib import HtmlDiff
from ...database import db
from ..party.models import Party
from ..snippet.models.... | # -*- coding: utf-8 -*-
"""
byceps.blueprints.snippet_admin.service
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
:Copyright: 2006-2016 Jochen Kupperschmidt
:License: Modified BSD, see LICENSE for details.
"""
from difflib import HtmlDiff
from ...database import db
from ..party.models import Party
from ..snippet.models.... |
Add email subject for exception reporting | <?php
namespace App\Exceptions;
use Exception;
use Illuminate\Foundation\Exceptions\Handler as ExceptionHandler;
use Mail;
class Handler extends ExceptionHandler
{
/**
* A list of the exception types that should not be reported.
*
* @var array
*/
protected $dontReport = [
'Symfony... | <?php
namespace App\Exceptions;
use Exception;
use Illuminate\Foundation\Exceptions\Handler as ExceptionHandler;
use Mail;
class Handler extends ExceptionHandler
{
/**
* A list of the exception types that should not be reported.
*
* @var array
*/
protected $dontReport = [
'Symfony... |
Enable a test case which was failing previously. | 'use strict';
var csslint = require('../lib/csslint'),
fs = require('fs'),
path = require('path');
var formatter = csslint.getFormatter('compact');
module.exports = (function() {
var tests = {};
fs.readdirSync('test/less').forEach(function(file) {
if (!/\.less/.test(file)) {
retu... | 'use strict';
var csslint = require('../lib/csslint'),
fs = require('fs'),
path = require('path');
var formatter = csslint.getFormatter('compact');
module.exports = (function() {
var tests = {};
fs.readdirSync('test/less').forEach(function(file) {
if (!/\.less/.test(file)) {
retu... |
Add tooltips to the requirements on the node list. | package net.sourceforge.javydreamercsw.client.ui.nodes;
import com.validation.manager.core.db.Requirement;
import com.validation.manager.core.server.core.RequirementServer;
import java.beans.IntrospectionException;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import javax.swing.A... | package net.sourceforge.javydreamercsw.client.ui.nodes;
import com.validation.manager.core.db.Requirement;
import com.validation.manager.core.server.core.RequirementServer;
import java.beans.IntrospectionException;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import javax.swing.A... |
Add scripts.js to scripts gulp pipe | 'use strict';
var autoprefixer = require('gulp-autoprefixer');
var cleanCSS = require('gulp-clean-css');
var concat = require('gulp-concat');
var gulp = require('gulp');
var sass = require('gulp-sass');
var uglify = require('gulp-uglify');
gulp.task('default', function () {
gulp.star... | 'use strict';
var autoprefixer = require('gulp-autoprefixer');
var cleanCSS = require('gulp-clean-css');
var concat = require('gulp-concat');
var gulp = require('gulp');
var sass = require('gulp-sass');
var uglify = require('gulp-uglify');
gulp.task('default', function () {
gulp.star... |
Use importlib to load custom fields by str | from django import forms
from django.contrib import admin
from django.utils.importlib import import_module
from setmagic import settings
from setmagic.models import Setting
_denied = lambda *args: False
class SetMagicAdmin(admin.ModelAdmin):
list_display = 'label', 'current_value',
list_editable = 'current... | from django import forms
from django.contrib import admin
from setmagic import settings
from setmagic.models import Setting
_denied = lambda *args: False
class SetMagicAdmin(admin.ModelAdmin):
list_display = 'label', 'current_value',
list_editable = 'current_value',
list_display_links = None
has_a... |
Add API doc link to key management page | @title('Manage API keys: '.$user->name)
@extends('app')
@section('content')
<h1>Manage API keys: {{ $user->name }}</h1>
<ol class="breadcrumb">
<li><a href="{{ act('panel', 'index', $user->id) }}">Control Panel</a></li>
<li class="active">Manage API keys</li>
</ol>
<p>
<a href... | @title('Manage API keys: '.$user->name)
@extends('app')
@section('content')
<h1>Manage API keys: {{ $user->name }}</h1>
<ol class="breadcrumb">
<li><a href="{{ act('panel', 'index', $user->id) }}">Control Panel</a></li>
<li class="active">Manage API keys</li>
</ol>
<h2>Active API Keys... |
Store uploaded images in public/storage/images/uploaded | <?php
namespace App\Http\Controllers;
use Illuminate\Support\Facades\Input;
use Illuminate\Support\Facades\Validator;
class FileuploaderController extends Controller
{
public function upload()
{
$input = Input::all();
$error = '';
$callback = Input::get('CKEditorFuncNum'... | <?php
namespace App\Http\Controllers;
use Illuminate\Support\Facades\Input;
use Illuminate\Support\Facades\Validator;
class FileuploaderController extends Controller
{
public function upload()
{
$input = Input::all();
$error = '';
$callback = Input::get('CKEditorFuncNum'... |
Fix pull request from berwie. Just terrible. | <?php
use \Entity\Station;
use \Entity\Song;
use \Entity\Schedule;
class Api_NowplayingController extends \PVL\Controller\Action\Api
{
public function indexAction()
{
$file_path_api = DF_INCLUDE_STATIC.'/api/nowplaying_api.json';
$np_raw = file_get_contents($file_path_api);
... | <?php
use \Entity\Station;
use \Entity\Song;
use \Entity\Schedule;
class Api_NowplayingController extends \PVL\Controller\Action\Api
{
public function indexAction()
{
$file_path_api = DF_INCLUDE_STATIC.'/api/nowplaying_api.json';
$np_raw = file_get_contents($file_path_api);
... |
Make the A look better. ('Cause it matters, right?) | function makeFont(width, height, sparsity) {
return {
a: function (x, y) {
var cx = 0, i = 0, cy = 0;
var f = [
function (x) {
if (x < width/2) {
return height - height * (x)/(width/2);
} else {
... | function makeFont(width, height, sparsity) {
return {
a: function (x, y) {
var cx = 0, i = 0, cy = 0;
var f = [
function (x) {
if (x < width/2) {
return height - height * (x)/(width/2);
} else {
... |
Add path field to preview file | from sqlalchemy_utils import UUIDType
from zou.app import db
from zou.app.models.serializer import SerializerMixin
from zou.app.models.base import BaseMixin
class PreviewFile(db.Model, BaseMixin, SerializerMixin):
"""
Describes a file which is aimed at being reviewed. It is not a publication
neither a wo... | from sqlalchemy_utils import UUIDType
from zou.app import db
from zou.app.models.serializer import SerializerMixin
from zou.app.models.base import BaseMixin
class PreviewFile(db.Model, BaseMixin, SerializerMixin):
"""
Describes a file which is aimed at being reviewed. It is not a publication
neither a wo... |
Remove debugging code added in bec782c | <?php
namespace AlgoliaSearch;
/**
* Class Json.
*/
class Json
{
public static function encode($value, $options = 0)
{
$json = json_encode($value, $options);
self::checkError();
return $json;
}
public static function decode($json, $assoc = false, $depth = 512)
{
... | <?php
namespace AlgoliaSearch;
/**
* Class Json.
*/
class Json
{
public static function encode($value, $options = 0)
{
$json = json_encode($value, $options);
self::checkError();
return $json;
}
public static function decode($json, $assoc = false, $depth = 512)
{
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.