text stringlengths 16 4.96k | positive stringlengths 321 2.24k | negative stringlengths 310 2.21k |
|---|---|---|
Update support for Meteor 1.2 | // package metadata file for Meteor.js
/* jshint strict:false */
/* global Package:true */
Package.describe({
name: 'twbs:bootstrap', // http://atmospherejs.com/twbs/bootstrap
summary: 'The most popular front-end framework for developing responsive, mobile first projects on the web.',
version: '3.3.5',
git: ... | // package metadata file for Meteor.js
/* jshint strict:false */
/* global Package:true */
Package.describe({
name: 'twbs:bootstrap', // http://atmospherejs.com/twbs/bootstrap
summary: 'The most popular front-end framework for developing responsive, mobile first projects on the web.',
version: '3.3.5',
git: ... |
Fix some code idiocies that lambdagrrl found. | module.exports = function(RED) {
"use strict";
function Fifo(config) {
RED.nodes.createNode(this,config);
this.queue = [];
this.depth = config.depth;
this.status({fill:"red",shape:"ring",text:"no value"});
this.on('input', function (msg) {
// are we full?
// if so, boot some out
if (this... | module.exports = function(RED) {
"use strict";
function Fifo(config) {
RED.nodes.createNode(this,config);
var me = this;
this.queue = [];
this.depth = config.depth;
this.status({fill:"red",shape:"ring",text:"no value"});
this.on('input', function (msg) {
// are we full?
// if so, boot so... |
Set cross origin tag for html5 embeds | /* global videojs */
import React from 'react'
import { webcastPropType } from '../../utils/webcastUtils'
export default class EmbedHtml5 extends React.Component {
static propTypes = {
webcast: webcastPropType.isRequired,
}
componentDidMount() {
videojs(this.props.webcast.id, {
width: '100%',
... | /* global videojs */
import React from 'react'
import { webcastPropType } from '../../utils/webcastUtils'
export default class EmbedHtml5 extends React.Component {
static propTypes = {
webcast: webcastPropType.isRequired,
}
componentDidMount() {
videojs(this.props.webcast.id, {
width: '100%',
... |
Fix search index regeneration initializing Sonic client incorrectly | <?php
/**
* This file is covered by the AGPLv3 license, which can be found at the LICENSE file in the root of this project.
* @copyright 2020 subtitulamos.tv
*/
namespace App\Commands;
use App\Services\Sonic;
use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Input\InputInterface;
use Sy... | <?php
/**
* This file is covered by the AGPLv3 license, which can be found at the LICENSE file in the root of this project.
* @copyright 2020 subtitulamos.tv
*/
namespace App\Commands;
use App\Services\Sonic;
use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Input\InputInterface;
use Sy... |
Remove title attribute from Bootstrap Select buttons. | ManageIQ.angular.app.directive('selectpickerForSelectTag', function() {
return {
require: 'ngModel',
link: function (scope, elem, attr, ctrl) {
scope['form_' + ctrl.$name] = elem[0];
scope.$watch(attr.ngModel, function() {
if((ctrl.$modelValue != undefined)) {
$(scope['form_' + ... | ManageIQ.angular.app.directive('selectpickerForSelectTag', function() {
return {
require: 'ngModel',
link: function (scope, elem, attr, ctrl) {
scope['form_' + ctrl.$name] = elem[0];
scope.$watch(attr.ngModel, function() {
if((ctrl.$modelValue != undefined)) {
$(scope['form_' + ... |
Add object-assign plugin to karma | var webpack = require('webpack');
module.exports = function (config) {
config.set({
browserNoActivityTimeout: 30000,
browsers: [ process.env.CONTINUOUS_INTEGRATION ? 'Firefox' : 'Chrome' ],
singleRun: process.env.CONTINUOUS_INTEGRATION === 'true',
frameworks: [ 'mocha' ],
files: [
'tes... | var webpack = require('webpack');
module.exports = function (config) {
config.set({
browserNoActivityTimeout: 30000,
browsers: [ process.env.CONTINUOUS_INTEGRATION ? 'Firefox' : 'Chrome' ],
singleRun: process.env.CONTINUOUS_INTEGRATION === 'true',
frameworks: [ 'mocha' ],
files: [
'tes... |
Increase initial scrollback to 40 messages. | Hummingbird.ChatRoute = Ember.Route.extend({
pingInterval: null,
model: function() {
return [];
},
afterModel: function() {
Hummingbird.TitleManager.setTitle("Chat");
},
ping: function() {
var self = this;
return ic.ajax({
url: "/chat/ping",
type: 'POST'
}).then(function(p... | Hummingbird.ChatRoute = Ember.Route.extend({
pingInterval: null,
model: function() {
return [];
},
afterModel: function() {
Hummingbird.TitleManager.setTitle("Chat");
},
ping: function() {
var self = this;
return ic.ajax({
url: "/chat/ping",
type: 'POST'
}).then(function(p... |
Tweak email address pattern and define the string as a constant. |
/*
* Copyright (C) 2011 Archie L. Cobbs. All rights reserved.
*
* $Id$
*/
package org.dellroad.stuff.validation;
import java.lang.annotation.Documented;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;... |
/*
* Copyright (C) 2011 Archie L. Cobbs. All rights reserved.
*
* $Id$
*/
package org.dellroad.stuff.validation;
import java.lang.annotation.Documented;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;... |
Correct the expected number of tests | const test = require('tape')
const BorrowState = require('borrow-state')
const sleep50ms = (something) => new Promise(function (resolve, reject) {
setTimeout(function () {
resolve(something)
}, 50)
})
;[true, false].forEach((unsafe) => {
test(`read-only-parallel (${unsafe ? 'un' : ''}safe)`, (t) => {
t.... | const test = require('tape')
const BorrowState = require('borrow-state')
const sleep50ms = (something) => new Promise(function (resolve, reject) {
setTimeout(function () {
resolve(something)
}, 50)
})
;[true, false].forEach((unsafe) => {
test(`read-only-parallel (${unsafe ? 'un' : ''}safe)`, (t) => {
t.... |
Use pandoc to convert the markdown readme to rst. | from distutils.core import setup
from sh import pandoc
setup(
name='cardscript',
version='0.6',
description="A scriptable card game processing engine.",
author="Charles Nelson",
author_email="cnelsonsic@gmail.com",
url="https://github.com/cnelsonsic/cardscript",
packages=['cardscript', 'car... | from distutils.core import setup
setup(
name='cardscript',
version='0.6',
description="A scriptable card game processing engine.",
author="Charles Nelson",
author_email="cnelsonsic@gmail.com",
url="https://github.com/cnelsonsic/cardscript",
packages=['cardscript', 'cardscript.cards'],
l... |
Check for empty string insertion as well
- Fixes #21 | /*
* Copyright (c) 2014 Snowplow Analytics Ltd. All rights reserved.
*
* This program is licensed to you under the Apache License Version 2.0,
* and you may not use this file except in compliance with the Apache License Version 2.0.
* You may obtain a copy of the Apache License Version 2.0 at http://www.apache.org... | /*
* Copyright (c) 2014 Snowplow Analytics Ltd. All rights reserved.
*
* This program is licensed to you under the Apache License Version 2.0,
* and you may not use this file except in compliance with the Apache License Version 2.0.
* You may obtain a copy of the Apache License Version 2.0 at http://www.apache.org... |
Change Scatter Plot to Scatterplot in default title | Settings = {
chart: {
padding: { right: 40, bottom: 100 },
margins: { top: 30, bottom: 0, right: 35 },
dots: {
size: 5,
color: '#378E00',
opacity: 0.7
}
},
defaultData: {
title: 'Scatterplot',
byYear: false,
chosenYear: '',
x: {
indicator: 'ipr', // Percenta... | Settings = {
chart: {
padding: { right: 40, bottom: 100 },
margins: { top: 30, bottom: 0, right: 35 },
dots: {
size: 5,
color: '#378E00',
opacity: 0.7
}
},
defaultData: {
title: 'Scatter Plot',
byYear: false,
chosenYear: '',
x: {
indicator: 'ipr', // Percent... |
Update webpack copy plugin configuration | const path = require('path');
const webpack = require('webpack');
const { CleanWebpackPlugin } = require('clean-webpack-plugin');
const HtmlWebpackPlugin = require('html-webpack-plugin');
const CopyWebpackPlugin = require('copy-webpack-plugin');
module.exports = {
entry: {
app: './src/app/app.js'
},
... | const path = require('path');
const webpack = require('webpack');
const { CleanWebpackPlugin } = require('clean-webpack-plugin');
const HtmlWebpackPlugin = require('html-webpack-plugin');
const CopyWebpackPlugin = require('copy-webpack-plugin');
module.exports = {
entry: {
app: './src/app/app.js'
},
... |
Remove attributes instead of setting a false value like []. | from eduid_am.exceptions import UserDoesNotExist
WHITELIST_SET_ATTRS = (
'givenName',
'sn',
'displayName',
'photo',
'preferredLanguage',
'mail',
'date', # last modification
# TODO: Arrays must use put or pop, not set, but need more deep refacts
'norEduPersonNIN',
'eduPersonEn... | from eduid_am.exceptions import UserDoesNotExist
WHITELIST_SET_ATTRS = (
'givenName',
'sn',
'displayName',
'photo',
'preferredLanguage',
'mail',
'date', # last modification
# TODO: Arrays must use put or pop, not set, but need more deep refacts
'norEduPersonNIN',
'eduPersonEn... |
Add test to get device with non-existant key | from pml.exceptions import PvException
import pml.device
import pytest
import mock
@pytest.fixture
def create_device(readback, setpoint):
_rb = readback
_sp = setpoint
device = pml.device.Device(rb_pv=_rb, sp_pv=_sp, cs=mock.MagicMock())
return device
def test_set_device_value():
rb_pv = 'SR01A-... | from pml.exceptions import PvException
import pml.device
import pytest
import mock
@pytest.fixture
def create_device(readback, setpoint):
_rb = readback
_sp = setpoint
device = pml.device.Device(rb_pv=_rb, sp_pv=_sp, cs=mock.MagicMock())
return device
def test_set_device_value():
rb_pv = 'SR01A-... |
Add export to use as module | // https://www.codewars.com/kata/death-by-coffee/javascript
const coffeeLimits = function(y,m,d) {
let healthNumber = y * 10000 + m * 100 + d;
let currentHex;
let current;
let i;
let result = [0,0];
for(i=1;i<=5000;i++){
current = healthNumber + i * 0xcafe;
currentHex = current.toSt... | // https://www.codewars.com/kata/death-by-coffee/javascript
const coffeeLimits = function(y,m,d) {
let healthNumber = y * 10000 + m * 100 + d;
let currentHex;
let current;
let i;
let result = [0,0];
for(i=1;i<=5000;i++){
current = healthNumber + i * 0xcafe;
currentHex = current.toSt... |
Fix rhybcpStatuses in the get response | package com.servinglynk.hmis.warehouse.core.model;
import java.util.ArrayList;
import java.util.List;
import com.servinglynk.hmis.warehouse.PaginatedModel;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonRootName;
@JsonRootName("rhybcpStatuses")
public class Rhybcpst... | package com.servinglynk.hmis.warehouse.core.model;
import java.util.ArrayList;
import java.util.List;
import com.servinglynk.hmis.warehouse.PaginatedModel;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonRootName;
@JsonRootName("rhybcpStatuses")
public class Rhybcpst... |
Fix setting of StepPhase in the Retry action
Change-Id: I92b5f1d6892dab5659eccdc15ab46aaa60986da7 | package com.sap.cloud.lm.sl.cf.process.actions;
import javax.inject.Inject;
import org.springframework.stereotype.Component;
import com.sap.cloud.lm.sl.cf.core.flowable.AdditionalProcessAction;
import com.sap.cloud.lm.sl.cf.core.flowable.FlowableFacade;
import com.sap.cloud.lm.sl.cf.core.flowable.RetryProcessAction;... | package com.sap.cloud.lm.sl.cf.process.actions;
import javax.inject.Inject;
import org.springframework.stereotype.Component;
import com.sap.cloud.lm.sl.cf.core.flowable.AdditionalProcessAction;
import com.sap.cloud.lm.sl.cf.core.flowable.FlowableFacade;
import com.sap.cloud.lm.sl.cf.core.flowable.RetryProcessAction;... |
Call sum endpoint with inqueue§ | import { takeLatest } from 'redux-saga'
import { call, put, fork } from 'redux-saga/effects'
import * as actions from './actions'
import 'isomorphic-fetch'
export default function* root(){
yield fork(sagas)
}
export function* sagas() {
console.log('setup saga')
yield [
takeLatest(actions.FETCH_TOTAL_AMOUNT,... | import { takeLatest } from 'redux-saga'
import { call, put, fork } from 'redux-saga/effects'
import * as actions from './actions'
import 'isomorphic-fetch'
export default function* root(){
yield fork(sagas)
}
export function* sagas() {
console.log('setup saga')
yield [
takeLatest(actions.FETCH_TOTAL_AMOUNT,... |
Correct AEP resource for person signup helper
Signed-off-by: shaisachs <47bd79f9420edf5d0991d1e2710179d4e040d480@ngpvan.com> |
var contentType = require('../middleware/contentType'),
config = require('../config');
function apiRoot(req, res) {
var root = config.get('apiEndpoint');
var answer = {
motd: 'Welcome to the NGP VAN OSDI Service!',
max_pagesize: 200,
vendor_name: 'NGP VAN, Inc.',
product_name: 'VAN',
osdi_... |
var contentType = require('../middleware/contentType'),
config = require('../config');
function apiRoot(req, res) {
var root = config.get('apiEndpoint');
var answer = {
motd: 'Welcome to the NGP VAN OSDI Service!',
max_pagesize: 200,
vendor_name: 'NGP VAN, Inc.',
product_name: 'VAN',
osdi_... |
Update regex used to check for codegenNativeComponent
Summary: Updates regex to allow for type casts
Reviewed By: TheSavior
Differential Revision: D16717249
fbshipit-source-id: f22561d5cd33ab129fc0af4490692344726d7d71 | /**
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @flow
* @format
*/
'use strict';
import type {SchemaType} from '../../CodegenSchema.js';
const FlowParser = require('../../pa... | /**
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @flow
* @format
*/
'use strict';
import type {SchemaType} from '../../CodegenSchema.js';
const FlowParser = require('../../pa... |
Fix for assertIs method not being present in Python 2.6. | from datetime import datetime
import sys
import unittest
import btceapi
class TestScraping(unittest.TestCase):
def test_scrape_main_page(self):
mainPage = btceapi.scrapeMainPage()
for message in mainPage.messages:
msgId, user, time, text = message
assert type(time) is date... | from datetime import datetime
import sys
import unittest
import btceapi
class TestScraping(unittest.TestCase):
def test_scrape_main_page(self):
mainPage = btceapi.scrapeMainPage()
for message in mainPage.messages:
msgId, user, time, text = message
self.assertIs(type(time),... |
Add some chronopost codes to recognize | <?php
namespace LWI\DeliveryTracking\Behavior;
use LWI\DeliveryTracking\DeliveryStatus;
trait ChronopostCodesTransformer
{
/**
* @param string $code
*
* @return null | DeliveryStatus
*/
protected function getStateFromCode($code)
{
switch ($code) {
case 'D':
... | <?php
namespace LWI\DeliveryTracking\Behavior;
use LWI\DeliveryTracking\DeliveryStatus;
trait ChronopostCodesTransformer
{
/**
* @param string $code
*
* @return null | DeliveryStatus
*/
protected function getStateFromCode($code)
{
switch ($code) {
case 'D':
... |
Add Method to Context interface | package chuper
import (
"net/url"
"github.com/PuerkitoBio/fetchbot"
"github.com/Sirupsen/logrus"
)
type Context interface {
Cache() Cache
Queue() Enqueuer
Log(fields map[string]interface{}) *logrus.Entry
URL() *url.URL
Method() string
SourceURL() *url.URL
}
type Ctx struct {
*fetchbot.Context
C Cache
L ... | package chuper
import (
"net/url"
"github.com/PuerkitoBio/fetchbot"
"github.com/Sirupsen/logrus"
)
type Context interface {
Cache() Cache
Queue() Enqueuer
Log(fields map[string]interface{}) *logrus.Entry
URL() *url.URL
SourceURL() *url.URL
}
type Ctx struct {
*fetchbot.Context
C Cache
L *logrus.Logger
}
... |
Fix some var names and ES6 syntax | import 'babel-polyfill';
const window = (typeof window !== 'undefined') ? window : {};
// Default config values.
const defaultConfig = {
loggingFunction: () => true,
loadInWorker: true, // FIXME cambia il nome
};
// Config used by the module.
const config = {};
// ***** Private functions *****
const formatE... | import 'babel-polyfill';
// Default config values.
const defaultConfig = {
loggingFunction: () => true,
};
// Config used by the module.
const config = {};
// Private function.
const formatError = (error = {}) => {
return error;
};
const formatAndLogError = (error) => {
};
// Public function.
const funcEx... |
Change onMessage signature to match MessageHandler | // Program gcm-logger logs and echoes as a GCM "server".
package main
import (
"github.com/alecthomas/kingpin"
"github.com/aliafshar/toylog"
"github.com/google/go-gcm"
)
var (
serverKey = kingpin.Flag("server_key", "The server key to use for GCM.").Short('k').Required().String()
senderId = kingpin.Flag("sender_... | // Program gcm-logger logs and echoes as a GCM "server".
package main
import (
"github.com/alecthomas/kingpin"
"github.com/aliafshar/toylog"
"github.com/google/go-gcm"
)
var (
serverKey = kingpin.Flag("server_key", "The server key to use for GCM.").Short('k').Required().String()
senderId = kingpin.Flag("sender_... |
Include deleted count into report
* updated tests | package com.nhl.link.move;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNull;
import java.util.Collections;
import java.util.Map;
import org.junit.Test;
import com.nhl.link.move.Execution;
public class ExecutionTest {
@Test
public void testCreateReport() {
Execution execu... | package com.nhl.link.move;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNull;
import java.util.Collections;
import java.util.Map;
import org.junit.Test;
import com.nhl.link.move.Execution;
public class ExecutionTest {
@Test
public void testCreateReport() {
Execution execu... |
Add find and delete functions to ang review model | (function(){
'use strict';
angular
.module('secondLead')
.factory('ReviewModel',['$http', 'Restangular', 'store', function($http, Restangular, store) {
var currentUser = store.get('user');
function extract(result) {
return result.data;
};
return {
getAll: function(dramaID){
... | (function(){
'use strict';
angular
.module('secondLead')
.factory('ReviewModel',['Restangular', 'store', function(Restangular, store) {
var currentUser = store.get('user');
return {
getAll: function(dramaID){
return Restangular.one('dramas', dramaID).getList('reviews').$object
... |
Replace direct reference to user in the recipe list api | var express = require('express');
var router = express.Router();
var JsonDB = require('node-json-db');
var _ = require('lodash');
// Recipes listing
router.get('/', function (req, res, next) {
var db = new JsonDB('db', false, false);
var recipes = db.getData('/recipes');
// Expand requested resources if they ex... | var express = require('express');
var router = express.Router();
var JsonDB = require('node-json-db');
var _ = require('lodash');
// Recipes listing
router.get('/', function (req, res, next) {
var db = new JsonDB('db', false, false);
var recipes = db.getData('/recipes');
// Expand requested resources if they ex... |
Fix unit test to temporarily pass Travis | import documentFormatter from 'src/logic/documentPackager/documentFormatter';
describe('DocumentFormatter', () => {
describe('format', () => {
it('should returns the same data for \'html viewMode\'', () => {
const viewMode = 'html';
const inputData = '<div>This is a HTML content</div>';
const o... | import documentFormatter from 'src/logic/documentPackager/documentFormatter';
import base64OfSimplePdf from './reference/base64OfSimplePdf';
describe('DocumentFormatter', () => {
describe('format', () => {
it('should returns the same data for \'html viewMode\'', () => {
const viewMode = 'html';
const... |
Remove no-op event handlers in playground. | /*global Playground*/
(function() {
"use strict";
Playground.VideoService = Conductor.Oasis.Service.extend({
initialize: function (port) {
this.sandbox.videoPort = port;
}
});
Playground.SurveyService = Conductor.Oasis.Service.extend({
initialize: function (port) {
this.sandbox.survey... | /*global Playground*/
(function() {
"use strict";
Playground.VideoService = Conductor.Oasis.Service.extend({
initialize: function (port) {
this.sandbox.videoPort = port;
},
events: {
videoWatched: function () {
}
}
});
Playground.SurveyService = Conductor.Oasis.Service.exte... |
Raise invalid page on paging error | from django.core.paginator import Paginator, InvalidPage
class ElasticsearchPaginator(Paginator):
"""
Paginator that prevents two queries to ES (for count and objects)
as ES gives count with objects
"""
MAX_ES_OFFSET = 10000
def page(self, number):
"""
Returns a Page object fo... | from django.core.paginator import Paginator
class ElasticsearchPaginator(Paginator):
"""
Paginator that prevents two queries to ES (for count and objects)
as ES gives count with objects
"""
MAX_ES_OFFSET = 10000
def page(self, number):
"""
Returns a Page object for the given 1... |
examples/fortune: Use the roaming and not the generic runtime factory
In this particular case, it means fortuned transparently remounts itself
as it moves across networks (if running on a laptop that moves around
for example) and it also turns on the debugging services.
In general though, I suspect we can simply do a... | // Copyright 2015 The Vanadium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
// Command fortuned runs a daemon that implements the Fortune interface.
package main
import (
"flag"
"log"
"v.io/v23"
"v.io/v23/security"
"v.io/x/... | // Copyright 2015 The Vanadium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
// Command fortuned runs a daemon that implements the Fortune interface.
package main
import (
"flag"
"log"
"v.io/v23"
"v.io/v23/security"
"v.io/x/... |
Use local memory as cache so ratelimit tests don't fail | from __future__ import absolute_import
import os
os.environ['INBOX_TESTING'] = '1'
from settings import *
CACHES = {
"default": {
"BACKEND": "django.core.cache.backends.locmem.LocMemCache"
}
}
db = os.environ.get('DB')
SECRET_KEY = "This is a test, you don't need secrets"
if db == "sqlite":
DAT... | from __future__ import absolute_import
import os
os.environ['INBOX_TESTING'] = '1'
from settings import *
CACHES = {
"default": {
"BACKEND": "django.core.cache.backends.dummy.DummyCache"
}
}
db = os.environ.get('DB')
SECRET_KEY = "This is a test, you don't need secrets"
if db == "sqlite":
DATAB... |
Improve the migration for unique data source name | from redash.models import db
import peewee
from playhouse.migrate import PostgresqlMigrator, migrate
if __name__ == '__main__':
migrator = PostgresqlMigrator(db.database)
with db.database.transaction():
# Change the uniqueness constraint on data source name to be (org, name):
# In some cases i... | from redash.models import db
import peewee
from playhouse.migrate import PostgresqlMigrator, migrate
if __name__ == '__main__':
migrator = PostgresqlMigrator(db.database)
with db.database.transaction():
# Change the uniqueness constraint on data source name to be (org, name):
success = False
... |
Support ConnectedTechnologies and EnabledTechnologies Properties | //var dbus = module.exports = require('node-dbus');
var dbus = require('node-dbus');
module.exports = function() {
var self = this;
this.init = function(callback) {
dbus.start(function() {
self.systemBus = dbus.system_bus();
self.manager = dbus.get_interface(self.systemBus, 'net.connman', '/', 'net.connman.... | //var dbus = module.exports = require('node-dbus');
var dbus = require('node-dbus');
module.exports = function() {
var self = this;
this.init = function(callback) {
dbus.start(function() {
self.systemBus = dbus.system_bus();
self.manager = dbus.get_interface(self.systemBus, 'net.connman', '/', 'net.connman.... |
Test double call to DisposableSubscription.unsubscribe() | package com.artemzin.qualitymatters.other;
import org.junit.Before;
import org.junit.Test;
import rx.functions.Action0;
import static org.assertj.core.api.Assertions.assertThat;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.verifyZeroInteractions;... | package com.artemzin.qualitymatters.other;
import org.junit.Before;
import org.junit.Test;
import rx.functions.Action0;
import static org.assertj.core.api.Assertions.assertThat;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.verifyZeroInteractions;... |
Edit model associations using new syntax | module.exports = (sequelize, DataTypes) => {
const User = sequelize.define('User', {
username: {
type: DataTypes.STRING,
allowNull: false,
unique: true,
},
password: {
type: DataTypes.STRING,
allowNull: false,
},
email: {
type: DataTypes.STRING,
allowNull:... | module.exports = (sequelize, DataTypes) => {
const User = sequelize.define('User', {
username: {
type: DataTypes.STRING,
allowNull: false,
unique: true,
},
password: {
type: DataTypes.STRING,
allowNull: false,
},
email: {
type: DataTypes.STRING,
allowNull:... |
Fix issues found by jshint | var express = require('express');
var http = require('http');
// var url = require('url');
var restify = require('express-restify-mongoose');
var mongoose = require('mongoose');
var Artist = require('./api/models/artist');
var Faq = require('./api/models/faq');
var News = require('./api/models/news');
var Program = re... | var express = require('express');
var http = require('http');
var url = require('url');
var restify = require('express-restify-mongoose');
var mongoose = require('mongoose');
var Artist = require('./api/models/artist');
var Faq = require('./api/models/faq');
var News = require('./api/models/news');
var Program = requi... |
Use item_type, and also register a block helper for each template | /**
* Class - a registry of templates. Duh.
*/
cronenberg.TemplateRegistry = function() {
this.registry = {};
/**
* Compile a template and register the compiled render function by
* item type. Each template must specify what kind of API entity
* it renders using the data-item-type HTML attribu... | /**
* Class - a registry of templates. Duh.
*/
cronenberg.TemplateRegistry = function() {
this.registry = {};
/**
* Compile a template and register the compiled render function by
* item type. Each template must specify what kind of API entity
* it renders using the data-item-type HTML attribu... |
Move ok response creation to pytest fixture |
import os
import pytest
import requests
from cisco_olt_http import operations
from cisco_olt_http.client import Client
@pytest.fixture
def data_dir():
return os.path.abspath(
os.path.join(os.path.dirname(__file__), 'data'))
@pytest.fixture
def ok_response(data_dir, mocker):
response = mocker.Mock(a... |
import os
import pytest
import requests
from cisco_olt_http import operations
from cisco_olt_http.client import Client
@pytest.fixture
def data_dir():
return os.path.abspath(
os.path.join(os.path.dirname(__file__), 'data'))
def test_get_data():
client = Client('http://base-url')
show_equipment_... |
Set expectations for the project disclaimer | import React from 'react';
import { mount, shallow } from 'enzyme';
import { expect } from 'chai';
import { project, workflow } from '../dev-classifier/mock-data';
import ProjectPage from './project-navbar';
describe('ProjectPage', () => {
const background = {
src: 'the project background image url'
};
it('... | import React from 'react';
import { mount, shallow } from 'enzyme';
import { expect } from 'chai';
import { project, workflow } from '../dev-classifier/mock-data';
import ProjectPage from './project-navbar';
describe('ProjectPage', () => {
const background = {
src: 'the project background image url'
};
it('... |
Remove some lingering citext stuff from nickname query |
import { db, Rat } from '../db'
import Query from './index'
/**
* A class representing a rat query
*/
class NicknameQuery extends Query {
/**
* Create a sequelize rat query from a set of parameters
* @constructor
* @param params
* @param connection
*/
constructor (params, connection) {
super(... |
import { db, Rat } from '../db'
import Query from './index'
/**
* A class representing a rat query
*/
class NicknameQuery extends Query {
/**
* Create a sequelize rat query from a set of parameters
* @constructor
* @param params
* @param connection
*/
constructor (params, connection) {
super(... |
Remove Edge launcher from Karma Conf | module.exports = function(config) {
config.set({
frameworks: [
'jasmine',
'karma-typescript',
],
plugins: [
'karma-typescript',
'karma-jasmine',
'karma-firefox-launcher',
'karma-chrome-launcher',
],
files: [
"./src/**/*.ts",
"./test/**/*.ts"
],
... | module.exports = function(config) {
config.set({
frameworks: [
'jasmine',
'karma-typescript',
],
plugins: [
'karma-typescript',
'karma-jasmine',
'karma-firefox-launcher',
'karma-chrome-launcher',
'karma-edge-launcher'
],
files: [
"./src/**/*.ts",
... |
Use $UserID instead of $User->id
git-svn-id: 3b6cb4556d214d66df54bca2662d7ef408f367bf@2610 46e82423-29d8-e211-989e-002590a4cdd4 | <?php
#
# $Id: login.php,v 1.1.2.8 2003-12-01 18:17:47 dan Exp $
#
# Copyright (c) 1998-2003 DVL Software Limited
#
if (IsSet($_GET['origin'])) $origin = $_GET["origin"];
?>
<form action="<?php echo $_SERVER["PHP_SELF"] . "?origin=$origin" ?>" method="POST" name="l">
<input type="hidden" name="custom_set... | <?php
#
# $Id: login.php,v 1.1.2.7 2003-07-04 14:59:19 dan Exp $
#
# Copyright (c) 1998-2003 DVL Software Limited
#
if (IsSet($_GET['origin'])) $origin = $_GET["origin"];
?>
<form action="<?php echo $_SERVER["PHP_SELF"] . "?origin=$origin" ?>" method="POST" name="l">
<input type="hidden" name="custom_set... |
PhpDoc: Fix type inconsistencies, put |null last for better readability | <?php
/*
* This file is part of the Elcodi package.
*
* Copyright (c) 2014 Elcodi.com
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*
* Feel free to edit as you please, and have fun.
*
* @author Marc Morera <yuhu@mmoreram.com>
... | <?php
/*
* This file is part of the Elcodi package.
*
* Copyright (c) 2014 Elcodi.com
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*
* Feel free to edit as you please, and have fun.
*
* @author Marc Morera <yuhu@mmoreram.com>
... |
Remove reference to postgis template. Django now installs postgis when database is created. | import os
import inspect
import subprocess
from django.template import Template
from django.template import Context
from django.conf import settings
from arches.management.commands import utils
def create_sqlfile(database_settings, path_to_file):
context = Context(database_settings)
postgres_version = s... | import os
import inspect
import subprocess
from django.template import Template
from django.template import Context
from django.conf import settings
from arches.management.commands import utils
def create_sqlfile(database_settings, path_to_file):
context = Context(database_settings)
postgres_version = s... |
Update pysaml2 dependency to resolve bugs related to attribute filtering. | #!/usr/bin/env python
"""
setup.py
"""
from setuptools import setup, find_packages
setup(
name='SATOSA',
version='0.4.1',
description='Protocol proxy (SAML/OIDC).',
author='DIRG',
author_email='dirg@its.umu.se',
license='Apache 2.0',
url='https://github.com/its-dirg/SATOSA',
packages=... | #!/usr/bin/env python
"""
setup.py
"""
from setuptools import setup, find_packages
setup(
name='SATOSA',
version='0.4.1',
description='Protocol proxy (SAML/OIDC).',
author='DIRG',
author_email='dirg@its.umu.se',
license='Apache 2.0',
url='https://github.com/its-dirg/SATOSA',
packages=... |
tests: Check bench mode==run with fixed block shape | from subprocess import check_call
def run_cmd(command, problem, so, shape, nbpml, *extra):
args = ["python", "../benchmarks/user/benchmark.py", command]
args.extend(["-P", str(problem)])
args.extend(["-so", str(so)])
args.extend(["-d"] + [str(i) for i in shape])
args.extend(["--nbpml", str(nbpml)]... | import os
from subprocess import check_call
import pytest
def run(command, problem, so, shape, nbpml, *extra):
args = ["python", "../benchmarks/user/benchmark.py", command]
args.extend(["-P", str(problem)])
args.extend(["-so", str(so)])
args.extend(["-d"] + [str(i) for i in shape])
args.extend(["... |
Fix warning about transitionTo being deprecated | import EditorControllerMixin from 'ghost/mixins/editor-base-controller';
var EditorNewController = Ember.ObjectController.extend(EditorControllerMixin, {
actions: {
/**
* Redirect to editor after the first save
*/
save: function () {
var self = this;
this... | import EditorControllerMixin from 'ghost/mixins/editor-base-controller';
var EditorNewController = Ember.ObjectController.extend(EditorControllerMixin, {
actions: {
/**
* Redirect to editor after the first save
*/
save: function () {
var self = this;
this... |
Add unique constraint on Meal name field | from __future__ import unicode_literals
from django.db import models
class Weekday(models.Model):
"""Model representing the day of the week."""
name = models.CharField(max_length=60, unique=True)
def clean(self):
"""
Capitalize the first letter of the first word to avoid case
in... | from __future__ import unicode_literals
from django.db import models
class Weekday(models.Model):
"""Model representing the day of the week."""
name = models.CharField(max_length=60, unique=True)
def clean(self):
"""
Capitalize the first letter of the first word to avoid case
in... |
Add google+ as alias for googleplus | var qs = require('querystring')
module.exports = function (network, url, opts) {
opts = opts || {}
if (!linkfor[network]) throw new Error('Unsupported network ' + network)
return linkfor[network](url, opts)
}
var linkfor = {
facebook: function (url, opts) {
var share = {
u: url
}
if (opts... | var qs = require('querystring')
module.exports = function (network, url, opts) {
opts = opts || {}
if (!linkfor[network]) throw new Error('Unsupported network ' + network)
return linkfor[network](url, opts)
}
var linkfor = {
facebook: function (url, opts) {
var share = {
u: url
}
if (opts... |
Update default image for borked images | /**
* Wait until the DOM is ready.
*
* @param {Function} fn
*/
import { flatMap, keyBy } from 'lodash';
export function ready(fn) {
if (document.readyState !== 'loading'){
fn();
} else {
document.addEventListener('DOMContentLoaded', fn);
}
}
export function calculateAge(date) {
const birthdate = ne... | /**
* Wait until the DOM is ready.
*
* @param {Function} fn
*/
import { flatMap, keyBy } from 'lodash';
export function ready(fn) {
if (document.readyState !== 'loading'){
fn();
} else {
document.addEventListener('DOMContentLoaded', fn);
}
}
export function calculateAge(date) {
const birthdate = ne... |
Fix busted subcommand shortcut for runserver | package main
import (
"github.com/cloudtools/ssh-cert-authority/util"
"github.com/codegangsta/cli"
"os"
)
func main() {
app := cli.NewApp()
app.Name = "ssh-cert-authority"
app.EnableBashCompletion = true
app.Version = ssh_ca_util.BuildVersion
app.Commands = []cli.Command{
{
Name: "request",
Aliase... | package main
import (
"github.com/cloudtools/ssh-cert-authority/util"
"github.com/codegangsta/cli"
"os"
)
func main() {
app := cli.NewApp()
app.Name = "ssh-cert-authority"
app.EnableBashCompletion = true
app.Version = ssh_ca_util.BuildVersion
app.Commands = []cli.Command{
{
Name: "request",
Aliase... |
Add missing tx context for user verify tx store. | package userverify
import (
"github.com/sirupsen/logrus"
"github.com/skygeario/skygear-server/pkg/core/db"
)
type safeStoreImpl struct {
impl *storeImpl
txContext db.SafeTxContext
}
func NewSafeStore(
builder db.SQLBuilder,
executor db.SQLExecutor,
logger *logrus.Entry,
txContext db.SafeTxContext,
) Sto... | package userverify
import (
"github.com/sirupsen/logrus"
"github.com/skygeario/skygear-server/pkg/core/db"
)
type safeStoreImpl struct {
impl *storeImpl
txContext db.SafeTxContext
}
func NewSafeStore(
builder db.SQLBuilder,
executor db.SQLExecutor,
logger *logrus.Entry,
txContext db.SafeTxContext,
) Sto... |
Set the cookie path properly.
This is needed so that the cookies are valid for
(only) us, and so that they're easier to track. | <?php
require_once("tokenstrategy.php");
class CookieStrategy extends TokenStrategy
{
/**
* the name for the cookie
*/
const COOKIENAME = "token";
public function getAuthToken()
{
return $_COOKIE[self::COOKIENAME];
}
public function setNextAuthToken($token)
{
$e... | <?php
require_once("tokenstrategy.php");
class CookieStrategy extends TokenStrategy
{
/**
* the name for the cookie
*/
const COOKIENAME = "token";
public function getAuthToken()
{
return $_COOKIE[self::COOKIENAME];
}
public function setNextAuthToken($token)
{
$e... |
Update master version to 0.3-dev | #from distutils.core import setup
from setuptools import setup
descr = """cellom2tif: Convert Cellomics .C01 images to TIFF.
This package uses the python-bioformats library to traverse directories
and convert files in the Cellomics format (.C01) to TIFF files.
"""
DISTNAME = 'cellom2tif'
DESCRIPTION ... | #from distutils.core import setup
from setuptools import setup
descr = """cellom2tif: Convert Cellomics .C01 images to TIFF.
This package uses the python-bioformats library to traverse directories
and convert files in the Cellomics format (.C01) to TIFF files.
"""
DISTNAME = 'cellom2tif'
DESCRIPTION ... |
Use extended shallow instead of mount from enzyme | import React from 'react'
import ReactDOM from 'react-dom'
import CircularProgressButton from './CircularProgressButton'
import Button from 'material-ui/Button'
import { createShallow } from 'material-ui/test-utils'
let shallow;
beforeAll(() => {
shallow = createShallow({ dive: true });
});
it('renders without c... | import React from 'react'
import ReactDOM from 'react-dom'
import CircularProgressButton from './CircularProgressButton'
import Button from 'material-ui/Button'
import { mount, shallow, render } from 'enzyme'
it('renders without crashing', () => {
const div = document.createElement('div');
ReactDOM.render(<Ci... |
Call hasNext in next to make sure we have an element available | package uk.co.jezuk.mango.iterators;
import java.util.Iterator;
import java.util.List;
import java.util.ArrayList;
import java.util.NoSuchElementException;
public class ChainIterator<T> implements Iterator<T>
{
private final Iterator<Iterator<T>> chain_;
private Iterator<T> current_;
public ChainIterator(final... | package uk.co.jezuk.mango.iterators;
import java.util.Iterator;
import java.util.List;
import java.util.ArrayList;
public class ChainIterator<T> implements Iterator<T>
{
private final Iterator<Iterator<T>> chain_;
private Iterator<T> current_;
public ChainIterator(final Object... iterables)
{
final List<... |
Replace the double arrow on collection with circle | <div class="col-md-12">
<div class="a-note">
<div class="layout">
<div class="layout-center" style="width: 100px">
<div>
<a href="/notes/{{$notes->id}}" class="note-title">
<i class="fa fa-circle-o"></i>
</a>
... | <div class="col-md-12">
<div class="a-note">
<div class="layout">
<div class="layout-center">
<div class="text-capitalize text-left">
<a href="/notes/{{$notes->id}}" class="note-title">
{{ $notes->notes_title }}
</a... |
Clean up the AuthComplete API a little | import logging
from django.contrib import messages
from django.http import HttpResponseRedirect, HttpResponse
from django.utils.encoding import force_text
from django.views.generic.base import View
from social_auth.exceptions import AuthFailed
from social_auth.views import complete
logger = logging.getLogger(__name_... | import logging
from django.contrib import messages
from django.http import HttpResponseRedirect, HttpResponse
from django.views.generic.base import View
from social_auth.exceptions import AuthFailed
from social_auth.views import complete
logger = logging.getLogger(__name__)
class AuthComplete(View):
def get(se... |
chore(gulp): Fix build behavior by returning streams. | 'use strict';
var gulp = require('gulp');
var jscs = require('gulp-jscs');
var jshint = require('gulp-jshint');
var gulpMocha = require('gulp-mocha');
var javascriptGlobs = ['*.js', 'src/**/*.js', 'test/**/*.js'];
gulp.task('style', function () {
return gulp.src(javascriptGlobs)
.pipe(jscs())
.pipe(jscs.re... | 'use strict';
var gulp = require('gulp');
var jscs = require('gulp-jscs');
var jshint = require('gulp-jshint');
var gulpMocha = require('gulp-mocha');
var javascriptGlobs = ['*.js', 'src/**/*.js', 'test/**/*.js'];
gulp.task('style', function () {
gulp.src(javascriptGlobs)
.pipe(jscs())
.pipe(jscs.reporter(... |
Remove sources from source maps. | const path = require('path');
const webpack = require('webpack');
const glob = require('glob');
const pkg = require('./package.json');
function newConfig() {
return {
resolve: {
extensions: ['.coffee']
},
module: {
rules: [
{test: /\.coffee$/, loader: 'coffee-loader'}
]
},... | const path = require('path');
const webpack = require('webpack');
const glob = require('glob');
const pkg = require('./package.json');
function newConfig() {
return {
resolve: {
extensions: ['.coffee']
},
module: {
rules: [
{test: /\.coffee$/, loader: 'coffee-loader'}
]
},... |
Remove --profile tag from debugging | //https://nvbn.github.io/2015/06/19/jekyll-browsersync/
var gulp = require('gulp');
var shell = require('gulp-shell');
var browserSync = require('browser-sync').create();
// Task for building blog when something changed:
gulp.task('build', shell.task(['bundle exec jekyll build --watch']));
// Task for serving blog wi... | //https://nvbn.github.io/2015/06/19/jekyll-browsersync/
var gulp = require('gulp');
var shell = require('gulp-shell');
var browserSync = require('browser-sync').create();
// Task for building blog when something changed:
gulp.task('build', shell.task(['bundle exec jekyll build --watch --profile']));
// Task for servi... |
Deal with commodity display for contracts | var path = require('path');
var rootPath = path.normalize(__dirname + '/../../');
module.exports = {
local: {
baseUrl: 'http://localhost:3030',
db: 'mongodb://localhost/rp_local',
rootPath: rootPath,
port: process.env.PORT || 3030
},
staging : {
baseUrl: 'http://... | var path = require('path');
var rootPath = path.normalize(__dirname + '/../../');
module.exports = {
local: {
baseUrl: 'http://localhost:3008',
db: 'mongodb://localhost/rp_local',
rootPath: rootPath,
port: process.env.PORT || 3008
},
staging : {
baseUrl: 'http://... |
Rewrite test to use ThrowableCaptor | package com.codeaffine.extras.jdt.internal.prefs;
import static com.codeaffine.test.util.lang.ThrowableCaptor.thrownBy;
import static org.assertj.core.api.Assertions.assertThat;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;
import org.eclipse... | package com.codeaffine.extras.jdt.internal.prefs;
import static org.junit.Assert.fail;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;
import org.eclipse.ui.IWorkbench;
import org.eclipse.ui.services.IEvaluationService;
import org.junit.Before;... |
Fix style error at command map imports. | package fi.helsinki.cs.tmc.cli.command;
import fi.helsinki.cs.tmc.cli.Application;
import java.util.HashMap;
import java.util.Map;
/**
* Class creates a map for commands.
*/
public class CommandMap {
private Map<String, Command> commands;
/**
* Constructor.
*/
public CommandMap(Application ... | package fi.helsinki.cs.tmc.cli.command;
import fi.helsinki.cs.tmc.cli.Application;
import java.util.HashMap;
import java.util.Map;
/**
* Class creates a map for commands.
*/
public class CommandMap {
private Map<String, Command> commands;
/**
* Constructor.
*/
public CommandMap(Application a... |
Implement method to start service. | package com.github.aureliano.achmed.os.service;
import org.apache.log4j.Logger;
import com.github.aureliano.achmed.command.CommandFacade;
import com.github.aureliano.achmed.command.CommandResponse;
import com.github.aureliano.achmed.helper.StringHelper;
public class RedHatService extends LinuxService {
private sta... | package com.github.aureliano.achmed.os.service;
import org.apache.log4j.Logger;
import com.github.aureliano.achmed.command.CommandFacade;
import com.github.aureliano.achmed.command.CommandResponse;
public class RedHatService extends LinuxService {
private static final Logger logger = Logger.getLogger(RedHatService... |
Implement bluebird instead of Q inside demo userDAO | "use strict";
var loki = require('lokijs');
var _ = require('lodash');
var Promise = require('bluebird');
// variable to hold the singleton instance, if used in that manner
var userDAOInstance = undefined;
//
// User Data Access Object
//
// Constructor
function UserDAO(dbName) {
// Define database name
dbName ... | "use strict";
var loki = require('lokijs');
var _ = require('lodash');
var Q = require('q');
// variable to hold the singleton instance, if used in that manner
var userDAOInstance = undefined;
//
// User Data Access Object
//
// Constructor
function UserDAO(dbName) {
// Define database name
dbName = (dbName != '... |
Modify created_at and updated_at to millisecond | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import cgi
import sqlite3
import time
import config
def valid(qs):
required_keys = ['title', 'comment', 'posted_by', 'localite', 'latitude', 'longitude']
return all([qs.has_key(k) for k in required_keys])
def post(title, comment, posted_by, localite, latitude, lo... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import cgi
import sqlite3
import time
import config
def valid(qs):
required_keys = ['title', 'comment', 'posted_by', 'localite', 'latitude', 'longitude']
return all([qs.has_key(k) for k in required_keys])
def post(title, comment, posted_by, localite, latitude, lo... |
Stop test run if config loading errors | #! /usr/bin/env node
'use strict';
var doctest = require('../lib/doctest');
var fs = require('fs');
var glob = require('glob');
var CONFIG_FILEPATH = process.cwd() + '/.markdown-doctest-setup.js';
var DEFAULT_GLOB = '**/*.+(md|markdown)';
var DEFAULT_IGNORE = ['**/node_modules/**', '**/bower_components/**'];
funct... | #! /usr/bin/env node
'use strict';
var doctest = require('../lib/doctest');
var fs = require('fs');
var glob = require('glob');
var CONFIG_FILEPATH = process.cwd() + '/.markdown-doctest-setup.js';
var DEFAULT_GLOB = '**/*.+(md|markdown)';
var DEFAULT_IGNORE = ['**/node_modules/**', '**/bower_components/**'];
funct... |
Fix error, need to add PressAddStory button | import React, { Component } from 'react';
import {
StyleSheet,
Text,
View,
TouchableHighlight,
} from 'react-native';
import I18n from 'react-native-i18n'
class Profile extends Component{
_onPressAddStory(){
}
render() {
return (
<View style={styles.container}>
<Text style={styles.ti... | import React, { Component } from 'react';
import {
StyleSheet,
Text,
View,
TouchableHighlight,
} from 'react-native';
import I18n from 'react-native-i18n'
class Profile extends Component{
async _onPressAddStory(){
try {
}
}
render() {
return (
<View style={styles.container}>
... |
Use omitempty tag for storage & network arrays | // Copyright © 2016 Zlatko Čalušić
//
// Use of this source code is governed by an MIT-style license that can be found in the LICENSE file.
// Package sysinfo is a pure Go library providing Linux OS / kernel / hardware system information.
package sysinfo
// SysInfo struct encapsulates all other information structs.
t... | // Copyright © 2016 Zlatko Čalušić
//
// Use of this source code is governed by an MIT-style license that can be found in the LICENSE file.
// Package sysinfo is a pure Go library providing Linux OS / kernel / hardware system information.
package sysinfo
// SysInfo struct encapsulates all other information structs.
t... |
Implement throw error when no function found | import * as PASTEL_FUNC from '../../functions/functions.js';
import CraftyBlock from './CraftyBlock.js';
export default class CraftyBlockSpec {
constructor(name, type, parameters = [], library="", docstring="") {
this.name = name;
this.type = type;
this.parameters = parameters;
this... | import * as PASTEL_FUNC from '../../functions/functions.js';
import CraftyBlock from './CraftyBlock.js';
export default class CraftyBlockSpec {
constructor(name, type, parameters = [], library="", docstring="") {
this.name = name;
this.type = type;
this.parameters = parameters;
this... |
Validate that the request body is unchanged by default | package rapi_test
import (
"io/ioutil"
"net/http"
"net/http/httptest"
"strings"
"testing"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"github.com/waltzofpearls/relay-api/rapi"
)
func TestEndpointUnchanged(t *testing.T) {
var requestContent string
expectedResult := `test`
t... | package rapi_test
import (
"net/http"
"net/http/httptest"
"strings"
"testing"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"github.com/waltzofpearls/relay-api/rapi"
)
func TestEndpoint(t *testing.T) {
ts := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http... |
Add paramiko to install_requires since libcloud deploy_node() requires it. | #!/bin/env python
# -*- coding: utf8 -*-
from setuptools import setup
setup(
name='fedimg',
version='0.0.1',
description='Service to automatically upload built Fedora images \
to internal and external cloud providers.',
classifiers=[
"Programming Language :: Python :: 2",
... | #!/bin/env python
# -*- coding: utf8 -*-
from setuptools import setup
setup(
name='fedimg',
version='0.0.1',
description='Service to automatically upload built Fedora images \
to internal and external cloud providers.',
classifiers=[
"Programming Language :: Python :: 2",
... |
Handle room users case when not in room | Template.roomView.helpers({
room: function () {
return Rooms.findOne({_id: Session.get('currentRoom')});
},
roomUsers: function () {
var room = Rooms.findOne({_id: Session.get('currentRoom')});
if(room) {
return Meteor.users.find({_id: {$in: room.users}});
}
... | Template.roomView.helpers({
room: function () {
return Rooms.findOne({_id: Session.get('currentRoom')});
},
roomUsers: function () {
var room = Rooms.findOne({_id: Session.get('currentRoom')});
return Meteor.users.find({_id: {$in: room.users}});
},
currentRooms: function () {... |
[Core] Fix filtering scenarios loaded from jar
I am running cucumber tests with features loaded from classpath:, like this:
```
java -cp fatjar.jar cucumber.api.cli.Main "classpath:features/FeatureWithExamples.feature:64"
```
However, when cucumber parses this path and creates a ZipResource from it, it adds an... | package cucumber.runtime.io;
import java.io.IOException;
import java.io.InputStream;
import java.net.URI;
import java.util.zip.ZipEntry;
import java.util.zip.ZipFile;
import static io.cucumber.core.model.Classpath.CLASSPATH_SCHEME_PREFIX;
class ZipResource implements Resource {
private final ZipFile jarFile;
... | package cucumber.runtime.io;
import java.io.IOException;
import java.io.InputStream;
import java.net.URI;
import java.util.zip.ZipEntry;
import java.util.zip.ZipFile;
import static io.cucumber.core.model.Classpath.CLASSPATH_SCHEME_PREFIX;
class ZipResource implements Resource {
private final ZipFile jarFile;
... |
Fix wrong URL for success login | from django.views.generic import FormView, RedirectView
from django.contrib.auth.forms import AuthenticationForm
from django.core.urlresolvers import reverse
from django.contrib.auth import login, logout
class LoginView(FormView):
template_name = 'homepage/login.html'
form_class = AuthenticationForm
def ... | from django.views.generic import FormView, RedirectView
from django.contrib.auth.forms import AuthenticationForm
from django.core.urlresolvers import reverse
from django.contrib.auth import login, logout
class LoginView(FormView):
template_name = 'homepage/login.html'
form_class = AuthenticationForm
def ... |
Disable ContextLost.WebGLContextLostFromSelectElement on Windows Release.
BUG=528139
TBR=kbr@chromium.org
Review URL: https://codereview.chromium.org/1319463006
Cr-Commit-Position: 972c6d2dc6dd5efdad1377c0d224e03eb8f276f7@{#347374} | # Copyright 2014 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
from gpu_test_expectations import GpuTestExpectations
# See the GpuTestExpectations class for documentation.
class ContextLostExpectations(GpuTestExpectati... | # Copyright 2014 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
from gpu_test_expectations import GpuTestExpectations
# See the GpuTestExpectations class for documentation.
class ContextLostExpectations(GpuTestExpectati... |
Fix DeviceIdentity on RN for Android
Reviewed By: Hypuk
Differential Revision: D5963912
fbshipit-source-id: 3959e5ab6af66512f0035efea7919572554e10b4 | /**
* 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.
*/
package co... | /**
* 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.
*/
package co... |
Allow mjmlEngine to be null
It looks better when we want to pass options but no mjmlEngine
```
mjml(null, {}) // :)
mjml(undefined, {}) // :(
``` | var through = require ('through2')
var mjmlDefaultEngine = require ('mjml')
var gutil = require ('gulp-util')
var GulpError = gutil.PluginError
var NAME = 'MJML'
module.exports = function mjml (mjmlEngine, options) {
if(!mjmlEngine) {
mjmlEngine = mjmlDefaultEngine
}
if (options === undefined) {
options... | var through = require ('through2')
var mjmlDefaultEngine = require ('mjml')
var gutil = require ('gulp-util')
var GulpError = gutil.PluginError
var NAME = 'MJML'
module.exports = function mjml (mjmlEngine, options) {
if(mjmlEngine === undefined) {
mjmlEngine = mjmlDefaultEngine
}
if (options === undefined) ... |
Fix sdgs feach coming from ndcs | import { createAction } from 'redux-actions';
import { createThunkAction } from 'utils/redux';
import isEmpty from 'lodash/isEmpty';
const fetchSdgGoalsInit = createAction('fetchSdgGoalsInit');
const fetchSdgGoalsReady = createAction('fetchSdgGoalsReady');
const fetchSdgGoalsFail = createAction('fetchSdgGoalsFail');
... | import { createAction } from 'redux-actions';
import { createThunkAction } from 'utils/redux';
import isEmpty from 'lodash/isEmpty';
const fetchSdgGoalsInit = createAction('fetchSdgGoalsInit');
const fetchSdgGoalsReady = createAction('fetchSdgGoalsReady');
const fetchSdgGoalsFail = createAction('fetchSdgGoalsFail');
... |
Add StoqPluginException to default imports | #!/usr/bin/env python3
# Copyright 2014-2018 PUNCH Cyber Analytics Group
#
# 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
#
# Un... | #!/usr/bin/env python3
# Copyright 2014-2018 PUNCH Cyber Analytics Group
#
# 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
#
# Un... |
Print LICENSE on top of the amalgamation | #!/usr/bin/env python
import sys
from os.path import basename, dirname, join
import re
INCLUDE_PATTERN = re.compile(r'^\s*#include "([\w.]+)"')
WREN_DIR = dirname(dirname(realpath(__file__)))
seen_files = set()
out = sys.stdout
# Prints a plain text file, adding comment markers.
def add_comment_file(filename):
wi... | #!/usr/bin/env python
import sys
from os.path import basename, dirname, join
import re
INCLUDE_PATTERN = re.compile(r'^\s*#include "([\w.]+)"')
seen_files = set()
out = sys.stdout
def add_file(filename):
bname = basename(filename)
# Only include each file at most once.
if bname in seen_files:
return
see... |
Add tests to check missions_completed attribute in random drone generator | const { generateRandom } = require('../../server/simulation/drone');
describe('generateRandom()', () => {
const sampleArguments = {coords: {lat: 1, long: 1}, distance: 1000 };
test('returns an object', () => {
expect(
typeof generateRandom(sampleArguments)
).toBe('object');
});
test('returns a... | const { generateRandom } = require('../../server/simulation/drone');
describe('generateRandom()', () => {
const sampleArguments = {coords: {lat: 1, long: 1}, distance: 1000 };
test('returns an object', () => {
expect(
typeof generateRandom(sampleArguments)
).toBe('object');
});
test('returns a... |
Change indentation style to use tabs | #!/usr/bin/env node
"use strict";
const moment = require("moment");
const sugar = require("sugar");
const chalk = require("chalk");
const exec = require("child_process").exec;
const fatal = err => {
console.error(`fatal: ${err}`);
process.exit(1);
};
process.argv.splice(0, 2);
if (process.argv.length === 0)... | #!/usr/bin/env node
"use strict";
const moment = require("moment");
const sugar = require("sugar");
const chalk = require("chalk");
const exec = require("child_process").exec;
const fatal = err => {
console.error(`fatal: ${err}`);
process.exit(1);
};
process.argv.splice(0, 2);
if (process.argv.length === 0) {
... |
Remove 'meta' in favour of 'params' | <?php echo '<?php' ?>
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateIndices extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('indices', function(Blueprint $table) {
... | <?php echo '<?php' ?>
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateIndices extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('indices', function(Blueprint $table) {
... |
Remove forgotten comment quotation marks | def check_argv(argv):
"""Check if arguments are ok.
When executing, there must be argument switch for test/live.
There also must be filename.
Method returns set(is_correct, filename, is_test)
"""
python_file_name = argv[0]
usage_msg = "Usage: python %s [-test | -live] filename.txt" % python... | def check_argv(argv):
"""Check if arguments are ok.
When executing, there must be argument switch for test/live.
There also must be filename.
Method returns set(is_correct, filename, is_test)
"""``
python_file_name = argv[0]
usage_msg = "Usage: python %s [-test | -live] filename.txt" % pyth... |
Update Worker API
- ADD type hints
- Remove unused imports | # stdlib
from typing import Callable
# syft relative
from ...messages.infra_messages import CreateWorkerMessage
from ...messages.infra_messages import DeleteWorkerMessage
from ...messages.infra_messages import GetWorkerMessage
from ...messages.infra_messages import GetWorkersMessage
from ...messages.infra_messages imp... | # stdlib
from typing import Any
from typing import Dict
# third party
from pandas import DataFrame
# syft relative
from ...messages.infra_messages import CreateWorkerMessage
from ...messages.infra_messages import DeleteWorkerMessage
from ...messages.infra_messages import GetWorkerMessage
from ...messages.infra_messag... |
Use new lrp convergence method
* GatherDesiredLRPs -> GatherAndPruneDesiredLRPs
Signed-off-by: James Myers <44cbd4b2784f900a6fede6279d0b7fdcbfaa89f5@pivotal.io> | package benchmark_bbs_test
import (
"github.com/cloudfoundry-incubator/bbs/db/etcd"
"github.com/cloudfoundry-incubator/benchmark-bbs/reporter"
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
)
const (
ConvergenceGathering = "ConvergenceGathering"
)
var BenchmarkConvergenceGathering = func(numTrials int) {... | package benchmark_bbs_test
import (
"github.com/cloudfoundry-incubator/bbs/db/etcd"
"github.com/cloudfoundry-incubator/benchmark-bbs/reporter"
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
)
const (
ConvergenceGathering = "ConvergenceGathering"
)
var BenchmarkConvergenceGathering = func(numTrials int) {... |
Use a filesystem db and add the sites app to fix a test failure. | # -*- coding: utf-8 -*-
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': '/tmp/django-formtools-tests.db',
}
}
INSTALLED_APPS = [
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.sites',
'formtools',
... | # -*- coding: utf-8 -*-
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': ':memory:',
}
}
INSTALLED_APPS = [
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'formtools',
'tests.wizard.wizardtests',
]
SECRET_KEY = 'sp... |
Fix individual message button in Slack
Closes #1120. | 'use strict';
togglbutton.render('#channel_name:not(.toggl)', { observe: true }, function() {
var link,
placeholder = $('.channel_title_info'),
project = $('#team_name').textContent,
description = $('#channel_name')
.textContent.trim()
.replace(/^#/, '');
link = togglbutton.createTimerLink... | 'use strict';
togglbutton.render('#channel_name:not(.toggl)', { observe: true }, function() {
var link,
placeholder = $('.channel_title_info'),
project = $('#team_name').textContent,
description = $('#channel_name')
.textContent.trim()
.replace(/^#/, '');
link = togglbutton.createTimerLink... |
Implement UpperCamelCase name check for enums | from tailor.swift.swiftlistener import SwiftListener
from tailor.utils.charformat import isUpperCamelCase
class MainListener(SwiftListener):
def enterClassName(self, ctx):
self.__verify_upper_camel_case(ctx, 'Class names should be in UpperCamelCase')
def enterEnumName(self, ctx):
self.__veri... | from tailor.swift.swiftlistener import SwiftListener
from tailor.utils.charformat import isUpperCamelCase
class MainListener(SwiftListener):
def enterClassName(self, ctx):
self.__verify_upper_camel_case(ctx, 'Class names should be in UpperCamelCase')
def enterEnumName(self, ctx):
pass
d... |
Fix latest migration's down() function | <?php
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class AddActiveFieldToUsersTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table("users", function(Blueprint $table) {
... | <?php
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class AddActiveFieldToUsersTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table("users", function(Blueprint $table) {
... |
Add visual.ons to external link formatter (will enable event tracking for outbound clicks) | // Using regex instead of simply using 'host' because it causes error with security on Government browsers (IE9 so far)
function getHostname(url) {
var m = url.match(/^http(s?):\/\/[^/]+/);
return m ? m[0] : null;
}
function eachAnchor(anchors) {
$(anchors).each(function() {
var href = $(this).att... | // Using regex instead of simply using 'host' because it causes error with security on Government browsers (IE9 so far)
function getHostname(url) {
var m = url.match(/^http(s?):\/\/[^/]+/);
return m ? m[0] : null;
}
function eachAnchor(anchors) {
$(anchors).each(function() {
var href = $(this).att... |
Add method for ensuring that no null values are contained in a collection. passed as an argument. | /*
* Copyright 2015 Martijn van der Woud - The Crimson Cricket Internet Services
*
* 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/LICE... | /*
* Copyright 2015 Martijn van der Woud - The Crimson Cricket Internet Services
*
* 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/LICE... |
Remove test for cell name and availability zone. | package vizzini_test
import (
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
)
var _ = Describe("Cells", func() {
It("should return all cells", func() {
cells, err := bbsClient.Cells(logger)
Expect(err).NotTo(HaveOccurred())
Expect(len(cells)).To(BeNumerically(">=", 1))
cell0 := cells[0]
Expect(... | package vizzini_test
import (
"strings"
"code.cloudfoundry.org/bbs/models"
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
)
var _ = Describe("Cells", func() {
It("should return all cells", func() {
cells, err := bbsClient.Cells(logger)
Expect(err).NotTo(HaveOccurred())
Expect(len(cells)).To(BeNumer... |
Remove non-working debug output to console | /*
Author: mythern
Copyright (C) 2014, MIT License
http://www.opensource.org/licenses/mit-license.php
Adressaway is provided free of charge, to any person obtaining a copy
of this software and associated documentation files, to deal in the Software
without restriction, including without li... | /*
Author: mythern
Copyright (C) 2014, MIT License
http://www.opensource.org/licenses/mit-license.php
Adressaway is provided free of charge, to any person obtaining a copy
of this software and associated documentation files, to deal in the Software
without restriction, including without li... |
Add in message remover for memedog | import BaseWatcher from './BaseWatcher';
import config from '../config';
/**
* This checks for people spamming cool dog crap.
*/
class CoolDogSpamWatcher extends BaseWatcher {
constructor(bot) {
super(bot);
}
usesBypassRules = true;
/**
* The method this watcher should listen on.
... | import BaseWatcher from './BaseWatcher';
import config from '../config';
/**
* This checks for people spamming cool dog crap.
*/
class CoolDogSpamWatcher extends BaseWatcher {
constructor(bot) {
super(bot);
}
usesBypassRules = true;
/**
* The method this watcher should listen on.
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.