text stringlengths 16 4.96k | positive stringlengths 321 2.24k | negative stringlengths 310 2.21k |
|---|---|---|
Fix tests to check status code, and not expect exception | package keywhiz.service.resources;
import com.codahale.metrics.health.HealthCheck;
import com.codahale.metrics.health.HealthCheckRegistry;
import io.dropwizard.setup.Environment;
import java.util.TreeMap;
import javax.ws.rs.InternalServerErrorException;
import javax.ws.rs.core.Response;
import org.junit.Before;
import... | package keywhiz.service.resources;
import com.codahale.metrics.health.HealthCheck;
import com.codahale.metrics.health.HealthCheckRegistry;
import io.dropwizard.setup.Environment;
import java.util.TreeMap;
import javax.ws.rs.InternalServerErrorException;
import org.junit.Before;
import org.junit.Test;
import static or... |
Change interface for make change in implementation | 'use strict';
const EventEmitter = require('events');
/**
* Tracker Manager
* @interface
*/
class ITrackerManager extends EventEmitter {
constructor() {
super();
if (this.constructor === ITrackerManager) {
throw new TypeError('Can not create new instance of interface');
}
}
/**
* Include tracker in... | 'use strict';
const EventEmitter = require('events');
/**
* Tracker Manager
* @interface
*/
class ITrackerManager extends EventEmitter {
constructor() {
super();
if (this.constructor === ITrackerManager) {
throw new TypeError('Can not create new instance of interface');
}
}
/**
* Include tracker in... |
Change \dt syntax to add an optional table name. | import logging
from .main import special_command, RAW_QUERY, PARSED_QUERY
log = logging.getLogger(__name__)
@special_command('\\dt', '\\dt [table]', 'List or describe tables.', arg_type=PARSED_QUERY, case_sensitive=True)
def list_tables(cur, arg=None, arg_type=PARSED_QUERY):
if arg:
query = 'SHOW FIELDS F... | import logging
from .main import special_command, RAW_QUERY, PARSED_QUERY
log = logging.getLogger(__name__)
@special_command('\\dt', '\\dt', 'List or describe tables.', arg_type=PARSED_QUERY, case_sensitive=True)
def list_tables(cur, arg=None, arg_type=PARSED_QUERY):
if arg:
query = 'SHOW FIELDS FROM {0}'... |
Revert "use only one expectation"
This reverts commit 21b733c10c04691717e49bd8a03b83b21976e4b5. | <?php
namespace PHPSpec2\Mocker\Mockery;
use Mockery;
use PHPSpec2\Mocker\MockProxyInterface;
use PHPSpec2\Stub\ArgumentsResolver;
class MockProxy implements MockProxyInterface
{
private $originalMock;
public function __construct($classOrInterface)
{
$this->originalMock = Mockery::mock($classOr... | <?php
namespace PHPSpec2\Mocker\Mockery;
use Mockery;
use PHPSpec2\Mocker\MockProxyInterface;
use PHPSpec2\Stub\ArgumentsResolver;
class MockProxy implements MockProxyInterface
{
private $originalMock;
public function __construct($classOrInterface)
{
$this->originalMock = Mockery::mock($classOr... |
Check to ensure that we're dealing with "green" threads | from guv.green import threading, time
def f1():
"""A simple function
"""
print('Hello, world!')
def f2():
"""A simple function that sleeps for a short period of time
"""
time.sleep(0.1)
class TestThread:
def test_thread_create(self):
t = threading.Thread(target=f1)
asse... | from guv.green import threading, time
def f1():
"""A simple function
"""
print('Hello, world!')
def f2():
"""A simple function that sleeps for a short period of time
"""
time.sleep(0.1)
class TestThread:
def test_thread_create(self):
t = threading.Thread(target=f1)
asse... |
Resolve Minor Issues with Test
Ensure that the tensorflow tests run on the CPU | # Lint as: python3
"""Tests for spectral."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import tensorflow as tf
import numpy as np
import os
import layers
class LayersTest(tf.test.TestCase):
def test_conv_transpose_shape(self):
inputs =... | # Lint as: python3
"""Tests for spectral."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import tensorflow as tf
import numpy as np
import layers
class LayersTest(tf.test.TestCase):
def test_conv_transpose_shape(self):
inputs = np.random.nor... |
Update to SDK 1.0.0-M8 in integration test scope. | package controllers;
import io.sphere.sdk.categories.Category;
import io.sphere.sdk.categories.queries.CategoryQuery;
import io.sphere.sdk.queries.PagedQueryResult;
import org.junit.Test;
import testutils.WithPlayJavaClient;
import java.util.Locale;
import static org.fest.assertions.Assertions.assertThat;
public cl... | package controllers;
import io.sphere.sdk.categories.Category;
import io.sphere.sdk.categories.queries.CategoryQuery;
import io.sphere.sdk.queries.PagedQueryResult;
import org.junit.Test;
import testutils.WithPlayJavaClient;
import java.util.Locale;
import static org.fest.assertions.Assertions.assertThat;
public cl... |
Add a column for archive link | <?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateBookmarksTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('bookmarks', f... | <?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateBookmarksTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('bookmarks', f... |
Fix problem with header lenght | <?php
return [
'settings' => [
'determineRouteBeforeAppMiddleware' => false,
'displayErrorDetails' => true,
'events_upload' => __DIR__.'/../public/uploads/evenements/',
'addContentLengthHeader' => false,
'view' => [
'template_path' => __DIR__ . '/../src/App/Reso... | <?php
return [
'settings' => [
'determineRouteBeforeAppMiddleware' => false,
'displayErrorDetails' => true,
'events_upload' => __DIR__.'/../public/uploads/evenements/',
'view' => [
'template_path' => __DIR__ . '/../src/App/Resources/views',
'twig' => [
... |
Fix error response not returning errors. | <?php
namespace FluxBB\Server\Response;
use FluxBB\Server\Request;
use Illuminate\Support\Contracts\MessageProviderInterface;
use Illuminate\Support\MessageBag;
class Error extends Redirect implements MessageProviderInterface
{
protected $errors;
public function __construct(Request $next, MessageBag $error... | <?php
namespace FluxBB\Server\Response;
use FluxBB\Server\Request;
use Illuminate\Support\Contracts\MessageProviderInterface;
use Illuminate\Support\MessageBag;
class Error extends Redirect implements MessageProviderInterface
{
protected $errors;
public function __construct(Request $next, MessageBag $error... |
[IMP] account_invoice_comment_template: Move comment_template_id field to the Invoicing tab
[IMP] account_invoice_comment_template: rename partner field name from comment_template_id to invoice_comment_template_id
[IMP] account_invoice_comment_template: Make partner field company_dependant and move domain definition ... | # License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
from odoo.tests.common import TransactionCase
class TestResPartner(TransactionCase):
def setUp(self):
super(TestResPartner, self).setUp()
self.template_id = self.env['base.comment.template'].create({
'name': 'Comment bef... | # License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
from odoo.tests.common import TransactionCase
class TestResPartner(TransactionCase):
def setUp(self):
self.template_id = self.env['base.comment.template'].create({
'name': 'Comment before lines',
'position': 'before_... |
Fix order for gulp modules - in task compile-sass | /**
* Compile scss files listed in the config
*/
'use strict';
const gulp = require('gulp');
const notify = require('gulp-notify');
const gulpif = require('gulp-if');
const sass = require('gulp-sass');
const autoprefixer = require('gulp-autoprefixer');
const gcmq = require('gulp-group-css-media-queries');
module.ex... | /**
* Compile scss files listed in the config
*/
'use strict';
const gulp = require('gulp');
const notify = require('gulp-notify');
const gulpif = require('gulp-if');
const sass = require('gulp-sass');
const autoprefixer = require('gulp-autoprefixer');
const gcmq = require('gulp-group-css-media-queries');
module.ex... |
Fix task def for gulp 4 | var log = require('color-log'),
runSequenceGenerator = require('run-sequence'),
createBundleTasks = require('./utils/createBundleTasks');
function build(callback) {
var runSequence = runSequenceGenerator.use(gulp),
buildTasks = [],
browserifyCompleteFn = function() {
log.mark('[BROWSERIFY... | var log = require('color-log'),
runSequenceGenerator = require('run-sequence'),
createBundleTasks = require('./utils/createBundleTasks');
module.exports = function(gulp, options) {
var tasks;
tasks = createBundleTasks(gulp, options);
/* Full build */
gulp.task(options.taskPrefix + 'build', function(ca... |
Make the unit tests work with 2.6. | # Copyright (c) 2014, Matt Layman
'''Tests for the StorageFactory.'''
import unittest
from markwiki.exceptions import ConfigurationError
from markwiki.storage.factory import UserStorageFactory
from markwiki.storage.fs.user import FileUserStorage
class InitializeException(Exception):
'''An exception to ensure st... | # Copyright (c) 2014, Matt Layman
'''Tests for the StorageFactory.'''
import unittest
from markwiki.exceptions import ConfigurationError
from markwiki.storage.factory import UserStorageFactory
from markwiki.storage.fs.user import FileUserStorage
class InitializeException(Exception):
'''An exception to ensure st... |
Make sure we use python2 | #! /usr/bin/python2
# from the __future__ package, import division
# to allow float division
from __future__ import division
def estimate_probs(trigram_counts_dict):
'''
# Estimates probabilities of trigrams using
# trigram_counts_dict and returns a new dictionary
# with the probabilities.
'''
... | # from the __future__ package, import division
# to allow float division
from __future__ import division
def estimate_probs(trigram_counts_dict):
'''
# Estimates probabilities of trigrams using
# trigram_counts_dict and returns a new dictionary
# with the probabilities.
'''
trigram_probs_dict ... |
Update copyright notice with MIT license | /*++
NASM Assembly Language Plugin
Copyright (c) 2017-2018 Aidan Khoury
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, ... | /*++
NASM Assembly Language Plugin
Copyright (c) 2017-2018 Aidan Khoury. All rights reserved.
This program 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) any... |
Make Kirby cachbuster plugin compatible with PHP < 7.1 | <?php
/**
* Kirby Asset Cachebuster Plugin
*
* @version 1.0.0
* @author Pedro Borges <oi@pedroborg.es>
* @copyright Pedro Borges <oi@pedroborg.es>
* @link https://github.com/pedroborges/kirby-asset-cachebuster
* @license MIT
*/
if (! function_exists('asset')) {
/**
* Generate a versioned ... | <?php
/**
* Kirby Asset Cachebuster Plugin
*
* @version 1.0.0
* @author Pedro Borges <oi@pedroborg.es>
* @copyright Pedro Borges <oi@pedroborg.es>
* @link https://github.com/pedroborges/kirby-asset-cachebuster
* @license MIT
*/
if (! function_exists('asset')) {
/**
* Generate a versioned ... |
Remove todo: Renaming to uppercase breaks service discovery | <?php
namespace Kibo\Phast\Services\Css;
use Kibo\Phast\Filters\HTML\ImagesOptimizationService\ImageURLRewriter;
use Kibo\Phast\Retrievers\Retriever;
use Kibo\Phast\Security\ServiceSignature;
use Kibo\Phast\Services\ProxyBaseService;
use Kibo\Phast\Services\ServiceFilter;
use Kibo\Phast\ValueObjects\Resource;
class ... | <?php
// TODO: Capitalize the css ns
namespace Kibo\Phast\Services\Css;
use Kibo\Phast\Filters\HTML\ImagesOptimizationService\ImageURLRewriter;
use Kibo\Phast\Retrievers\Retriever;
use Kibo\Phast\Security\ServiceSignature;
use Kibo\Phast\Services\ProxyBaseService;
use Kibo\Phast\Services\ServiceFilter;
use Kibo\Phast... |
Fix order of static and router to let static to handle static files first |
/**
* Module dependencies.
*/
var express = require('express')
, routes = require('./routes')
, http = require('http')
, mongoose = require('mongoose');
// TODO: Refactor db connection string
mongoose.connect('mongodb://localhost/nodewiki', function(err) {
if (err) {
console.log('Could not conne... |
/**
* Module dependencies.
*/
var express = require('express')
, routes = require('./routes')
, http = require('http')
, mongoose = require('mongoose');
// TODO: Refactor db connection string
mongoose.connect('mongodb://localhost/nodewiki', function(err) {
if (err) {
console.log('Could not conne... |
Revert "Add Emoji list of `Binary_Property`s"
This reverts commit 5dc3741e84f72e21a0376e2370475bd9691388bc. | const {
assemble,
writeFile,
unicodeVersion
} = require('./utils.js');
// This includes only the binary properties required by UTS18 RL1.2 for level 1 Unicode regex
// support, minus `Assigned` which has special handling since it is the inverse of Unicode category
// `Unassigned`. To include all binary pro... | const {
assemble,
writeFile,
unicodeVersion
} = require('./utils.js');
// This includes only the binary properties required by UTS18 RL1.2 for level 1 Unicode regex
// support, minus `Assigned` which has special handling since it is the inverse of Unicode category
// `Unassigned`. To include all binary pro... |
Check passed coordinates to be correct | import dataComplete from './actions/dataComplete';
import preprocessData from './actions/preprocessData';
import readFile from '../functions/file/readFile';
import preprocessFile from '../functions/file/preprocessFile';
import parseCoordinates from '../functions/parseCoordinates';
import issetCoordinates from '../funct... | import dataComplete from './actions/dataComplete';
import preprocessData from './actions/preprocessData';
import readFile from '../functions/file/readFile';
import preprocessFile from '../functions/file/preprocessFile';
import { PREPROCESSDATA, READDATA } from './constants';
const middleware = store => next => action... |
Validate slide max position and duration | <?php
namespace Zeropingheroes\Lanager\Requests;
class StoreSlideRequest extends Request
{
use LaravelValidation;
/**
* Whether the request is valid
*
* @return bool
*/
public function valid(): bool
{
$this->validationRules = [
'lan_id' => ['require... | <?php
namespace Zeropingheroes\Lanager\Requests;
class StoreSlideRequest extends Request
{
use LaravelValidation;
/**
* Whether the request is valid
*
* @return bool
*/
public function valid(): bool
{
$this->validationRules = [
'lan_id' => ['require... |
Add New Temps to Beginning | import time
import requests
class TemperatureMonitor:
def __init__(self, temperature_sensor, interval=60, smoothing=5, observers=()):
self.temperature_sensor = temperature_sensor
self.interval = interval
self.smoothing = smoothing
self.observers = observers
self.history = ... | import time
import requests
class TemperatureMonitor:
def __init__(self, temperature_sensor, interval=60, smoothing=5, observers=()):
self.temperature_sensor = temperature_sensor
self.interval = interval
self.smoothing = smoothing
self.observers = observers
self.history = ... |
Add to line 15 for testing. | import ephem
from datetime import datetime
def const(planet_name): # function name and parameters
planet_class = getattr(ephem, planet_name) # sets ephem object class
date_class = datetime.now()
planet = planet_class() # sets planet variable
south_bend = ephem.Observer... | import ephem
from datetime import datetime
def const(planet_name): # function name and parameters
planet_class = getattr(ephem, planet_name) # sets ephem object class
date_class = datetime.now()
planet = planet_class() # sets planet variable
south_bend = ephem.Observer... |
Use `CheckString` for test harness related func arguments. | package regexp_test
import (
"github.com/Shopify/go-lua"
"github.com/Shopify/goluago/regexp"
"testing"
)
func TestLuaRegexp(t *testing.T) {
l := lua.NewState()
lua.OpenLibraries(l)
regexp.Open(l)
failHook := func(l *lua.State) int {
str := lua.CheckString(l, -1)
lua.Pop(l, 1)
t.Error(str)
return 0
}... | package regexp_test
import (
"github.com/Shopify/go-lua"
"github.com/Shopify/goluago/regexp"
"testing"
)
func TestLuaRegexp(t *testing.T) {
l := lua.NewState()
lua.OpenLibraries(l)
regexp.Open(l)
failHook := func(l *lua.State) int {
str, ok := lua.ToString(l, -1)
if !ok {
t.Fatalf("need a string on th... |
Switch test coverage reporting off for travis | if (!process.env.TRAVIS) {
var semicov = require('semicov');
semicov.init('lib');
process.on('exit', semicov.report);
}
try {
global.sinon = require('sinon');
} catch (e) {
// ignore
}
var group_name = false, EXT_EXP;
function it (should, test_case) {
check_external_exports();
if (group_na... | var semicov = require('semicov');
semicov.init('lib');
process.on('exit', semicov.report);
try {
global.sinon = require('sinon');
} catch (e) {
// ignore
}
var group_name = false, EXT_EXP;
function it (should, test_case) {
check_external_exports();
if (group_name) {
EXT_EXP[group_name][should]... |
Fix bug in language selection switching
https://github.com/globaleaks/GlobaLeaks/issues/452 | GLClient.controller('toolTipCtrl',
['$scope', '$rootScope', 'Authentication',
'$location', '$cookies', 'Translations', 'Node', '$route',
function($scope, $rootScope, Authentication, $location,
$cookies, Translations, Node, $route) {
if (!$cookies['language'])
$cookies['language'] = 'en';
$scope.s... | GLClient.controller('toolTipCtrl',
['$scope', '$rootScope', 'Authentication',
'$location', '$cookies', 'Translations', 'Node', '$route',
function($scope, $rootScope, Authentication, $location,
$cookies, Translations, Node, $route) {
if (!$cookies['language'])
$cookies['language'] = 'en';
$scope.s... |
Use `Room.getCities` instead of checking each visible room controller | 'use strict'
/**
* Top level program- it is responsible for launching everything else.
*/
class Player extends kernel.process {
constructor (...args) {
super(...args)
this.priority = PRIORITIES_PLAYER
}
main () {
this.launchChildProcess('respawner', 'respawner')
this.launchChildProcess('intel... | 'use strict'
/**
* Top level program- it is responsible for launching everything else.
*/
class Player extends kernel.process {
constructor (...args) {
super(...args)
this.priority = PRIORITIES_PLAYER
}
main () {
this.launchChildProcess('respawner', 'respawner')
this.launchChildProcess('intel... |
Check if array element is present before access
Signed-off-by: Daniel Kesselberg <1d6e1cf70ec6f9ab28d3ea4b27a49a77654d370e@danielkesselberg.de> | <?php
declare(strict_types=1);
/**
* @copyright Copyright (c) 2017 Joas Schilling <coding@schilljs.com>
*
* @author Joas Schilling <coding@schilljs.com>
*
* @license GNU AGPL version 3 or any later version
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU A... | <?php
declare(strict_types=1);
/**
* @copyright Copyright (c) 2017 Joas Schilling <coding@schilljs.com>
*
* @author Joas Schilling <coding@schilljs.com>
*
* @license GNU AGPL version 3 or any later version
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU A... |
Update Point to use normal dictionaries for its coordinates |
class Point(object):
"""Contains information about for each scan point
Attributes:
positions (dict): Dict of str position_name -> float position for each
scannable dimension. E.g. {"x": 0.1, "y": 2.2}
lower (dict): Dict of str position_name -> float lower_bound for each
... | from collections import OrderedDict
class Point(object):
"""Contains information about for each scan point
Attributes:
positions (dict): Dict of str position_name -> float position for each
scannable dimension. E.g. {"x": 0.1, "y": 2.2}
lower (dict): Dict of str position_name -> f... |
Fix kilikTable for Symfony 5.4 | <?php
namespace Kilik\TableBundle\DependencyInjection;
use Symfony\Component\Config\Definition\Builder\TreeBuilder;
use Symfony\Component\Config\Definition\ConfigurationInterface;
/**
* This is the class that validates and merges configuration from your app/config files.
*
* To learn more see {@link http://symfon... | <?php
namespace Kilik\TableBundle\DependencyInjection;
use Symfony\Component\Config\Definition\Builder\TreeBuilder;
use Symfony\Component\Config\Definition\ConfigurationInterface;
/**
* This is the class that validates and merges configuration from your app/config files.
*
* To learn more see {@link http://symfon... |
Fix typo in /data fixture. | import { Router, Route, connect } from '../../index';
// It expects a factory function that it can inject dependencies into.
export default (React, browserHistory) => {
const Home = React => {
const component = ({ title }) => <h1 className="title">{ title }</h1>;
const mapStateToProps = (state) => {
c... | import { Router, Route, connect } from '../../index';
// It expects a factory function that it can inject dependencies into.
export default (React, browserHistory) => {
const Home = React => {
const component = ({ title }) => <h1 className="title">{ title }</h1>;
const mapStateToProps = (state) => {
c... |
Move default position of plot slightly (would cover visualization) | package edu.agh.tunev.ui.plot;
import java.beans.PropertyVetoException;
import javax.swing.JInternalFrame;
import javax.swing.SwingUtilities;
public abstract class AbstractPlot extends JInternalFrame {
private static final long serialVersionUID = 1L;
/**
* Nazwa wykresu w UI.
*/
public static String PLOT_NA... | package edu.agh.tunev.ui.plot;
import java.beans.PropertyVetoException;
import javax.swing.JInternalFrame;
import javax.swing.SwingUtilities;
public abstract class AbstractPlot extends JInternalFrame {
private static final long serialVersionUID = 1L;
/**
* Nazwa wykresu w UI.
*/
public static String PLOT_NA... |
Mark output format as XML | 'use strict';
var jade = require('jade');
var fs = require('fs');
exports.name = 'jade';
exports.outputFormat = 'xml';
exports.compile = function (source, options) {
var fn = jade.compile(source, options);
return {fn: fn, dependencies: fn.dependencies}
};
exports.compileClient = function (source, options) {
r... | 'use strict';
var jade = require('jade');
var fs = require('fs');
exports.name = 'jade';
exports.outputFormat = 'html';
exports.compile = function (source, options) {
var fn = jade.compile(source, options);
return {fn: fn, dependencies: fn.dependencies}
};
exports.compileClient = function (source, options) {
... |
Remove unneeded call to Println | package cryptopals
import (
"encoding/base64"
"fmt"
"math/big"
"testing"
)
func TestDecryptRsaParityOracle(t *testing.T) {
priv := generateRsaPrivateKey(1024)
pub := priv.public()
encoded := "VGhhdCdzIHdoeSBJIGZvdW5kIHlvdSBkb24ndCBwbGF5IGFyb3VuZCB3aXRoIHRoZSBGdW5reSBDb2xkIE1lZGluYQ=="
message, _ := base64.Ra... | package cryptopals
import (
"encoding/base64"
"fmt"
"math/big"
"testing"
)
func TestDecryptRsaParityOracle(t *testing.T) {
priv := generateRsaPrivateKey(1024)
pub := priv.public()
fmt.Printf("n: %v\n\n", pub.n)
encoded := "VGhhdCdzIHdoeSBJIGZvdW5kIHlvdSBkb24ndCBwbGF5IGFyb3VuZCB3aXRoIHRoZSBGdW5reSBDb2xkIE1lZ... |
Change default layout to vertical
Resolves #54 | import { combineReducers } from 'redux'
import { merge } from 'ramda'
import { routerStateReducer } from 'redux-router'
import { SETTINGS_CHANGE, DISPLAY_FILTERS_CHANGE } from '../constants/actionTypes'
import data from './dataReducer'
import ui from './uiReducer'
import search from './searchReducer'
import semester... | import { combineReducers } from 'redux'
import { merge } from 'ramda'
import { routerStateReducer } from 'redux-router'
import { SETTINGS_CHANGE, DISPLAY_FILTERS_CHANGE } from '../constants/actionTypes'
import data from './dataReducer'
import ui from './uiReducer'
import search from './searchReducer'
import semester... |
GF-4248: Adjust main menu wide template.
To be used in Activity one panel up sample, some code should be
modified.
Enyo-DCO-1.1-Signed-off-by: David Um <david.um@lge.com> | enyo.kind({
name: "moon.sample.video.MainMenuWideSample",
kind: "moon.Panel",
classes: "enyo-unselectable moon moon-video-mainmenu",
titleAbove: "01",
title: "Main Menu",
components: [
/** If you want to use this template alone with spotlight, remove this comment out.
{kind: "enyo.Spotli... | enyo.kind({
name: "moon.sample.video.MainMenuWideSample",
kind: "moon.Panel",
classes: "enyo-unselectable moon moon-video-mainmenu",
fit: true,
titleAbove: "01",
title: "Main Menu",
components: [
{kind: "enyo.Spotlight"},
{kind: "FittableColumns", components: [
{
... |
Add data fetching for testing out Redis | import graphql from 'babel-plugin-relay/macro'
import { createFragmentContainer } from 'react-relay'
import Dashboard from 'js/components/Dashboard/DashboardComponent'
export default createFragmentContainer(Dashboard, {
app: graphql`
fragment DashboardContainer_app on App {
campaign {
isLive
... | import graphql from 'babel-plugin-relay/macro'
import { createFragmentContainer } from 'react-relay'
import Dashboard from 'js/components/Dashboard/DashboardComponent'
export default createFragmentContainer(Dashboard, {
app: graphql`
fragment DashboardContainer_app on App {
campaign {
isLive
... |
Allow pngs to be the thumbnail. | // All JSON schemas related to ballot objects
exports.candidates = {
"title": "Ballot Candidates Schema",
"type": "array",
"minItems": 5,
"items": {
"type": "object",
"properties": {
"id": {
"type": "string",
"required":true
},
... | // All JSON schemas related to ballot objects
exports.candidates = {
"title": "Ballot Candidates Schema",
"type": "array",
"minItems": 5,
"items": {
"type": "object",
"properties": {
"id": {
"type": "string",
"required":true
},
... |
Disable logging if NODE_ENV === 'test'. | const fs = require('fs')
const _ = require('lodash')
let isDisabled = false
function buildMessage(obj) {
if(typeof obj === 'string') {
return obj + '\r\n'
} else if(obj instanceof Array) {
let str = ''
_.each(obj, m => str += buildMessage(m))
return str
} else if(obj instanceof Object) {
ret... | const fs = require('fs')
const _ = require('lodash')
let isDisabled = false
function buildMessage(obj) {
if(typeof obj === 'string') {
return obj + '\r\n'
} else if(obj instanceof Array) {
let str = ''
_.each(obj, m => str += buildMessage(m))
return str
} else if(obj instanceof Object) {
ret... |
Fix bug with google account refresh | 'use strict';
angular.module('homepageApp')
.controller('MainCtrl', function ($scope, $http, xmlFilter, Storage, Google, Gmail) {
$scope.calendars = [
{src:'thibault.david@gmail.com', color: '#2952A3'},
{src:'2g5hhq1d0nk373earfrnlb37k8@group.calendar.google.com', color: '#B1365F'},
{src:'david.... | 'use strict';
angular.module('homepageApp')
.controller('MainCtrl', function ($scope, $http, xmlFilter, Storage, Google, Gmail) {
$scope.calendars = [
{src:'thibault.david@gmail.com', color: '#2952A3'},
{src:'2g5hhq1d0nk373earfrnlb37k8@group.calendar.google.com', color: '#B1365F'},
{src:'david.... |
Remove unused functions in Expirer.js | var utils = require('./util'),
util = require("util"),
events = require("events");
function Expirer(collection, options){
var defaults = {
expire_after_ms: 10 * 60 * 1000,
time_attribute: 'touched'
},
self = this,
timer;
options = utils.merge(defaults, options || {});
options.cleanup_interv... | var utils = require('./util'),
util = require("util"),
events = require("events");
function Expirer(collection, options){
var defaults = {
expire_after_ms: 10 * 60 * 1000,
time_attribute: 'touched'
},
me = this,
timer;
options = utils.merge(defaults, options || {});
options.cleanup_interval... |
Fix Firefox where 'onstorage' in window === false. Reversing the check works in all browsers | var support = module.exports = {
// http://peter.michaux.ca/articles/feature-detection-state-of-the-art-browser-scripting
has: function(object, property){
var t = typeof object[property];
return t == 'function' || (!!(t == 'object' && object[property])) || t == 'unknown';
},
on: function(target, name, c... | var support = module.exports = {
// http://peter.michaux.ca/articles/feature-detection-state-of-the-art-browser-scripting
has: function(object, property){
var t = typeof object[property];
return t == 'function' || (!!(t == 'object' && object[property])) || t == 'unknown';
},
on: function(target, name, c... |
Fix case where there are no extension. | import sublime
import os
def getSetting(key,default=None):
s = sublime.load_settings("Fuse.sublime-settings")
return s.get(key, default)
def getFusePathFromSettings():
path = getSetting("fuse_path_override")
if path == "" or path == None:
return "fuse"
else:
return path+"/fuse"
def setSetting(key,value):
s... | import sublime
import os
def getSetting(key,default=None):
s = sublime.load_settings("Fuse.sublime-settings")
return s.get(key, default)
def getFusePathFromSettings():
path = getSetting("fuse_path_override")
if path == "" or path == None:
return "fuse"
else:
return path+"/fuse"
def setSetting(key,value):
s... |
Handle some JEI stuff differently, still broken.. | package codechicken.enderstorage.plugin.jei;
import codechicken.enderstorage.recipe.RecipeBase;
import com.google.common.collect.Sets;
import mezz.jei.api.*;
import mezz.jei.api.gui.ICraftingGridHelper;
import mezz.jei.api.recipe.VanillaRecipeCategoryUid;
import net.minecraft.util.ResourceLocation;
import net.minecraf... | package codechicken.enderstorage.plugin.jei;
import codechicken.enderstorage.recipe.RecipeBase;
import mezz.jei.api.*;
import mezz.jei.api.gui.ICraftingGridHelper;
import mezz.jei.api.recipe.VanillaRecipeCategoryUid;
import net.minecraft.util.ResourceLocation;
import net.minecraftforge.fml.common.registry.ForgeRegistr... |
Delete existing files before downloading them again | package pl.niekoniecznie.p2e;
import pl.niekoniecznie.polar.io.PolarEntry;
import pl.niekoniecznie.polar.io.PolarFileSystem;
import java.io.IOException;
import java.io.InputStream;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.nio.file.attribute.FileTime;
import java.u... | package pl.niekoniecznie.p2e;
import pl.niekoniecznie.polar.io.PolarEntry;
import pl.niekoniecznie.polar.io.PolarFileSystem;
import java.io.IOException;
import java.io.InputStream;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.nio.file.attribute.FileTime;
import java.u... |
Check if not using a mock fixed phpspec with hhvm | <?php
namespace spec\League\Pipeline;
use League\Pipeline\CallableOperation;
use League\Pipeline\OperationInterface;
use League\Pipeline\PipelineBuilder;
use League\Pipeline\PipelineInterface;
use PhpSpec\ObjectBehavior;
use Prophecy\Argument;
class PipelineBuilderSpec extends ObjectBehavior
{
function it_is_ini... | <?php
namespace spec\League\Pipeline;
use League\Pipeline\CallableOperation;
use League\Pipeline\OperationInterface;
use League\Pipeline\PipelineBuilder;
use League\Pipeline\PipelineInterface;
use PhpSpec\ObjectBehavior;
use Prophecy\Argument;
class PipelineBuilderSpec extends ObjectBehavior
{
function it_is_ini... |
Move from floats to Vectors | package main
// Shifts all the values in xs by one and puts x at the beginning.
func Shift(xs []Vector, x Vector) {
for i := len(xs) - 1; i > 0; i-- {
xs[i] = xs[i-1]
}
xs[0] = x
}
type Integrator func(xs, vs []Vector, a Vector, dt float64)
// Performs a step of an Euler integration
func Euler(xs, vs []Vecto... | package main
// Shifts all the values in xs by one and puts x at the beginning.
func Shift(xs []float64, x float64) {
for i := len(xs) - 1; i > 0; i-- {
xs[i] = xs[i-1]
}
xs[0] = x
}
type Integrator func(xs, vs []float64, a, dt float64)
// Performs a step of an Euler integration
func Euler(xs, vs []float64, ... |
Update cli for recently added models | import ujson as json
from sift.build import DatasetBuilder
from sift.models import links, text, embeddings
class BuildDocModel(DatasetBuilder):
""" Build a model over a corpus of text documents """
@classmethod
def providers(cls):
return [
links.EntityCounts,
links.EntityNam... | import ujson as json
from sift.build import DatasetBuilder
from sift.models import links, text, embeddings
class BuildDocModel(DatasetBuilder):
""" Build a model over a corpus of text documents """
@classmethod
def providers(cls):
return [
links.EntityCounts,
links.EntityNam... |
Make the leap to v1 | import setuptools
REQUIREMENTS = [
"nose==1.3.0",
"python-dateutil==1.5",
]
if __name__ == "__main__":
setuptools.setup(
name="jsond",
version="1.0.0",
author="EDITD",
author_email="engineering@editd.com",
packages=setuptools.find_packages(),
scripts=[],
... | import setuptools
REQUIREMENTS = [
"nose==1.3.0",
"python-dateutil==1.5",
]
if __name__ == "__main__":
setuptools.setup(
name="jsond",
version="0.0.1",
author="EDITD",
author_email="engineering@editd.com",
packages=setuptools.find_packages(),
scripts=[],
... |
Update Target rendering to use gCamera.isInView | Target = function(x, y) {
this.x = x;
this.y = y;
this.life = 11;
this.size = 12;
return this;
}
Target.prototype.render = (function(context) {
function render() {
var x = this.x - gCamera.x;
var y = this.y - gCamera.y;
// Only render if within the camera's bounds
if (gCamera... | Target = function(x, y) {
this.x = x;
this.y = y;
this.life = 11;
return this;
}
Target.prototype.render = (function(context) {
function render() {
var x = this.x - gCamera.x;
var y = this.y - gCamera.y;
// Only render if within the camera's bounds
if (x + 12 > 0 && x - 12 < SCREE... |
Add ID and timestamp for notifs from CB | package engine
import (
"encoding/json"
"time"
"code.google.com/p/go-uuid/uuid"
"iotrules/mylog"
)
type NotifyContextRequest struct {
SubscriptionId string
Originator string
ContextResponses []struct{ ContextElement ContextElement }
}
type ContextElement struct {
Id string
IsPattern string... | package engine
import (
"encoding/json"
"iotrules/mylog"
)
type NotifyContextRequest struct {
SubscriptionId string
Originator string
ContextResponses []struct{ ContextElement ContextElement }
}
type ContextElement struct {
Id string
IsPattern string
Type string
Attributes []Attribute
... |
Add signature_request_invalid, template_created, and template_error event enum values. | package com.hellosign.sdk.resource.support.types;
/**
* The MIT License (MIT)
*
* Copyright (C) 2014 hellosign.com
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restrict... | package com.hellosign.sdk.resource.support.types;
/**
* The MIT License (MIT)
*
* Copyright (C) 2014 hellosign.com
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restrict... |
Return database results in root GET (3/16). | var express = require('express');
var cors = require('cors');
var bodyParser = require('body-parser');
var nano = require('nano')('http://localhost:5984');
var todo = nano.db.use('todo');
var app = express();
app.use(cors());
app.use(bodyParser.json());
app.get('/', function(req, res, next) {
console.log('get trig... | var express = require('express');
var cors = require('cors');
var bodyParser = require('body-parser');
var nano = require('nano')('http://localhost:5984');
var todo = nano.db.use('todo');
var app = express();
app.use(cors());
app.use(bodyParser.json());
app.get('/', function(req, res, next) {
console.log('get trig... |
Use current time if no arguments given | #!/bin/python
import argparse
import requests
import timetable
import datetime
import time
if __name__ == '__main__':
parser = argparse.ArgumentParser()
parser.add_argument("-d", "--day", default='', required=False, help="Day to check the timetable on. eg: Thursday")
parser.add_argument("-t", "--time", default='... | #!/bin/python
import argparse
import requests
import timetable
if __name__ == '__main__':
parser = argparse.ArgumentParser()
parser.add_argument("-d", "--day", default='', required=True, help="Day to check the timetable on. eg: Thursday")
parser.add_argument("-t", "--time", default='', required=True, help="The t... |
Add default value in case missing.
Signed-off-by: Mior Muhammad Zaki <e1a543840a942eb68427510a8a483282a7bfeddf@gmail.com> | <?php
namespace Orchestra\Foundation\Jobs;
use Orchestra\Contracts\Authorization\Authorization;
use Orchestra\Model\Role;
class SyncDefaultAuthorization extends Job
{
/**
* Re-sync administrator access control.
*
* @param \Orchestra\Contracts\Authorization\Authorization $acl
*
* @retur... | <?php
namespace Orchestra\Foundation\Jobs;
use Orchestra\Contracts\Authorization\Authorization;
use Orchestra\Model\Role;
class SyncDefaultAuthorization extends Job
{
/**
* Re-sync administrator access control.
*
* @param \Orchestra\Contracts\Authorization\Authorization $acl
*
* @retur... |
Add decimal and integer regex | /*
* regex-pill
* https://github.com/lgoldstien/regex-pill
*
* Copyright (c) 2014 Lawrence Goldstien
* Licensed under the MIT license.
*/
'use strict';
var RegexLibraryContents = {
"hostnames/databases/mongodb": /^(mongodb:\/\/)([a-z0-9]+:[a-z0-9]+@)?([a-zA-Z0-9-_.]+)(:[0-9]+)?(\/[a-z_-]+)?$/g,
"primati... | /*
* regex-pill
* https://github.com/lgoldstien/regex-pill
*
* Copyright (c) 2014 Lawrence Goldstien
* Licensed under the MIT license.
*/
'use strict';
var RegexLibraryContents = {
"hostnames/databases/mongodb": /^(mongodb:\/\/)([a-z0-9]+:[a-z0-9]+@)?([a-zA-Z0-9-_.]+)(:[0-9]+)?(\/[a-z_-]+)?$/g,
};
var Reg... |
Update test code to compare with real type rather than string value. | package net.folab.fo.runtime;
import static org.junit.Assert.*;
import static org.hamcrest.CoreMatchers.*;
import java.lang.reflect.Field;
import net.folab.fo.runtime._fo._lang.Boolean;
import net.folab.fo.runtime._fo._lang.Integer;
import org.junit.Test;
import org.junit.Before;
public class GeneratedCodeTest {
... | package net.folab.fo.runtime;
import static org.junit.Assert.*;
import static org.hamcrest.CoreMatchers.*;
import java.lang.reflect.Field;
import org.junit.Test;
import org.junit.Before;
public class GeneratedCodeTest {
private Class<?> genClass;
@Before
public void setUp() throws ClassNotFoundExcepti... |
Remove this. on gpio ref | const WebSocket = require('ws');
const gpio = require('rpi-gpio')
const wss = new WebSocket.Server({ port: 8080 });
var power = false;
var mute = false;
const pinConfig = {
power: 18,
mute: 17
}
wss.on('connection', function connection(ws) {
gpio.setMode(gpio.MODE_BCM);
ws.on('message', function in... | const WebSocket = require('ws');
const gpio = require('rpi-gpio')
const wss = new WebSocket.Server({ port: 8080 });
var power = false;
var mute = false;
const pinConfig = {
power: 18,
mute: 17
}
wss.on('connection', function connection(ws) {
gpio.setMode(gpio.MODE_BCM);
ws.on('message', function in... |
Add image fields to v2/groupRequests response | import _ from 'lodash'
import { dbAdapter } from '../../../models'
import exceptions from '../../../support/exceptions'
export default class GroupsController {
static async groupRequests(req, res) {
if (!req.user)
return res.status(401).jsonp({ err: 'Unauthorized', status: 'fail'})
try {
let m... | import _ from 'lodash'
import { dbAdapter } from '../../../models'
import exceptions from '../../../support/exceptions'
export default class GroupsController {
static async groupRequests(req, res) {
if (!req.user)
return res.status(401).jsonp({ err: 'Unauthorized', status: 'fail'})
try {
let m... |
Use custom config page hosted on gh-pages.
The config page is hosted on the gh-pages branch of this repo. This allows it to be HTTPS, and much lighter than the predecessor. | var UI = require('ui');
var Vibe = require('ui/vibe');
var ajax = require('ajax');
var host;
Pebble.addEventListener('showConfiguration', function(e) {
// TODO - This only works over HTTP. A much simpler config site can be made and hosted on github pages.
Pebble.openURL('https://qubyte.github.io/pebble-presenter/'... | var UI = require('ui');
var Vibe = require('ui/vibe');
var ajax = require('ajax');
var host;
Pebble.addEventListener('showConfiguration', function(e) {
Pebble.openURL('https://pebble-config.herokuapp.com/config?title=Pebble%20Presenter%20Config&fields=host');
});
Pebble.addEventListener('webviewclosed', function(e)... |
Update constants for Laravel 5.2. | <?php
namespace App\Http\Middleware;
use Illuminate\Http\Request;
use Fideloper\Proxy\TrustProxies as Middleware;
class TrustProxies extends Middleware
{
/**
* The trusted proxies for this application,
* sourced from 'config/trustedproxy.php'.
*
* @var array
*/
protected $proxies;
... | <?php
namespace App\Http\Middleware;
use Illuminate\Http\Request;
use Fideloper\Proxy\TrustProxies as Middleware;
class TrustProxies extends Middleware
{
/**
* The trusted proxies for this application,
* sourced from 'config/trustedproxy.php'.
*
* @var array
*/
protected $proxies;
... |
Remove unnecessary check in distinct operator | package com.annimon.stream.operator;
import com.annimon.stream.iterator.LsaExtIterator;
import java.util.HashSet;
import java.util.Iterator;
import java.util.Set;
public class ObjDistinct<T> extends LsaExtIterator<T> {
private final Iterator<? extends T> iterator;
private final Set<T> set;
public ObjDis... | package com.annimon.stream.operator;
import com.annimon.stream.iterator.LsaExtIterator;
import java.util.HashSet;
import java.util.Iterator;
import java.util.Set;
public class ObjDistinct<T> extends LsaExtIterator<T> {
private final Iterator<? extends T> iterator;
private final Set<T> set;
public ObjDis... |
Fix target_id support in JenkinsGenericBuilder | from .builder import JenkinsBuilder
class JenkinsGenericBuilder(JenkinsBuilder):
def __init__(self, *args, **kwargs):
self.script = kwargs.pop('script')
self.cluster = kwargs.pop('cluster')
super(JenkinsGenericBuilder, self).__init__(*args, **kwargs)
def get_job_parameters(self, job, ... | from .builder import JenkinsBuilder
class JenkinsGenericBuilder(JenkinsBuilder):
def __init__(self, *args, **kwargs):
self.script = kwargs.pop('script')
self.cluster = kwargs.pop('cluster')
super(JenkinsGenericBuilder, self).__init__(*args, **kwargs)
def get_job_parameters(self, job, ... |
Revert "Add the EC2 instance ID to the automatic metadata"
This reverts commit 189f0fa7ed0bd4b656e5eb9e3c8db3ad6605e92b. | package agent
import (
"errors"
"fmt"
"time"
"github.com/AdRoll/goamz/aws"
"github.com/AdRoll/goamz/ec2"
)
type EC2Tags struct {
}
func (e EC2Tags) Get() (map[string]string, error) {
tags := make(map[string]string)
// Passing blank values here instructs the AWS library to look at the
// current instances m... | package agent
import (
"errors"
"fmt"
"time"
"github.com/AdRoll/goamz/aws"
"github.com/AdRoll/goamz/ec2"
)
type EC2Tags struct {
}
func (e EC2Tags) Get() (map[string]string, error) {
tags := make(map[string]string)
// Passing blank values here instructs the AWS library to look at the
// current instances m... |
Fix (Observation test): change method name | <?php
namespace AppBundle\TestsService;
use AppBundle\Service\ObservationService;
use AppBundle\Entity\Observation;
use PHPUnit\Framework\TestCase;
use OC\BookingBundle\Service\Utils;
use Symfony\Bundle\FrameworkBundle\Test\WebTestCase;
use Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorage;
... | <?php
namespace AppBundle\TestsService;
use AppBundle\Service\ObservationService;
use AppBundle\Entity\Observation;
use PHPUnit\Framework\TestCase;
use OC\BookingBundle\Service\Utils;
use Symfony\Bundle\FrameworkBundle\Test\WebTestCase;
use Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorage;
... |
Add test expectations to error test | /*
* grunt-external-daemon
* https://github.com/jlindsey/grunt-external-daemon
*
* Copyright (c) 2013 Joshua Lindsey
* Licensed under the MIT license.
*/
'use strict';
var grunt = require('grunt'),
exec = require('child_process').exec;
exports.missing_cmd = function(test) {
test.expect(1);
exec('grun... | /*
* grunt-external-daemon
* https://github.com/jlindsey/grunt-external-daemon
*
* Copyright (c) 2013 Joshua Lindsey
* Licensed under the MIT license.
*/
'use strict';
var grunt = require('grunt'),
exec = require('child_process').exec;
exports.missing_cmd = function(test) {
exec('grunt external_daemon:s... |
Update service provider to use tags for publish | <?php
namespace Conner\Tagging\Providers;
use Illuminate\Support\ServiceProvider;
use Conner\Tagging\Contracts\TaggingUtility;
use Conner\Tagging\Util;
/**
* Copyright (C) 2014 Robert Conner
*/
class TaggingServiceProvider extends ServiceProvider
{
/**
* Indicates if loading of the provider is def... | <?php
namespace Conner\Tagging\Providers;
use Illuminate\Support\ServiceProvider;
use Conner\Tagging\Contracts\TaggingUtility;
use Conner\Tagging\Util;
/**
* Copyright (C) 2014 Robert Conner
*/
class TaggingServiceProvider extends ServiceProvider {
/**
* Indicates if loading of the provider is de... |
Make sure to allow copy if only edges are selected | package org.cytoscape.editor.internal;
import java.util.List;
import org.cytoscape.model.CyEdge;
import org.cytoscape.model.CyNetwork;
import org.cytoscape.model.CyNetworkManager;
import org.cytoscape.model.CyNode;
import org.cytoscape.model.CyTableUtil;
import org.cytoscape.task.AbstractNetworkViewTaskFactory;
impor... | package org.cytoscape.editor.internal;
import java.util.List;
import org.cytoscape.model.CyNetwork;
import org.cytoscape.model.CyNetworkManager;
import org.cytoscape.model.CyNode;
import org.cytoscape.model.CyTableUtil;
import org.cytoscape.task.AbstractNetworkViewTaskFactory;
import org.cytoscape.view.model.CyNetwor... |
Remove "socialsharing_googleplus" from Social Sharing Bundle
Signed-off-by: Marius Blüm <38edb439dbcce85f0f597d90d338db16e5438073@lineone.io> | <?php
/**
* @copyright Copyright (c) 2017 Lukas Reschke <lukas@statuscode.ch>
*
* @license GNU AGPL version 3 or any later version
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation,... | <?php
/**
* @copyright Copyright (c) 2017 Lukas Reschke <lukas@statuscode.ch>
*
* @license GNU AGPL version 3 or any later version
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation,... |
Test mocking classes with methods returning references | <?php
declare(strict_types=1);
namespace Moka\Tests;
abstract class IncompleteAbstractTestClass implements TestInterface
{
public $public;
protected $protected;
private $private;
public $isTrue;
public static $getInt;
public function isTrue(): bool
{
return true;
}
pu... | <?php
declare(strict_types=1);
namespace Moka\Tests;
abstract class IncompleteAbstractTestClass implements TestInterface
{
public $public;
protected $protected;
private $private;
public $isTrue;
public static $getInt;
public function isTrue(): bool
{
return true;
}
pu... |
Enable method-level security by annotating the configuration class in *this* project. Works (for now), but not an ideal solution. | package ca.corefacility.bioinformatics.irida.web.config;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Import;
import org.springframework.security.authentication.AuthenticationManager;
import org... | package ca.corefacility.bioinformatics.irida.web.config;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Import;
import org.springframework.security.authentication.AuthenticationManager;
import org... |
Update acceptance test task to work with selenium-standalone v3 | var gulp = require('gulp');
var _ = require('lodash');
var Jasmine = require('jasmine');
var selenium = require('selenium-standalone');
// Defines Gulp tasks for running browser acceptance tests.
// Takes an array of configuration objects:
// [
// {
// name: String - Task Name
// deps: Array[String] ... | var gulp = require('gulp');
var _ = require('lodash');
var Jasmine = require('jasmine');
var selenium = require('selenium-standalone');
// Defines Gulp tasks for running browser acceptance tests.
// Takes an array of configuration objects:
// [
// {
// name: String - Task Name
// deps: Array[String] ... |
[Discord] Update CommandTree.on_error to only take two parameters
Remove command parameter, matching discord.py update, and use Interaction.command instead |
from discord import app_commands
import logging
import sys
import traceback
import sentry_sdk
class CommandTree(app_commands.CommandTree):
async def on_error(self, interaction, error):
sentry_sdk.capture_exception(error)
print(
f"Ignoring exception in slash command {interaction.com... |
from discord import app_commands
import logging
import sys
import traceback
import sentry_sdk
class CommandTree(app_commands.CommandTree):
async def on_error(self, interaction, command, error):
sentry_sdk.capture_exception(error)
print(
f"Ignoring exception in slash command {comman... |
Fix green and yellow being opposites | // Package chalk lets you colour you
// terminal string styles
package chalk
// Black colours your string black
func Black(s string) string {
return "\033[30m" + s + "\033[0m"
}
// Red colours your string red
func Red(s string) string {
return "\033[31m" + s + "\033[0m"
}
// Green colours your string green
func Gr... | // Package chalk lets you colour you
// terminal string styles
package chalk
// Black colours your string black
func Black(s string) string {
return "\033[30m" + s + "\033[0m"
}
// Red colours your string red
func Red(s string) string {
return "\033[31m" + s + "\033[0m"
}
// Yellow colours your string yellow
func ... |
Set a correct controller name | /**
* @file Instantiates and configures angular modules for your module.
*/
define(['angular'], function (ng) {
'use strict';
ng.module('{{template_name}}.controllers', []);
ng.module('{{template_name}}.providers', []);
ng.module('{{template_name}}.services', []);
ng.module('{{template_name}}.factories', [... | /**
* @file Instantiates and configures angular modules for your module.
*/
define(['angular'], function (ng) {
'use strict';
ng.module('{{template_name}}.controllers', []);
ng.module('{{template_name}}.providers', []);
ng.module('{{template_name}}.services', []);
ng.module('{{template_name}}.factories', [... |
Adjust default anti-csrf token ttl to 15 minutes | <?php
namespace BNETDocs\Libraries;
use \CarlBennett\MVC\Libraries\Common;
class CSRF {
const TTL = 900; // 15 minutes
private function __construct() {}
public static function generate($id, $ttl = self::TTL) {
$id = (int) $id;
$t = microtime(true);
$s = mt_rand();
$v = hash("sha256", $t *... | <?php
namespace BNETDocs\Libraries;
use \CarlBennett\MVC\Libraries\Common;
class CSRF {
const TTL = 300;
private function __construct() {}
public static function generate($id, $ttl = self::TTL) {
$id = (int) $id;
$t = microtime(true);
$s = mt_rand();
$v = hash("sha256", $t * $s * $id);
... |
Use GitHub link shortener for comment link
This makes the link a bit easier to copy/paste, but more importantly
reduces the line width to a more manageable size. | Package.describe({
summary: "JavaScript.next-to-JavaScript-of-today compiler",
version: "0.0.42"
});
Package._transitional_registerBuildPlugin({
name: "harmony-compiler",
use: [],
sources: [
"plugin/compiler.js"
],
npmDependencies: {"traceur": "0.0.42"}
});
Package.on_use(function(api, where) {
wh... | Package.describe({
summary: "JavaScript.next-to-JavaScript-of-today compiler",
version: "0.0.42"
});
Package._transitional_registerBuildPlugin({
name: "harmony-compiler",
use: [],
sources: [
"plugin/compiler.js"
],
npmDependencies: {"traceur": "0.0.42"}
});
Package.on_use(function(api, where) {
wh... |
Raise Temperature of space stations so snow stops forming everywhere | package zmaster587.advancedRocketry.world.biome;
import java.util.LinkedList;
import java.util.List;
import net.minecraft.entity.EnumCreatureType;
import net.minecraft.init.Blocks;
import net.minecraft.world.biome.BiomeGenBase;
public class BiomeGenSpace extends BiomeGenBase {
public BiomeGenSpace(int biomeId, bool... | package zmaster587.advancedRocketry.world.biome;
import java.util.LinkedList;
import java.util.List;
import net.minecraft.entity.EnumCreatureType;
import net.minecraft.init.Blocks;
import net.minecraft.world.biome.BiomeGenBase;
public class BiomeGenSpace extends BiomeGenBase {
public BiomeGenSpace(int biomeId, bool... |
Rename function and update description | /**
* @license Apache-2.0
*
* Copyright (c) 2019 The Stdlib Authors.
*
* 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 a... | /**
* @license Apache-2.0
*
* Copyright (c) 2019 The Stdlib Authors.
*
* 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 a... |
Remove token for absent panel in duplication frontend
This should have been omitted from #2704 | import mirrorCreator from 'mirror-creator';
export const duplicationModes = mirrorCreator([
'OBJECT',
'COURSE',
]);
// These are mirrored in app/helpers/course/object_duplications_helper.rb
export const duplicableItemTypes = mirrorCreator([
'ASSESSMENT',
'TAB',
'CATEGORY',
'SURVEY',
'ACHIEVEMENT',
'FO... | import mirrorCreator from 'mirror-creator';
export const duplicationModes = mirrorCreator([
'OBJECT',
'COURSE',
]);
// These are mirrored in app/helpers/course/object_duplications_helper.rb
export const duplicableItemTypes = mirrorCreator([
'ASSESSMENT',
'TAB',
'CATEGORY',
'SURVEY',
'ACHIEVEMENT',
'FO... |
Fix appRoot for catchall resource. | package com.hubspot.singularity.resources;
import javax.inject.Singleton;
import javax.ws.rs.GET;
import javax.ws.rs.Path;
import javax.ws.rs.Produces;
import javax.ws.rs.core.MediaType;
import com.google.inject.Inject;
import com.google.inject.name.Named;
import com.hubspot.singularity.config.SingularityConfiguratio... | package com.hubspot.singularity.resources;
import javax.inject.Singleton;
import javax.ws.rs.GET;
import javax.ws.rs.Path;
import javax.ws.rs.Produces;
import javax.ws.rs.core.MediaType;
import com.google.inject.Inject;
import com.google.inject.name.Named;
import com.hubspot.singularity.config.SingularityConfiguratio... |
Address review comment: Just pass through fields we aren't changing. | # Copyright Hybrid Logic Ltd. See LICENSE file for details.
"""
This module defines the Eliot log events emitted by the API implementation.
"""
__all__ = [
"JSON_REQUEST",
"REQUEST",
]
from eliot import Field, ActionType
LOG_SYSTEM = u"api"
METHOD = Field(u"method", lambda method: method,
... | # Copyright Hybrid Logic Ltd. See LICENSE file for details.
"""
This module defines the Eliot log events emitted by the API implementation.
"""
__all__ = [
"JSON_REQUEST",
"REQUEST",
]
from eliot import Field, ActionType
LOG_SYSTEM = u"api"
METHOD = Field.forTypes(
u"method", [unicode, bytes], u"T... |
Convert to one step util | 'use strict';
var ensureDate = require('es5-ext/date/valid-date')
, ensureString = require('es5-ext/object/validate-stringifiable-value')
, db = require('../db');
// Convert any date to db.Date in specified time zone.
module.exports = function (date, timeZone) {
ensureDate(date);
timeZone = ensureSt... | 'use strict';
var ensureDate = require('es5-ext/date/valid-date')
, ensureString = require('es5-ext/object/validate-stringifiable-value')
, memoize = require('memoizee/plain')
, validDb = require('dbjs/valid-dbjs');
// Convert any date to db.Date in specified time zone.
module.exports = memoize(func... |
Fix missed raw type ArrayList | package me.nallar.javapatcher.mappings;
import java.util.*;
/**
* Maps method/field/class names in patches to allow obfuscated code to be patched.
*/
public abstract class Mappings {
/**
* Takes a list of Class/Method/FieldDescriptions and maps them all using the appropriate map(*Description)
*
* @param list... | package me.nallar.javapatcher.mappings;
import java.util.*;
/**
* Maps method/field/class names in patches to allow obfuscated code to be patched.
*/
public abstract class Mappings {
/**
* Takes a list of Class/Method/FieldDescriptions and maps them all using the appropriate map(*Description)
*
* @param list... |
Add location field in relation between course and period | <?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateCoursePeriodTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('course_per... | <?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateCoursePeriodTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('course_per... |
Use hash_type param for pem_finger | # -*- coding: utf-8 -*-
'''
Functions to view the minion's public key information
'''
from __future__ import absolute_import
# Import python libs
import os
# Import Salt libs
import salt.utils
def finger():
'''
Return the minion's public key fingerprint
CLI Example:
.. code-block:: bash
s... | # -*- coding: utf-8 -*-
'''
Functions to view the minion's public key information
'''
from __future__ import absolute_import
# Import python libs
import os
# Import Salt libs
import salt.utils
def finger():
'''
Return the minion's public key fingerprint
CLI Example:
.. code-block:: bash
s... |
Optimize the common case to reduce startup time. | import sys
from process import Process
from exit import err_exit
class Python(object):
"""A Python interpreter path that can test itself."""
def __init__(self, defaults, process=None):
self.process = process or Process()
self.python = defaults.python
def __str__(self):
return se... | from process import Process
from exit import err_exit
class Python(object):
"""A Python interpreter path that can test itself."""
def __init__(self, defaults, process=None):
self.process = process or Process()
self.python = defaults.python
def __str__(self):
return self.python
... |
Fix the ggj route setup | const routeRegex = /^\/(global-game-jam-2021|globalgamejam2021|ggj2021|ggj21)(?:\/.*)?$/;
const githubUrl = 'https://levilindsey.github.io/global-game-jam-2021';
// Attaches the route handlers for this app.
exports.attachRoutes = (server, appPath, config) => {
server.get(routeRegex, handleRequest);
// --- --- /... | const routeRegex = /^\/(global-game-jam-2021|globalgamejam2021|ggj2021|ggj21)(?:\/.*)?$/;
const githubUrl = 'https://levilindsey.github.io/global-game-jam-2021';
// Attaches the route handlers for this app.
exports.attachRoutes = (server, appPath, config) => {
server.get(routeRegex, handleRequest);
// --- --- /... |
Replace Chrome with Firefox for travis | var webpackConf = require('./webpack.config.js');
module.exports = function(config) {
config.set({
files: [
// Each file acts as entry point for the webpack configuration
'./node_modules/phantomjs-polyfill/bind-polyfill.js',
'test/client/**/*.js'
],
frameworks: ['mocha', 'sinon-chai'],
... | var webpackConf = require('./webpack.config.js');
module.exports = function(config) {
config.set({
files: [
// Each file acts as entry point for the webpack configuration
'./node_modules/phantomjs-polyfill/bind-polyfill.js',
'test/client/**/*.js'
],
frameworks: ['mocha', 'sinon-chai'],
... |
Revert "fix: so that sync will not always be false" | const isString = val => typeof val === 'string';
const isBlob = val => val instanceof Blob;
polyfill.call(typeof window === 'object' ? window : this);
function polyfill() {
if (isSupported.call(this)) return;
if (!('navigator' in this)) this.navigator = {};
this.navigator.sendBeacon = sendBeacon.bind(this);
};... | const isString = val => typeof val === 'string';
const isBlob = val => val instanceof Blob;
polyfill.call(typeof window === 'object' ? window : this);
function polyfill() {
if (isSupported.call(this)) return;
if (!('navigator' in this)) this.navigator = {};
this.navigator.sendBeacon = sendBeacon.bind(this);
};... |
Test that deprecation exceptions are working differently, after
suggestion by @embray | # Licensed under a 3-clause BSD style license - see LICENSE.rst
from __future__ import (absolute_import, division, print_function,
unicode_literals)
# test helper.run_tests function
import warnings
from .. import helper
from ... import _get_test_runner
from .. helper import pytest
# run_test... | # Licensed under a 3-clause BSD style license - see LICENSE.rst
from __future__ import (absolute_import, division, print_function,
unicode_literals)
# test helper.run_tests function
import sys
from .. import helper
from ... import _get_test_runner
from .. helper import pytest
# run_tests sho... |
Fix tests in python 2.6 | from datetime import datetime, date, timedelta
import unittest
from businesstime.holidays.aus import QueenslandPublicHolidays, BrisbanePublicHolidays
class QueenslandPublicHolidaysTest(unittest.TestCase):
def test_2016_08(self):
holidays_gen = QueenslandPublicHolidays()
self.assertEqual(
... | from datetime import datetime, date, timedelta
import unittest
from businesstime.holidays.aus import QueenslandPublicHolidays, BrisbanePublicHolidays
class QueenslandPublicHolidaysTest(unittest.TestCase):
def test_2016_08(self):
holidays_gen = QueenslandPublicHolidays()
self.assertEqual(
... |
Set debug to true for template debugging | from .base import *
# Disable debug mode
DEBUG = True
TEMPLATE_DEBUG = True
# Compress static files offline
# http://django-compressor.readthedocs.org/en/latest/settings/#django.conf.settings.COMPRESS_OFFLINE
COMPRESS_OFFLINE = True
# Send notification emails as a background task using Celery,
# to prevent this... | from .base import *
# Disable debug mode
DEBUG = False
TEMPLATE_DEBUG = False
# Compress static files offline
# http://django-compressor.readthedocs.org/en/latest/settings/#django.conf.settings.COMPRESS_OFFLINE
COMPRESS_OFFLINE = True
# Send notification emails as a background task using Celery,
# to prevent th... |
Add properCase. Use 'for-of' statement in path. | /** Wrap DOM selector methods:
* document.querySelector,
* document.getElementById,
* document.getElementsByClassName]
*/
const dom = {
query(arg) {
return document.querySelector(arg);
},
id(arg) {
return document.getElementById(arg);
},
class(arg) {
return document.getElementsByClassName(arg)... | /** Wrap DOM selector methods:
* document.querySelector,
* document.getElementById,
* document.getElementsByClassName]
*/
const dom = {
query(arg) {
return document.querySelector(arg);
},
id(arg) {
return document.getElementById(arg);
},
class(arg) {
return document.getElementsByClassName(arg)... |
Fix the VFG path test. | import angr
import logging
import os
l = logging.getLogger("angr_tests")
test_location = str(os.path.join(os.path.dirname(os.path.realpath(__file__)),
'../../binaries/tests'))
def test_vfg_paths():
p = angr.Project(os.path.join(test_location, "x86_64/track_user_input"))
main_a... | import angr
import logging
import os
l = logging.getLogger("angr_tests")
test_location = str(os.path.join(os.path.dirname(os.path.realpath(__file__)),
'../../binaries/tests'))
def test_vfg_paths():
p = angr.Project(os.path.join(test_location, "x86_64/track_user_input"))
main_a... |
Fix GCI Task URL Pattern. | #!/usr/bin/env python2.5
#
# Copyright 2011 the Melange authors.
#
# 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 applic... | #!/usr/bin/env python2.5
#
# Copyright 2011 the Melange authors.
#
# 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 applic... |
Use more specific session cookie name | """
Config parameters for the Flask app itself.
Nothing here is user-configurable; all config variables you can set yourself are in config.py.
Generally speaking, don't touch this file unless you know what you're doing.
"""
import config
import constants
# Flask-SQLAlchemy
SQLALCHEMY_DATABASE_URI = 'mysql://{databas... | """
Config parameters for the Flask app itself.
Nothing here is user-configurable; all config variables you can set yourself are in config.py.
Generally speaking, don't touch this file unless you know what you're doing.
"""
import config
import constants
# Flask-SQLAlchemy
SQLALCHEMY_DATABASE_URI = 'mysql://{databas... |
Change highest color to orange | /*eslint-env browser*/
/*eslint no-use-before-define:0 */
/*global $*/
(function(){
"use strict";
$(document).ready(function(){
setInterval(updatePage, 100);
});
function updatePage(){
$.getJSON("./state.json", updateImage);
}
function updateLights(data){
$.each(data, function(index, value){... | /*eslint-env browser*/
/*eslint no-use-before-define:0 */
/*global $*/
(function(){
"use strict";
$(document).ready(function(){
setInterval(updatePage, 100);
});
function updatePage(){
$.getJSON("./state.json", updateImage);
}
function updateLights(data){
$.each(data, function(index, value){... |
fix(Spellchecker): Fix disabling spellchecker after app start | import { autorun, observable } from 'mobx';
import { DEFAULT_FEATURES_CONFIG } from '../../config';
const debug = require('debug')('Franz:feature:spellchecker');
export const config = observable({
isIncludedInCurrentPlan: DEFAULT_FEATURES_CONFIG.isSpellcheckerIncludedInCurrentPlan,
});
export default function ini... | import { autorun, observable } from 'mobx';
import { DEFAULT_FEATURES_CONFIG } from '../../config';
const debug = require('debug')('Franz:feature:spellchecker');
export const config = observable({
isIncludedInCurrentPlan: DEFAULT_FEATURES_CONFIG.isSpellcheckerIncludedInCurrentPlan,
});
export default function ini... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.