text stringlengths 17 1.47k | positive stringlengths 673 4.43k | negative stringlengths 677 2.81k |
|---|---|---|
Fix regex for html links parsing. | export class HtmlTools {
static escapeHtml (text) {
return text.replace(/[\"&<>]/g, a => HtmlTools._escapeCharMap[a]);
}
static anchorLinksEscapeHtml (text) {
var linkRegex = /((https?:\/\/|ftps?:\/\/|www\.|[^\s:=]+@www\.).*?[a-zA-Z_\/0-9\-\#=&])(?=(\.|,|;|:|\?|\!)?("|'|«|»|\[|\s|\r|\n|$))/... | export class HtmlTools {
static escapeHtml (text) {
return text.replace(/[\"&<>]/g, a => HtmlTools._escapeCharMap[a]);
}
static anchorLinksEscapeHtml (text) {
var linkRegex = /((https?:\/\/|www\.|[^\s:=]+@www\.).*?[a-z_\/0-9\-\#=&])(?=(\.|,|;|\?|\!)?("|'|«|»|\[|\s|\r|\n|$))/g;
... |
Add absolute URLs to form and question admin | #!/usr/bin/python
# -*- coding: utf-8 -*-
from django.core.urlresolvers import reverse
from django.utils.translation import ugettext as _
from django.db import models
class Form(models.Model):
title = models.CharField(_("Title"), max_length=255)
def __unicode__(self):
return u'%s' % self.title
... | #!/usr/bin/python
# -*- coding: utf-8 -*-
from django.utils.translation import ugettext as _
from django.db import models
class Form(models.Model):
title = models.CharField(_("Title"), max_length=255)
def __unicode__(self):
return u'%s' % self.title
class Meta:
ordering = ('title', )
... |
Add a method to noop the make_key in Django | """
django_casscache
~~~~~~~~~~~~~~~~
:copyright: (c) 2013 by Matt Robenolt.
:license: BSD, see LICENSE for more details.
"""
from django.core.cache.backends.memcached import BaseMemcachedCache
class CasscacheCache(BaseMemcachedCache):
"An implementation of a cache binding using casscache"
def __init__(self... | """
django_casscache
~~~~~~~~~~~~~~~~
:copyright: (c) 2013 by Matt Robenolt.
:license: BSD, see LICENSE for more details.
"""
from django.core.cache.backends.memcached import BaseMemcachedCache
class CasscacheCache(BaseMemcachedCache):
"An implementation of a cache binding using casscache"
def __init__(self... |
Remove timestamp from the concat task. | module.exports = function(grunt) {
// Project configuration.
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
concat: {
options: {
stripBanners: false, // no comments are stripped
banner: '/*! <%= pkg.name %> - v<%= pkg.version %> */\n',
... | module.exports = function(grunt) {
// Project configuration.
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
concat: {
options: {
stripBanners: false, // no comments are stripped
banner: '/*! <%= pkg.name %> - v<%= pkg.version %> - ' +
... |
Check whether any getter returns an array before returning a non-array type in Data. | <?php
namespace ComplexPie;
class Data extends Extension
{
protected static $static_ext = array();
public static function add_static_extension($extpoint, $ext, $priority)
{
if ($extpoint === 'get' && !is_callable($ext))
{
throw new \InvalidArgumentException("$ext is not cal... | <?php
namespace ComplexPie;
class Data extends Extension
{
protected static $static_ext = array();
public static function add_static_extension($extpoint, $ext, $priority)
{
if ($extpoint === 'get' && !is_callable($ext))
{
throw new \InvalidArgumentException("$ext is not cal... |
Fix subtle bug in the ReduceReads stash reported by Adam
* The tailSet generated every time we flush the reads stash is still being affected by subsequent clears because it is just a pointer to the parent element in the original TreeSet. This is dangerous, and there is a weird condition where the clear will affect... | package org.broadinstitute.sting.utils.sam;
import com.google.java.contract.Ensures;
import com.google.java.contract.Requires;
import net.sf.samtools.SAMRecord;
import java.util.Comparator;
public class AlignmentStartWithNoTiesComparator implements Comparator<SAMRecord> {
@Requires("c1 >= 0 && c2 >= 0")
@Ens... | package org.broadinstitute.sting.utils.sam;
import com.google.java.contract.Ensures;
import com.google.java.contract.Requires;
import net.sf.samtools.SAMRecord;
import java.util.Comparator;
public class AlignmentStartWithNoTiesComparator implements Comparator<SAMRecord> {
@Requires("c1 >= 0 && c2 >= 0")
@Ens... |
Add 3.8 to the list of supported versions | from setuptools import setup
classifiers = [
'Development Status :: 4 - Beta',
'Intended Audience :: Developers',
'License :: OSI Approved :: Apache Software License',
'Operating System :: POSIX',
'Operating System :: MacOS :: Ma... | from setuptools import setup
classifiers = [
'Development Status :: 4 - Beta',
'Intended Audience :: Developers',
'License :: OSI Approved :: Apache Software License',
'Operating System :: POSIX',
'Operating System :: MacOS :: Ma... |
Support the app_dev.php front controller | <?php
class ContaoValetDriver extends ValetDriver
{
/**
* Determine if the driver serves the request.
*
* @param string $sitePath
* @param string $siteName
* @param string $uri
* @return bool
*/
public function serves($sitePath, $siteName, $uri)
{
return is_... | <?php
class ContaoValetDriver extends ValetDriver
{
/**
* Determine if the driver serves the request.
*
* @param string $sitePath
* @param string $siteName
* @param string $uri
* @return bool
*/
public function serves($sitePath, $siteName, $uri)
{
return is_... |
Use $timeout to make $apply functions go to the next digest, to prevent "$digest already in progress". | import CartBase from './base/cart-base.js';
class CartBlogListCtrl extends CartBase {
constructor($scope, $timeout, ...args) {
super(...args);
this.logInit('CartBlogListCtrl');
this.$scope = $scope;
this.$timeout = $timeout;
this.postList = [];
this.init();
}
init() {
if (!this.a... | import CartBase from './base/cart-base.js';
class CartBlogListCtrl extends CartBase {
constructor($scope, ...args) {
super(...args);
this.logInit('CartBlogListCtrl');
this.$scope = $scope;
this.postList = [];
this.init();
}
init() {
if (!this.apiService.isDataInitialized()) {
/... |
Fix NullPointerException when the inventory doesn't contain sugar canes | package org.paolo565.drills.utils;
import org.bukkit.Material;
import org.bukkit.inventory.Inventory;
import org.bukkit.inventory.ItemStack;
public class InventoryUtils {
public static int countItemsInInventory(Inventory inventory, Material material) {
int count = 0;
for(int i = 0; i < inventory.... | package org.paolo565.drills.utils;
import org.bukkit.Material;
import org.bukkit.inventory.Inventory;
import org.bukkit.inventory.ItemStack;
public class InventoryUtils {
public static int countItemsInInventory(Inventory inventory, Material material) {
int count = 0;
for(int i = 0; i < inventory.... |
Add test for missing paddable char | import request from 'supertest';
import test from 'tape';
import app from '../server';
test('Should leftpad correctly', t => {
request(app)
.get('?str=paddin%27%20oswalt&len=68&ch=@')
.expect(200)
.expect('Content-Type', /json/)
.end((err, res) => {
if (err) thro... | import request from 'supertest';
import test from 'tape';
import app from '../server';
test('Should leftpad correctly', t => {
request(app)
.get('?str=paddin%27%20oswalt&len=68&ch=@')
.expect(200)
.expect('Content-Type', /json/)
.end((err, res) => {
if (err) thro... |
Add missing config variable name |
var path = require('path');
var yaml_config = require('node-yaml-config');
var _ = require('lodash');
function ymlHerokuConfigModule() {
var HEROKU_VARS_SUPPORT = [
'user', 'password', 'url', 'pipeline', 'jobs', 'key', 'secret', 'account', 'debug', 'dangerzone', 'acceptableTimeFailed', 'timeDiff'
];
var c... |
var path = require('path');
var yaml_config = require('node-yaml-config');
var _ = require('lodash');
function ymlHerokuConfigModule() {
var HEROKU_VARS_SUPPORT = [
'user', 'password', 'url', 'pipeline', 'jobs', 'key', 'secret', 'account', 'debug', 'dangerzone', 'acceptableTimeFailed'
];
var create = func... |
Update post view to save username references and save a post id in user entity | from flask import render_template, redirect, url_for
from flask_classy import FlaskView, route
from flask_user import login_required, current_user
from ..models import PostModel
from ..forms import PostForm
class Post(FlaskView):
""" Here will handle post creations, delete and update."""
def get(self, entity... | from flask import render_template, redirect, url_for
from flask_classy import FlaskView, route
from flask_user import login_required
from ..models import PostModel
from ..forms import PostForm
class Post(FlaskView):
""" Here will handle post creations, delete and update."""
def get(self, entity_id):
... |
Update of sorted merge step test case
git-svn-id: 51b39fcfd0d3a6ea7caa15377cad4af13b9d2664@4016 5fb7f6ec-07c1-534a-b4ca-9155e429e800 | package org.pentaho.di.run.sortedmerge;
import junit.framework.TestCase;
import org.pentaho.di.core.Result;
import org.pentaho.di.core.logging.LogWriter;
import org.pentaho.di.run.AllRunTests;
import org.pentaho.di.run.TimedTransRunner;
public class RunSortedMerge extends TestCase
{
public void test_S... | package org.pentaho.di.run.sortedmerge;
import junit.framework.TestCase;
import org.pentaho.di.core.Result;
import org.pentaho.di.core.logging.LogWriter;
import org.pentaho.di.run.AllRunTests;
import org.pentaho.di.run.TimedTransRunner;
public class RunSortedMerge extends TestCase
{
public void test_S... |
fix(components/tab): Switch label prop type to node
Signed-off-by: Sorin Davidoi <26079c5830d7e64e00f1acbebee386bbb15cb990@gmail.com> | // (C) Copyright 2014-2016 Hewlett Packard Enterprise Development LP
import React, { Component, PropTypes } from 'react';
import classnames from 'classnames';
import Button from './Button';
import CSSClassnames from '../utils/CSSClassnames';
const CLASS_ROOT = CSSClassnames.TAB;
export default class Tab extends Comp... | // (C) Copyright 2014-2016 Hewlett Packard Enterprise Development LP
import React, { Component, PropTypes } from 'react';
import classnames from 'classnames';
import Button from './Button';
import CSSClassnames from '../utils/CSSClassnames';
const CLASS_ROOT = CSSClassnames.TAB;
export default class Tab extends Comp... |
Fix "show campaign" button label | @extends('layouts.app')
@section('title', 'Schedule new campaign run')
@section('content')
<div class="c-header">
<h2>SCHEDULES</h2>
</div>
<div class="card">
<div class="card-header">
<h2>Edit scheduled run <small>{{ $schedule->campaign->name }}</small></h2>
<div ... | @extends('layouts.app')
@section('title', 'Schedule new campaign run')
@section('content')
<div class="c-header">
<h2>SCHEDULES</h2>
</div>
<div class="card">
<div class="card-header">
<h2>Edit scheduled run <small>{{ $schedule->campaign->name }}</small></h2>
<div ... |
Apply consistent tabbing to gruntfile
2 space tabs | module.exports = function(grunt) {
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
banner: '/*! <%= pkg.name %> <%= pkg.version %> | Copyright <%= grunt.template.today("yyyy") %> <%= pkg.author.name %> | <%= pkg.license %> License */\n',
concat: {
options: {
stripBanners: {
... | module.exports = function(grunt) {
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
banner: '/*! <%= pkg.name %> <%= pkg.version %> | Copyright <%= grunt.template.today("yyyy") %> <%= pkg.author.name %> | <%= pkg.license %> License */\n',
concat: {
options: {
... |
Add a 'use' statement for PHP 5.3 bug. | <?php
namespace PureMachine\Bundle\WebServiceBundle\WebService;
use Symfony\Component\DependencyInjection\ContainerAwareInterface;
use JMS\DiExtraBundle\Annotation\Inject;
use JMS\DiExtraBundle\Annotation\InjectParams;
use Symfony\Component\DependencyInjection\ContainerInterface;
use JMS\DiExtraBundle\Annotation\Servi... | <?php
namespace PureMachine\Bundle\WebServiceBundle\WebService;
use Symfony\Component\DependencyInjection\ContainerAwareInterface;
use JMS\DiExtraBundle\Annotation\Inject;
use JMS\DiExtraBundle\Annotation\InjectParams;
use Symfony\Component\DependencyInjection\ContainerInterface;
class SymfonyBaseWebService extends B... |
Use single quotes for strings | import React, { Component, PropTypes } from 'react';
import FormControl from 'react-bootstrap/lib/FormControl';
class Filter extends Component {
constructor(props){
super(props);
this.state = {filterValue : this.props.query};
this.inputChanged = this.inputChanged.bind(this);
}
com... | import React, { Component, PropTypes } from 'react';
import FormControl from 'react-bootstrap/lib/FormControl';
class Filter extends Component {
constructor(props){
super(props);
this.state = {filterValue : this.props.query};
this.inputChanged = this.inputChanged.bind(this);
}
com... |
Add must login requirement to user page | <?php
namespace Page;
class User
{
public function index()
{
$this->router->redirect('user/profile');
}
public function profile()
{
$this->auth->requireLogin();
$this->load->model('Manga');
$this->load->library('Manga... | <?php
namespace Page;
class User
{
public function index()
{
$this->router->redirect('user/profile');
}
public function profile()
{
$this->load->model('Manga');
$this->load->library('Manga', 'MangaLib');
$this->load->l... |
Update DictStack implementation from jaraco.collections 3.5.1 | import collections
import itertools
# from jaraco.collections 3.5.1
class DictStack(list, collections.abc.Mapping):
"""
A stack of dictionaries that behaves as a view on those dictionaries,
giving preference to the last.
>>> stack = DictStack([dict(a=1, c=2), dict(b=2, a=2)])
>>> stack['a']
2... | import collections
import itertools
# from jaraco.collections 3.5
class DictStack(list, collections.abc.Mapping):
"""
A stack of dictionaries that behaves as a view on those dictionaries,
giving preference to the last.
>>> stack = DictStack([dict(a=1, c=2), dict(b=2, a=2)])
>>> stack['a']
2
... |
Make npm verbose during 'platform build -vv' | <?php
namespace Platformsh\Cli\Local\Toolstack;
use Platformsh\Cli\Exception\DependencyMissingException;
use Symfony\Component\Console\Output\OutputInterface;
class NodeJs extends ToolstackBase
{
public function getKey()
{
return 'nodejs:default';
}
public function detect($appRoot)
{
... | <?php
namespace Platformsh\Cli\Local\Toolstack;
use Platformsh\Cli\Exception\DependencyMissingException;
class NodeJs extends ToolstackBase
{
public function getKey()
{
return 'nodejs:default';
}
public function detect($appRoot)
{
// Refuse to detect automatically.
return... |
Make field filter errors ValidationErrors |
from django.db.models.fields import NOT_PROVIDED
from django.forms import ValidationError
from nap.utils import digattr
class field(property):
'''A base class to compare against.'''
def __get__(self, instance, cls=None):
if instance is None:
return self
return self.fget(instance.... |
from django.db.models.fields import NOT_PROVIDED
from nap.utils import digattr
class field(property):
'''A base class to compare against.'''
def __get__(self, instance, cls=None):
if instance is None:
return self
return self.fget(instance._obj)
def __set__(self, instance, va... |
Add test login error case | <?php
namespace Tests\Feature;
use Tests\TestCase;
use Illuminate\Foundation\Testing\WithoutMiddleware;
use Illuminate\Foundation\Testing\DatabaseMigrations;
use Illuminate\Foundation\Testing\DatabaseTransactions;
use App\Models\User;
use Illuminate\Support\Facades\Hash;
use Tymon\JWTAuth\Facades\JWTAuth;
class Log... | <?php
namespace Tests\Feature;
use Tests\TestCase;
use Illuminate\Foundation\Testing\WithoutMiddleware;
use Illuminate\Foundation\Testing\DatabaseMigrations;
use Illuminate\Foundation\Testing\DatabaseTransactions;
use App\Models\User;
use Illuminate\Support\Facades\Hash;
use Tymon\JWTAuth\Facades\JWTAuth;
class Log... |
Add chain capability to a row object | <?php
/*
* This file is part of the DataGridBundle.
*
* (c) Stanislav Turza <sorien@mail.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Sorien\DataGridBundle\Grid;
class Row
{
private $fields;
private $co... | <?php
/*
* This file is part of the DataGridBundle.
*
* (c) Stanislav Turza <sorien@mail.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Sorien\DataGridBundle\Grid;
class Row
{
private $fields;
private $co... |
Make the last function also a generator, so that the explanation flows better | #!/usr/bin/env python
import sys, operator, string
def characters(filename):
for line in open(filename):
for c in line:
yield c
def all_words(filename):
start_char = True
for c in characters(filename):
if start_char == True:
word = ""
if c.isalnum():
... | #!/usr/bin/env python
import sys, operator, string
def characters(filename):
for line in open(filename):
for c in line:
yield c
def all_words(filename):
start_char = True
for c in characters(filename):
if start_char == True:
word = ""
if c.isalnum():
... |
Use updated_at isntead of created_at | <div class="content-filter-ui" data-url="{!! URL::current() !!}">
{!! Form::label('newscat_id', trans('app.category')) !!}: {!! Form::selectForeign('newscat_id', null, true) !!}
</div>
@foreach ($newsCollection as $news)
<article class="news">
<header>
<h2>{{ $news->title }}</h2>
... | <div class="content-filter-ui" data-url="{!! URL::current() !!}">
{!! Form::label('newscat_id', trans('app.category')) !!}: {!! Form::selectForeign('newscat_id', null, true) !!}
</div>
@foreach ($newsCollection as $news)
<article class="news">
<header>
<h2>{{ $news->title }}</h2>
... |
Revert "fix: NpzPckLoader meddle one-element array"
This reverts commit b3bf178ed07d789282a05fa4efac799c9e0c5910.
NpzPckLoader:
* 1 vs array(1)
* 'a' vs array('a', dtype='<U1')
NpzPckSaver np.asanyarray:
* 1 vs np.void(pickle.dumps('1'))
* 'a' vs np.void(pickle.dumps('a'))
Note:
* type(np.asanyarray(np.void(pi... | # -*- coding: utf-8 -*-
# Copyright (c) 2019 shmilee
'''
Contains Npz pickled file loader class.
'''
import numpy
import zipfile
from ..glogger import getGLogger
from .base import BasePckLoader
__all__ = ['NpzPckLoader']
log = getGLogger('L')
class NpzPckLoader(BasePckLoader):
'''
Load pickled data from ... | # -*- coding: utf-8 -*-
# Copyright (c) 2019 shmilee
'''
Contains Npz pickled file loader class.
'''
import numpy
import zipfile
from ..glogger import getGLogger
from .base import BasePckLoader
__all__ = ['NpzPckLoader']
log = getGLogger('L')
class NpzPckLoader(BasePckLoader):
'''
Load pickled data from ... |
Fix failing move forward tests | class Rover:
compass = ['N', 'E', 'S', 'W']
def __init__(self, x=0, y=0, direction='N'):
self.x = x
self.y = y
self.direction = direction
@property
def position(self):
return self.x, self.y, self.direction
@property
def compass_index(self):
return next... | class Rover:
compass = ['N', 'E', 'S', 'W']
def __init__(self, x=0, y=0, direction='N'):
self.x = x
self.y = y
self.direction = direction
@property
def position(self):
return self.x, self.y, self.direction
@property
def compass_index(self):
return next... |
Fix exception when access is not specified | package com.github.dump247.jenkins.plugins.dockerjob.slaves;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import static com.google.common.base.Preconditions.checkNotNull;
public class DirectoryMapping {
private static final Pattern MAPPING_PATTERN = Pattern.compile("^(/[^:]+):(/[^:]+)(?::(ro|r... | package com.github.dump247.jenkins.plugins.dockerjob.slaves;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import static com.google.common.base.Preconditions.checkNotNull;
public class DirectoryMapping {
private static final Pattern MAPPING_PATTERN = Pattern.compile("^(/[^:]+):(/[^:]+)(?::(ro|r... |
Switch workbench option to package | <?php namespace Arcanedev\GeoIP\Commands;
use Illuminate\Console\Command;
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Input\InputArgument;
class InstallCommand extends Command
{
/* ------------------------------------------------------------------------------------------------
... | <?php namespace Arcanedev\GeoIP\Commands;
use Illuminate\Console\Command;
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Input\InputArgument;
class InstallCommand extends Command
{
/* ------------------------------------------------------------------------------------------------
... |
Create the console script entrypoint. | #!/usr/bin/env python
import os
from setuptools import setup
def readreq(filename):
result = []
with open(filename) as f:
for req in f:
req = req.lstrip()
if req.startswith('-e ') or req.startswith('http:'):
idx = req.find('#egg=')
if idx >= 0:... | #!/usr/bin/env python
import os
from setuptools import setup
def readreq(filename):
result = []
with open(filename) as f:
for req in f:
req = req.lstrip()
if req.startswith('-e ') or req.startswith('http:'):
idx = req.find('#egg=')
if idx >= 0:... |
Convert column edit to react-modal | import classnames from 'classnames';
import Form from './Item/Form';
import Modal from 'react-modal';
import React, { Component } from 'react';
class EditColumn extends Component {
constructor() {
super();
this.state = { isEditing: false };
this.onDelete = this.onDelete.bind(this);
this.onEdit = th... | import classnames from 'classnames';
import Form from './Item/Form';
import React, { Component } from 'react';
class EditColumn extends Component {
constructor() {
super();
this.state = { isEditing: false };
this.onDelete = this.onDelete.bind(this);
this.onEdit = this.onEdit.bind(this);
this.to... |
Use buffer() to try and avoid memory copies | # -*- coding: utf-8 -*-
import errno
import collections
from savate import writev
# FIXME: should this be a method of BufferEvent below ?
# FIXME: handle Python2.x/Python3k compat here
def buffer_slice(buff, offset, size):
return buffer(buff, offset, size)
class BufferOutputHandler(object):
def __init__(sel... | # -*- coding: utf-8 -*-
import errno
import collections
from savate import writev
# FIXME: should this be a method of BufferEvent below ?
# FIXME: handle Python2.x/Python3k compat here
def buffer_slice(buff, offset, size):
return buffer(buff, offset, size)
class BufferOutputHandler(object):
def __init__(sel... |
Support hostname argument on hosts defined in inventory.yml | <?php
namespace Droid\Loader;
use Symfony\Component\Yaml\Parser as YamlParser;
use Droid\Model\Inventory;
use Droid\Model\Host;
use Droid\Model\HostGroup;
use RuntimeException;
class YamlInventoryLoader
{
public function load(Inventory $inventory, $filename)
{
if (!file_exists($filename)) {
... | <?php
namespace Droid\Loader;
use Symfony\Component\Yaml\Parser as YamlParser;
use Droid\Model\Inventory;
use Droid\Model\Host;
use Droid\Model\HostGroup;
use RuntimeException;
class YamlInventoryLoader
{
public function load(Inventory $inventory, $filename)
{
if (!file_exists($filename)) {
... |
Fix sending Amazon SES email with header by using protected properties in PHPMailer. | <?php
namespace ByJG\Mail\Wrapper;
use Aws\Common\Credentials\Credentials;
use Aws\Ses\SesClient;
use ByJG\Mail\Envelope;
use ByJG\Mail\MailConnection;
class AmazonSesWrapper extends PHPMailerWrapper
{
/**
* ses://accessid:aswsecret@region
*
* @param MailConnection $this->connection
* @param... | <?php
namespace ByJG\Mail\Wrapper;
use Aws\Common\Credentials\Credentials;
use Aws\Ses\SesClient;
use ByJG\Mail\Envelope;
use ByJG\Mail\MailConnection;
class AmazonSesWrapper extends PHPMailerWrapper
{
/**
* ses://accessid:aswsecret@region
*
* @param MailConnection $this->connection
* @param... |
feat(repo): Include module name in AMD definition
RequireJS needs to know which name to register an AMD module under. The name was previously mixing; this PR fixes that. | 'use strict';
var webpack = require('webpack');
var LodashModuleReplacementPlugin = require('lodash-webpack-plugin');
var env = process.env.NODE_ENV;
var reactExternal = {
root: 'React',
commonjs2: 'react',
commonjs: 'react',
amd: 'react'
};
var reactDomExternal = {
root: 'ReactDOM',
commonjs2:... | 'use strict';
var webpack = require('webpack');
var LodashModuleReplacementPlugin = require('lodash-webpack-plugin');
var env = process.env.NODE_ENV;
var reactExternal = {
root: 'React',
commonjs2: 'react',
commonjs: 'react',
amd: 'react'
};
var reactDomExternal = {
root: 'ReactDOM',
commonjs2:... |
Make AsyncTasks parallel on API 11+
According to the examination of the source code to AsyncTask, on pre-Honeycomb all of the AsyncTasks were executed on a thread pool with a minimum of 5 threads and a maximum of 128. But on API 11+, it won't be executed on a thread pool unless you call executeOnExecutor() with the co... | package inaka.com.tinytask;
public class TinyTask<T> {
private static TinyTask instance = null;
private GenericTask<T> genericTask;
private Something<T> something;
private DoThis<T> callback;
private TinyTask(Something<T> something) {
this.something = something;
}
private TinyTas... | package inaka.com.tinytask;
public class TinyTask<T> {
private static TinyTask instance = null;
private GenericTask<T> genericTask;
private Something<T> something;
private DoThis<T> callback;
private TinyTask(Something<T> something) {
this.something = something;
}
private TinyTas... |
Fix Webpack entry module path | const webpack = require('webpack');
const ExtractTextPlugin = require("extract-text-webpack-plugin");
const path = require('path');
// Extract CSS into a separate file
const extractSass = new ExtractTextPlugin({
filename: "../css/main.css",
});
// Minify JavaScript
const UglifyJsPlugin = new webpack.optimize.Ugli... | const webpack = require('webpack');
const ExtractTextPlugin = require("extract-text-webpack-plugin");
const path = require('path');
// Extract CSS into a separate file
const extractSass = new ExtractTextPlugin({
filename: "../css/main.css",
});
// Minify JavaScript
const UglifyJsPlugin = new webpack.optimize.Ugli... |
Return 404 if package was not found instead of raising an exception | """Simple blueprint."""
import os
from flask import Blueprint, current_app, make_response, render_template
blueprint = Blueprint('simple', __name__, url_prefix='/simple',
template_folder='templates')
@blueprint.route('', methods=['POST'])
def search_simple():
"""Handling pip search."""
re... | """Simple blueprint."""
import os
from flask import Blueprint, current_app, make_response, render_template
blueprint = Blueprint('simple', __name__, url_prefix='/simple',
template_folder='templates')
@blueprint.route('', methods=['POST'])
def search_simple():
"""Handling pip search."""
re... |
Make the string translator return the actual right values!
* zvm/zstring.py:
(ZStringStream._get_block): Remove debug printing.
(ZStringStream.get): Make the offset calculations work on the
correct bits of the data chunk. Remove debug printing. | #
# A ZString-to-ASCII Universal Translator.
#
# For the license of this file, please consult the LICENSE file in the
# root directory of this distribution.
#
class ZStringEndOfString(Exception):
"""No more data left in string."""
class ZStringStream(object):
"""This class takes an address and a ZMemory, and ... | #
# A ZString-to-ASCII Universal Translator.
#
# For the license of this file, please consult the LICENSE file in the
# root directory of this distribution.
#
class ZStringEndOfString(Exception):
"""No more data left in string."""
class ZStringStream(object):
"""This class takes an address and a ZMemory, and ... |
feat(form): Include maxBikeTime with default general settings | import React, { Component, PropTypes } from 'react'
import { connect } from 'react-redux'
import DropdownSelector from './dropdown-selector'
import queryParams from '../../common/query-params'
class GeneralSettingsPanel extends Component {
static propTypes = {
query: PropTypes.object,
paramNames: PropTypes.... | import React, { Component, PropTypes } from 'react'
import { connect } from 'react-redux'
import DropdownSelector from './dropdown-selector'
import queryParams from '../../common/query-params'
class GeneralSettingsPanel extends Component {
static propTypes = {
query: PropTypes.object,
paramNames: PropTypes.... |
Improve IN clause in WHERE | <?php
namespace BW\BlogBundle\Entity;
use Doctrine\ORM\EntityRepository;
/**
* PostRepository
*
* This class was generated by the Doctrine ORM. Add your own custom
* repository methods below.
*/
class PostRepository extends EntityRepository {
public function findNestedBy($left, $right) {
$reque... | <?php
namespace BW\BlogBundle\Entity;
use Doctrine\ORM\EntityRepository;
/**
* PostRepository
*
* This class was generated by the Doctrine ORM. Add your own custom
* repository methods below.
*/
class PostRepository extends EntityRepository {
public function findNestedBy($left, $right) {
$qb = ... |
Fix up error handling for flowd | # flowtools_wrapper.py
# Copyright 2014 Bo Bayles (bbayles@gmail.com)
# See http://github.com/bbayles/py3flowtools for documentation and license
from __future__ import division, print_function, unicode_literals
import io
import os
import sys
from .flow_line import FlowLine
if sys.version_info.major < 3:
import ... | # flowtools_wrapper.py
# Copyright 2014 Bo Bayles (bbayles@gmail.com)
# See http://github.com/bbayles/py3flowtools for documentation and license
from __future__ import division, print_function, unicode_literals
import io
import os
import sys
from .flow_line import FlowLine
if sys.version_info.major < 3:
import ... |
Remove retries limit in read ftm. | import json
import logging
class IOHandler(object):
@classmethod
def is_host_compatible(cls, host):
return False
def __init__(self, host):
raise NotImplementedError
def is_ready(self):
raise NotImplementedError
def read(self, trials=5):
try:
data = se... | import json
import logging
class IOHandler(object):
@classmethod
def is_host_compatible(cls, host):
return False
def __init__(self, host):
raise NotImplementedError
def is_ready(self):
raise NotImplementedError
def read(self, trials=5):
try:
data = se... |
Fix deprecation warning from moment | var _ = require('lodash'),
moment = require('moment');
function RelativeTimeExtension() {
moment.updateLocale('en', {
relativeTime : {
future: "in %s",
past: "%s ago",
s: function (number, withoutSuffix, key, isFuture) {
var plural = (number < 2) ?... | var _ = require('lodash'),
moment = require('moment');
function RelativeTimeExtension() {
moment.locale('en', {
relativeTime : {
future: "in %s",
past: "%s ago",
s: function (number, withoutSuffix, key, isFuture) {
var plural = (number < 2) ? " sec... |
Fix crash on delete in private message | const BotModule = require('../BotModule');
module.exports = BotModule.extend({
config: null,
i18n: null,
dependencies: {
'config': 'config',
'i18n': 'i18n',
},
initialize: function (dependencyGraph) {
this._super(dependencyGraph);
this.discordClient.on('messageDelete... | const BotModule = require('../BotModule');
module.exports = BotModule.extend({
config: null,
i18n: null,
dependencies: {
'config': 'config',
'i18n': 'i18n',
},
initialize: function (dependencyGraph) {
this._super(dependencyGraph);
this.discordClient.on('messageDelete... |
Adjust code style, remove constant and exception | package com.sleekbyte.tailor.grammar;
import com.sleekbyte.tailor.Tailor;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import java.io.ByteArrayOutputStream;
import java.io.File;
import java.io.PrintStream;
import static org.junit.Assert.assertEquals;
public class GrammarTest {
protec... | package com.sleekbyte.tailor.grammar;
import com.sleekbyte.tailor.Tailor;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import java.io.*;
import static org.junit.Assert.assertEquals;
public class GrammarTest {
protected static final String TEST_INPUT_DIR = "src/test/java/com/sleekbyte... |
Upgrade image base_url to SSL | const _ = require('lodash');
const imageConfig = require('../config/tmdb.json').images;
const formatApiResponse = require('../utils/formatApiResponse');
const { createTransformMany } = require('./utils');
const ORIGINAL_IMAGE_SIZE = 'original';
const BASE_IMAGE_URL = imageConfig.secure_base_url;
const getImageUrl = (... | const _ = require('lodash');
const imageConfig = require('../config/tmdb.json').images;
const formatApiResponse = require('../utils/formatApiResponse');
const { createTransformMany } = require('./utils');
const ORIGINAL_IMAGE_SIZE = 'original';
const BASE_IMAGE_URL = imageConfig.base_url;
const getImageUrl = (baseUrl... |
Include options and background files in packaging | #! /usr/bin/env node
var fs = require('fs');
var exec = require('child_process').exec;
var jsonfile = require('jsonfile');
var manifestFile = 'manifest.json';
fs.readFile(manifestFile, 'UTF-8', function (err, data) {
if (err) {
console.log('Error!', err);
}
var manifest = JSON.parse(data);
va... | #! /usr/bin/env node
var fs = require('fs');
var exec = require('child_process').exec;
var jsonfile = require('jsonfile');
var manifestFile = 'manifest.json';
fs.readFile(manifestFile, 'UTF-8', function (err, data) {
if (err) {
console.log('Error!', err);
}
var manifest = JSON.parse(data);
va... |
Make title field be full width | import React, { Component } from "react";
import { Form } from "react-form";
import TextField from "material-ui/TextField";
import { Container, Col } from "reactstrap";
import BodyEditor from "./BodyEditor";
import ImageListEditor from "./ImageListEditor";
export default class ItemEditor extends Component {
render()... | import React, { Component } from "react";
import { Form, Text } from "react-form";
import { Container, Col } from "reactstrap";
import BodyEditor from "./BodyEditor";
import ImageListEditor from "./ImageListEditor";
export default class ItemEditor extends Component {
render() {
let { thing, sidebar, onSubmit } =... |
Update tests to explicitly account for previous | from spec import Spec, skip, ok_, eq_, raises
from invoke.parser import Parser, Context, Argument
from invoke.collection import Collection
class Parser_(Spec):
def can_take_initial_context(self):
c = Context()
p = Parser(initial=c)
eq_(p.initial, c)
def can_take_initial_and_other_con... | from spec import Spec, skip, ok_, eq_, raises
from invoke.parser import Parser, Context, Argument
from invoke.collection import Collection
class Parser_(Spec):
def has_and_requires_initial_context(self):
c = Context()
p = Parser(initial=c)
eq_(p.initial, c)
def may_also_take_addition... |
Bump version: 0.0.2 -> 0.0.3
[ci skip] | from conans import ConanFile
from conans.tools import download, unzip
import os
VERSION = "0.0.3"
class SanitizeTargetCMakeConan(ConanFile):
name = "sanitize-target-cmake"
version = os.environ.get("CONAN_VERSION_OVERRIDE", VERSION)
generators = "cmake"
requires = ("cmake-include-guard/master@smspilla... | from conans import ConanFile
from conans.tools import download, unzip
import os
VERSION = "0.0.2"
class SanitizeTargetCMakeConan(ConanFile):
name = "sanitize-target-cmake"
version = os.environ.get("CONAN_VERSION_OVERRIDE", VERSION)
generators = "cmake"
requires = ("cmake-include-guard/master@smspilla... |
Use a smaller timeout value | "use strict";
var global = require("./global.js");
var ASSERT = require("./assert.js");
var schedule;
if (typeof process !== "undefined" && process !== null &&
typeof process.cwd === "function" &&
typeof process.nextTick === "function" &&
typeof process.version === "string") {
schedule = function Promis... | "use strict";
var global = require("./global.js");
var ASSERT = require("./assert.js");
var schedule;
if (typeof process !== "undefined" && process !== null &&
typeof process.cwd === "function" &&
typeof process.nextTick === "function" &&
typeof process.version === "string") {
schedule = function Promis... |
Allow request type specification in ajax requests
Also include csrf token in POST requests, and actually pass
data in the request | function AjaxNetwork() {
function sendRequest(url, onComplete, data, method) {
var requestMethod = method == null ? "GET" : method;
var headers = {};
if (requestMethod == "POST") {
headers["X-CSRFToken"] = $.cookie("csrftoken");
}
$.ajax({
url: url,
... | function AjaxNetwork() {
function sendRequest(url, onComplete, data) {
$.ajax({
url: url,
dataType: 'json',
complete: onComplete,
error: function(jqXHR, textStatus, errorThrown) {
console.log("Error sending request to url(" + url + "): ",
... |
Update test, fix test size | "use strict";
var assert = require('chai').assert;
var xdTesting = require('../../lib/index')
var templates = require('../../lib/templates');
var q = require('q');
describe('MultiDevice - selectAny', function () {
var test = this;
test.baseUrl = "http://localhost:8090/";
it('should select a single devic... | "use strict";
var assert = require('chai').assert;
var xdTesting = require('../../lib/index')
var templates = require('../../lib/templates');
var q = require('q');
describe('MultiDevice - selectAny', function () {
var test = this;
test.baseUrl = "http://localhost:8090/";
it('should select a single devic... |
Remove @author tag for GeLo. | <?php
/*
* This file is part of the Http Discovery package.
*
* (c) PHP HTTP Team <team@php-http.org>
*
* For the full copyright and license information, please read the LICENSE
* file that was distributed with this source code.
*/
namespace Http\Discovery\StreamFactory;
use Http\Message\StreamFactory;
use Ps... | <?php
/*
* This file is part of the Http Discovery package.
*
* (c) PHP HTTP Team <team@php-http.org>
*
* For the full copyright and license information, please read the LICENSE
* file that was distributed with this source code.
*/
namespace Http\Discovery\StreamFactory;
use Http\Message\StreamFactory;
use Ps... |
Use correct m2m join table name in LatestCommentsFeed
git-svn-id: 554f83ef17aa7291f84efa897c1acfc5d0035373@9089 bcc190cf-cafb-0310-a4f2-bffc1f526a37 | from django.conf import settings
from django.contrib.syndication.feeds import Feed
from django.contrib.sites.models import Site
from django.contrib import comments
class LatestCommentFeed(Feed):
"""Feed of latest comments on the current site."""
def title(self):
if not hasattr(self, '_site'):
... | from django.conf import settings
from django.contrib.syndication.feeds import Feed
from django.contrib.sites.models import Site
from django.contrib import comments
class LatestCommentFeed(Feed):
"""Feed of latest comments on the current site."""
def title(self):
if not hasattr(self, '_site'):
... |
Fix publish for first installation | <?php namespace Pingpong\Twitter;
use Codebird\Codebird;
use Illuminate\Support\ServiceProvider;
class TwitterServiceProvider extends ServiceProvider {
/**
* Indicates if loading of the provider is deferred.
*
* @var bool
*/
protected $defer = false;
/**
* Boot the package.
*
* @return void
*/
... | <?php namespace Pingpong\Twitter;
use Codebird\Codebird;
use Illuminate\Support\ServiceProvider;
class TwitterServiceProvider extends ServiceProvider {
/**
* Indicates if loading of the provider is deferred.
*
* @var bool
*/
protected $defer = false;
/**
* Boot the package.
*
* @return void
*/
... |
Fix react 16 key warning bug. | // @flow
import React from 'react';
import Box from 'grommet/components/Box';
import Heading from 'grommet/components/Heading';
type BlockProps = {
title: string,
onClick: () => void,
wireframe: React$Element<any>,
key: string,
}
const Block = ({ title, onClick, wireframe, key }: BlockProps) =>
<Box onClick... | // @flow
import React from 'react';
import Box from 'grommet/components/Box';
import Button from 'grommet/components/Button';
import Heading from 'grommet/components/Heading';
type BlockProps = {
title: string,
onClick: () => void,
wireframe: HTMLElement,
}
const Block = ({ title, onClick, wireframe }: BlockPro... |
Fix compilation with new SDK | package org.jetbrains.jps.cabal;
import org.jetbrains.annotations.NotNull;
import java.io.File;
import java.io.IOException;
import java.lang.reflect.Array;
import java.util.ArrayList;
import java.util.Arrays;
public class CabalJspInterface{
private final String myCabalPath;
@NotNull
private File myCabal... | package org.jetbrains.jps.cabal;
import org.jetbrains.annotations.NotNull;
import java.io.File;
import java.io.IOException;
import java.lang.reflect.Array;
import java.util.ArrayList;
import java.util.Arrays;
public class CabalJspInterface{
private final String myCabalPath;
@NotNull
private File myCabal... |
Change the background, and default style | require('script!3Dmol/release/3Dmol.js');
require('style/3dmol.styl');
angular.module('chemPhyWebApp')
.directive('chemPhyWeb3dmol', ['$http', '$log', function($http, $log) {
return {
scope: {},
link: function($scope, $element) {
// Viewer config - properties 'defau... | require('script!3Dmol/release/3Dmol.js');
require('style/3dmol.styl');
angular.module('chemPhyWebApp')
.directive('chemPhyWeb3dmol', ['$http', '$log', function($http, $log) {
return {
scope: {},
link: function($scope, $element) {
// Viewer config - properties 'defau... |
Add support for Python 3.7 and Django 2.2 | #!/usr/bin/env python
from codecs import open
from setuptools import find_packages, setup
with open('README.rst', 'r', 'utf-8') as f:
readme = f.read()
setup(
name='django-latest-tweets',
version='0.4.5',
description='Latest Tweets for Django',
long_description=readme,
url='https://github.c... | #!/usr/bin/env python
from codecs import open
from setuptools import find_packages, setup
with open('README.rst', 'r', 'utf-8') as f:
readme = f.read()
setup(
name='django-latest-tweets',
version='0.4.5',
description='Latest Tweets for Django',
long_description=readme,
url='https://github.c... |
Comment out sorting function for now | import request from 'request';
import { parseString } from 'xml2js';
export default function loadFromBGG(req) {
return new Promise((resolve, reject) => {
request({
url: `http://www.boardgamegeek.com/xmlapi2/search?query=${req.query.q}&type=boardgame`,
timeout: 10000
}, (error, response, body) => ... | import request from 'request';
import { parseString } from 'xml2js';
export default function loadFromBGG(req) {
return new Promise((resolve, reject) => {
request({
url: `http://www.boardgamegeek.com/xmlapi2/search?query=${req.query.q}&type=boardgame`,
timeout: 10000
}, (error, response, body) => ... |
Define StyleLintPlugin in webpack base config. | import path from 'path';
import webpack from 'webpack';
import StyleLintPlugin from 'stylelint-webpack-plugin';
const paths = {
ASSETS: path.resolve(__dirname, './assets'),
SRC: path.resolve(__dirname),
COMPONENTS: path.resolve(__dirname, '../src'),
DIST: path.resolve(__dirname, './build')
};
module.exports =... | import path from 'path';
import webpack from 'webpack';
const paths = {
ASSETS: path.resolve(__dirname, './assets'),
SRC: path.resolve(__dirname),
COMPONENTS: path.resolve(__dirname, '../src'),
DIST: path.resolve(__dirname, './build')
};
module.exports = {
plugins: [
new webpack.ContextReplacementPlugi... |
Change instance declaration of defaultProps to static | import Component from '../PureRenderComponent.react';
import Radium from 'radium';
import React from 'react';
import RPT from 'prop-types';
import * as colors from '../styles/Colors';
@Radium
export default class Select extends Component {
static propTypes = {
onChange: RPT.func,
options: RPT.array.isRequire... | import Component from '../PureRenderComponent.react';
import Radium from 'radium';
import React from 'react';
import RPT from 'prop-types';
import * as colors from '../styles/Colors';
@Radium
export default class Select extends Component {
static propTypes = {
onChange: RPT.func,
options: RPT.array.isRequire... |
DELETE requests should now work | var express = require('express');
var router = express.Router();
var errands = require('../modules/errands');
router.get('/', function(req, res, next) {
errands.getAll(function (err, result) {
if (err) {
return res.status(500).json(err);
}
res.json(result);
});
});
router... | var express = require('express');
var router = express.Router();
var errands = require('../modules/errands');
router.get('/', function(req, res, next) {
errands.getAll(function (err, result) {
if (err) {
return res.status(500).json(err);
}
res.json(result);
});
});
router... |
Allow searching for HPO term ID's and match only entries that contain all of the query words (instead of one of the query words). | var elasticsearch = require('elasticsearch');
if (sails.config.useElastic === true) {
var CLIENT = new elasticsearch.Client({
host: sails.config.elasticHost,
log: sails.config.elasticLogLevel
})
}
module.exports = function(req, res) {
if (!CLIENT) {
return res.notFound()
}
... | var elasticsearch = require('elasticsearch');
if (sails.config.useElastic === true) {
var CLIENT = new elasticsearch.Client({
host: sails.config.elasticHost,
log: sails.config.elasticLogLevel
})
}
module.exports = function(req, res) {
if (!CLIENT) {
return res.notFound()
}
... |
Make compass pointer consistent with LineChart | import React from 'react';
class Compass extends React.Component {
static defaultProps = {
width: 100,
height: 100,
color: "rgb(255, 128, 0)",
pointer_color: "rgb(255, 255, 255)"
};
render() {
let padding = 25,
width = this.props.width,
... | import React from 'react';
class Compass extends React.Component {
static defaultProps = {
width: 100,
height: 100,
color: "rgb(255, 128, 0)"
};
render() {
let padding = 25,
width = this.props.width,
height = this.props.height,
... |
Update to reflect new example data | from __future__ import division
import numpy as np
import matplotlib as mpl
import matplotlib.pyplot as plt
__all__ = ["palplot", "dogplot"]
def palplot(pal, size=1):
"""Plot the values in a color palette as a horizontal array.
Parameters
----------
pal : sequence of matplotlib colors
color... | from __future__ import division
import numpy as np
import matplotlib as mpl
import matplotlib.pyplot as plt
__all__ = ["palplot", "dogplot"]
def palplot(pal, size=1):
"""Plot the values in a color palette as a horizontal array.
Parameters
----------
pal : sequence of matplotlib colors
color... |
Use theme colors in notifications
Closes #177 | import React, { PropTypes } from 'react';
import { connect } from 'react-redux';
import Snackbar from 'material-ui/Snackbar';
import { hideNotification as hideNotificationAction } from '../../actions/notificationActions' ;
function getStyles(context) {
if (!context) return { primary1Color: '#00bcd4', accent1Color:... | import React, { PropTypes } from 'react';
import { connect } from 'react-redux';
import Snackbar from 'material-ui/Snackbar';
import { hideNotification as hideNotificationAction } from '../../actions/notificationActions' ;
class Notification extends React.Component {
handleRequestClose = () => {
this.props... |
Update ContactBook Middleware to obey contract | import logging
from django.http import Http404
from gargoyle import gargoyle
from contacts.models import Book
sentry = logging.getLogger('sentry')
class ContactBookMiddleware(object):
def process_view(self, request, view_func, view_args, view_kwargs):
# CONTRACT: At the end of this, if the user is authen... | import logging
from django.http import Http404
from gargoyle import gargoyle
from contacts.models import Book
sentry = logging.getLogger('sentry')
class ContactBookMiddleware(object):
def process_view(self, request, view_func, view_args, view_kwargs):
if hasattr(request, 'user'):
if request.... |
Refresh the embed block onload in PublishBrief | var Publish = {
enableSend: function() {
MovimUtils.removeClass('#button_send', 'disabled');
},
disableSend: function() {
MovimUtils.addClass('#button_send', 'disabled');
}
}
var PublishBrief = {
togglePrivacy: function() {
var checked = document.querySelector('#publishbrief... | var Publish = {
enableSend: function() {
MovimUtils.removeClass('#button_send', 'disabled');
},
disableSend: function() {
MovimUtils.addClass('#button_send', 'disabled');
}
}
var PublishBrief = {
togglePrivacy: function() {
var checked = document.querySelector('#publishbrief... |
Fix install dependencies and bump to 1.0.3 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from setuptools import setup
def get_description():
try:
with open("README.md") as f:
return f.read()
except IOError:
return ""
setup(name='ulp',
version='1.0.3',
author='Guilherme Victal',
author_email='guilherme a... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from setuptools import setup
def get_description():
try:
with open("README.md") as f:
return f.read()
except IOError:
return ""
setup(name='ulp',
version='1.0.2',
author='Guilherme Victal',
author_email='guilherme a... |
Change data provider name for add email test | <?php
class AddMailTest extends PHPUnit_Extensions_Selenium2TestCase
{
protected function setUp()
{
$this->setHost('127.0.0.1');
$this->setBrowser('firefox');
$this->setBrowserUrl('http://mail-sender.dev');
}
public function setUpPage()
{
$this->url('/mail_sender.ph... | <?php
class AddMailTest extends PHPUnit_Extensions_Selenium2TestCase
{
protected function setUp()
{
$this->setHost('127.0.0.1');
$this->setBrowser('firefox');
$this->setBrowserUrl('http://mail-sender.dev');
}
public function setUpPage()
{
$this->url('/mail_sender.ph... |
Return the appended node to match the DOM api | var mocks = {
getFakeView: function(width, height) {
return {
handler: false,
clientWidth: width,
clientHeight: height,
addEventListener: function(handler) { this.handler = handler; },
removeEventListener: function() {... | var mocks = {
getFakeView: function(width, height) {
return {
handler: false,
clientWidth: width,
clientHeight: height,
addEventListener: function(handler) { this.handler = handler; },
removeEventListener: function() {... |
Add a subcommand for listing packages | """WebShack: Sensible web components.
Usage:
webshack list
webshack get <package>...
webshack -h | --help
webshack --version
Options:
-h --help Show this screen.
--version Show version.
"""
import sys
from docopt import docopt
from termcolor import colored
from webshack.install_package ... | """WebShack: Sensible web components.
Usage:
webshack get <package>...
webshack -h | --help
webshack --version
Options:
-h --help Show this screen.
--version Show version.
"""
import sys
from docopt import docopt
from termcolor import colored
from webshack.install_package import install_p... |
Remove subtree push from grunt push-master task. | module.exports = function() {
return {
_defaults: {
bg: false
},
/**
* Clean the app distribution folder.
*/
app_clean: {
execOpts: {
cwd: '.'
},
cmd: 'rm -Rf <%= distScriptsPath %>/*'
},
... | module.exports = function() {
return {
_defaults: {
bg: false
},
/**
* Clean the app distribution folder.
*/
app_clean: {
execOpts: {
cwd: '.'
},
cmd: 'rm -Rf <%= distScriptsPath %>/*'
},
... |
Add key to list to optimise rendering | import React from "react"
import classes from "./HeaderBar.module.css"
import Logo from "../../assets/sGonksLogo.png"
import { Link, NavLink } from "react-router-dom"
import LinkButton from "../UI/LinkButton/LinkButton"
import LoginButtonSet from "../UI/LoginButtonSet/LoginButtonSet";
const HeaderBar = (props) => {
... | import React from "react"
import classes from "./HeaderBar.module.css"
import Logo from "../../assets/sGonksLogo.png"
import { Link, NavLink } from "react-router-dom"
import LinkButton from "../UI/LinkButton/LinkButton"
import LoginButtonSet from "../UI/LoginButtonSet/LoginButtonSet";
const HeaderBar = (props) => {
... |
Update class name to camelcase pattern. | class UploadFile():
def __init__(self, name, type=None, size=None, not_allowed_msg=''):
self.name = name
self.type = type
self.size = size
self.not_allowed_msg = not_allowed_msg
self.url = "data/%s" % name
self.delete_url = "delete/%s" % name
self.delete_type... | class uploadfile():
def __init__(self, name, type=None, size=None, not_allowed_msg=''):
self.name = name
self.type = type
self.size = size
self.not_allowed_msg = not_allowed_msg
self.url = "data/%s" % name
self.delete_url = "delete/%s" % name
self.delete_type... |
Raise an exception when the API response is not successful | BASE_URL = 'https://api.box.com/2.0'
FOLDERS_URL = '{}/folders/{{}}/items'.format(BASE_URL)
MAX_FOLDERS = 1000
class Client(object):
def __init__(self, provider_logic):
"""
Box client constructor
:param provider_logic: oauthclient ProviderLogic instance
:return:
"""
... | BASE_URL = 'https://api.box.com/2.0'
FOLDERS_URL = '{}/folders/{{}}/items'.format(BASE_URL)
MAX_FOLDERS = 1000
class Client(object):
def __init__(self, provider_logic):
"""
Box client constructor
:param provider_logic: oauthclient ProviderLogic instance
:return:
"""
... |
Fix webpack module resolving rule | var path = require('path');
var webpack = require('webpack');
var HtmlWebpackPlugin = require('html-webpack-plugin');
module.exports = {
context: __dirname,
entry: 'client',
output: {
path: path.resolve(__dirname, 'dist'),
filename: 'bundle.js',
chunkFilename: '[id].js'
},
resolve: {
root: pa... | var path = require('path');
var webpack = require('webpack');
var HtmlWebpackPlugin = require('html-webpack-plugin');
module.exports = {
context: __dirname,
entry: './client-test/client.js',
output: {
path: path.resolve(__dirname, 'dist'),
filename: 'bundle.js',
chunkFilename: '[id].js'
},
plugin... |
Fix releases breaking if there were no notes | <?php
namespace Transformers;
class RecordTransformer extends Transformer
{
/**
* transform record
*
* @param array $record
* @return array
*/
public function transform($record)
{
return [
'release_id' => $record->release_id,
'title' => $record->bas... | <?php
namespace Transformers;
class RecordTransformer extends Transformer
{
/**
* transform record
*
* @param array $record
* @return array
*/
public function transform($record)
{
return [
'release_id' => $record->release_id,
'title' => $record->bas... |
Update mock to be a bit closer to generated content | 'use strict';
var extensions = function(){
global.AI = {};
AI.extensions = {
commands: {
test: (function() {
var module = {};
(function() {
function command(flag, parameters) {
console.log("Hello world");
... | 'use strict';
var extensions = function(){
global.AI = {};
AI.extensions = {
commands: {
test: (function() {
var module = {};
(function() {
'use strict';
function command(flag, parameters) {
co... |
Add msgpack, dependency used in parallel code. Remove PIL, since it's not pip-installable? | from setuptools import setup, find_packages
version = '0.2.0'
setup(
name='scoville',
version=version,
description="A tool for attributing MVT tile size.",
long_description=open('README.md').read(),
classifiers=[
# strings from http://pypi.python.org/pypi?%3Aaction=list_classifiers
... | from setuptools import setup, find_packages
version = '0.2.0'
setup(
name='scoville',
version=version,
description="A tool for attributing MVT tile size.",
long_description=open('README.md').read(),
classifiers=[
# strings from http://pypi.python.org/pypi?%3Aaction=list_classifiers
... |
Make code compatible with PHP <5.4 by removing short array syntax | <?php
class Algolia_Algoliasearch_Model_Resource_Fulltext_Collection extends Mage_CatalogSearch_Model_Resource_Fulltext_Collection
{
/**
* Add search query filter without preparing result since result table causes lots of lock contention.
*
* @param string $query
* @throws Exception
* @re... | <?php
class Algolia_Algoliasearch_Model_Resource_Fulltext_Collection extends Mage_CatalogSearch_Model_Resource_Fulltext_Collection
{
/**
* Add search query filter without preparing result since result table causes lots of lock contention.
*
* @param string $query
* @throws Exception
* @re... |
Add missing void pop in uncaptured exception blocks | from thinglang.compiler.buffer import CompilationBuffer
from thinglang.compiler.opcodes import OpcodeJump, OpcodePopLocal, OpcodePop
from thinglang.lexer.blocks.exceptions import LexicalHandle
from thinglang.lexer.values.identifier import Identifier
from thinglang.parser.nodes import BaseNode
from thinglang.parser.rule... | from thinglang.compiler.buffer import CompilationBuffer
from thinglang.compiler.opcodes import OpcodeJump, OpcodePopLocal
from thinglang.lexer.blocks.exceptions import LexicalHandle
from thinglang.lexer.values.identifier import Identifier
from thinglang.parser.nodes import BaseNode
from thinglang.parser.rule import Par... |
Fix bug setting the key='elb', subkey='name' attribute. | from clusto.drivers.devices.appliance.basicappliance import BasicAppliance
import boto.ec2.elb
class AmazonELB(BasicAppliance):
_driver_name = 'amazonelb'
def __init__(self, name, elbname, **kwargs):
BasicAppliance.__init__(self, name, **kwargs)
self.set_attr(key='elb', subkey='name', value=el... | from clusto.drivers.devices.appliance.basicappliance import BasicAppliance
import boto.ec2.elb
class AmazonELB(BasicAppliance):
_driver_name = 'amazonelb'
def __init__(self, name, elbname, **kwargs):
BasicAppliance.__init__(self, name, **kwargs)
self.set_attr(key='elb', subkey='name', value='e... |
Handle mounting and unmounting via ref callback | import React, { Component, PropTypes } from 'react'
import ReactDOMServer from 'react-dom/server'
import SVGInjector from 'svg-injector'
export default class ReactSVG extends Component {
static defaultProps = {
callback: () => {},
className: '',
evalScripts: 'once',
style: {}
}
static propTypes... | import React, { Component, PropTypes } from 'react'
import ReactDOM from 'react-dom'
import ReactDOMServer from 'react-dom/server'
import SVGInjector from 'svg-injector'
export default class ReactSVG extends Component {
static defaultProps = {
callback: () => {},
className: '',
evalScripts: 'once',
... |
Fix for null values in Voice events | <?php
declare(strict_types=1);
namespace Nexmo\Webhook;
use PDO;
use Zend\Diactoros\ServerRequestFactory;
use Psr\Http\Message\ServerRequestInterface;
abstract class Factory
{
abstract public static function createFromArray(array $data);
public static function createFromJson(string $json)
{
$dat... | <?php
declare(strict_types=1);
namespace Nexmo\Webhook;
use PDO;
use Zend\Diactoros\ServerRequestFactory;
use Psr\Http\Message\ServerRequestInterface;
abstract class Factory
{
abstract public static function createFromArray(array $data);
public static function createFromJson(string $json)
{
$dat... |
Fix bug to make template optional | """
Mixin fragment/html behavior into XBlocks
"""
from __future__ import absolute_import
from django.template.context import Context
from xblock.fragment import Fragment
class XBlockFragmentBuilderMixin(object):
"""
Create a default XBlock fragment builder
"""
def build_fragment(
self,
... | """
Mixin fragment/html behavior into XBlocks
"""
from __future__ import absolute_import
from django.template.context import Context
from xblock.fragment import Fragment
class XBlockFragmentBuilderMixin(object):
"""
Create a default XBlock fragment builder
"""
def build_fragment(
self,
... |
Revert "Remove IF EXISTS from DROP TABLE when resetting the db."
This reverts commit a7dce25964cd740b0d0db86b255ede60c913e73d. | import sqlite3
DB_FILENAME = 'citationhunt.sqlite3'
def init_db():
return sqlite3.connect(DB_FILENAME)
def reset_db():
db = init_db()
with db:
db.execute('''
DROP TABLE IF EXISTS categories
''')
db.execute('''
DROP TABLE IF EXISTS articles
''')
... | import sqlite3
DB_FILENAME = 'citationhunt.sqlite3'
def init_db():
return sqlite3.connect(DB_FILENAME)
def reset_db():
db = init_db()
with db:
db.execute('''
DROP TABLE categories
''')
db.execute('''
DROP TABLE articles
''')
db.execute('''
... |
Fix static files finder errors
Conflicts:
bluebottle/utils/staticfiles_finders.py | from django.utils._os import safe_join
import os
from django.conf import settings
from django.contrib.staticfiles.finders import FileSystemFinder
from bluebottle.clients.models import Client
class TenantStaticFilesFinder(FileSystemFinder):
def find(self, path, all=False):
"""
Looks for files in ... | from django.utils._os import safe_join
import os
from django.conf import settings
from django.contrib.staticfiles.finders import FileSystemFinder
from bluebottle.clients.models import Client
class TenantStaticFilesFinder(FileSystemFinder):
def find(self, path, all=False):
"""
Looks for files in ... |
Add sub fetching on page changeé | import React, { Component } from 'react'
import PostListContainer from '../../containers/PostListContainer'
import Tabs, { Tab } from '../widgets/Tabs'
class Subreddit extends Component {
constructor (props) {
super(props)
}
componentDidMount () {
this.props.actions.requestSubreddit(this.props.r)
}
... | import React, { Component } from 'react'
import PostListContainer from '../../containers/PostListContainer'
import Tabs, { Tab } from '../widgets/Tabs'
class Subreddit extends Component {
constructor (props) {
super(props)
}
componentDidMount () {
this.props.actions.requestSubreddit(this.props.r)
}
... |
Set default install to be not-verbose | module.exports = {
verbose: false,
styleLoader: "style-loader!css-loader!sass-loader",
scripts: {
'transition': true,
'alert': true,
'button': true,
'carousel': true,
'collapse': true,
'dropdown': true,
'modal': true,
'tooltip': true,
'popover': true,
'scrollspy': true,
... | module.exports = {
verbose: true,
styleLoader: "style-loader!css-loader!sass-loader",
scripts: {
'transition': true,
'alert': true,
'button': true,
'carousel': true,
'collapse': true,
'dropdown': true,
'modal': true,
'tooltip': true,
'popover': true,
'scrollspy': true,
... |
Add exception handling when call json parse | var smash = require("../smash.js");
var requestFactory = require('../core/request.js');
//TODO
//maybe group this with response
//no possibility to define JSON encoder/decoder
function lambdaProxyRequest() {
var that = this;
var next = null;
var fail = null;
var buildRequest = function (event) {
... | var smash = require("../smash.js");
var requestFactory = require('../core/request.js');
//TODO
//maybe group this with response
//no possibility to define JSON encoder/decoder
function lambdaProxyRequest() {
var that = this;
var next = null;
var fail = null;
var buildRequest = function (event) {
... |
Fix indefinite loading state for fresh start without network | const {
ADD_ITEM,
REMOVE_ITEM,
OFFLINE_ITEMS_LOADED,
CONNECTION_CHECKING,
CONNECTION_CHECKED,
CONNECTION_ONLINE,
CONNECTION_OFFLINE
} = require('../actions/items')
const initialState = {
onlineList: [],
offlineList: [],
connectionChecked: false
}
module.exports = function items(state = initialStat... | const {
ADD_ITEM,
REMOVE_ITEM,
OFFLINE_ITEMS_LOADED,
CONNECTION_CHECKING,
CONNECTION_CHECKED,
CONNECTION_ONLINE,
CONNECTION_OFFLINE
} = require('../actions/items')
const initialState = {
onlineList: [],
offlineList: [],
connectionChecked: false
}
module.exports = function items(state = initialStat... |
Fix test involving Element object | from evelink import api
from evelink import constants
def parse_assets(api_result):
def handle_rowset(rowset, parent_location):
results = []
for row in rowset.findall('row'):
item = {'id': int(row.attrib['itemID']),
'item_type_id': int(row.attrib['typeID']),
... | from evelink import api
from evelink import constants
def parse_assets(api_result):
def handle_rowset(rowset, parent_location):
results = []
for row in rowset.findall('row'):
item = {'id': int(row.attrib['itemID']),
'item_type_id': int(row.attrib['typeID']),
... |
Use live endpoint even on dev
It seems kind of okay | const ENDPOINT = "https://api.cojs.co/v0"
// const ENDPOINT = 'http://localhost:3000'
// Maybe "Connection" might be better
class Session {
constructor(id) {
// this.state = 'DISCONNECTED'
this.id = id
this.ready = Promise.resolve(id)
if(!id)
this.ready = this.create()
.then(({session... | // const ENDPOINT = "https://api.cojs.co/v0"
const ENDPOINT = 'http://localhost:3000'
// Maybe "Connection" might be better
class Session {
constructor(id) {
// this.state = 'DISCONNECTED'
this.id = id
this.ready = Promise.resolve(id)
if(!id)
this.ready = this.create()
.then(({session... |
Correct indentation et replace doublequote | var parse_insee = function(insee){
if ( insee.length !== 5 ) {
return null ;
}
//Cas spécial pour la Corse
if ( (insee.substr(0,2) == '2A') || (insee.substr(0,2) == '2B')) {
return {
code_dep: insee.substr(0,2),
code_com: insee.substr(2,3)
} ;
} else {... | var parse_insee = function(insee){
if ( insee.length !== 5 ) {
return null ;
}
//Cas spécial pour la Corse
if ( (insee.substr(0,2) == '2A') || (insee.substr(0,2) == '2B')) {
return {
code_dep: insee.substr(0,2),
code_com: insee.substr(2,3)
} ;
} else {
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.