text stringlengths 16 4.96k | positive stringlengths 321 2.24k | negative stringlengths 310 2.21k |
|---|---|---|
Update UT for removed fields | package cli
import (
"testing"
"github.com/libopenstorage/openstorage/api"
"github.com/stretchr/testify/require"
)
func TestCmdMarshalProto(t *testing.T) {
volumeSpec := &api.VolumeSpec{
Size: 64,
Format: api.FSType_FS_TYPE_EXT4,
}
data := cmdMarshalProto(volumeSpec, false)
require.Equal(
t,
`{
"ep... | package cli
import (
"testing"
"github.com/libopenstorage/openstorage/api"
"github.com/stretchr/testify/require"
)
func TestCmdMarshalProto(t *testing.T) {
volumeSpec := &api.VolumeSpec{
Size: 64,
Format: api.FSType_FS_TYPE_EXT4,
}
data := cmdMarshalProto(volumeSpec, false)
require.Equal(
t,
`{
"ep... |
Fix compile error in tests. | package com.codingchili.core.logging;
import io.vertx.core.Vertx;
import io.vertx.ext.unit.Async;
import io.vertx.ext.unit.TestContext;
import io.vertx.ext.unit.junit.VertxUnitRunner;
import org.junit.*;
import org.junit.runner.RunWith;
import com.codingchili.core.context.ServiceContext;
import com.codingchili.core.t... | package com.codingchili.core.logging;
import io.vertx.core.Vertx;
import io.vertx.ext.unit.Async;
import io.vertx.ext.unit.TestContext;
import io.vertx.ext.unit.junit.VertxUnitRunner;
import org.junit.*;
import org.junit.runner.RunWith;
import com.codingchili.core.context.SystemContext;
import com.codingchili.core.te... |
Correct code to match db scheme | var express = require('express');
var mysql = require('mysql');
var app = express();
app.use(express.static('public'));
var connection = mysql.createConnection({
host : process.env.MYSQL_HOST ||,
user : process.env.MYSQL_USER ||,
password : process.env.MYSQL_PASS ||,
database : process.env.MYSQL_DB ||... | var express = require('express');
var mysql = require('mysql');
var app = express();
app.use(express.static('public'));
var connection = mysql.createConnection({
host : process.env.MYSQL_HOST,
user : process.env.MYSQL_USER,
password : process.env.MYSQL_PASS,
database : process.env.MYSQL_DB
});
connec... |
Update service to use new IoC container. | <?php namespace Craft;
class SmartdownService extends BaseApplicationComponent
{
/**
* @var \Experience\Smartdown\App\Utilities\Parser;
*/
protected $parser;
/**
* Initialises the parser instance.
*/
public function __construct()
{
$this->parser = SmartdownPlugin::$cont... | <?php namespace Craft;
class SmartdownService extends BaseApplicationComponent
{
protected $parser;
/**
* Initialises the parser instance.
*/
public function __construct()
{
$this->parser = smartdown()->parser;
}
/**
* Runs the given string through all of the available ... |
Add some more comments to the example | /*
A bot that welcomes new guild members when they join
*/
// Import the discord.js module
const Discord = require('discord.js');
// Create an instance of a Discord Client
const client = new Discord.Client();
// The token of your bot - https://discordapp.com/developers/applications/me
const token = 'your bot token... | /*
A bot that welcomes new guild members when they join
*/
// Import the discord.js module
const Discord = require('discord.js');
// Create an instance of a Discord Client
const client = new Discord.Client();
// The token of your bot - https://discordapp.com/developers/applications/me
const token = 'your bot token... |
Test for setOption in AdapterAbstract | <?php
namespace Versionable\Tests\Prospect\Adapter;
use Versionable\Prospect\Adapter\AdapterAbstract;
/**
* Test class for AdapterAbstract.
* Generated by PHPUnit on 2011-04-08 at 08:43:07.
*/
class AdapterAbstractTest extends \PHPUnit_Framework_TestCase
{
/**
* @var AdapterAbstract
*/
protected $objec... | <?php
namespace Versionable\Tests\Prospect\Adapter;
use Versionable\Prospect\Adapter\AdapterAbstract;
/**
* Test class for AdapterAbstract.
* Generated by PHPUnit on 2011-04-08 at 08:43:07.
*/
class AdapterAbstractTest extends \PHPUnit_Framework_TestCase
{
/**
* @var AdapterAbstract
*/
protected $objec... |
FIX Ensure required HTTPRequest arguments are provided | <?php
/**
* Composer update checker job. Runs the check as a queuedjob.
*
* @author Peter Thaleikis
* @license MIT
*/
class CheckComposerUpdatesJob extends AbstractQueuedJob implements QueuedJob
{
/**
* The task to run
*
* @var BuildTask
*/
protected $task;
/**
* define the ti... | <?php
/**
* Composer update checker job. Runs the check as a queuedjob.
*
* @author Peter Thaleikis
* @license MIT
*/
class CheckComposerUpdatesJob extends AbstractQueuedJob implements QueuedJob
{
/**
* The task to run
*
* @var BuildTask
*/
protected $task;
/**
* define the ti... |
Improve determination of array shape for constant expressions
When Evaluating a constant expression, I only used to look at the first
column in the df dictionary. But that could also be a constant or
expression. So look instead at all columns and find the first numpy
array. |
import numpy as np
import numpy.ma as ma
import projections.r2py.reval as reval
import projections.r2py.rparser as rparser
class SimpleExpr():
def __init__(self, name, expr):
self.name = name
self.tree = reval.make_inputs(rparser.parse(expr))
lokals = {}
exec(reval.to_py(self.tree, name), lokals)
... |
import numpy as np
import numpy.ma as ma
import projections.r2py.reval as reval
import projections.r2py.rparser as rparser
class SimpleExpr():
def __init__(self, name, expr):
self.name = name
self.tree = reval.make_inputs(rparser.parse(expr))
lokals = {}
exec(reval.to_py(self.tree, name), lokals)
... |
Move ProgramLine style into head | import React from 'react'
import PropTypes from 'prop-types'
import Moment from 'react-moment'
import Link from 'next/link'
import Head from 'next/head'
import generateUrl from 'utils/urlGenerator'
import EditButton from 'containers/EditButton'
import stylesheet from './style.scss'
const ProgramLine = (props) => (
... | import React from 'react'
import PropTypes from 'prop-types'
import Moment from 'react-moment'
import Link from 'next/link'
import generateUrl from 'utils/urlGenerator'
import EditButton from 'containers/EditButton'
import stylesheet from './style.scss'
const ProgramLine = (props) => (
<div className='program-line... |
Set status 500 on error | <?php
namespace Stratify\ErrorHandlerModule;
use Psr\Http\Message\ResponseInterface;
use Psr\Http\Message\ServerRequestInterface;
use Whoops\Handler\PrettyPageHandler;
use Whoops\Run;
class ErrorHandlerMiddleware
{
private $whoops;
public function __invoke(
ServerRequestInterface $request,
R... | <?php
namespace Stratify\ErrorHandlerModule;
use Psr\Http\Message\ResponseInterface;
use Psr\Http\Message\ServerRequestInterface;
use Whoops\Handler\PrettyPageHandler;
use Whoops\Run;
class ErrorHandlerMiddleware
{
private $whoops;
public function __invoke(
ServerRequestInterface $request,
R... |
Make sitemap file names static, move metadata to redis | // Collect urls to include in sitemap
//
'use strict';
const pump = require('pump');
const through2 = require('through2');
module.exports = function (N, apiPath) {
N.wire.on(apiPath, function get_users_sitemap(data) {
let stream = pump(
N.models.users.User.collection
.find(... | // Collect urls to include in sitemap
//
'use strict';
const pump = require('pump');
const through2 = require('through2');
module.exports = function (N, apiPath) {
N.wire.on(apiPath, function get_users_sitemap(data) {
data.streams.push(
pump(
N.models.users.User.collection
... |
Solve small issue with ifs | package model.solvers.problems;
import model.population.Population;
import model.population.PopulationFactory;
import model.solvers.fitness.Fitness;
public class MultiplexProblem extends Problem {
private int numA;
private int creationMethod;
private int maxDepth;
private boolean ifsAllowed;
public MultiplexP... | package model.solvers.problems;
import model.population.Population;
import model.population.PopulationFactory;
import model.solvers.fitness.Fitness;
public class MultiplexProblem extends Problem {
private int numA;
private int creationMethod;
private int maxDepth;
private boolean ifsAllowed;
public MultiplexP... |
Fix for demo controller not always updating the page | function ctrl($rootScope) {
if(!$rootScope.initialized) {
$rootScope.initialized = true;
$rootScope.$on('ADE-start', function(e,data) {
$rootScope.lastMessage = 'started edit';
});
$rootScope.$on('ADE-finish', function(e,data) {
console.log(data);
var exit = 'Exited via clicking outside';
switch... | function ctrl($rootScope) {
if(!$rootScope.initialized) {
$rootScope.initialized = true;
$rootScope.$on('ADE-start', function(e,data) {
$rootScope.lastMessage = 'started edit';
});
$rootScope.$on('ADE-finish', function(e,data) {
console.log(data);
var exit = 'Exited via clicking outside';
switch... |
Add DatabaseError to list of errors that kill a historian | from flow import exit_codes
from flow.configuration.settings.injector import setting
from flow.handler import Handler
from flow.util.exit import exit_process
from flow_workflow.historian.messages import UpdateMessage
from injector import inject
from sqlalchemy.exc import ResourceClosedError, TimeoutError, Disconnection... | from flow import exit_codes
from flow.configuration.settings.injector import setting
from flow.handler import Handler
from flow.util.exit import exit_process
from flow_workflow.historian.messages import UpdateMessage
from injector import inject
from sqlalchemy.exc import ResourceClosedError, TimeoutError, Disconnection... |
Fix incorrect import in CLI file | #!/usr/bin/env node
/* eslint-disable no-negated-condition */
'use strict';
const meow = require('meow');
const chalk = require('chalk');
const scow = require('..');
const cli = meow(`
Usage
$ scow <input> <output>
Options
-c, --compress Compress HTML
Examples
$ scow emails/*.html dist
`, {
f... | #!/usr/bin/env node
/* eslint-disable no-negated-condition */
'use strict';
const meow = require('meow');
const chalk = require('chalk');
const scow = require('.');
const cli = meow(`
Usage
$ scow <input> <output>
Options
-c, --compress Compress HTML
Examples
$ scow emails/*.html dist
`, {
fl... |
Cut indiehackers parser | Add hackernews parser |
// The schedule object saves the times at which each source bundle should be updated
// Documentation on how to write crontab: http://crontab.org/
const schedules = [
// {
// source: 'elmundo',
// hourFreq: '*',
// timeZone: 'America/Los_Angeles'
// },
// {
// source: 'hackernews',
// hourFr... |
// The schedule object saves the times at which each source bundle should be updated
// Documentation on how to write crontab: http://crontab.org/
const schedules = [
// {
// source: 'elmundo',
// hourFreq: '*',
// timeZone: 'America/Los_Angeles'
// },
// {
// source: 'hackernews',
// hourFr... |
Fix checking if a path is absolute in windows. | /*******************************************************************************
* Copyright 2014 Rafael Garcia Moreno.
*
* 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://w... | /*******************************************************************************
* Copyright 2014 Rafael Garcia Moreno.
*
* 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://w... |
Stop throwing yellew boxes when we warn from native
Summary: This caused a bunch of stuff to break, reverting and will fix the problems before committing next time.
Reviewed By: fkgozali
Differential Revision: D4363398
fbshipit-source-id: 55146c9da998f6a3883307c36422a9d440ea7f52 | /**
* Copyright (c) 2015-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
* @provides... | /**
* Copyright (c) 2015-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
* @provides... |
Fix indentation to be a multiple of 4 | # (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.com>
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) an... | # (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.com>
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) an... |
Use Model.remoteMethod instead of loopback's fn.
Rework Todo model to define the remote method `stats` using the new
method `Model.remoteMethod` instead of the deprecated
`loopback.remoteMethod`. | var loopback = require('loopback');
var async = require('async');
module.exports = function(Todo/*, Base*/) {
Todo.definition.properties.created.default = Date.now;
Todo.beforeSave = function(next, model) {
if (!model.id) model.id = 't-' + Math.floor(Math.random() * 10000).toString();
next();
};
Tod... | var loopback = require('loopback');
var async = require('async');
module.exports = function(Todo/*, Base*/) {
Todo.definition.properties.created.default = Date.now;
Todo.beforeSave = function(next, model) {
if (!model.id) model.id = 't-' + Math.floor(Math.random() * 10000).toString();
next();
};
Tod... |
[SwiftmailerBundle] Fix expected default value in SwiftmailerExtension unit test | <?php
/*
* This file is part of the Symfony package.
*
* (c) Fabien Potencier <fabien.potencier@symfony-project.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Bundle\SwiftmailerBundle\Tests\DependencyInjec... | <?php
/*
* This file is part of the Symfony package.
*
* (c) Fabien Potencier <fabien.potencier@symfony-project.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Bundle\SwiftmailerBundle\Tests\DependencyInjec... |
Allow vertices to define a `prepare_vertex` function which will be called just once at some point in the build process. | import sys
from pacman103.core import control
from pacman103 import conf
from . import builder
class Simulator(object):
def __init__(self, model, dt=0.001, seed=None):
# Build the model
self.builder = builder.Builder()
self.dao = self.builder(model, dt, seed)
self.dao.writeTextSp... | import sys
from pacman103.core import control
from pacman103 import conf
from . import builder
class Simulator(object):
def __init__(self, model, dt=0.001, seed=None):
# Build the model
self.builder = builder.Builder()
self.dao = self.builder(model, dt, seed)
self.dao.writeTextSp... |
Fix production webpack for static pages | const HtmlWebpackPlugin = require('html-webpack-plugin');
const path = require('path');
const webpackFiles = require('../lib/build/files/webpack_files');
const Package = require('./../package.json');
const VERSION = Package.version;
module.exports = {
entry: './lib/assets/javascripts/dashboard/statics/static.js',
... | const HtmlWebpackPlugin = require('html-webpack-plugin');
const path = require('path');
const webpackFiles = require('../lib/build/files/webpack_files');
const Package = require('./../package.json');
const VERSION = Package.version;
module.exports = {
entry: './lib/assets/javascripts/cartodb/static.js',
output: {... |
Save the settings from the database step. | <?php
namespace ForkCMS\Bundle\InstallerBundle\Form\Handler;
use Symfony\Component\Form\Form;
use Symfony\Component\HttpFoundation\Request;
/**
* Validates and saves the data from the databases form
*
* @author Wouter Sioen <wouter.sioen@wijs.be>
*/
class DatabaseHandler
{
public function process(Form $form,... | <?php
namespace ForkCMS\Bundle\InstallerBundle\Form\Handler;
use Symfony\Component\Form\Form;
use Symfony\Component\HttpFoundation\Request;
/**
* Validates and saves the data from the databases form
*
* @author Wouter Sioen <wouter.sioen@wijs.be>
*/
class DatabaseHandler
{
public function process(Form $form,... |
Change ordering to FeaturedRep model. | from django.contrib.auth.models import User
from django.db import models
from django.dispatch import receiver
from south.signals import post_migrate
from remo.base.utils import add_permissions_to_groups
class FeaturedRep(models.Model):
"""Featured Rep model.
Featured Rep -or Rep of the Month- relates exist... | from django.contrib.auth.models import User
from django.db import models
from django.dispatch import receiver
from south.signals import post_migrate
from remo.base.utils import add_permissions_to_groups
class FeaturedRep(models.Model):
"""Featured Rep model.
Featured Rep -or Rep of the Month- relates exist... |
Add mode for changing what file it is, and fix a bug where a line without an equals wouldn't work | class ConfigReader():
def __init__(self,name="config.txt"):
self.keys={}
self.name = name
#Read Keys from file
def readKeys(self):
keysFile=open(self.name,"r")
fileLines=keysFile.readlines()
keysFile.close()
self.keys.clear()
for item in fileLines:
#If last char is \n
if (item[-1]=='\n'):
ite... | class ConfigReader():
def __init__(self):
self.keys={}
#Read Keys from file
def readKeys(self):
keysFile=open("config.txt","r")
fileLines=keysFile.readlines()
keysFile.close()
self.keys.clear()
for item in fileLines:
#If last char is \n
if (item[-1]=='\n'):
item=item[:-1]
#If a commented ... |
Add ref to stub router component for accessibility | import _ from 'lodash';
import React from 'react/addons';
var stubRouterContext = (Component, props, stubs) => {
return React.createClass({
childContextTypes: {
getCurrentPath: React.PropTypes.func,
getCurrentRoutes: React.PropTypes.func,
getCurrentPathname: React.PropTypes.func,
getCurre... | import _ from 'lodash';
import React from 'react/addons';
var stubRouterContext = (Component, props, stubs) => {
return React.createClass({
childContextTypes: {
getCurrentPath: React.PropTypes.func,
getCurrentRoutes: React.PropTypes.func,
getCurrentPathname: React.PropTypes.func,
getCurre... |
Update administration tool copyright year | <?php
/*
$Id$
osCommerce, Open Source E-Commerce Solutions
http://www.oscommerce.com
Copyright (c) 2008 osCommerce
Released under the GNU General Public License
*/
?>
<br>
<table border="0" width="100%" cellspacing="0" cellpadding="2">
<tr>
<td align="center" class="smallText">
<?php
/*
The followi... | <?php
/*
$Id$
osCommerce, Open Source E-Commerce Solutions
http://www.oscommerce.com
Copyright (c) 2008 osCommerce
Released under the GNU General Public License
*/
?>
<br>
<table border="0" width="100%" cellspacing="0" cellpadding="2">
<tr>
<td align="center" class="smallText">
<?php
/*
The followi... |
Use correct version of antiscroll in blueprint | module.exports = {
normalizeEntityName: function() {},
afterInstall: function(options) {
// We assume that handlebars, ember, and jquery already exist
return this.addBowerPackagesToProject([
{
// Antiscroll seems to be abandoned by its original authors. We need
// two things: (1) a ve... | module.exports = {
normalizeEntityName: function() {},
afterInstall: function(options) {
// We assume that handlebars, ember, and jquery already exist
return this.addBowerPackagesToProject([
{
// Antiscroll seems to be abandoned by its original authors. We need
// two things: (1) a ve... |
Use Error instead of Errorf | // Cozy Cloud is a personal platform as a service with a focus on data.
// Cozy Cloud can be seen as 4 layers, from inside to outside:
//
// 1. A place to keep your personal data
//
// 2. A core API to handle the data
//
// 3. Your web apps, and also the mobile & desktop clients
//
// 4. A coherent User Experience
//
/... | // Cozy Cloud is a personal platform as a service with a focus on data.
// Cozy Cloud can be seen as 4 layers, from inside to outside:
//
// 1. A place to keep your personal data
//
// 2. A core API to handle the data
//
// 3. Your web apps, and also the mobile & desktop clients
//
// 4. A coherent User Experience
//
/... |
Support for Watchify. We hook onto the pipeline on every reset and a new through object gets created. | /* jshint -W040 */
'use strict';
var path = require('path'),
through = require('through');
module.exports = sourcemapify;
/**
* Transforms the browserify sourcemap
*
* @param browserify
* @param options
*/
function sourcemapify(browserify, options) {
options = options || browserify._options || {};
fun... | /* jshint -W040 */
'use strict';
var path = require('path'),
through = require('through');
module.exports = sourcemapify;
/**
* Transforms the browserify sourcemap
*
* @param browserify
* @param options
*/
function sourcemapify(browserify, options) {
options = options || browserify._options || {};
/... |
Fix deprecated option of Redux Dev Tools. | /* eslint-disable global-require */
/* global window */
import { createStore, applyMiddleware, combineReducers } from 'redux';
import createSagaMiddleware from 'redux-saga';
import { isTest } from 'worona-deps';
import { reduxReactRouter, routerStateReducer as router } from 'redux-router';
import { composeWithDevTools ... | /* eslint-disable global-require */
/* global window */
import { createStore, applyMiddleware, combineReducers } from 'redux';
import createSagaMiddleware from 'redux-saga';
import { isTest } from 'worona-deps';
import { reduxReactRouter, routerStateReducer as router } from 'redux-router';
import { composeWithDevTools ... |
Move searchPortal ref function to constructor | import React, { Component } from 'react';
export default class EmojiSuggestionsPortal extends Component {
constructor(props) {
super(props);
this.searchPortalRef = (element) => { this.searchPortal = element; };
}
componentWillMount() {
this.props.store.register(this.props.offsetKey);
this.update... | import React, { Component } from 'react';
export default class EmojiSuggestionsPortal extends Component {
componentWillMount() {
this.props.store.register(this.props.offsetKey);
this.updatePortalClientRect(this.props);
// trigger a re-render so the EmojiSuggestions becomes active
this.props.setEdit... |
Set all older tracks to be "visible". | <?php
declare(strict_types=1);
namespace App\Entity\Migration;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;
final class Version20220706235608 extends AbstractMigration
{
public function getDescription(): string
{
return 'Add "is_visible" denormalization to song_history... | <?php
declare(strict_types=1);
namespace App\Entity\Migration;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;
final class Version20220706235608 extends AbstractMigration
{
public function getDescription(): string
{
return 'Add "is_visible" denormalization to song_history... |
Add extra momentjs locales for 'de' and 'es'
refs #1909 | //= require jquery
//= require jquery_ujs
//= require twitter/bootstrap
//= require lodash
//= require handlebars.runtime
//= require diacritics
// To use placeholders in inputs in browsers that do not support it
// natively yet.
//= require jquery/jquery.placeholder
// Notifications (flash messages).
//= require jqu... | //= require jquery
//= require jquery_ujs
//= require twitter/bootstrap
//= require lodash
//= require handlebars.runtime
//= require diacritics
// To use placeholders in inputs in browsers that do not support it
// natively yet.
//= require jquery/jquery.placeholder
// Notifications (flash messages).
//= require jqu... |
Fix for PHP < 5 error | <?php
# let people know if they are running an unsupported version of PHP
if(phpversion() < 5) {
echo '<h3>Stacey requires PHP/5.0 or higher.<br>You are currently running PHP/".phpversion().".</h3><p>You should contact your host to see if they can upgrade your version of PHP.</p>';
} else {
# require helpers class... | <?php
# let people know if they are running an unsupported version of PHP
if(phpversion() < 5) {
echo '<h3>Stacey requires PHP/5.0 or higher.<br>You are currently running PHP/".phpversion().".</h3><p>You should contact your host to see if they can upgrade your version of PHP.</p>';
return;
}
# require helpers class... |
Fix Forgotten Key Error in Read Campaign Setting Model Logic | var configuration = require('../../../config/configuration.json')
module.exports = {
getCampaignSettingModel: function (redisClient, CampaignHashID, callback) {
var tableName = configuration.TableMACampaignModelSettingModel + CampaignHashID
var model = {}
redisClient.hget(tableName, configuration.Constan... | var configuration = require('../../../config/configuration.json')
module.exports = {
getCampaignSettingModel: function (redisClient, CampaignHashID, callback) {
var tableName = configuration.TableMACampaignModelSettingModel + CampaignHashID
var model = {}
redisClient.hget(tableName, configuration.Constan... |
Fix coding standard [skip fix] | <?php
namespace Miaoxing\Config\Service;
use Wei\Env;
use Wei\RetTrait;
/**
* 配置服务
*
* @property Env $env
*/
class ConfigV1 extends \Wei\Config
{
use RetTrait;
/**
* 配置文件的路径
*
* @var string
*/
protected $configFile = 'data/config.php';
/**
* {@inheritdoc}
*/
pu... | <?php
namespace Miaoxing\Config\Service;
use Wei\Env;
use Exception;
use League\Flysystem\Adapter\Local;
use League\Flysystem\Sftp\SftpAdapter;
use League\Flysystem\Filesystem;
use Wei\RetTrait;
/**
* 配置服务
*
* @property Env $env
*/
class ConfigV1 extends \Wei\Config
{
use RetTrait;
/**
* 配置文件的路径
... |
Add method to obtain max compressed length | /*
* 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... |
Add overwriting of set methods. | <?PHP
/**
* An Uri value object.
* This is just a wrapper for Zend Uri.
*
* @link https://github.com/zendframework/zend-uri
*
* @todo This has to be a Guzzle Uri or https://github.com/mvdbos/vdb-uri
*
* @package Serendipity\Framework
* @subpackage ValueObjects
*
* @author Adamo Crespi <hello@aerend... | <?PHP
/**
* An Uri value object.
* This is just a wrapper for Zend Uri.
*
* @link https://github.com/zendframework/zend-uri
*
* @todo This has to be a Guzzle Uri or https://github.com/mvdbos/vdb-uri
*
* @package Serendipity\Framework
* @subpackage ValueObjects
*
* @author Adamo Crespi <hello@aerend... |
Set initial size for main toggle box | package com.easternedgerobotics.rov.fx;
import javafx.geometry.Insets;
import javafx.scene.Parent;
import javafx.scene.control.ToggleButton;
import javafx.scene.layout.BorderPane;
import javax.inject.Inject;
public class MainView implements View {
static final int SPACING = 10;
static final int TOGGLE_BOX_W... | package com.easternedgerobotics.rov.fx;
import javafx.geometry.Insets;
import javafx.scene.Parent;
import javafx.scene.control.ToggleButton;
import javafx.scene.layout.BorderPane;
import javax.inject.Inject;
public class MainView implements View {
static final int SPACING = 10;
final BorderPane box = new Bo... |
Add read static files feature. | #!/usr/bin/env python3
class Routes:
'''Define the feature of route for URIs.'''
def __init__(self):
self._Routes = []
def AddRoute(self, uri, callback):
'''Add an URI into the route table.'''
self._Routes.append([uri, callback])
def Dispatch(self, req, res):
'''Dispatch an URI according to the route tab... | #!/usr/bin/env python3
class Routes:
'''Define the feature of route for URIs.'''
def __init__(self):
self._Routes = []
def AddRoute(self, uri, callback):
'''Add an URI into the route table.'''
self._Routes.append([uri, callback])
def Dispatch(self, req, res):
'''Dispatch an URI according to the route tab... |
Add deferred register to test sounds | package info.u_team.u_team_test.init;
import info.u_team.u_team_core.soundevent.USoundEvent;
import info.u_team.u_team_test.TestMod;
import net.minecraft.util.SoundEvent;
import net.minecraftforge.eventbus.api.IEventBus;
import net.minecraftforge.fml.common.Mod.EventBusSubscriber;
import net.minecraftforge.fml.common.... | package info.u_team.u_team_test.init;
import info.u_team.u_team_core.soundevent.USoundEvent;
import info.u_team.u_team_core.util.registry.BaseRegistryUtil;
import info.u_team.u_team_test.TestMod;
import net.minecraft.util.SoundEvent;
import net.minecraftforge.event.RegistryEvent.Register;
import net.minecraftforge.eve... |
Use only accelerometer for orientation. | from flask import Flask, Response
from sense_hat import SenseHat
sense = SenseHat()
sense.set_imu_config(False, False, True)
app = Flask(__name__)
@app.route('/')
def all_sensors():
return "Hello, world!"
@app.route('/humidity')
def humidity():
return "Hello, world!"
@app.route('/pressure')
def pressure... | from flask import Flask, Response
from sense_hat import SenseHat
sense = SenseHat()
sense.set_imu_config(True, True, True)
app = Flask(__name__)
@app.route('/')
def all_sensors():
return "Hello, world!"
@app.route('/humidity')
def humidity():
return "Hello, world!"
@app.route('/pressure')
def pressure()... |
Add missing var error for windows, minor change pushing in | // +build windows
/*
* Minio Client (C) 2015 Minio, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this fs 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 appl... | // +build windows
/*
* Minio Client (C) 2015 Minio, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this fs 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 appl... |
Fix more db connection strings | from __future__ import with_statement
from alembic import context
import sqlalchemy
import logging
logging.basicConfig(level=logging.INFO, format="[%(asctime)s] %(levelname)s:%(name)s:%(message)s")
target_metadata = None
def run_migrations_offline():
"""Run migrations in 'offline' mode.
This configures the contex... | from __future__ import with_statement
from alembic import context
import sqlalchemy
import logging
logging.basicConfig(level=logging.INFO, format="[%(asctime)s] %(levelname)s:%(name)s:%(message)s")
target_metadata = None
def run_migrations_offline():
"""Run migrations in 'offline' mode.
This configures the contex... |
Debug mode for redis (commented out). | // Global registry for our Redis connection.
// Use this instead of passing around a single 'client' handle.
// Also allows us to select a database within Redis.
var redis = require("redis");
var _ = require("underscore");
var client;
var db = 0;
var sessionclient;
var session_db = 1;
exports.initClient = function(s... | // Global registry for our Redis connection.
// Use this instead of passing around a single 'client' handle.
// Also allows us to select a database within Redis.
var redis = require("redis");
var _ = require("underscore");
var client;
var db = 0;
var sessionclient;
var session_db = 1;
exports.initClient = function(s... |
Add update_reservation to dummy plugin
update_reservation is now an abstract method. It needs to be added to
all plugins.
Change-Id: I921878bd5233613b804b17813af1aac5bdfed9e7
(cherry picked from commit 1dbc30202bddfd4f03bdc9a8005de3c363d2ac1d) | # Copyright (c) 2013 Mirantis Inc.
#
# 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 writ... | # Copyright (c) 2013 Mirantis Inc.
#
# 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 writ... |
Add the correct classname to the view button in the browse template to be consistent with the other buttons. | <?php
namespace TCG\Voyager\Actions;
class ViewAction extends AbstractAction
{
public function getTitle()
{
return __('voyager::generic.view');
}
public function getIcon()
{
return 'voyager-eye';
}
public function getPolicy()
{
return 'read';
}
public... | <?php
namespace TCG\Voyager\Actions;
class ViewAction extends AbstractAction
{
public function getTitle()
{
return __('voyager::generic.view');
}
public function getIcon()
{
return 'voyager-eye';
}
public function getPolicy()
{
return 'read';
}
public... |
Add click action copy to clipboard | package protocolsupport.api.chat.modifiers;
import java.net.MalformedURLException;
import java.net.URL;
import protocolsupport.utils.Utils;
public class ClickAction {
private final Type type;
private final String value;
public ClickAction(Type action, String value) {
this.type = action;
this.value = value;
... | package protocolsupport.api.chat.modifiers;
import java.net.MalformedURLException;
import java.net.URL;
import protocolsupport.utils.Utils;
public class ClickAction {
private final Type type;
private final String value;
public ClickAction(Type action, String value) {
this.type = action;
this.value = value;
... |
Rename write all items class and description | <?php
/**
* Loops through all products and Categories, and sets their URL Segments, if
* they do not already have one
*
* @package commerce
* @subpackage tasks
*/
class CatalogueWriteAllItemsTask extends BuildTask {
protected $title = 'Write All Products and Categories';
protected $description = 'Loop throu... | <?php
/**
* Loops through all products and Categories, and sets their URL Segments, if
* they do not already have one
*
* @package commerce
* @subpackage tasks
*/
class CommerceWriteItemsTask extends BuildTask {
protected $title = 'Write All Commerce Items';
protected $description = 'Loop through all produc... |
Change test reporter to something more compact | const gulp = require('gulp');
const bump = require('gulp-bump');
const eslint = require('gulp-eslint');
const mocha = require('gulp-mocha');
const fs = require('fs');
exports.bump = function(src, type){
return () =>
gulp.src(src)
.pipe(bump({type: type}))
.pipe(gulp.dest('./'));
};
exports.lint = fu... | const gulp = require('gulp');
const bump = require('gulp-bump');
const eslint = require('gulp-eslint');
const mocha = require('gulp-mocha');
const fs = require('fs');
exports.bump = function(src, type){
return () =>
gulp.src(src)
.pipe(bump({type: type}))
.pipe(gulp.dest('./'));
};
exports.lint = fu... |
lxc/exec: Fix signal handler for Windows
Closes #3496
Signed-off-by: Stéphane Graber <089afc6d81f66f1168a9849e15660feae286e024@ubuntu.com> | // +build windows
package main
import (
"io"
"os"
"os/signal"
"syscall"
"github.com/gorilla/websocket"
"github.com/mattn/go-colorable"
"github.com/lxc/lxd/shared/logger"
)
// Windows doesn't process ANSI sequences natively, so we wrap
// os.Stdout for improved user experience for Windows client
type Wrapped... | // +build windows
package main
import (
"io"
"os"
"github.com/gorilla/websocket"
"github.com/mattn/go-colorable"
"github.com/lxc/lxd/shared/logger"
)
// Windows doesn't process ANSI sequences natively, so we wrap
// os.Stdout for improved user experience for Windows client
type WrappedWriteCloser struct {
io... |
Set webpack devtool to false in production | const path = require('path')
module.exports = ({ actions }) => {
actions.setWebpackConfig({
devtool: process.env.NODE_ENV !== 'production',
resolve: {
alias: {
'@components': path.resolve(__dirname, '../../components/'),
'@icons': path.resolve(__dirname, '../../icons/'),
'@style... | const path = require('path')
module.exports = ({ actions }) => {
actions.setWebpackConfig({
resolve: {
alias: {
'@components': path.resolve(__dirname, '../../components/'),
'@icons': path.resolve(__dirname, '../../icons/'),
'@styles': path.resolve(__dirname, '../../styles/'),
... |
Handle input with a http form, rather than JSON | package main
import (
"net/http"
"fmt"
)
func handlePing(w http.ResponseWriter, r *http.Request) {
fmt.Fprint(w, "OK")
}
type Input struct {
FeedId string
FeedUrl string
}
func handleRequest(w http.ResponseWriter, r *http.Request) {
if r.Method != http.MethodPost {
http.Error(w, "Not... | package main
import (
"net/http"
"fmt"
"encoding/json"
)
func handlePing(w http.ResponseWriter, r *http.Request) {
fmt.Fprint(w, "OK")
}
func handleRequest(w http.ResponseWriter, r *http.Request) {
type Input struct {
FeedId string `json:"feed_id"`
FeedUrl string `json:"feed_url"`... |
Use ‘transformPropsIntoState’, the method was renamed. | import { assert } from 'chai';
import cloneDeep from 'lodash/cloneDeep';
import Attributes from '../Attributes';
import defaultTheme from '../../theme';
describe('Attributes', () => {
describe('#processProps', () => {
describe('It doesn\'t mutate the default theme', () => {
let expectedDefaultTheme;
... | import { assert } from 'chai';
import cloneDeep from 'lodash/cloneDeep';
import Attributes from '../Attributes';
import defaultTheme from '../../theme';
describe('Attributes', () => {
describe('#processProps', () => {
describe('It doesn\'t mutate the default theme', () => {
let expectedDefaultTheme;
... |
Fix exception when running install-task | from base import BaseMethod
from fabric.api import *
from lib.utils import SSHTunnel, RemoteSSHTunnel
from fabric.colors import green, red
from lib import configuration
import copy
class DrupalConsoleMethod(BaseMethod):
@staticmethod
def supports(methodName):
return methodName == 'drupalconsole'
def instal... | from base import BaseMethod
from fabric.api import *
from lib.utils import SSHTunnel, RemoteSSHTunnel
from fabric.colors import green, red
from lib import configuration
import copy
class DrupalConsoleMethod(BaseMethod):
@staticmethod
def supports(methodName):
return methodName == 'drupalconsole'
def instal... |
Use node instead webpack to launch Browsersync session | #!/usr/bin/env node
const {spawn} = require('child_process');
const exit = require('signal-exit');
const output = require('./../lib/helpers/output');
const params = ['node_modules/redukt/lib/webpack.watch.js', '--colors', '--watch'];
const node = spawn('node', params, {
detached: true,
stdio: ['ignore', 'p... | #!/usr/bin/env node
const {spawn} = require('child_process');
const exit = require('signal-exit');
const output = require('./../lib/helpers/output');
const params = ['--config=node_modules/redukt/lib/webpack.config.js', '--colors', '--watch', '--hide-modules'];
const webpack = spawn('webpack', params, {
detac... |
Add & implement the optional 'onClick' prop, to provide visual interaction if set | import React, { PureComponent } from 'react';
import PropTypes from 'prop-types';
import cx from 'classnames';
import theme from './theme.css';
import Box from '../box';
import { TextSmall } from '../typography';
class ProgressStep extends PureComponent {
render() {
const { label, active, completed, onClick } =... | import React, { PureComponent } from 'react';
import PropTypes from 'prop-types';
import cx from 'classnames';
import theme from './theme.css';
import Box from '../box';
import { TextSmall } from '../typography';
class ProgressStep extends PureComponent {
render() {
const { label, active, completed } = this.pro... |
Fix build URLs on index page | var delegate = require('delegate');
var form = document.querySelector('.component-build-form');
if(form) {
var checkboxes = form.querySelectorAll('input[type="checkbox"]');
var buildUrl = form.querySelectorAll('.build-url');
delegate(form, 'input[name^="components"]', 'change', change);
function change() {
... | var delegate = require('delegate');
var form = document.querySelector('.component-build-form');
if(form) {
var checkboxes = form.querySelectorAll('input[type="checkbox"]');
var buildUrl = form.querySelectorAll('.build-url');
delegate(form, 'input[name^="components"]', 'change', change);
function change() {
... |
Extend EditText instead of AppCompatEditText | package com.alexstyl.specialdates.search;
import android.content.Context;
import android.util.AttributeSet;
import android.view.KeyEvent;
import android.widget.EditText;
public class BackKeyEditText extends EditText {
public BackKeyEditText(Context context, AttributeSet attrs) {
super(context, attrs);
... | package com.alexstyl.specialdates.search;
import android.content.Context;
import android.util.AttributeSet;
import android.view.KeyEvent;
import android.widget.EditText;
public class BackKeyEditText extends android.support.v7.widget.AppCompatEditText {
public BackKeyEditText(Context context, AttributeSet attrs) {... |
Fix lin. decay NW comment. | package cs437.som.neighborhood;
import cs437.som.NeightborhoodWidthFunction;
/**
* Neighborhood width strategy for self-organizing maps that decays the width
* linearly as the iterations progress.
*
* The exact behavior follows the formula:
* w_i * (1 - (-t / t_max))
* where
* w_i is the initial w... | package cs437.som.neighborhood;
import cs437.som.NeightborhoodWidthFunction;
/**
* Neighborhood width strategy for self-organizing maps that decays the width
* linearly as the iterations progress.
*
* The exact behavior follows the formula:
* w_i * (1 - (-t / t_max))
* where
* w_i is the initial w... |
Rename some things to avoid name conflicts | package models
import (
"time"
)
// ProjectStatus is a type alias which will be used to create an enum of acceptable project status states.
type ProjectStatus string
// ProjectStatus pseudo-enum values
const (
PStatusPublished ProjectStatus = "published"
PStatuses = []ProjectStatus{StatusPublished}
)
// Errors ... | package models
import (
"time"
)
// ProjectStatus is a type alias which will be used to create an enum of acceptable project status states.
type ProjectStatus string
// ProjectStatus pseudo-enum values
const (
StatusPublished ProjectStatus = "published"
Statuses = []ProjectStatus{StatusPublished}
)
// Errors pe... |
Core: Enable modifying orders with taxes
Refs SHOOP-2338 / SHOOP-2578 | # -*- coding: utf-8 -*-
# This file is part of Shoop.
#
# Copyright (c) 2012-2016, Shoop Ltd. All rights reserved.
#
# This source code is licensed under the AGPLv3 license found in the
# LICENSE file in the root directory of this source tree.
from django.db.transaction import atomic
from shoop.core.models import Orde... | # -*- coding: utf-8 -*-
# This file is part of Shoop.
#
# Copyright (c) 2012-2016, Shoop Ltd. All rights reserved.
#
# This source code is licensed under the AGPLv3 license found in the
# LICENSE file in the root directory of this source tree.
from django.db.transaction import atomic
from shoop.core.models import Orde... |
Clean up temporary package.json files. | import buildmessage from "../utils/buildmessage.js";
import {
pathJoin,
statOrNull,
writeFile,
unlink,
} from "../fs/files.js";
const INSTALL_JOB_MESSAGE = "installing dependencies from package.json";
export function install(appDir) {
const packageJsonPath = pathJoin(appDir, "package.json");
const needTem... | import buildmessage from "../utils/buildmessage.js";
import {
pathJoin,
statOrNull,
writeFile,
} from "../fs/files.js";
const INSTALL_JOB_MESSAGE = "installing dependencies from package.json";
export function install(appDir) {
const testAppPkgJsonPath = pathJoin(appDir, "package.json");
if (! statOrNull(te... |
Update site URL; update documentation; simplify getSiteUniqueKey() | <?php
/**
* Extension to sCache.
*
* @copyright Copyright (c) 2011 Poluza.
* @author Andrew Udvare [au] <andrew@poluza.com>
* @license http://www.opensource.org/licenses/mit-license.php
*
* @package Sutra
* @link http://www.sutralib.com/
*
* @version 1.01
*/
class sCache extends fCache {
/**
* The curre... | <?php
/**
* Singleton class to manage Sutra-specific cache.
*
* @copyright Copyright (c) 2011 Poluza.
* @author Andrew Udvare [au] <andrew@poluza.com>
* @license http://www.opensource.org/licenses/mit-license.php
*
* @package Sutra
* @link http://www.example.com/
*
* @version 1.0
*/
class sCache extends fCac... |
Fix url to real production url | const LifeforcePlugin = require("../utils/LifeforcePlugin.js");
//const serverhostname = "http://localhost:16001";
const serverhostname = "https://api.repkam09.com";
class MetaEndpoints extends LifeforcePlugin {
constructor(restifyserver, logger, name) {
super(restifyserver, logger, name);
this.ap... | const LifeforcePlugin = require("../utils/LifeforcePlugin.js");
const serverhostname = "http://localhost:16001";
//const serverhostname = "https://api.repkam09.com";
class MetaEndpoints extends LifeforcePlugin {
constructor(restifyserver, logger, name) {
super(restifyserver, logger, name);
this.ap... |
Change pretty-text2 choices dropdown to look like a link instead of a button | 'use strict';
var React = require('react/addons');
var _ = require('underscore');
/*
Choices drop down component for picking tags.
*/
var ChoicesDropdown = React.createClass({
handleClick: function (key) {
this.props.handleSelection(key);
},
render: function() {
var self = this;
var items = [];... | 'use strict';
var React = require('react/addons');
var _ = require('underscore');
/*
Choices drop down component for picking tags.
*/
var ChoicesDropdown = React.createClass({
handleClick: function (key) {
this.props.handleSelection(key);
},
render: function() {
var self = this;
var items = _.... |
Fix call to observe_if_calendar_available() from window.setTimeout | var calendar_grid = document.querySelector('div[role="grid"]');
var body = document.querySelector('body');
var disable_scroll = function () {
$('div[role="grid"]').on('mousewheel', function (e) {
if (e.target.id == 'el') return;
e.preventDefault();
e.stopPropagation();
});
};
var muta... | var calendar_grid = document.querySelector('div[role="grid"]');
var body = document.querySelector('body');
var disable_scroll = function () {
// Get a handle on the calendar grid
$('div[role="grid"]').on('mousewheel', function (e) {
// Scrolling.... hahhahahaha I don't think so
if (e.target.id == ... |
Use border-box style for all elements | import React from 'react'
import ReactDOM from 'react-dom'
import { createGlobalStyle } from 'styled-components'
import { App } from './App'
import woff2 from './fonts/source-sans-pro-v11-latin-regular.woff2'
import woff from './fonts/source-sans-pro-v11-latin-regular.woff'
import registerServiceWorker from './registe... | import React from 'react'
import ReactDOM from 'react-dom'
import { createGlobalStyle } from 'styled-components'
import { App } from './App'
import woff2 from './fonts/source-sans-pro-v11-latin-regular.woff2'
import woff from './fonts/source-sans-pro-v11-latin-regular.woff'
import registerServiceWorker from './registe... |
Fix having ver info written twice (divergence). Makes "mk cut_a_release" ver update work. | #!/usr/bin/env python
# Copyright (c) 2008-2010 ActiveState Corp.
# License: MIT (http://www.opensource.org/licenses/mit-license.php)
r"""A small Django app that provides template tags for Markdown using the
python-markdown2 library.
See <http://github.com/trentm/django-markdown-deux> for more info.
"""
__version_in... | #!/usr/bin/env python
# Copyright (c) 2008-2010 ActiveState Corp.
# License: MIT (http://www.opensource.org/licenses/mit-license.php)
r"""A small Django app that provides template tags for Markdown using the
python-markdown2 library.
See <http://github.com/trentm/django-markdown-deux> for more info.
"""
__version_in... |
Fix Document class unknown in migration | <?php
use Phinx\Migration\AbstractMigration;
use Pragma\Docs\Models\Document;
class AddUidToDocuments extends AbstractMigration
{
public function change()
{
$strategy = defined('ORM_UID_STRATEGY') && ORM_UID_STRATEGY == 'mysql' ? 'mysql' : 'php';
$table = $this->table('documents');
$table->addColumn("uid... | <?php
use Phinx\Migration\AbstractMigration;
class AddUidToDocuments extends AbstractMigration
{
public function change()
{
$strategy = defined('ORM_UID_STRATEGY') && ORM_UID_STRATEGY == 'mysql' ? 'mysql' : 'php';
$table = $this->table('documents');
$table->addColumn("uid", "string")
->update();
... |
Make the access check code a bit more readable.
git-svn-id: ed609ce04ec9e3c0bc25e071e87814dd6d976548@383 c7a0535c-eda6-11de-83d8-6d5adf01d787 | /*
* Mutability Detector
*
* Copyright 2009 Graham Allan
*
* 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... | /*
* Mutability Detector
*
* Copyright 2009 Graham Allan
*
* 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... |
Put use declaration on two lines | <?php
namespace Hipay\MiraklConnector\Api\Hipay;
use Hipay\MiraklConnector\Api\ConfigurationInterface
as BaseConfigurationInterface;
/**
* File Config.php
*
* @author Ivanis Kouamé <ivanis.kouame@smile.fr>
* @copyright 2015 Smile
*/
interface ConfigurationInterface extends BaseConfigurationInterface
{
... | <?php
namespace Hipay\MiraklConnector\Api\Hipay;
use Hipay\MiraklConnector\Api\ConfigurationInterface as BaseConfigurationInterface;
/**
* File Config.php
*
* @author Ivanis Kouamé <ivanis.kouame@smile.fr>
* @copyright 2015 Smile
*/
interface ConfigurationInterface extends BaseConfigurationInterface
{
/**
... |
Fix appending of query params. | <?php
namespace Yajra\CMS\Http\Controllers;
use App\Http\Controllers\Controller;
use Illuminate\Http\Request;
use Yajra\CMS\Entities\Category;
use Yajra\CMS\Events\CategoryWasViewed;
class CategoryController extends Controller
{
/**
* Display an article.
*
* @param \Yajra\CMS\Entities\Category $ca... | <?php
namespace Yajra\CMS\Http\Controllers;
use App\Http\Controllers\Controller;
use Illuminate\Http\Request;
use Yajra\CMS\Entities\Category;
use Yajra\CMS\Events\CategoryWasViewed;
class CategoryController extends Controller
{
/**
* Display an article.
*
* @param \Yajra\CMS\Entities\Category $ca... |
Use lists, not delimited strings | var webpack = require( 'webpack' );
module.exports = {
entry: [
'webpack-dev-server/client?http://localhost:8080',
'webpack/hot/only-dev-server',
'./src/index'
],
module: {
loaders: [ {
test: /\.jsx?$/,
exclude: /node_modules/,
loaders: [ 'react... | var webpack = require( 'webpack' );
module.exports = {
entry: [
'webpack-dev-server/client?http://localhost:8080',
'webpack/hot/only-dev-server',
'./src/index.jsx'
],
module: {
loaders: [ {
test: /\.jsx?$/,
exclude: /node_modules/,
loader: 'reac... |
Include mac ipv6 localhost, server address. | <?php
// if you don't want to setup permissions the proper way, just uncomment the following PHP line
// read http://symfony.com/doc/current/book/installation.html#configuration-and-setup for more information
//umask(0000);
// this check prevents access to debug front controllers that are deployed by accident to prod... | <?php
// if you don't want to setup permissions the proper way, just uncomment the following PHP line
// read http://symfony.com/doc/current/book/installation.html#configuration-and-setup for more information
//umask(0000);
// this check prevents access to debug front controllers that are deployed by accident to prod... |
Add comments about asymptotic normality. | package waldo
import "math"
// Sample represents data drawn from some distribution. To compute
// the Wald statistics we need to have a point estimator function
// (e.g., the maximum likelihood estimator (MLE))
// as well as the sampling distribution's variance. Recall
// that the sampling distribution is defined a... | package waldo
import "math"
// Sample represents data drawn from some distribution. To compute
// the Wald statistics we need to have a point estimator function
// (e.g., the maximum likelihood estimator (MLE))
// as well as the sampling distribution's variance. Recall
// that the sampling distribution is defined a... |
Switch to ES6 Temlate Literals | 'use strict';
const google = require('google');
module.exports = exports = {};
const questions = (function() {
let methods = {};
methods.search = function(response, convo) {
google(response.text, (err, results) => {
if(err) {
console.log(err);
convo.say('Sorry, but an error occur... | 'use strict';
const google = require('google');
module.exports = exports = {};
const questions = (function() {
let methods = {};
methods.search = function(response, convo) {
google(response.text, (err, results) => {
if(err) {
console.log(err);
convo.say('Sorry, but an error occur... |
Add awp as an additional shell command | #!/usr/bin/env python
# coding=utf-8
from setuptools import setup
setup(
name='alfred-workflow-packager',
version='0.11.0',
description='A CLI utility for packaging and exporting Alfred workflows',
url='https://github.com/caleb531/alfred-workflow-packager',
author='Caleb Evans',
author_email='... | #!/usr/bin/env python
# coding=utf-8
from setuptools import setup
setup(
name='alfred-workflow-packager',
version='0.11.0',
description='A CLI utility for packaging and exporting Alfred workflows',
url='https://github.com/caleb531/alfred-workflow-packager',
author='Caleb Evans',
author_email='... |
Fix embroider build in CI | 'use strict';
const EmberAddon = require('ember-cli/lib/broccoli/ember-addon');
const { maybeEmbroider } = require('@embroider/test-setup');
process.env.buildTarget = EmberAddon.env();
module.exports = function (defaults) {
const app = new EmberAddon(defaults, {
minifyCSS: {
enabled: false
}
});
... | 'use strict';
const EmberAddon = require('ember-cli/lib/broccoli/ember-addon');
const { maybeEmbroider } = require('@embroider/test-setup');
process.env.buildTarget = EmberAddon.env();
module.exports = function (defaults) {
const app = new EmberAddon(defaults, {
minifyCSS: {
enabled: false
}
});
... |
Update requests requirement from <2.26,>=2.4.2 to >=2.4.2,<2.27
Updates the requirements on [requests](https://github.com/psf/requests) to permit the latest version.
- [Release notes](https://github.com/psf/requests/releases)
- [Changelog](https://github.com/psf/requests/blob/master/HISTORY.md)
- [Commits](https://git... | from setuptools import setup, find_packages
setup(
name='panoptes_client',
url='https://github.com/zooniverse/panoptes-python-client',
author='Adam McMaster',
author_email='adam@zooniverse.org',
version='1.4.0',
packages=find_packages(),
include_package_data=True,
install_requires=[
... | from setuptools import setup, find_packages
setup(
name='panoptes_client',
url='https://github.com/zooniverse/panoptes-python-client',
author='Adam McMaster',
author_email='adam@zooniverse.org',
version='1.4.0',
packages=find_packages(),
include_package_data=True,
install_requires=[
... |
Include missing columns in output | from collections import namedtuple
class Termite:
def __init__(self, label, color):
self.label = label
self.color = color
self.trail = []
self.tracker = None
def to_csv(self):
with open('data/{}-trail.csv'.format(self.label), mode='w') as trail_out:
trail_o... | from collections import namedtuple
class Termite:
def __init__(self, label, color):
self.label = label
self.color = color
self.trail = []
self.tracker = None
def to_csv(self):
with open('data/{}-trail.csv'.format(self.label), mode='w') as trail_out:
trail_o... |
Add text selection inside 'li' element | from scrapy.contrib.spiders import CrawlSpider, Rule
from scrapy.contrib.linkextractors.sgml import SgmlLinkExtractor
from scrapy.selector import Selector
from dataset import DatasetItem
class DatasetSpider(CrawlSpider):
name = 'dataset'
allowed_domains = ['data.gc.ca/data/en']
start_urls = ['http://data.... | from scrapy.contrib.spiders import CrawlSpider, Rule
from scrapy.contrib.linkextractors.sgml import SgmlLinkExtractor
from scrapy.selector import Selector
from dataset import DatasetItem
class DatasetSpider(CrawlSpider):
name = 'dataset'
allowed_domains = ['data.gc.ca/data/en']
start_urls = ['http://data.... |
linkedql: Change name of variable in BuildIdentifier | package linkedql
import "github.com/cayleygraph/quad"
import "github.com/cayleygraph/quad/voc"
// EntityIdentifier is an interface to be used where a single entity identifier is expected.
type EntityIdentifier interface {
BuildIdentifier(ns *voc.Namespaces) (quad.Value, error)
}
// EntityIRI is an entity IRI.
type... | package linkedql
import "github.com/cayleygraph/quad"
import "github.com/cayleygraph/quad/voc"
// EntityIdentifier is an interface to be used where a single entity identifier is expected.
type EntityIdentifier interface {
BuildIdentifier(ns *voc.Namespaces) (quad.Value, error)
}
// EntityIRI is an entity IRI.
type... |
Put license at top of file | /*
* 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... | package tech.tablesaw.io.saw;
/*
* 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... |
Change development label to dev to match NODE_ENV |
const config = {
dev: {
client: 'sqlite3',
connection: {
filename: './db/dev.sqlite3'
}
},
staging: {
client: 'postgresql',
connection: {
database: 'my_db',
user: 'username',
password: 'password'
},
pool: {
min: 2,
max: 10
},
migration... |
const config = {
development: {
client: 'sqlite3',
connection: {
filename: './db/dev.sqlite3'
}
},
staging: {
client: 'postgresql',
connection: {
database: 'my_db',
user: 'username',
password: 'password'
},
pool: {
min: 2,
max: 10
},
m... |
controller/examples: Add file/line to log messages
Signed-off-by: Jonathan Rudenberg <3692bfa45759a67d83aedf0045f6cb635a966abf@titanous.com> | package main
import (
"fmt"
"io"
"log"
"os"
)
type config struct {
controllerKey string
ourPort string
logOut io.Writer
}
func init() {
log.SetFlags(log.Lshortfile | log.Lmicroseconds)
}
func loadConfigFromEnv() (*config, error) {
c := &config{}
c.controllerKey = os.Getenv("CONTROLLER_KEY")
... | package main
import (
"fmt"
"io"
"os"
)
type config struct {
controllerKey string
ourPort string
logOut io.Writer
}
func loadConfigFromEnv() (*config, error) {
c := &config{}
c.controllerKey = os.Getenv("CONTROLLER_KEY")
if c.controllerKey == "" {
return nil, fmt.Errorf("CONTROLLER_KEY is req... |
Reset world chunks metric to fix accumulating unloaded worlds
Signed-off-by: Byron Marohn <72c48d57fac8949117d5a1dd58341ee30497c114@live.com> | package de.sldk.mc.metrics;
import io.prometheus.client.Gauge;
import org.bukkit.World;
import org.bukkit.plugin.Plugin;
public class LoadedChunks extends WorldMetric {
private static final Gauge LOADED_CHUNKS = Gauge.build()
.name(prefix("loaded_chunks_total"))
.help("Chunks loaded per w... | package de.sldk.mc.metrics;
import io.prometheus.client.Gauge;
import org.bukkit.World;
import org.bukkit.plugin.Plugin;
public class LoadedChunks extends WorldMetric {
private static final Gauge LOADED_CHUNKS = Gauge.build()
.name(prefix("loaded_chunks_total"))
.help("Chunks loaded per w... |
Fix pass of arguments issue | 'use strict';
var assign = require('es5-ext/object/assign')
, setPrototypeOf = require('es5-ext/object/set-prototype-of')
, d = require('d')
, captureStackTrace = Error.captureStackTrace
, AbstractError;
AbstractError = function AbstractError(message/*, code, ext*/) {
var ext, code;
if... | 'use strict';
var assign = require('es5-ext/object/assign')
, setPrototypeOf = require('es5-ext/object/set-prototype-of')
, d = require('d')
, captureStackTrace = Error.captureStackTrace
, AbstractError;
AbstractError = function AbstractError(message/*, code, ext*/) {
var ext, code;
if... |
Handle array of values for the MAC. | <?php
namespace MCordingley\LaravelSapient\Middleware;
use Closure;
use Illuminate\Http\Request;
use MCordingley\LaravelSapient\Contracts\KeyResolver;
use ParagonIE\ConstantTime\Base64UrlSafe;
use ParagonIE\Sapient\CryptographyKeys\SigningPublicKey;
use Symfony\Component\HttpFoundation\Response;
final class VerifyRe... | <?php
namespace MCordingley\LaravelSapient\Middleware;
use Closure;
use Illuminate\Http\Request;
use MCordingley\LaravelSapient\Contracts\KeyResolver;
use ParagonIE\ConstantTime\Base64UrlSafe;
use ParagonIE\Sapient\CryptographyKeys\SigningPublicKey;
use Symfony\Component\HttpFoundation\Response;
final class VerifyRe... |
Reword package info a bit | /*
* Copyright 2018, TeamDev. All rights reserved.
*
* Redistribution and use in source and/or binary forms, with or without
* modification, must retain the above copyright notice and the following
* disclaimer.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR... | /*
* Copyright 2018, TeamDev. All rights reserved.
*
* Redistribution and use in source and/or binary forms, with or without
* modification, must retain the above copyright notice and the following
* disclaimer.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR... |
Use let and const instead of var | module.exports = {
getRequest: (url, callback) => {
let request = new XMLHttpRequest();
request.open('GET', url, true);
request.onload = () => {
if (request.status >= 200 && request.status < 400) {
const data = JSON.parse(request.responseText);
callback(data);
} else {
... | module.exports = {
getRequest: (url, callback) => {
var request = new XMLHttpRequest();
request.open('GET', url, true);
request.onload = () => {
if (request.status >= 200 && request.status < 400) {
var data = JSON.parse(request.responseText);
callback(data);
} else {
co... |
Disable ckeditor resizing to get rid of bottom bar | /* globals CKEDITOR */
import Ember from 'ember';
import layout from '../templates/components/ck-editor';
export default Ember.Component.extend({
layout: layout,
_editor: null,
didInsertElement () {
let textarea = this.element.querySelector('.editor');
let editor = this._editor = CKEDITOR.replace(texta... | /* globals CKEDITOR */
import Ember from 'ember';
import layout from '../templates/components/ck-editor';
export default Ember.Component.extend({
layout: layout,
_editor: null,
didInsertElement() {
let textarea = this.element.querySelector('.editor');
let editor = this._editor = CKEDITOR.replace(textar... |
Enforce unique user names in the database model
Set unique=TRUE and deleted TODO comment line | from django.db import models
from common.util.generator import get_random_id
class Student(models.Model):
username = models.CharField(max_length=7,unique=True)
magic_id = models.CharField(max_length=8)
child = models.BooleanField()
def __str__(self):
return self.username
def save(self, ... | from django.db import models
from common.util.generator import get_random_id
class Student(models.Model):
# ToDo: Make username unique
username = models.CharField(max_length=7)
magic_id = models.CharField(max_length=8)
child = models.BooleanField()
def __str__(self):
return self.username... |
Set is-ie class on grid root. | import { appendIfMissing } from '@zambezi/d3-utils'
import { defaultTemplate } from './basic-grid-template'
import { isIE } from './is-ie'
import { select } from 'd3-selection'
export function createSetupGridTemplate() {
const appendStirrup = appendIfMissing('div.zambezi-grid-stirrup')
let template = defaultTemp... | import { defaultTemplate } from './basic-grid-template'
import { appendIfMissing } from '@zambezi/d3-utils'
import { select } from 'd3-selection'
export function createSetupGridTemplate() {
const appendStirrup = appendIfMissing('div.zambezi-grid-stirrup')
let template = defaultTemplate
function setupTemplate(... |
Use length instead of property iteration | /* global exports */
"use strict";
// module Data.Foreign
// jshint maxparams: 3
exports.parseJSONImpl = function (left, right, str) {
try {
return right(JSON.parse(str));
} catch (e) {
return left(e.toString());
}
};
// jshint maxparams: 1
exports.toForeign = function (value) {
return value;
};
exp... | /* global exports */
"use strict";
// module Data.Foreign
// jshint maxparams: 3
exports.parseJSONImpl = function (left, right, str) {
try {
return right(JSON.parse(str));
} catch (e) {
return left(e.toString());
}
};
// jshint maxparams: 1
exports.toForeign = function (value) {
return value;
};
exp... |
Add version constraints for all dependencies of accounts-password.
This is necessary to allow publishing accounts-password independently of a
Meteor release.
Note that the npm-bcrypt version has been bumped to 0.8.7_1. | Package.describe({
summary: "Password support for accounts",
version: "1.2.13"
});
Package.onUse(function(api) {
api.use('npm-bcrypt@=0.8.7_1');
api.use([
'accounts-base@1.2.9',
'srp@1.0.9',
'sha@1.0.8',
'ejson@1.0.12',
'ddp@1.2.5'
], ['client', 'server']);
// Export Accounts (etc) to... | Package.describe({
summary: "Password support for accounts",
version: "1.2.12"
});
Package.onUse(function(api) {
api.use('npm-bcrypt@=0.8.7');
api.use([
'accounts-base',
'srp',
'sha',
'ejson',
'ddp'
], ['client', 'server']);
// Export Accounts (etc) to packages using this one.
api.i... |
Use the proper Email validation message | <?php
namespace Frontend\Modules\Mailmotor\Domain\Subscription\Command;
use Frontend\Core\Language\Locale;
use Symfony\Component\Validator\Constraints as Assert;
use Frontend\Modules\Mailmotor\Domain\Subscription\Validator\Constraints as MailingListAssert;
final class Unsubscription
{
/**
* @var string
... | <?php
namespace Frontend\Modules\Mailmotor\Domain\Subscription\Command;
use Frontend\Core\Language\Locale;
use Symfony\Component\Validator\Constraints as Assert;
use Frontend\Modules\Mailmotor\Domain\Subscription\Validator\Constraints as MailingListAssert;
final class Unsubscription
{
/**
* @var string
... |
Move from junit to testng for integration tests | package net.kencochrane.raven.log4j;
import net.kencochrane.raven.stub.SentryStub;
import org.apache.log4j.Logger;
import org.testng.annotations.AfterMethod;
import org.testng.annotations.Test;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.is;
public class SentryAppenderIT ... | package net.kencochrane.raven.log4j;
import net.kencochrane.raven.stub.SentryStub;
import org.apache.log4j.Logger;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.is;
public class SentryAppenderIT {
p... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.