text stringlengths 17 1.47k | positive stringlengths 673 4.43k | negative stringlengths 677 2.81k |
|---|---|---|
Handle falsey children in Commands component | import React from 'react';
import PropTypes from 'prop-types';
import {DOMNodePropType} from '../prop-types';
export default class Commands extends React.Component {
static propTypes = {
registry: PropTypes.object.isRequired,
target: PropTypes.oneOfType([
PropTypes.string,
DOMNodePropType,
]... | import React from 'react';
import PropTypes from 'prop-types';
import {DOMNodePropType} from '../prop-types';
export default class Commands extends React.Component {
static propTypes = {
registry: PropTypes.object.isRequired,
target: PropTypes.oneOfType([
PropTypes.string,
DOMNodePropType,
]... |
Use real on message handler | 'use strict';
function QueueSeeker(pool) {
this.db = 5;
this.channel = 'batch:hosts';
this.redisPrefix = 'batch:queues:';
this.pattern = this.redisPrefix + '*';
this.pool = pool;
}
module.exports = QueueSeeker;
QueueSeeker.prototype.seek = function (onMessage, callback) {
var initialCursor = ... | 'use strict';
function QueueSeeker(pool) {
this.db = 5;
this.channel = 'batch:hosts';
this.redisPrefix = 'batch:queues:';
this.pattern = this.redisPrefix + '*';
this.pool = pool;
}
module.exports = QueueSeeker;
QueueSeeker.prototype.seek = function (onMessage, callback) {
var initialCursor = ... |
Add conditions in upload method | package com.example.julian.locationservice;
import android.content.Context;
import com.meedamian.info.BasicData;
import org.json.JSONException;
import org.json.JSONObject;
public class DataUploader {
private Context c;
private String phone;
private String vanity;
private String country;
private... | package com.example.julian.locationservice;
import android.content.Context;
import com.meedamian.info.BasicData;
import org.json.JSONException;
import org.json.JSONObject;
public class DataUploader {
private Context c;
private String phone;
private String vanity;
private String county;
private ... |
Add presenter methods to retrieve books by type | package com.verybadalloc.designlib.presenters;
import com.hannesdorfmann.mosby.mvp.MvpBasePresenter;
import com.verybadalloc.designlib.model.Book;
import com.verybadalloc.designlib.network.DataCallback;
import com.verybadalloc.designlib.network.DataFetcher;
import com.verybadalloc.designlib.views.BooksListView;
/**
... | package com.verybadalloc.designlib.presenters;
import com.hannesdorfmann.mosby.mvp.MvpBasePresenter;
import com.verybadalloc.designlib.model.Book;
import com.verybadalloc.designlib.network.DataCallback;
import com.verybadalloc.designlib.network.DataFetcher;
import com.verybadalloc.designlib.views.BooksListView;
/**
... |
Correct path if slug contains "-" | <?php
namespace Caffeinated\Modules\Console;
use Illuminate\Console\GeneratorCommand as LaravelGeneratorCommand;
use Illuminate\Support\Str;
use Module;
abstract class GeneratorCommand extends LaravelGeneratorCommand
{
/**
* Parse the name and format according to the root namespace.
*
* @param str... | <?php
namespace Caffeinated\Modules\Console;
use Illuminate\Console\GeneratorCommand as LaravelGeneratorCommand;
use Illuminate\Support\Str;
use Module;
abstract class GeneratorCommand extends LaravelGeneratorCommand
{
/**
* Parse the name and format according to the root namespace.
*
* @param str... |
Use fullpath for validator facade
Added fullpath import for the validator facade. | <?php
namespace App\Http\Controllers\Auth;
use App\User;
use App\Http\Controllers\Controller;
use Illuminate\Support\Facades\Validator;
use Illuminate\Foundation\Auth\RegistersUsers;
class RegisterController extends Controller
{
/*
|--------------------------------------------------------------------------
... | <?php
namespace App\Http\Controllers\Auth;
use App\User;
use Validator;
use App\Http\Controllers\Controller;
use Illuminate\Foundation\Auth\RegistersUsers;
class RegisterController extends Controller
{
/*
|--------------------------------------------------------------------------
| Register Controller
... |
Add bildge water event map name
my app was crashing and it may come in handy later if the event repeats. | package com.robrua.orianna.type.core.common;
import java.util.HashMap;
import java.util.Map;
public enum GameMap {
BUTCHERS_BRIDGE(14), HOWLING_ABYSS(12), SUMMONERS_RIFT(11), SUMMONERS_RIFT_AUTUMN(2), SUMMONERS_RIFT_SUMMER(1), THE_CRYSTAL_SCAR(8), THE_PROVING_GROUNDS(3), TWISTED_TREELINE(10), TWISTED_TREELI... | package com.robrua.orianna.type.core.common;
import java.util.HashMap;
import java.util.Map;
public enum GameMap {
HOWLING_ABYSS(12), SUMMONERS_RIFT(11), SUMMONERS_RIFT_AUTUMN(2), SUMMONERS_RIFT_SUMMER(1), THE_CRYSTAL_SCAR(8), THE_PROVING_GROUNDS(3), TWISTED_TREELINE(10), TWISTED_TREELINE_ORIGINAL(
... |
Improve how child hooks are run in FeedForward | from .model import Model
from ... import describe
def _run_child_hooks(model, X, y):
for layer in model._layers:
for hook in layer.on_data_hooks:
hook(layer, X, y)
@describe.on_data(_run_child_hooks)
class FeedForward(Model):
'''A feed-forward network, that chains multiple Model instances ... | from .model import Model
class FeedForward(Model):
'''A feed-forward network, that chains multiple Model instances together.'''
def __init__(self, layers, **kwargs):
Model.__init__(self, **kwargs)
self.layers.extend(layers)
if self.layers:
nO = self.layers[0].output_shape[1... |
Bump vers for square Aramaic Unicode
#975 from @D-K-E | """Config for PyPI."""
from setuptools import find_packages
from setuptools import setup
setup(
author='Kyle P. Johnson',
author_email='kyle@kyle-p-johnson.com',
classifiers=[
'Intended Audience :: Education',
'Intended Audience :: Science/Research',
'License :: OSI Approved :: MI... | """Config for PyPI."""
from setuptools import find_packages
from setuptools import setup
setup(
author='Kyle P. Johnson',
author_email='kyle@kyle-p-johnson.com',
classifiers=[
'Intended Audience :: Education',
'Intended Audience :: Science/Research',
'License :: OSI Approved :: MI... |
Add key to selection rows | import React from 'react';
import PropTypes from 'prop-types';
import { Button } from 'react-bootstrap';
import FontAwesome from 'react-fontawesome';
import ContentContainer from '../../../components/applayout/ContentContainer';
import TopUtilizersSelectionRowContainer from '../containers/TopUtilizersSelectionRowConta... | import React from 'react';
import PropTypes from 'prop-types';
import { Button } from 'react-bootstrap';
import FontAwesome from 'react-fontawesome';
import ContentContainer from '../../../components/applayout/ContentContainer';
import TopUtilizersSelectionRowContainer from '../containers/TopUtilizersSelectionRowConta... |
Comment out fix_fee_product_index from migration | # -*- coding: utf-8 -*-
# Generated by Django 1.11.22 on 2019-10-31 16:33
from __future__ import unicode_literals
from django.db import migrations, OperationalError, ProgrammingError
def fix_fee_product_index(apps, schema_editor):
try:
schema_editor.execute(
'ALTER TABLE IF EXISTS cfpb.rateche... | # -*- coding: utf-8 -*-
# Generated by Django 1.11.22 on 2019-10-31 16:33
from __future__ import unicode_literals
from django.db import migrations, OperationalError, ProgrammingError
def fix_fee_product_index(apps, schema_editor):
try:
schema_editor.execute(
'ALTER TABLE IF EXISTS cfpb.rateche... |
Remove console log and rework vars. | document.getElementById('generate').onclick = genPassword;
function getRandomInt(min, max) {
return Math.floor(Math.random() * (max - min + 1)) + min;
}
function genPassword() {
var pass = "";
for (i = 0; i < document.getElementById('length').value; i++) {
var a = [];
if (document.getElem... | document.getElementById('generate').onclick = genPassword;
function getRandomInt(min, max) {
return Math.floor(Math.random() * (max - min + 1)) + min;
}
function genPassword() {
var passLength = document.getElementById('length').value;
var pass="";
for (i = 0; i < passLength; i++) {
var a = []... |
Handle Dash objects in to_json | from __future__ import absolute_import
import plotly
import plotly.graph_objs as go
def validate_coerce_fig_to_dict(fig, validate, clone=True):
from plotly.basedatatypes import BaseFigure
if isinstance(fig, BaseFigure):
fig_dict = fig.to_dict(clone=clone)
elif isinstance(fig, dict):
if v... | from __future__ import absolute_import
import plotly
import plotly.graph_objs as go
def validate_coerce_fig_to_dict(fig, validate, clone=True):
from plotly.basedatatypes import BaseFigure
if isinstance(fig, BaseFigure):
fig_dict = fig.to_dict(clone=clone)
elif isinstance(fig, dict):
if v... |
Remove stub text for deployment message | var moment = require('moment');
require('moment-duration-format');
module.exports = {
willDeploy: function(context) {
return Promise.resolve({
slack: {
startDeployDate: new Date()
}
});
},
didDeploy: function(context, slack) {
var startDeployDate = context.slack.startDeployDat... | var moment = require('moment');
require('moment-duration-format');
module.exports = {
willDeploy: function(context) {
return Promise.resolve({
slack: {
startDeployDate: new Date()
}
});
},
didDeploy: function(context, slack) {
var startDeployDate = context.slack.startDeployDat... |
Send join message on startup |
package forager.client;
import java.io.IOException;
import forager.events.JoinEvent;
import galileo.event.EventWrapper;
import galileo.net.ClientMessageRouter;
import galileo.net.GalileoMessage;
import galileo.net.MessageListener;
import galileo.net.NetworkDestination;
public class Forager implements MessageListen... |
package forager.client;
import java.io.IOException;
import galileo.net.ClientMessageRouter;
import galileo.net.GalileoMessage;
import galileo.net.MessageListener;
import galileo.net.NetworkDestination;
public class Forager implements MessageListener {
private NetworkDestination overlord;
private ClientMess... |
Fix locale not updated (should not mutate global locale) | import React from 'react';
import PropTypes from 'prop-types';
import getDisplayName from '../utils/getDisplayName';
import { localeShape } from '../constants/PropTypes';
export default Page => {
class WithLocale extends React.Component {
static displayName = getDisplayName('WithLocale', Page);
static propT... | import React from 'react';
import PropTypes from 'prop-types';
import getDisplayName from '../utils/getDisplayName';
import { localeShape } from '../constants/PropTypes';
export default Page => {
class WithLocale extends React.Component {
static displayName = getDisplayName('WithLocale', Page);
static propT... |
Disable annoying syncdb info for volatile db | from .util import import_module
import logging
def init():
"""
Initialize nazs environment, setup logging, processes and all
needed stuff for running nazs
"""
from django.core import management
# Sync volatile db, TODO set correct permissions
management.call_command('syncdb',
... | from .util import import_module
import logging
def init():
"""
Initialize nazs environment, setup logging, processes and all
needed stuff for running nazs
"""
from django.core import management
# Sync volatile db, TODO set correct permissions
management.call_command('syncdb', database='vo... |
Fix tests (needed some delay) | <?php
namespace Tests\Browser;
use Tests\DuskTestCase;
use Illuminate\Foundation\Testing\DatabaseMigrations;
use App\Trio;
class SolveTest extends DuskTestCase
{
public function testCanSolveTrio()
{
$this->browse(function ($browser) {
//Go to solve screen
$browser->visit('/so... | <?php
namespace Tests\Browser;
use Tests\DuskTestCase;
use Illuminate\Foundation\Testing\DatabaseMigrations;
use App\Trio;
class SolveTest extends DuskTestCase
{
public function testCanSolveTrio()
{
$this->browse(function ($browser) {
//Go to solve screen
$browser->visit('/so... |
Allow for destination file in mock endpoint | package com.llnw.storage.client;
import com.google.common.collect.Lists;
import com.google.common.io.Files;
import com.llnw.storage.client.io.ActivityCallback;
import javax.annotation.Nullable;
import java.io.File;
import java.io.IOException;
import java.util.List;
public class MockEndpointFactory extends EndpointF... | package com.llnw.storage.client;
import com.google.common.collect.Lists;
import com.llnw.storage.client.io.ActivityCallback;
import javax.annotation.Nullable;
import java.io.File;
import java.io.IOException;
import java.util.List;
public class MockEndpointFactory extends EndpointFactory {
public MockEndpointFac... |
Remove scalar type hint for php56 compat | <?php
/**
* This file is part of the Valit package.
*
* @package Valit
* @author Kim Ravn Hansen <moccalotto@gmail.com>
* @copyright 2017
* @license MIT
*/
namespace Moccalotto\Valit\Contracts;
interface CheckManager
{
/**
* Get or create the singleton instance.
*
* @return CheckManager
... | <?php
/**
* This file is part of the Valit package.
*
* @package Valit
* @author Kim Ravn Hansen <moccalotto@gmail.com>
* @copyright 2017
* @license MIT
*/
namespace Moccalotto\Valit\Contracts;
interface CheckManager
{
/**
* Get or create the singleton instance.
*
* @return CheckManager
... |
Use a different method for locating an existing stack
Should help with cases where there are too many stacks to receive in a single listStacks request. This way, we should only ever receive a single stack. | "use strict";
const AWS = require('aws-sdk');
const Promise = require('bluebird');
const _ = require('lodash');
//
// Step that fetches the existing stack, and stores it in the context
//
module.exports = function(context) {
return new Promise(function(resolve, reject) {
const CF = new AWS.CloudFormation... | "use strict";
const AWS = require('aws-sdk');
const Promise = require('bluebird');
const _ = require('lodash');
//
// Step that fetches the existing stack, and stores it in the context
//
module.exports = function(context) {
return new Promise(function(resolve, reject) {
const CF = new AWS.CloudFormation... |
Add Zend_Db Test - fetchAll | <?php
class ZendDbTest extends \PHPUnit_Framework_TestCase
{
public function testInstantiateDbAdapter()
{
$this->assertInstanceOf('\Zend_Db_Adapter_Pdo_Sqlite', $this->getDbAdapter());
}
public function testZendDbFactoryWithZendConfig()
{
$config = new Zend_Config(
arra... | <?php
class ZendDbTest extends \PHPUnit_Framework_TestCase
{
public function testInstantiateDbAdapter()
{
$adapter = \Zend_Db::factory(
'Pdo_Sqlite',
array(
'dbname' => dirname(__FILE__) . '/../../../data/test.sqlite'
)
);
$this->asser... |
Revert "Move build.branch-names to project settings"
This reverts commit a38fc17616ae160aa41046470964034294eade1a. | import logging
from flask import current_app
from fnmatch import fnmatch
from changes.api.build_index import BuildIndexAPIView
from changes.config import db
from changes.models import ItemOption
logger = logging.getLogger('build_revision')
def should_build_branch(revision, allowed_branches):
if not revision.b... | import logging
from flask import current_app
from fnmatch import fnmatch
from changes.api.build_index import BuildIndexAPIView
from changes.config import db
from changes.models import ItemOption, Project
logger = logging.getLogger('build_revision')
def should_build_branch(revision, allowed_branches):
if not r... |
Check for duplicates in existing dataset. Fix reference to dump file. | import json
from backend.app import app, db
from backend.models import *
from flask import url_for
# read in json redirect dump
with open('data/nid_url.json', 'r') as f:
redirects = json.loads(f.read())
print len(redirects)
old_urls = []
existing_redirects = Redirect.query.all()
for redirect in existing_redirec... | import json
from backend.app import app, db
from backend.models import *
from flask import url_for
# read in json redirect dump
with open('data/prod_url_alias.json', 'r') as f:
redirects = json.loads(f.read())
print len(redirects)
old_urls = []
error_count = 0
for i in range(len(redirects)):
nid = None
... |
Add 'hydrate' option to the doctrine mapper | <?php
namespace FOQ\ElasticaBundle\Mapper;
use FOQ\ElasticaBundle\MapperInterface;
use Doctrine\Common\Persistence\ObjectRepository;
/**
* Maps Elastica documents with Doctrine objects
* This mapper assumes an exact match between
* elastica documents ids and doctrine object ids
*/
class DoctrineMapper implements... | <?php
namespace FOQ\ElasticaBundle\Mapper;
use FOQ\ElasticaBundle\MapperInterface;
use Doctrine\Common\Persistence\ObjectRepository;
/**
* Maps Elastica documents with Doctrine objects
* This mapper assumes an exact match between
* elastica documents ids and doctrine object ids
*/
class DoctrineMapper implements... |
Remove class active from pagination
active class should be on the first page, not on the prev button | <?php include '_include/head.php'; ?>
<div class="site">
<?php include '_include/header.php'; ?>
<main class="main site-content">
<div class="container">
<h1 class="title">Notification</h1>
<ul class="all-notif list-nostyle block">
<!... | <?php include '_include/head.php'; ?>
<div class="site">
<?php include '_include/header.php'; ?>
<main class="main site-content">
<div class="container">
<h1 class="title">Notification</h1>
<ul class="all-notif list-nostyle block">
<!... |
Disable auto links by default | <?php
namespace Fenrizbes\TypographBundle\DependencyInjection;
use Symfony\Component\Config\Definition\Builder\TreeBuilder;
use Symfony\Component\Config\Definition\ConfigurationInterface;
class Configuration implements ConfigurationInterface
{
public function getConfigTreeBuilder()
{
$treeBuilder = n... | <?php
namespace Fenrizbes\TypographBundle\DependencyInjection;
use Symfony\Component\Config\Definition\Builder\TreeBuilder;
use Symfony\Component\Config\Definition\ConfigurationInterface;
class Configuration implements ConfigurationInterface
{
public function getConfigTreeBuilder()
{
$treeBuilder = n... |
Allow GitHub styles not to be purged | module.exports = {
siteMetadata: {
title: `Neon Tsunami`,
author: `Dwight Watson`,
description: `A blog on Laravel & Rails.`,
siteUrl: `https://www.neontsunami.com`,
social: {
twitter: `DwightConrad`,
},
},
plugins: [
`gatsby-plugin-postcss`,
{
resolve: `gatsby-plugin-p... | module.exports = {
siteMetadata: {
title: `Neon Tsunami`,
author: `Dwight Watson`,
description: `A blog on Laravel & Rails.`,
siteUrl: `https://www.neontsunami.com`,
social: {
twitter: `DwightConrad`,
},
},
plugins: [
`gatsby-plugin-postcss`,
{
resolve: `gatsby-plugin-p... |
Fix config test expected error message. | 'use strict';
var expect = require('chai').expect,
config = require('../../../config/config');
describe('config', function () {
describe('getConfig', function () {
var configDirectory = '../../../config/';
describe('existing configuration', function () {
var testCases = [
... | 'use strict';
var expect = require('chai').expect,
config = require('../../../config/config');
describe('config', function () {
describe('getConfig', function () {
var configDirectory = '../../../config/';
describe('existing configuration', function () {
var testCases = [
... |
Split emitted errors into two groups: connectionError and error | var util = require('util');
var http = require('http');
function HTTPTransport() {
// Opbeat currently doesn't support HTTP
this.defaultPort = 80;
this.transport = http;
}
HTTPTransport.prototype.send = function(client, message, headers) {
var options = {
hostname: client.dsn.host,
path... | var util = require('util');
var http = require('http');
function HTTPTransport() {
// Opbeat currently doesn't support HTTP
this.defaultPort = 80;
this.transport = http;
}
HTTPTransport.prototype.send = function(client, message, headers) {
var options = {
hostname: client.dsn.host,
path... |
Change build_dest default in config | <?php
return [
/*
|--------------------------------------------------------------------------
| CDNify CDN list.
|--------------------------------------------------------------------------
|
| This is a list of CDN's for cdnify to use, it will most likely be a url.
|
*/
'cdn' => [
... | <?php
return [
/*
|--------------------------------------------------------------------------
| CDNify CDN list.
|--------------------------------------------------------------------------
|
| This is a list of CDN's for cdnify to use, it will most likely be a url.
|
*/
'cdn' => [
... |
Use worker_int to avoid \n being printed too late | """Gunicorn configuration file used by gunserver's Gunicorn subprocess.
This module is not designed to be imported directly, but provided as
Gunicorn's configuration file.
"""
import os
import sys
import django
import gunicorn
# General configs.
bind = os.environ['DJANGO_ADDRPORT']
logger_class = 'djgunicorn.loggi... | """Gunicorn configuration file used by gunserver's Gunicorn subprocess.
This module is not designed to be imported directly, but provided as
Gunicorn's configuration file.
"""
import os
import sys
import django
import gunicorn
# General configs.
bind = os.environ['DJANGO_ADDRPORT']
logger_class = 'djgunicorn.loggi... |
Use Flask routing to allow for variables in URL | # -*- coding: utf-8 -*-
from functools import wraps
from flask import request
def log_request(self):
log = self.server.log
if log:
if hasattr(log, 'info'):
log.info(self.format_request() + '\n')
else:
log.write(self.format_request() + '\n')
# Monkeys are made for fr... | # -*- coding: utf-8 -*-
def log_request(self):
log = self.server.log
if log:
if hasattr(log, 'info'):
log.info(self.format_request() + '\n')
else:
log.write(self.format_request() + '\n')
# Monkeys are made for freedom.
try:
import gevent
from geventwebsocket.gu... |
Fix translation of notify slack | <?php
/*
* This file is part of Fixhub.
*
* Copyright (C) 2016 Fixhub.org
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
return [
'label' => 'Slack推送',
'create' => '新增',
'edit' ... | <?php
/*
* This file is part of Fixhub.
*
* Copyright (C) 2016 Fixhub.org
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
return [
'label' => 'Slack推送',
'create' => '新增',
'edit' ... |
Upgrade configparser to fix pip build issue on PyPy. | from setuptools import setup
import sys
REQUIREMENTS = [
'argparse',
'GitPython>=0.3.2.RC1',
'Pillow>=2.3.0',
'requests',
]
if sys.version_info <= (3,):
REQUIREMENTS.append('configparser==3.5.0b2') # Using the beta for PyPy compatibility
setup(name='lolologist',
vers... | from setuptools import setup
import sys
REQUIREMENTS = [
'argparse',
'GitPython>=0.3.2.RC1',
'Pillow>=2.3.0',
'requests',
]
if sys.version_info <= (3,):
REQUIREMENTS.append('configparser')
setup(name='lolologist',
version='0.4.0',
description='A utility that ge... |
Fix missing $ in navbar. | <?php
namespace MinePlus\DesignBundle\Navbar;
use Doctrine\Common\Collections\ArrayCollection;
class Navbar
{
/*
* @var string
*/
const COLOR_WHITE = 'white';
/*
* @var string
*/
const COLOR_BLACK = 'black';
/*
* When this is set, the color-choice is up to ... | <?php
namespace MinePlus\DesignBundle\Navbar;
use Doctrine\Common\Collections\ArrayCollection;
class Navbar
{
/*
* @var string
*/
const COLOR_WHITE = 'white';
/*
* @var string
*/
const COLOR_BLACK = 'black';
/*
* When this is set, the color-choice is up to ... |
Update : RangeIter args name changed | from .base import Client
class RangeIter(object):
def __init__(self, range_datas):
self._container = range_datas if self._valid_range(range_datas) else None
def _valid_range(self, range_datas):
if (not isinstance(range_datas, tuple) or
any(not isinstance(pair, tuple) for pair in r... | from .base import Client
class RangeIter(object):
def __init__(self, range_datas):
self._container = range_datas if self._valid_range(range_datas) else None
def _valid_range(self, range_datas):
if (not isinstance(range_datas, tuple) or
any(not isinstance(pair, tuple) for pair in r... |
Move download_url and bump version | import setuptools
from gitvendor.version import Version
from setuptools import find_packages
CLASSIFIERS = [
'Development Status :: 3 - Alpha',
'License :: OSI Approved :: MIT License',
'Environment :: Console',
'Topic :: Software Development'
]
setuptools.setup(name='git-vendor',
ver... | import setuptools
from gitvendor.version import Version
from setuptools import find_packages
CLASSIFIERS = [
'Development Status :: 3 - Alpha',
'License :: OSI Approved :: MIT License',
'Environment :: Console',
'Topic :: Software Development'
]
setuptools.setup(name='git-vendor',
ver... |
Sort by review count by default | var app = angular.module('foodfood', ['ui.router', 'ngSanitize', 'ngStorage']);
app.config(['$stateProvider', '$urlRouterProvider', function($stateProvider, $urlRouterProvider) {
$urlRouterProvider.otherwise('/main');
$stateProvider
.state('main', {
url: '/main',
views: {
'': {
templateUr... | var app = angular.module('foodfood', ['ui.router', 'ngSanitize', 'ngStorage']);
app.config(['$stateProvider', '$urlRouterProvider', function($stateProvider, $urlRouterProvider) {
$urlRouterProvider.otherwise('/main');
$stateProvider
.state('main', {
url: '/main',
views: {
'': {
templateUr... |
Add placeable to javascript context | import json
import rexviewer as r
import naali
import urllib2
from componenthandler import DynamiccomponentHandler
class JavascriptHandler(DynamiccomponentHandler):
GUINAME = "Javascript Handler"
def __init__(self):
DynamiccomponentHandler.__init__(self)
self.jsloaded = False
def onChang... | import json
import rexviewer as r
import naali
import urllib2
from componenthandler import DynamiccomponentHandler
class JavascriptHandler(DynamiccomponentHandler):
GUINAME = "Javascript Handler"
def __init__(self):
DynamiccomponentHandler.__init__(self)
self.jsloaded = False
def onChang... |
Add project as request attribute to save a little boilerplate | # Miscellaneos functions relating the projects app
import os
from datetime import datetime
from django.http import HttpResponseRedirect
from django.utils.http import urlquote
from django.conf import settings
def project_required(func):
"""
Decorator function for other actions that
require a project to be ... | # Miscellaneos functions relating the projects app
import os
from datetime import datetime
from django.http import HttpResponseRedirect
from django.utils.http import urlquote
from django.conf import settings
def project_required(func):
"""
Decorator function for other actions that
require a project to be ... |
Add viewEventSchedules function to read all schedules for an event. | var base = require('./base.js');
exports.assemble = {
addSchedule:
function (parameters, response) {
var userEventEntry = {
availability: JSON.stringify(parameters.availability),
Users_id: parameters.usersid,
Events_id: parameters.eventsid
... | var base = require('./base.js');
exports.assemble = {
addSchedule:
function (parameters, response) {
var userEventEntry = {
availability: JSON.stringify(parameters.availability),
Users_id: parameters.usersid,
Events_id: parameters.eventsid
... |
Replace the use of the list for a set to emphasize the semantics. | """
banana.maya.MFileIO
~~~~~~~~~~~~~~~~~~~
Monkey patching of the `~maya.OpenMaya.MFileIO` class.
:copyright: Copyright 2014 by Christopher Crouzet.
:license: MIT, see LICENSE for details.
"""
import gorilla
from maya import OpenMaya
@gorilla.patch(OpenMaya)
class MFileIO(object):
... | """
banana.maya.MFileIO
~~~~~~~~~~~~~~~~~~~
Monkey patching of the `~maya.OpenMaya.MFileIO` class.
:copyright: Copyright 2014 by Christopher Crouzet.
:license: MIT, see LICENSE for details.
"""
import gorilla
from maya import OpenMaya
@gorilla.patch(OpenMaya)
class MFileIO(object):
... |
Configure MIDDLEWARE_CLASSES in test settings
Django 1.7 complained:
(1_7.W001) MIDDLEWARE_CLASSES is not set.
HINT: Django 1.7 changed the global defaults for the
MIDDLEWARE_CLASSES.
django.contrib.sessions.middleware.SessionMiddleware,
django.contrib.auth.middleware.AuthenticationMiddleware, and
... | #!/usr/bin/env python
import sys
import django
from django.conf import settings
if not settings.configured:
settings.configure(
AUTHENTICATION_BACKENDS=(
'django_authgroupex.auth.AuthGroupeXBackend',
),
DATABASES={
'default': {
'ENGINE': 'django.db.... | #!/usr/bin/env python
import sys
import django
from django.conf import settings
if not settings.configured:
settings.configure(
AUTHENTICATION_BACKENDS=(
'django_authgroupex.auth.AuthGroupeXBackend',
),
DATABASES={
'default': {
'ENGINE': 'django.db.... |
Update /signin link to /login | import React, { Component } from 'react'
import { Link, IndexLink } from 'react-router'
export class Nav extends Component {
constructor(props) {
super(props)
}
render() {
return (
<nav className="transparent haze-background wrap navbar navbar-default" role="navigation">
<div className="co... | import React, { Component } from 'react'
import { Link, IndexLink } from 'react-router'
export class Nav extends Component {
constructor(props) {
super(props)
}
render() {
return (
<nav className="transparent haze-background wrap navbar navbar-default" role="navigation">
<div className="co... |
Add code to allow user to configure their own hostname, source, and sourcetype (with defaults) | import logging
import socket
import traceback
from threading import Thread
import requests
class SplunkHandler(logging.Handler):
"""
A logging handler to send events to a Splunk Enterprise instance
"""
def __init__(self, host, port, username, password, index, hostname=None, source=None, sourcetype=... | import logging
import socket
import traceback
from threading import Thread
import requests
class SplunkHandler(logging.Handler):
"""
A logging handler to send events to a Splunk Enterprise instance
"""
def __init__(self, host, port, username, password, index):
logging.Handler.__init__(self... |
Remove unused Joystick import from the main robot class. | /*----------------------------------------------------------------------------*/
/* Copyright (c) FIRST 2008. All Rights Reserved. */
/* Open Source Software - may be modified and shared by FRC teams. The code */
/* must be accompanied by the FIRST BSD license file in the root directory of... | /*----------------------------------------------------------------------------*/
/* Copyright (c) FIRST 2008. All Rights Reserved. */
/* Open Source Software - may be modified and shared by FRC teams. The code */
/* must be accompanied by the FIRST BSD license file in the root directory of... |
Use the extracted method, not the original helper. | <?php
namespace DoSomething\Gateway\Common;
class Introspector
{
/**
* Returns all traits used by a class, its subclasses and trait of their traits.
* @see illuminate/support's `class_uses_recursive`
*
* @param object|string $class
* @return array
*/
public static function getA... | <?php
namespace DoSomething\Gateway\Common;
class Introspector
{
/**
* Returns all traits used by a class, its subclasses and trait of their traits.
* @see illuminate/support's `class_uses_recursive`
*
* @param object|string $class
* @return array
*/
public static function getA... |
Rename GET parameter from ?filter to ?search | export default class AutoCompleteSubjects {
constructor(wrapper) {
this.wrapper = wrapper;
}
initialize(selector) {
const $input = this.wrapper.find('input[type=text]');
const $realInput = this.wrapper.find('input[type=hidden]');
const jsonUrl = this.wrapper.data("url");
... | export default class AutoCompleteSubjects {
constructor(wrapper) {
this.wrapper = wrapper;
}
initialize(selector) {
const $input = this.wrapper.find('input[type=text]');
const $realInput = this.wrapper.find('input[type=hidden]');
const jsonUrl = this.wrapper.data("url");
... |
fix(Service): Fix disappearing cursor in services
Workaround for disappearing cursors in webviews | import React, { Component } from 'react';
import PropTypes from 'prop-types';
import { observer } from 'mobx-react';
import ElectronWebView from 'react-electron-web-view';
import ServiceModel from '../../../models/Service';
@observer
class ServiceWebview extends Component {
static propTypes = {
service: PropTyp... | import React, { Component } from 'react';
import PropTypes from 'prop-types';
import { observer } from 'mobx-react';
import ElectronWebView from 'react-electron-web-view';
import ServiceModel from '../../../models/Service';
@observer
class ServiceWebview extends Component {
static propTypes = {
service: PropTyp... |
Insert dummy data for intercepts. | <?php
declare(strict_types=1);
namespace mcordingley\Regression\RegressionAlgorithm;
use InvalidArgumentException;
use mcordingley\LinearAlgebra\Matrix;
use mcordingley\Regression\CoefficientSet;
use mcordingley\Regression\DataBag;
use mcordingley\Regression\RegressionAlgorithm;
final class LinearLeastSquares imple... | <?php
declare(strict_types=1);
namespace mcordingley\Regression\RegressionAlgorithm;
use InvalidArgumentException;
use mcordingley\LinearAlgebra\Matrix;
use mcordingley\Regression\CoefficientSet;
use mcordingley\Regression\DataBag;
use mcordingley\Regression\RegressionAlgorithm;
final class LinearLeastSquares imple... |
Fix issue where task list appears above search result | var React = require('react'),
StateMixin = require('../mixins/app-StateMixin'),
SearchBox = require('../components/app-SearchBox'),
TaskList = require('../components/app-TaskList');
var MainCard = React.createClass({
mixins: [StateMixin],
render: function () {
"use strict";
return (... | var React = require('react'),
StateMixin = require('../mixins/app-StateMixin'),
SearchBox = require('../components/app-SearchBox'),
TaskList = require('../components/app-TaskList');
var MainCard = React.createClass({
mixins: [StateMixin],
render: function () {
"use strict";
return (... |
Move pyclamav import inside of clean method on RWValidatedFileField so that it doesn't get imported by streamscript or unless as needed for field validation | from django.forms import forms
from south.modelsinspector import add_introspection_rules
from validatedfile.fields import ValidatedFileField
class RWValidatedFileField(ValidatedFileField):
"""
Same as FileField, but you can specify:
* content_types - list containing allowed content_types.
Exa... | from django.forms import forms
from south.modelsinspector import add_introspection_rules
from validatedfile.fields import ValidatedFileField
import pyclamav
class RWValidatedFileField(ValidatedFileField):
"""
Same as FileField, but you can specify:
* content_types - list containing allowed content_typ... |
Integrate response factory into the deck controller." | <?php
namespace MoFlashCards\DeckBundle\Controller;
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
class DeckController extends Controller
{
/**
* Lists all available decks.... | <?php
namespace MoFlashCards\DeckBundle\Controller;
use JMS\Serializer\SerializationContext;
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
class DeckController extends Controller
{
... |
Add missing jshint override and always use string `displayValue`. | (function () {
'use strict';
define(
[
'lodash',
'knockout'
],
function (_, ko) {
return function (selectedSearchTypeObservable, resultFieldsObservable, detailUrlTemplate) {
return {
mapType: function (searchType) {... | (function () {
'use strict';
define(
[
'lodash',
'knockout'
],
function (_, ko) {
return function (selectedSearchTypeObservable, resultFieldsObservable, detailUrlTemplate) {
return {
mapType: function (searchType) {... |
Fix getChainedByMaster if there are not additional subroots
fixes test | <?php
class Kwc_Chained_Start_Component extends Kwc_Abstract
{
public static function getSettings()
{
$ret = parent::getSettings();
$ret['flags']['hasAllChainedByMaster'] = true;
return $ret;
}
public static function validateSettings($settings, $componentClass)
{
par... | <?php
class Kwc_Chained_Start_Component extends Kwc_Abstract
{
public static function getSettings()
{
$ret = parent::getSettings();
$ret['flags']['hasAllChainedByMaster'] = true;
return $ret;
}
public static function validateSettings($settings, $componentClass)
{
par... |
Read More module: refactoring and made regex more forgiving | <?php
class ReadMore extends Modules {
public function __init() {
# Replace comment codes before markup modules filters them.
$this->setPriority("markup_post_text", 4);
}
public function markup_post_text($text, $post = null) {
if (!is_string($text) or !pr... | <?php
class ReadMore extends Modules {
public function __init() {
$this->addAlias("markup_post_text", "more", 4); # Replace "<!--more-->" before markup modules filter it.
}
public function more($text, $post = null) {
if (!is_string($text) or preg_match("/<!--more(.+?... |
Increase service worker cache version | var CACHE_NAME = 'buddhabrot-2017-10-12-2';
var urlsToCache = [
'.',
'/',
'/main.js',
'/material-components-web.min.css',
'/material-components-web.min.js',
'/rust-logo-blk.svg',
'/rustybrot.asmjs.js',
'/rustybrot.wasm',
'/rustybrot.wasm.js',
'/worker-compositor.js',
'/worker-producer.js',
'/man... | var CACHE_NAME = 'buddhabrot-2017-10-12-1';
var urlsToCache = [
'.',
'/',
'/main.js',
'/material-components-web.min.css',
'/material-components-web.min.js',
'/rust-logo-blk.svg',
'/rustybrot.asmjs.js',
'/rustybrot.wasm',
'/rustybrot.wasm.js',
'/worker-compositor.js',
'/worker-producer.js',
'/man... |
Rename result parameter to output in CLI | 'use(strict)'
import {read, write} from '.'
import * as argsParser from './util/args'
export default function () {
var args = process.argv.slice(2)
let opts = argsParser
.option('--type', '-t', null)
.option('--base', '-b', null)
.option('--expand', '-e', false)
// .option('--flatten', '-f', fals... | 'use(strict)'
import {read, write} from '.'
import * as argsParser from './util/args'
export default function () {
var args = process.argv.slice(2)
let opts = argsParser
.option('--type', '-t', null)
.option('--base', '-b', null)
.option('--expand', '-e', false)
// .option('--flatten', '-f', fals... |
Fix typo breaking doc popups | import re
import pydoc
import gtk
from data_format import insert_with_tag, is_data_object
BOLD_RE = re.compile("(?:(.)\b(.))+")
STRIP_BOLD_RE = re.compile("(.)\b(.)")
def insert_docs(buf, iter, obj, bold_tag):
"""Insert documentation about obj into a gtk.TextBuffer
buf -- the buffer to insert the documentat... | import re
import pydoc
import gtk
from data_format import insert_with_tag, is_data_object
BOLD_RE = re.compile("(?:(.)\b(.))+")
STRIP_BOLD_RE = re.compile("(.)\b(.)")
def insert_docs(buf, iter, obj, bold_tag):
"""Insert documentation about obj into a gtk.TextBuffer
buf -- the buffer to insert the documentat... |
Use a uuid to identify component. | package adapters;
import com.fasterxml.jackson.databind.JsonNode;
import com.fasterxml.jackson.databind.ObjectMapper;
import converters.JsonConverter;
import datamodel.EventHubMessage;
import datamodel.Measurement;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.io.IOException;
import java.util.D... | package adapters;
import com.fasterxml.jackson.databind.JsonNode;
import com.fasterxml.jackson.databind.ObjectMapper;
import converters.JsonConverter;
import datamodel.EventHubMessage;
import datamodel.Measurement;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.io.IOException;
import java.util.D... |
Sort titles by lower case | "use strict";
/**
* Collection of spines.
**/
define([
"underscore",
"backbone"
], function(_, Backbone) {
var SpineCollection = Backbone.Collection.extend({
filterKey: null,
/**
* sortBy comparator: return the title, by which BB will sort the collection.
**/
c... | "use strict";
/**
* Collection of spines.
**/
define([
"underscore",
"backbone"
], function(_, Backbone) {
var SpineCollection = Backbone.Collection.extend({
filterKey: null,
/**
* sortBy comparator: return the title, by which BB will sort the collection.
**/
c... |
Reduce allocation of hadoop configuration objects | /*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distribut... | /*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distribut... |
Fix the getByUser request, the field name is userId, not user | package uk.ac.ox.oucs.oauth.dao;
import org.hibernate.HibernateException;
import org.hibernate.Session;
import org.springframework.orm.hibernate3.HibernateCallback;
import org.springframework.orm.hibernate3.support.HibernateDaoSupport;
import uk.ac.ox.oucs.oauth.domain.Accessor;
import java.sql.SQLException;
import j... | package uk.ac.ox.oucs.oauth.dao;
import org.hibernate.HibernateException;
import org.hibernate.Session;
import org.springframework.orm.hibernate3.HibernateCallback;
import org.springframework.orm.hibernate3.support.HibernateDaoSupport;
import uk.ac.ox.oucs.oauth.domain.Accessor;
import java.sql.SQLException;
import j... |
Test deployment to PyPI from Travis | #!/usr/bin/env python
# coding: utf8
# Copyright 2013-2015 Vincent Jacques <vincent@vincent-jacques.net>
import setuptools
version = "0.5.1"
setuptools.setup(
name="MockMockMock",
version=version,
description="Mocking library focusing on very explicit definition of the mocks' behaviour",
author="Vi... | #!/usr/bin/env python
# coding: utf8
# Copyright 2013-2015 Vincent Jacques <vincent@vincent-jacques.net>
import setuptools
version = "0.5.0"
setuptools.setup(
name="MockMockMock",
version=version,
description="Mocking library focusing on very explicit definition of the mocks' behaviour",
author="Vi... |
Add taxPercentage() for Laravel Cashier 6.0
In Laravel Cashier 6.0, the function to get tax rate is now ``taxPercentage()`` instead of ``getTaxPercent()`` | <?php
namespace Mpociot\VatCalculator\Traits;
use Mpociot\VatCalculator\Facades\VatCalculator;
trait BillableWithinTheEU
{
/**
* @var int
*/
protected $stripeTaxPercent = 0;
/**
* @var
*/
protected $userCountryCode;
/**
* @var bool
*/
protected $userIsCompany =... | <?php
namespace Mpociot\VatCalculator\Traits;
use Mpociot\VatCalculator\Facades\VatCalculator;
trait BillableWithinTheEU
{
/**
* @var int
*/
protected $stripeTaxPercent = 0;
/**
* @var
*/
protected $userCountryCode;
/**
* @var bool
*/
protected $userIsCompany =... |
Bug: Edit ticket attachment and show changes before update | @section('content')
<div class="modal fade" id="modal-attachment-edit" tabindex="-1" role="dialog" aria-labelledby="modal-attachment-edit-Label">
<div class="modal-dialog model-lg" role="document">
<div class="modal-content">
<div class="modal-header">
<h4 class="modal-title">{{ trans(... | @section('content')
<div class="modal fade" id="modal-attachment-edit" tabindex="-1" role="dialog" aria-labelledby="modal-attachment-edit-Label">
<div class="modal-dialog model-lg" role="document">
<div class="modal-content">
<div class="modal-header">
<h4 class="modal-title">{{ trans(... |
Update regexp to detect magic comment | # -*- coding: utf-8 -*-
import re
__version__ = '0.1.0'
class CodingChecker(object):
name = 'flake8_coding'
version = __version__
def __init__(self, tree, filename):
self.filename = filename
@classmethod
def add_options(cls, parser):
parser.add_option(
'--accept-enc... | # -*- coding: utf-8 -*-
import re
__version__ = '0.1.0'
class CodingChecker(object):
name = 'flake8_coding'
version = __version__
def __init__(self, tree, filename):
self.filename = filename
@classmethod
def add_options(cls, parser):
parser.add_option(
'--accept-enc... |
Update authentication file for neverbounce authentiction | (function () {
"use strict";
const Promise = require('bluebird');
const request = Promise.promisify(require('request'));
const neverBounceApiKeys = require('./apiKeys.js').neverbounce;
const apiUsername = neverBounceApiKeys.username;
const apiSecretKey = neverBounceApiKeys.key;
const authen... | (function () {
"use strict";
const Promise = require('bluebird');
const request = Promise.promisify(require('request'));
const apiUsername = require('./apiKeys.js').username;
const apiSecretKey = require('./apiKeys.js').key;
const authenticateNeverBounce = function () {
request({
... |
Use itemID as react list key. | import React from "react";
import moment from 'moment';
import ReactCSSTransitionGroup from 'react-addons-css-transition-group'
import NewsItem from "./NewsItem";
import NewsCow from "./NewsCow";
// const NewsItem = ({info}) => (
// <div className="newsItem">
// {info.title} <span className="subItem">{info.site... | import React from "react";
import moment from 'moment';
import ReactCSSTransitionGroup from 'react-addons-css-transition-group'
import NewsItem from "./NewsItem";
import NewsCow from "./NewsCow";
// const NewsItem = ({info}) => (
// <div className="newsItem">
// {info.title} <span className="subItem">{info.site... |
Add dataSourceConfig to link passed datasource keys | /**
* Created by XaviTorello on 30/05/18
*/
import React from 'react';
import ComposedComponent from './ComposedComponent';
import AutoComplete from 'material-ui/AutoComplete';
const dataSourceConfig = {
text: 'name',
value: 'value',
};
class TextSuggest extends React.Component {
render() {
// conso... | /**
* Created by XaviTorello on 30/05/18
*/
import React from 'react';
import ComposedComponent from './ComposedComponent';
import AutoComplete from 'material-ui/AutoComplete';
class TextSuggest extends React.Component {
render() {
// console.log('TextSuggest', this.props.form);
// assign the so... |
Remove an invalid trove classifier.
* setup.py(setuptools.setup): Remove "Intended Audience :: BigDate"
since it's not in pypi's list of valid trove classifiers and
prevents successful upload of the package when present.
Change-Id: Iee487d1737a12158bb181d21ae841d07e0820e10 | import setuptools
from savanna.openstack.common import setup as common_setup
requires = common_setup.parse_requirements()
depend_links = common_setup.parse_dependency_links()
project = 'savanna'
setuptools.setup(
name=project,
version=common_setup.get_version(project, '0.1'),
description='Savanna project... | import setuptools
from savanna.openstack.common import setup as common_setup
requires = common_setup.parse_requirements()
depend_links = common_setup.parse_dependency_links()
project = 'savanna'
setuptools.setup(
name=project,
version=common_setup.get_version(project, '0.1'),
description='Savanna project... |
Use oslo_config new type PortOpt for port options
The oslo_config library provides new type PortOpt to validate the
range of port now.
Change-Id: Ifbfee642309fec668e363555c2abd103c1f8c4af
ref: https://github.com/openstack/oslo.config/blob/2.6.0/oslo_config/cfg.py#L1114
Depends-On: Ida294b05a85f5bef587b761fcd03c28c7a3... | # Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# d... | # Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# d... |
Allow passing extra kwargs into register decorator
In order to support extra key-word arguments in add_url_rule method, e.g. subdomain. | from flask import Blueprint
from functools import wraps
from flask_mongorest.methods import Create, Update, BulkUpdate, Fetch, List, Delete
class MongoRest(object):
def __init__(self, app, **kwargs):
self.app = app
self.url_prefix = kwargs.pop('url_prefix', '')
app.register_blueprint(Bluep... | from flask import Blueprint
from functools import wraps
from flask_mongorest.methods import Create, Update, BulkUpdate, Fetch, List, Delete
class MongoRest(object):
def __init__(self, app, **kwargs):
self.app = app
self.url_prefix = kwargs.pop('url_prefix', '')
app.register_blueprint(Bluep... |
Fix bad console output formatting | import time
import sys
from utils import format_duration
if sys.platform == "win32":
default_timer = time.clock
else:
default_timer = time.time
class Benchmark():
def __init__(self, func, name="", repeat=5):
self.func = func
self.repeat = repeat
self.name = name
self.verb... | import time
import sys
from utils import format_duration
if sys.platform == "win32":
default_timer = time.clock
else:
default_timer = time.time
class Benchmark():
def __init__(self, func, name="", repeat=5):
self.func = func
self.repeat = repeat
self.name = name
self.verb... |
Exclude tests package from distribution | #!/usr/bin/env python
import sys, os
try:
from setuptools import setup, find_packages
except ImportError:
from distutils.core import setup
# Hack to prevent "TypeError: 'NoneType' object is not callable" error
# in multiprocessing/util.py _exit_function when setup.py exits
# (see http://www.eby-sarna.com/pi... | #!/usr/bin/env python
import sys, os
try:
from setuptools import setup, find_packages
except ImportError:
from distutils.core import setup
# Hack to prevent "TypeError: 'NoneType' object is not callable" error
# in multiprocessing/util.py _exit_function when setup.py exits
# (see http://www.eby-sarna.com/pi... |
Add express to externals list in demand-express | const {join, resolve} = require('path');
const {CheckerPlugin} = require('awesome-typescript-loader');
const loaders = require('./webpack/loaders');
module.exports = {
target: 'node',
entry: {
server: ['./server/index.ts'],
},
output: {
filename: 'index.js',
path: resolve(join(__dirname, 'dist-se... | const {join, resolve} = require('path');
const {CheckerPlugin} = require('awesome-typescript-loader');
const loaders = require('./webpack/loaders');
module.exports = {
target: 'node',
entry: {
server: ['./server/index.ts'],
},
output: {
filename: 'index.js',
path: resolve(join(__dirname, 'dist-se... |
Allow files to be exlcuded | /*jslint node:true */
var RequireAll = (function () {
'use strict';
var fs = require('fs'),
exclude = function (excludeRegexp, name) {
return excludeRegexp && name.match(excludeRegexp);
},
loadAllModules = function (options) {
var files = fs.readdirSync(o... | /*jslint node:true */
var RequireAll = (function () {
'use strict';
var fs = require('fs'),
exclude = function (excludeRegexp, name) {
return excludeRegexp && name.match(excludeRegexp);
},
loadAllModules = function (options) {
var files = fs.readdirSync(o... |
Change authentication header of restapi service to prevent login popups | package ubic.gemma.web.services.rest.util;
import org.codehaus.jackson.map.ObjectMapper;
import org.springframework.security.core.AuthenticationException;
import org.springframework.security.web.authentication.www.BasicAuthenticationEntryPoint;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.H... | package ubic.gemma.web.services.rest.util;
import org.codehaus.jackson.map.ObjectMapper;
import org.springframework.security.core.AuthenticationException;
import org.springframework.security.web.authentication.www.BasicAuthenticationEntryPoint;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.H... |
Use bigger AC icon for mobile support | <?php
function slack_get_user_by_email($email) {
static $users;
if (defined('SLACK_API_TOKEN')) {
if (!$users) {
// @todo cache users.list
$slack = new Slack(SLACK_API_TOKEN);
$response = $slack->call('users.list');
if ($response['ok']) {
... | <?php
function slack_get_user_by_email($email) {
static $users;
if (defined('SLACK_API_TOKEN')) {
if (!$users) {
// @todo cache users.list
$slack = new Slack(SLACK_API_TOKEN);
$response = $slack->call('users.list');
if ($response['ok']) {
... |
Fix modal when there's no options available | <?php
if (isset($meta) && is_object($meta)) {
$_title = $meta->label;
$_key = $meta->key;
$tipo = $meta->type;
$options = [];
if (array_key_exists('options',$meta->config)) {
$options = $meta->config['options'];
}
?>
<div class="<?php echo $class; ?>">
<?php
$thi... | <?php
if (isset($meta) && is_object($meta)) {
$_title = $meta->label;
$_key = $meta->key;
$tipo = $meta->type;
$options = $meta->config['options'];
?>
<div class="<?php echo $class; ?>">
<?php
$this->part("modal/title", ['title' => $_title]);
if ($tipo === "select" && i... |
Add missing id in initial state | import {
SEEK,
SET_DURATION,
SET_CURRENT_SONG,
CHANGE_VOLUME,
CHANGE_CURRENT_SECONDS,
PLAY,
PAUSE
} from './../actions/actionTypes'
const initialState = {
isPlaying: false,
playFromSeconds: 0,
totalSeconds: 0,
currentSeconds: 0,
currentSong: {
id: '',
title: '',
artist: '',
albu... | import {
SEEK,
SET_DURATION,
SET_CURRENT_SONG,
CHANGE_VOLUME,
CHANGE_CURRENT_SECONDS,
PLAY,
PAUSE
} from './../actions/actionTypes'
const initialState = {
isPlaying: false,
playFromSeconds: 0,
totalSeconds: 0,
currentSeconds: 0,
currentSong: {
title: '',
artist: '',
album: '',
a... |
Add easing function to auto-scroll | 'use strict';
angular.module('arethusaTranslateGuiApp').directive('containers', [
'$timeout',
function($timeout) {
return {
restrict: 'A',
scope: true,
link: function(scope, element) {
scope.$on('dataLoaded', function() {
// When new data is loaded the DOM will take a while to upd... | 'use strict';
angular.module('arethusaTranslateGuiApp').directive('containers', [
'$timeout',
function($timeout) {
return {
restrict: 'A',
scope: true,
link: function(scope, element) {
scope.$on('dataLoaded', function() {
// When new data is loaded the DOM will take a while to upd... |
Fix tests when username has a ' character in it
Laravel HTML entity encodes the username, so we need to do the same
thing in the test so the HTML output will match. | <?php
namespace Tests\Functional;
use App\Models\User;
use Illuminate\Foundation\Testing\DatabaseMigrations;
use Illuminate\Foundation\Testing\DatabaseTransactions;
class NavigationTest extends \Tests\TestCase {
use DatabaseMigrations;
public function testGuestNavigation()
{
$this->get('/')
... | <?php
namespace Tests\Functional;
use App\Models\User;
use Illuminate\Foundation\Testing\DatabaseMigrations;
use Illuminate\Foundation\Testing\DatabaseTransactions;
class NavigationTest extends \Tests\TestCase {
use DatabaseMigrations;
public function testGuestNavigation()
{
$this->get('/')
... |
Add rc as prerelease name | module.exports = function(grunt) {
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
bump: {
options: {
files: ['package.json'],
updateConfigs: ['pkg'],
commit: true,
commitMessage: 'Release v%VERSION%',
... | module.exports = function(grunt) {
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
bump: {
options: {
files: ['package.json'],
updateConfigs: ['pkg'],
commit: true,
commitMessage: 'Release v%VERSION%',
... |
Check that the priority order is respected if QT_API or USE_QT_API are not specified. | import os
from qtpy import QtCore, QtGui, QtWidgets, QtWebEngineWidgets
def assert_pyside():
import PySide
assert QtCore.QEvent is PySide.QtCore.QEvent
assert QtGui.QPainter is PySide.QtGui.QPainter
assert QtWidgets.QWidget is PySide.QtGui.QWidget
assert QtWebEngineWidgets.QWebEnginePage is PySid... | import os
def test_qt_api():
"""
If QT_API is specified, we check that the correct Qt wrapper was used
"""
from qtpy import QtCore, QtGui, QtWidgets, QtWebEngineWidgets
QT_API = os.environ.get('QT_API', None)
if QT_API == 'pyside':
import PySide
assert QtCore.QEvent is PySid... |
Fix for conformance statement error | package uk.nhs.careconnect.ri.gatewaylib.camel.interceptor;
import org.apache.camel.Exchange;
import org.apache.camel.Processor;
public class GatewayPostProcessor implements Processor
{
@Override
public void process(Exchange exchange) throws Exception {
if (exchange.getIn().getHeader("X-Request-ID") ... | package uk.nhs.careconnect.ri.gatewaylib.camel.interceptor;
import org.apache.camel.Exchange;
import org.apache.camel.Processor;
public class GatewayPostProcessor implements Processor
{
@Override
public void process(Exchange exchange) throws Exception {
if (exchange.getIn().getHeader("X-Request-ID")... |
Change embedded join link to direct klicker.uzh.ch domain | import React from 'react'
import PropTypes from 'prop-types'
import { compose, withProps } from 'recompose'
import QRCode from 'qrcode.react'
import { withRouter } from 'next/router'
import { StaticLayout } from '../components/layouts'
import { withLogging } from '../lib'
const propTypes = {
shortname: PropTypes.st... | import React from 'react'
import PropTypes from 'prop-types'
import { compose, withProps } from 'recompose'
import QRCode from 'qrcode.react'
import { withRouter } from 'next/router'
import { StaticLayout } from '../components/layouts'
import { withLogging } from '../lib'
const propTypes = {
shortname: PropTypes.st... |
Remove comments and source-map from the minified version. | const UglifyJsPlugin = require("uglifyjs-webpack-plugin");
const path = require("path");
module.exports = {
mode: "development",
devtool: "inline-source-map",
entry: {
IntelliSearch: "./src/SearchClient.ts",
"IntelliSearch.min": "./src/SearchClient.ts"
},
output: {
path: pat... | const UglifyJsPlugin = require("uglifyjs-webpack-plugin");
const path = require("path");
module.exports = {
mode: "development",
devtool: "inline-source-map",
entry: {
IntelliSearch: "./src/SearchClient.ts",
"IntelliSearch.min": "./src/SearchClient.ts"
},
output: {
path: pat... |
Remove unnecessary scratch file flag | import re
from threading import Timer
import sublime_plugin
import sublime
DEFAULT_NAME = 'Find Results'
ALT_NAME_BASE = 'Find Results '
class OpenSearchInNewTab(sublime_plugin.EventListener):
# set a bit changed name
# so the tab won't be bothered
# during new search
def on_activated(self, view):
... | import re
from threading import Timer
import sublime_plugin
import sublime
DEFAULT_NAME = 'Find Results'
ALT_NAME_BASE = 'Find Results '
class OpenSearchInNewTab(sublime_plugin.EventListener):
# set a bit changed name
# so the tab won't be bothered
# during new search
def on_activated(self, view):
... |
Rename seed clients for consistency. | <?php
use Illuminate\Database\Seeder;
use Northstar\Models\Client;
use Northstar\Auth\Scope;
class ClientTableSeeder extends Seeder
{
/**
* Run the database seeds.
*
* @return void
*/
public function run()
{
DB::table('clients')->delete();
// For easy testing, we'll se... | <?php
use Illuminate\Database\Seeder;
use Northstar\Models\Client;
use Northstar\Auth\Scope;
class ClientTableSeeder extends Seeder
{
/**
* Run the database seeds.
*
* @return void
*/
public function run()
{
DB::table('clients')->delete();
// For easy testing, we'll se... |
Convert direction to upper case | #!/usr/bin/env python3
from nanagogo.api import NanagogoRequest, NanagogoError, s
def get(path, params={}):
r = NanagogoRequest(path,
method="GET",
params=params)
return r.wrap()
def post(path, params={}, data=None):
r = NanagogoRequest(path,
... | #!/usr/bin/env python3
from nanagogo.api import NanagogoRequest, NanagogoError
def get(path, params={}):
r = NanagogoRequest(path,
method="GET",
params=params)
return r.wrap()
def post(path, params={}, data=None):
r = NanagogoRequest(path,
... |
Remove /want help; already is invalid usage so shows default help |
package com.exphc.FreeTrade;
import java.util.logging.Logger;
import org.bukkit.plugin.java.JavaPlugin;
import org.bukkit.command.*;
import org.bukkit.entity.*;
public class FreeTrade extends JavaPlugin {
Logger log = Logger.getLogger("Minecraft");
public void onEnable() {
log.info("FreeTrade enable... |
package com.exphc.FreeTrade;
import java.util.logging.Logger;
import org.bukkit.plugin.java.JavaPlugin;
import org.bukkit.command.*;
import org.bukkit.entity.*;
public class FreeTrade extends JavaPlugin {
Logger log = Logger.getLogger("Minecraft");
public void onEnable() {
log.info("FreeTrade enable... |
Add user tooltip and links in message | import React from 'react';
import { FormattedRelative } from 'react-intl';
import { Link } from 'react-router';
import Body from '../post/Body';
import Avatar from '../widgets/Avatar';
import ProfileTooltipOrigin from '../user/profileTooltip/ProfileTooltipOrigin';
const Message = (props) => {
const { model } = props... | import React from 'react';
import { FormattedRelative } from 'react-intl';
import Body from '../post/Body';
import Avatar from '../widgets/Avatar';
const Message = (props) => {
const { model } = props;
const sentAt = model[0].sentAt;
const senderUsername = (model[0].senderUsername || model[0].sentBy);
return (... |
Send to cloud every 60 seconds | package agent
import (
"time"
"fmt"
"github.com/crowdmob/goamz/aws"
"github.com/crowdmob/goamz/cloudwatch"
)
const (
SCHEDULED_LOOP = 60
)
var cw *cloudwatch.CloudWatch
func init() {
region := aws.Regions["eu-west-1"]
auth, err := aws.EnvAuth()
if err != nil {
L.Err("Unable ... | package agent
import (
"time"
"fmt"
"github.com/crowdmob/goamz/aws"
"github.com/crowdmob/goamz/cloudwatch"
)
const (
SCHEDULED_LOOP = 6
)
var cw *cloudwatch.CloudWatch
func init() {
region := aws.Regions["eu-west-1"]
auth, err := aws.EnvAuth()
if err != nil {
L.Err("Unable t... |
Add override listener to Dashboard. | <?php
namespace Octo\System\Admin\Controller;
use b8\Config;
use Octo\Admin\Controller;
use Octo\Event;
use Octo\Store;
use Octo\System\Model\Setting;
class DashboardController extends Controller
{
public function index()
{
$this->setTitle(Config::getInstance()->get('site.name') . ': Dashboard');
... | <?php
namespace Octo\System\Admin\Controller;
use b8\Config;
use Octo\Admin\Controller;
use Octo\Event;
use Octo\Store;
use Octo\System\Model\Setting;
class DashboardController extends Controller
{
public function index()
{
$this->setTitle(Config::getInstance()->get('site.name') . ': Dashboard');
... |
Set default AUTOGEN_TEST to 0 | INPUT_DECL_PATHS = [
"../../target/device/libio/export"
# "../../../pia-sdk-repo/iolib/arduino/arduiPIA.h"
]
AUTOGEN_TEST = 0
if AUTOGEN_TEST == 1:
INPUT_DECL_PATHS = [
"./testSuite/"
]
VERSION = '0.0.1'
TARGET = 'galileo'
OUTPUT_COMP_PATH = '../../target/companion/lib/b... | INPUT_DECL_PATHS = [
"../../target/device/libio/export"
# "../../../pia-sdk-repo/iolib/arduino/arduiPIA.h"
]
AUTOGEN_TEST = 1
if AUTOGEN_TEST == 1:
INPUT_DECL_PATHS = [
"./testSuite/"
]
VERSION = '0.0.1'
TARGET = 'galileo'
OUTPUT_COMP_PATH = '../../target/companion/lib/b... |
Update stratisd-client-dbus requirement to 0.07
Signed-off-by: mulhern <7b51bcf507bcd7afb72bf8663752c0ddbeb517f6@redhat.com> | import os
import sys
import setuptools
if sys.version_info[0] < 3:
from codecs import open
def local_file(name):
return os.path.relpath(os.path.join(os.path.dirname(__file__), name))
README = local_file("README.rst")
with open(local_file("src/stratis_cli/_version.py")) as o:
exec(o.read())
setuptool... | import os
import sys
import setuptools
if sys.version_info[0] < 3:
from codecs import open
def local_file(name):
return os.path.relpath(os.path.join(os.path.dirname(__file__), name))
README = local_file("README.rst")
with open(local_file("src/stratis_cli/_version.py")) as o:
exec(o.read())
setuptool... |
Add slightly more descriptive keywords for PyPI | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from setuptools import setup
with open('README.rst') as readme_file:
readme = readme_file.read()
with open('HISTORY.rst') as history_file:
history = history_file.read()
requirements = [
'pyparsing'
]
test_requirements = [
]
setup(
name='boolrule',
... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from setuptools import setup
with open('README.rst') as readme_file:
readme = readme_file.read()
with open('HISTORY.rst') as history_file:
history = history_file.read()
requirements = [
'pyparsing'
]
test_requirements = [
]
setup(
name='boolrule',
... |
Fix destination be at current directory | <?php
namespace FaizShukri\Quran\Supports;
class Config
{
private $config;
public function __construct(array $config = [])
{
$this->config = $this->buildConfig($config);
}
/**
* Build a config array. Merge user defined config with our default config.
*
* @param array $conf... | <?php
namespace FaizShukri\Quran\Supports;
class Config
{
private $config;
public function __construct(array $config = [])
{
$this->config = $this->buildConfig($config);
}
/**
* Build a config array. Merge user defined config with our default config.
*
* @param array $conf... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.