text stringlengths 16 4.96k | positive stringlengths 321 2.24k | negative stringlengths 310 2.21k |
|---|---|---|
[AC-9046] Fix the query for updating the people and mentor urls to community url | # Generated by Django 2.2.10 on 2021-11-05 12:29
from django.db import migrations
from django.db.models.query_utils import Q
def update_url_to_community(apps, schema_editor):
people_url = "/people"
mentor_url = "/directory"
community_url = "/community"
SiteRedirectPage = apps.get_model('accelerator', 'SiteRe... | # Generated by Django 2.2.10 on 2021-11-05 12:29
from django.db import migrations
from django.db.models.query_utils import Q
def update_url_to_community(apps, schema_editor):
people_url = "/people"
mentor_url = "/directory"
community_url = "/community"
SiteRedirectPage = apps.get_model('accelerator', 'SiteRe... |
Allow specifying custom host and port when starting app | """Task functions for use with Invoke."""
from invoke import task
@task
def clean(context):
cmd = '$(npm bin)/gulp clean'
context.run(cmd)
@task
def requirements(context):
steps = [
'pip install -r requirements.txt',
'npm install',
'$(npm bin)/bower install',
]
cmd = ' &... | """Task functions for use with Invoke."""
from invoke import task
@task
def clean(context):
cmd = '$(npm bin)/gulp clean'
context.run(cmd)
@task
def requirements(context):
steps = [
'pip install -r requirements.txt',
'npm install',
'$(npm bin)/bower install',
]
cmd = ' &... |
Fix broken path for destination | /* eslint-env node */
/** global: Buffer */
'use strict';
const gutil = require('gulp-util');
const through = require('through2');
const wpPot = require('wp-pot');
const PluginError = gutil.PluginError;
/**
* Determine if `obj` is a object or not.
*
* @param {object} obj
*
* @return {boolean}
*/
function isO... | /* eslint-env node */
/** global: Buffer */
'use strict';
const gutil = require('gulp-util');
const through = require('through2');
const wpPot = require('wp-pot');
const PluginError = gutil.PluginError;
/**
* Determine if `obj` is a object or not.
*
* @param {object} obj
*
* @return {boolean}
*/
function isO... |
Add space character after code element | import React, { PropTypes } from 'react'
export default function Counter({
increment,
incrementIfOdd,
decrement,
counter,
}) {
return (
<section>
<p className="intro">
To get started, edit <code>src/routes/index.js </code>
and save to reload.
</p>
<p>
Clicked: {c... | import React, { PropTypes } from 'react'
export default function Counter({
increment,
incrementIfOdd,
decrement,
counter,
}) {
return (
<section>
<p className="intro">
To get started, edit <code>src/routes/index.js</code>
and save to reload.
</p>
<p>
Clicked: {co... |
Update tests for new redirect-after-create stream. | from tornado.httpclient import HTTPRequest
from nose.tools import eq_, ok_
import json
import faker
from astral.api.tests import BaseTest
from astral.models import Stream
from astral.models.tests.factories import StreamFactory
class StreamsHandlerTest(BaseTest):
def test_get_streams(self):
[StreamFactory(... | from tornado.httpclient import HTTPRequest
from nose.tools import eq_, ok_
import json
import faker
from astral.api.tests import BaseTest
from astral.models import Stream
from astral.models.tests.factories import StreamFactory
class StreamsHandlerTest(BaseTest):
def test_get_streams(self):
[StreamFactory(... |
:fire: Remove unused function and import in tests | import expect from 'expect.js'
import {fix} from '../../../src/typography-fixer'
import rules from '../../../src/rules/en-UK/html'
const fixString = fix(rules)
describe('en-UK html rules', () => {
it('includes fraction rules', () => {
expect(rules.some((r) => {
return r.name.indexOf('html.common') >= 0
... | import expect from 'expect.js'
import {fix, check} from '../../../src/typography-fixer'
import rules from '../../../src/rules/en-UK/html'
const fixString = fix(rules)
const checkString = check(rules)
describe('en-UK html rules', () => {
it('includes fraction rules', () => {
expect(rules.some((r) => {
retu... |
Handle julian leap days separately. | from datetime import date, timedelta
class DateWithCalendar(object):
def __init__(self, calendar_class, date):
self.calendar = calendar_class
self.date = date
def convert_to(self, calendar):
return calendar.from_date(self.date)
def __eq__(self, other):
return self.calendar... | from datetime import date, timedelta
class DateWithCalendar(object):
def __init__(self, calendar_class, date):
self.calendar = calendar_class
self.date = date
def convert_to(self, calendar):
return calendar.from_date(self.date)
def __eq__(self, other):
return self.calendar... |
Add branch tag to saucelabs runs | var fs = require('fs');
var specs = JSON.parse(fs.readFileSync('tests/end2end/specs.json'));
var browser_capabilities = JSON.parse(process.env.SELENIUM_BROWSER_CAPABILITIES);
browser_capabilities['name'] = 'GlobaLeaks-E2E';
browser_capabilities['tunnel-identifier'] = process.env.TRAVIS_JOB_NUMBER;
browser_capabilities... | var fs = require('fs');
var specs = JSON.parse(fs.readFileSync('tests/end2end/specs.json'));
var browser_capabilities = JSON.parse(process.env.SELENIUM_BROWSER_CAPABILITIES);
browser_capabilities['name'] = 'GlobaLeaks-E2E';
browser_capabilities['tunnel-identifier'] = process.env.TRAVIS_JOB_NUMBER;
browser_capabilities... |
Replace all keys/tokens/passwords by env variables | from flask import Flask, request
from flask.ext.sqlalchemy import SQLAlchemy
from twilio import twiml
import subprocess
import os
from cmd import cmds
app = Flask(__name__)
#app.config.from_object('config')
db = SQLAlchemy(app)
ACCOUNT_SID = os.environ['ACCOUNT_SID']
AUTH_TOKEN = os.environ['AUTH_TOKEN']
APP_SID = o... | from flask import Flask, request
from flask.ext.sqlalchemy import SQLAlchemy
from twilio import twiml
import subprocess
import os
from cmd import cmds
app = Flask(__name__)
#app.config.from_object('config')
db = SQLAlchemy(app)
ACCOUNT_SID = "" #os.environ['ACCOUNT_SID']
AUTH_TOKEN = "" #os.environ['AUTH_TOKEN']
APP... |
Write test data as list unless otherwise needed | from simulocloud import PointCloud
import json
import numpy as np
_TEST_XYZ = [[10.0, 12.2, 14.4, 16.6, 18.8],
[11.1, 13.3, 15.5, 17.7, 19.9],
[0.1, 2.1, 4.5, 6.7, 8.9]]
_EXPECTED_POINTS = np.array([( 10. , 11.1, 0.1),
( 12.2, 13.3, 2.1),
... | from simulocloud import PointCloud
import json
import numpy as np
_TEST_XYZ = """[[10.0, 12.2, 14.4, 16.6, 18.8],
[11.1, 13.3, 15.5, 17.7, 19.9],
[0.1, 2.1, 4.5, 6.7, 8.9]]"""
_EXPECTED_POINTS = np.array([( 10. , 11.1, 0.1),
( 12.2, 13.3, 2.1),
... |
Correct CSS class for forum view | /*
Copyright 2018 Carmilla Mina Jankovic
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing,... | /*
Copyright 2018 Carmilla Mina Jankovic
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing,... |
Make tests forwards-compatible with new email API | from base64 import b64encode
import quopri
from daemail.message import DraftMessage
TEXT = 'àéîøü\n'
# Something in the email module implicitly adds a newline to the body text if
# one isn't present, so we need to include one here lest the base64 encodings
# not match up.
TEXT_ENC = TEXT.encode('utf-8')
... | import quopri
from daemail.message import DraftMessage
TEXT = 'àéîøü'
def test_quopri_text():
msg = DraftMessage()
msg.addtext(TEXT)
blob = msg.compile()
assert isinstance(blob, bytes)
assert TEXT.encode('utf-8') not in blob
assert quopri.encodestring(TEXT.encode('utf-8')) in blob
def test_... |
Add breadcrumbs to the frontend actions
Fixes #11 | <?php
/**
* Frontend {{ moduleName }} {{ action }} action
*/
class Frontend{{ moduleName|capitalize }}{{ action|capitalize }} extends FrontendBaseBlock
{
/**
* Execute the extra
*
* @return void
*/
public function execute()
{
parent::execute();
$this->loadTemplate();
... | <?php
/**
* Frontend {{ moduleName }} {{ action }} action
*/
class Frontend{{ moduleName|capitalize }}{{ action|capitalize }} extends FrontendBaseBlock
{
/**
* Execute the extra
*
* @return void
*/
public function execute()
{
parent::execute();
$this->loadTemplate();
... |
Make get_build print nice(r) JSON output
BUG=skia:
Review-Url: https://codereview.chromium.org/2183313008 | package main
import (
"bytes"
"encoding/json"
"flag"
"path"
"github.com/skia-dev/glog"
"go.skia.org/infra/go/auth"
"go.skia.org/infra/go/buildbucket"
"go.skia.org/infra/go/common"
)
var (
id = flag.String("id", "", "ID of the build to retrieve.")
workdir = flag.String("workdir", "workdir", "Working di... | package main
import (
"flag"
"path"
"github.com/skia-dev/glog"
"go.skia.org/infra/go/auth"
"go.skia.org/infra/go/buildbucket"
"go.skia.org/infra/go/common"
)
var (
id = flag.String("id", "", "ID of the build to retrieve.")
workdir = flag.String("workdir", "workdir", "Working directory to use.")
)
func ... |
Change of domain name to api.socketlabs.com | <?php
//prints each recipient email addresses associated for delivery failures
//
//replace the following constant **** values with your own
define("ACCOUNT_ID", "9999");
define("API_USER", "user");
define("API_PASSWORD", "3150ebe08f4c66a3ba3f");
//calls messagesFailed
$service_url = 'https://api.socketlabs.com/messa... | <?php
//prints each recipient email addresses associated for delivery failures
//
//replace the following constant **** values with your own
define("ACCOUNT_ID", "9999");
define("API_USER", "user");
define("API_PASSWORD", "3150ebe08f4c66a3ba3f");
//calls messagesFailed
$service_url = 'https://api.email-od.com/message... |
Use relative imports, Python 2.6 style | __author__ = 'Daniel Greenfeld, Chris Adams'
VERSION = (0, 5, 1)
def get_version():
version = '%s.%s' % (VERSION[0], VERSION[1])
if VERSION[2]:
version = '%s.%s' % (version, VERSION[2])
return version
__version__ = get_version()
def clean_html():
raise ImportError("clean_html requires html5l... | __author__ = 'Daniel Greenfeld, Chris Adams'
VERSION = (0, 5, 1)
def get_version():
version = '%s.%s' % (VERSION[0], VERSION[1])
if VERSION[2]:
version = '%s.%s' % (version, VERSION[2])
return version
__version__ = get_version()
def clean_html():
raise ImportError("clean_html requires html5l... |
Rename data prop to initial | /* @flow */
export const inMemory = (initial : Object, transition : Function) => {
let rootState = initial;
const read = () => rootState;
const write = (fn : Function) => {
const oldState = read();
const newState = fn(oldState);
transition(oldState, newState);
rootState = newState;
return rea... | /* @flow */
export const inMemory = (data : Object, transition : Function) => {
let rootState = data;
const read = () => rootState;
const write = (fn : Function) => {
const oldState = read();
const newState = fn(oldState);
transition(oldState, newState);
rootState = newState;
return read();
... |
Update login api changes for steemconnect-v2 | import Promise from 'bluebird';
import steemConnect from 'sc2-sdk';
import Cookie from 'js-cookie';
import request from 'superagent';
import { getFollowing } from '../user/userActions';
import { initPushpad } from './pushpadHelper';
Promise.promisifyAll(steemConnect);
Promise.promisifyAll(request.Request.prototype);
... | import Promise from 'bluebird';
import steemConnect from 'sc2-sdk';
import Cookie from 'js-cookie';
import request from 'superagent';
import { getFollowing } from '../user/userActions';
import { initPushpad } from './pushpadHelper';
Promise.promisifyAll(steemConnect);
Promise.promisifyAll(request.Request.prototype);
... |
Add disableDraggingForSnapshotTest to CreateGroups to workaround react-beautiful-dnd / snapshot renderer mismatch | import PropTypes from 'prop-types';
import React from 'react';
// A visual UI element for horizontal dots indicating "more"
// See https://material.io/icons/#ic_more_horiz
function MoreDots({color = '#ccc'}) {
return (
<svg className="MoreDots" fill={color} height="18" viewBox="0 0 24 24" width="18" xmlns="http:... | import PropTypes from 'prop-types';
import React from 'react';
// A visual UI element for horizontal dots indicating "more"
// See https://material.io/icons/#ic_more_horiz
function MoreDots({color = '#ccc'}) {
return (
<svg fill={color} height="18" viewBox="0 0 24 24" width="18" xmlns="http://www.w3.org/2000/svg... |
Fix Chrome exiting when running `ember-test` | module.exports = {
test_page: 'tests/index.html?hidepassed',
disable_watching: true,
launch_in_ci: [
'Chrome'
],
launch_in_dev: [
'Chrome'
],
browser_args: {
Chrome: {
ci: [
// --no-sandbox is needed when running Chrome inside a container
process.env.CI ? '--no-sandbox' :... | module.exports = {
test_page: 'tests/index.html?hidepassed',
disable_watching: true,
launch_in_ci: [
'Chrome'
],
launch_in_dev: [
'Chrome'
],
browser_args: {
Chrome: {
ci: [
// --no-sandbox is needed when running Chrome inside a container
process.env.CI ? '--no-sandbox' :... |
Add foursquare/swarm token and new cron job setting | module.exports = {
authToken: process.env.AUTH_TOKEN || 'secret',
env: process.env.NODE_ENV,
flickr: {
key: process.env.FLICKR_KEY || '123abc',
secret: process.env.FLICKR_SECRET || 'secret',
userId: process.env.FLICKR_USER_ID || 'user'
},
host: process.env.HOST || 'localhost',
github: {
apiU... | module.exports = {
authToken: process.env.AUTH_TOKEN || 'secret',
env: process.env.NODE_ENV,
flickr: {
key: process.env.FLICKR_KEY || '123abc',
secret: process.env.FLICKR_SECRET || 'secret',
userId: process.env.FLICKR_USER_ID || 'user'
},
host: process.env.HOST || 'localhost',
github: {
apiU... |
Refactor for using the new Response class | <?php
namespace PhpWatson\Sdk\Tests\Language\RetrieveAndRank;
use PhpWatson\Sdk\Tests\AbstractTestCase;
use PhpWatson\Sdk\Language\RetrieveAndRank\V1\RetrieveAndRankService;
class RetrieveAndRankV1Test extends AbstractTestCase
{
/**
* @var RetrieveAndRankService
*/
public $service;
public func... | <?php
namespace PhpWatson\Sdk\Tests\Language\RetrieveAndRank;
use PhpWatson\Sdk\Tests\AbstractTestCase;
use PhpWatson\Sdk\Language\RetrieveAndRank\V1\RetrieveAndRankService;
class RetrieveAndRankV1Test extends AbstractTestCase
{
/**
* @var RetrieveAndRankService
*/
public $service;
public func... |
Fix patterns for Django > 1.10
Pike requires Django 1.11 so fix the template pattern import which was
not compatible with that version. This fixes:
File
"/srv/www/openstack-dashboard/openstack_dashboard/dashboards/help/guides/\
urls.py", line 15, in <module>
from django.conf.urls import patterns, url
ImportError:... | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable... | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable... |
Use the TTF version of the font in Java.
Windows (XP anyway) seems not to support OpenType fonts. Yay! | /**
* Copyright 2010 The PlayN 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 applicable law or agreed ... | /**
* Copyright 2010 The PlayN 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 applicable law or agreed ... |
Add enabled() static function to check if site is enabled
Signed-off-by: Kirtan Gajjar <dda7ffca0822762c3fa90dba716be1cac57d994e@gmail.com> | <?php
namespace EE\Model;
use EE;
/**
* Site model class.
*/
class Site extends Base {
/**
* @var string Table of the model from where it will be stored/retrived
*/
protected static $table = 'sites';
/**
* @var string Primary/Unique key of the table
*/
protected static $primary_key = 'site_url';
/**... | <?php
namespace EE\Model;
use EE;
/**
* Site model class.
*/
class Site extends Base {
/**
* @var string Table of the model from where it will be stored/retrived
*/
protected static $table = 'sites';
/**
* @var string Primary/Unique key of the table
*/
protected static $primary_key = 'site_url';
/**... |
Add default test db name to travis local.py | # -*- coding: utf-8 -*-
'''Example settings/local.py file.
These settings override what's in website/settings/defaults.py
NOTE: local.py will not be added to source control.
'''
from . import defaults
DB_PORT = 27017
DEV_MODE = True
DEBUG_MODE = True # Sets app to debug mode, turns off template caching, etc.
SEAR... | # -*- coding: utf-8 -*-
'''Example settings/local.py file.
These settings override what's in website/settings/defaults.py
NOTE: local.py will not be added to source control.
'''
from . import defaults
DB_PORT = 27017
DEV_MODE = True
DEBUG_MODE = True # Sets app to debug mode, turns off template caching, etc.
SEAR... |
Fix positionFromTop when scrolling window after window resize | /**
* Gets the height of the element, accounting for API differences between
* `window` and other DOM elements.
*/
export function getHeight (element) {
return element === window
? window.innerHeight
: element.getBoundingClientRect().height
}
/**
* Gets the vertical position of an element within its scro... | /**
* Gets the height of the element, accounting for API differences between
* `window` and other DOM elements.
*/
export function getHeight (element) {
return element === window
? window.innerHeight
: element.getBoundingClientRect().height
}
/**
* Gets the vertical position of an element within its scro... |
Edit path and external evaluation | from pygraphc.misc.IPLoM import *
from pygraphc.evaluation.ExternalEvaluation import *
# set input path
dataset_path = '/home/hudan/Git/labeled-authlog/dataset/Hofstede2014/dataset1_perday/'
groundtruth_file = dataset_path + 'Dec 1.log.labeled'
analyzed_file = 'Dec 1.log'
OutputPath = '/home/hudan/Git/pygraphc/result/... | from pygraphc.misc.IPLoM import *
from pygraphc.evaluation.ExternalEvaluation import *
# set input path
ip_address = '161.166.232.17'
standard_path = '/home/hudan/Git/labeled-authlog/dataset/Hofstede2014/dataset1/' + ip_address
standard_file = standard_path + 'auth.log.anon.labeled'
analyzed_file = 'auth.log.anon'
pre... |
Allow normal traces in dev | <?php
namespace Outlandish\Wpackagist\EventListener;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\HttpKernel\Event\ExceptionEvent;
use Symfony\Component\HttpKernel\Exception\HttpExceptionInterface;
class ExceptionListener
{
public function onKernelException(ExceptionEvent $event)
{
... | <?php
namespace Outlandish\Wpackagist\EventListener;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\HttpKernel\Event\ExceptionEvent;
use Symfony\Component\HttpKernel\Exception\HttpExceptionInterface;
class ExceptionListener
{
public function onKernelException(ExceptionEvent $event)
{
... |
Fix drawer width double / int issues | package com.reactnativenavigation.params.parsers;
import android.os.Bundle;
import android.support.annotation.Nullable;
import com.reactnativenavigation.params.NavigationParams;
import com.reactnativenavigation.params.SideMenuParams;
import com.reactnativenavigation.views.SideMenu.Side;
class SideMenuParamsParser ex... | package com.reactnativenavigation.params.parsers;
import android.os.Bundle;
import android.support.annotation.Nullable;
import com.reactnativenavigation.params.NavigationParams;
import com.reactnativenavigation.params.SideMenuParams;
import com.reactnativenavigation.views.SideMenu.Side;
class SideMenuParamsParser ex... |
Use react and react-dom as global packages (reduce plugins packages size) | import React from 'react'
import ReactDOM from 'react-dom'
import { Provider } from 'react-redux'
import store from './store'
import Search from './containers/Search'
import './css/global.css'
import { initializePlugins } from 'lib/rpc/functions'
import { on } from 'lib/rpc/events'
import { updateTerm } from './actions... | import React from 'react'
import { render } from 'react-dom'
import { Provider } from 'react-redux'
import store from './store'
import Search from './containers/Search'
import './css/global.css'
import { initializePlugins } from 'lib/rpc/functions'
import { on } from 'lib/rpc/events'
import { updateTerm } from './actio... |
Change to JS event to click buttons | 'use strict';
/**
* Class to fetch the feed list and draw the aside
*/
var Feeds = new Class({
feeds: [],
initialize: function () {
this.loadFeeds();
},
/** Load feeds from API and trigger the drawing function */
loadFeeds: function () {
new Request.JSON({
method: 'g... | 'use strict';
/**
* Class to fetch the feed list and draw the aside
*/
var Feeds = new Class({
feeds: [],
initialize: function () {
this.loadFeeds();
},
/** Load feeds from API and trigger the drawing function */
loadFeeds: function () {
new Request.JSON({
method: 'g... |
Remove bug that was generating invalid XML | 'use strict';
var fs = require('fs');
function reset() {
exports.out = [];
exports.xmlEmitter = null;
exports.opts = {};
} reset();
/**
* Load a formatter
* @param {String} formatterPath
* @return
*/
function loadFormatter(formatterPath) {
return require('./lib/' + formatterPath + '_emitter');
}... | 'use strict';
var fs = require('fs');
function reset() {
exports.out = [];
exports.xmlEmitter = null;
exports.opts = {};
} reset();
/**
* Load a formatter
* @param {String} formatterPath
* @return
*/
function loadFormatter(formatterPath) {
return require('./lib/' + formatterPath + '_emitter');
}... |
Improve log message when no CSRF token found
Closes gh-10436 | /*
* Copyright 2002-2021 the original author or 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
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by a... | /*
* Copyright 2002-2013 the original author or 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
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by a... |
Add auth details if session_id is not provided in the request | <?php
namespace Jwpage\Clickatell;
use Guzzle\Common\Collection;
use Guzzle\Service\Client;
use Guzzle\Service\Description\ServiceDescription;
class ClickatellClient extends Client
{
public static function factory($config = array())
{
$default = array(
'base_url' => 'http://api.clickatell... | <?php
namespace Jwpage\Clickatell;
use Guzzle\Common\Collection;
use Guzzle\Service\Client;
use Guzzle\Service\Description\ServiceDescription;
class ClickatellClient extends Client
{
public static function factory($config = array())
{
$default = array(
'base_url' => 'http://api.clickatell... |
Fix task_api_get_results failing if task had no results, while this is actually fine. | package org.metaborg.runtime.task.primitives;
import static org.metaborg.runtime.task.util.ListBuilder.makeList;
import org.metaborg.runtime.task.Task;
import org.metaborg.runtime.task.TaskEngine;
import org.metaborg.runtime.task.TaskManager;
import org.spoofax.interpreter.core.IContext;
import org.spoofax.interprete... | package org.metaborg.runtime.task.primitives;
import static org.metaborg.runtime.task.util.ListBuilder.makeList;
import org.metaborg.runtime.task.Task;
import org.metaborg.runtime.task.TaskEngine;
import org.metaborg.runtime.task.TaskManager;
import org.spoofax.interpreter.core.IContext;
import org.spoofax.interprete... |
Add maxHttpConnections for Influxdb 0.9.0 code path
Change-Id: Ief4759610c3b8570ed58170265e069458d731540 | /*
* Copyright (c) 2014 Hewlett-Packard Development Company, L.P.
*
* 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... | /*
* Copyright (c) 2014 Hewlett-Packard Development Company, L.P.
*
* 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... |
Revert "Simplify the use of `phutil_get_library_root`"
Summary:
This reverts commit 67a17d0efb025665237d0d174d55d1887f9a6064.
This doesn't actually work because the call to `phutil_get_current_library_name()` always occurs within `libphutil`.
Test Plan: N/A
Reviewers: epriestley, #blessed_reviewers
Reviewed By: ep... | <?php
function phutil_get_library_root($library) {
$bootloader = PhutilBootloader::getInstance();
return $bootloader->getLibraryRoot($library);
}
function phutil_get_library_root_for_path($path) {
foreach (Filesystem::walkToRoot($path) as $dir) {
if (Filesystem::pathExists($dir.'/__phutil_library_init__.php... | <?php
function phutil_get_library_root($library = null) {
if (!$library) {
$library = phutil_get_current_library_name();
}
$bootloader = PhutilBootloader::getInstance();
return $bootloader->getLibraryRoot($library);
}
function phutil_get_library_root_for_path($path) {
foreach (Filesystem::walkToRoot($pa... |
Test against jQuery slim 3.x | QUnit.config.urlConfig.push({
id: "jquery",
label: "jQuery version",
value: ["3.2.1", "3.2.1.slim", "3.1.1", "3.1.1.slim", "3.0.0", "3.0.0.slim", "2.2.4", "2.1.4", "2.0.3", "1.12.4", "1.11.3"],
tooltip: "What jQuery Core version to test against"
});
/* Hijacks normal form submit; lets it submit to an iframe to... | QUnit.config.urlConfig.push({
id: "jquery",
label: "jQuery version",
value: ["3.2.1", "3.2.0", "3.1.1", "3.0.0", "2.2.4", "2.1.4", "2.0.3", "1.12.4", "1.11.3"],
tooltip: "What jQuery Core version to test against"
});
/* Hijacks normal form submit; lets it submit to an iframe to prevent
* navigating away from ... |
Handle opening files directly from native OS
Relying on `open-file` event. Couldn't be any simpler.
You'll need a built copy of nteract to use this (with our new dist hooks). | import app from 'app';
import {
launchFilename,
launchNewNotebook,
} from './launch';
import { Menu } from 'electron';
import { defaultMenu, loadFullMenu } from './menu';
import { resolve } from 'path';
const program = require('commander');
const version = require('../../package.json').version;
program
.versi... | import app from 'app';
import {
launchFilename,
launchNewNotebook,
} from './launch';
import { Menu } from 'electron';
import { defaultMenu, loadFullMenu } from './menu';
import { resolve } from 'path';
const program = require('commander');
const version = require('../../package.json').version;
program
.versi... |
Update tests to mock generic helper function | jest.mock('../../../models/meeting');
const { toggleRegistration } = require('../meeting');
const { getActiveGenfors, updateGenfors } = require('../../../models/meeting');
const { generateSocket, generateGenfors } = require('../../../utils/generateTestData');
describe('toggleRegistration', () => {
beforeEach(() => {... | jest.mock('../../../models/meeting');
const { toggleRegistration } = require('../meeting');
const { getActiveGenfors, toggleRegistrationStatus } = require('../../../models/meeting');
const { generateSocket, generateGenfors } = require('../../../utils/generateTestData');
describe('toggleRegistration', () => {
beforeE... |
Improve naming of a variable | var Promise = require('es6-promise').Promise;
var engine = require('static-engine');
module.exports = function (name, plugins) {
return function (pages) {
var promises = pages.map(function (page) {
return new Promise(function(resolve, reject){
var current_pages = page[name] ... | var Promise = require('es6-promise').Promise;
var engine = require('static-engine');
module.exports = function (name, plugins) {
return function (pages) {
var promises = pages.map(function (page) {
return new Promise(function(resolve, reject){
var current_pages = page[name] ... |
Append fields before files in FormData of request | import registerListeners from './register-listeners';
export default ({ request, files, instance, progress }) =>
new Promise(resolve => {
const xhr = new XMLHttpRequest();
instance(xhr);
registerListeners({ xhr, resolve, progress });
xhr.open(request.method || 'POST', request.url);
xhr.withCred... | import registerListeners from './register-listeners';
export default ({ request, files, instance, progress }) =>
new Promise(resolve => {
const xhr = new XMLHttpRequest();
instance(xhr);
registerListeners({ xhr, resolve, progress });
xhr.open(request.method || 'POST', request.url);
xhr.withCred... |
Fix issue with not being able to paint on max edge | import React from 'react';
import ReactDOM from 'react-dom';
import { connect } from 'react-redux';
import immutableToJs from 'utils/immutableToJs';
import { toPickTile } from 'state/actions/pickTile';
import { toPlaceTile } from 'state/actions/placeTile';
import grounds from 'state/models/grounds';
import Editor ... | import React from 'react';
import ReactDOM from 'react-dom';
import { connect } from 'react-redux';
import immutableToJs from 'utils/immutableToJs';
import { toPickTile } from 'state/actions/pickTile';
import { toPlaceTile } from 'state/actions/placeTile';
import grounds from 'state/models/grounds';
import Editor ... |
Check new-style, not old-style permission names in settings
Should finally fix UIU-130. | import _ from 'lodash';
import React from 'react';
import Settings from '@folio/stripes-components/lib/Settings';
import PermissionSets from './permissions/PermissionSets';
import PatronGroupsSettings from './PatronGroupsSettings';
import AddressTypesSettings from './AddressTypesSettings';
const pages = [
{
rou... | import _ from 'lodash';
import React from 'react';
import Settings from '@folio/stripes-components/lib/Settings';
import PermissionSets from './permissions/PermissionSets';
import PatronGroupsSettings from './PatronGroupsSettings';
import AddressTypesSettings from './AddressTypesSettings';
const pages = [
{
rou... |
Stop infinite scroll when calling init. Use 'this' if initializing inside a controller already | function InfiniteScroll (cursor) {
var self = this;
// observeChanges will fire for initial set, so count can start at 0
self.count = 0;
var cursor = cursor.observeChanges({
added: function () {
self.count++;
},
removed: function () {
self.count--;
}
});
this.stop = function ()... | function InfiniteScroll (cursor) {
var self = this;
// observeChanges will fire for initial set, so count can start at 0
self.count = 0;
var cursor = cursor.observeChanges({
added: function () {
self.count++;
},
removed: function () {
self.count--;
}
});
this.stop = function ()... |
Update to import for for Django 1.9 compatibility. | import datetime
from django.conf import settings
from django.contrib.sites.shortcuts import get_current_site
from django.utils.functional import SimpleLazyObject
from django.utils.timezone import utc
from downtime.models import Period
from .models import Banner
def template_settings(request):
'''Template context ... | import datetime
from django.conf import settings
from django.contrib.sites.models import get_current_site
from django.utils.functional import SimpleLazyObject
from django.utils.timezone import utc
from downtime.models import Period
from .models import Banner
def template_settings(request):
'''Template context pro... |
Improve checkbox filter performance by checking key instead of iterating | export function filterByText(data, textFilter) {
if (textFilter === '') {
return data;
}
// case-insensitive
textFilter = textFilter.toLowerCase();
const exactMatches = [];
const substringMatches = [];
data.forEach(i => {
const name = i.name.toLowerCase();
if (name.split(' ').includes(textFil... | export function filterByText(data, textFilter) {
if (textFilter === '') {
return data;
}
// case-insensitive
textFilter = textFilter.toLowerCase();
const exactMatches = [];
const substringMatches = [];
data.forEach(i => {
const name = i.name.toLowerCase();
if (name.split(' ').includes(textFil... |
Use correct Backdrop options for user satisfaction.
Sort by "_timestamp: ascending" and provide a limit of 0. This gives
us all available data, and works against live Backdrop data on preview.
It would be better to sort by "_timestamp:descending" and use a limit
of 2, since at the moment we only require 2 data points... | define([
'extensions/controllers/module',
'common/views/visualisations/user-satisfaction',
'common/collections/list'
],
function (ModuleController, UserSatisfactionView, ListCollection) {
var UserSatisfactionModule = ModuleController.extend({
className: function () {
var classes = this.model.get('clas... | define([
'extensions/controllers/module',
'common/views/visualisations/user-satisfaction',
'common/collections/list'
],
function (ModuleController, UserSatisfactionView, ListCollection) {
var UserSatisfactionModule = ModuleController.extend({
className: function () {
var classes = this.model.get('clas... |
Drop use of Phramework settngs | <?php
/**
* Copyright 2015 Xenofon Spafaridis
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law... | <?php
/**
* Copyright 2015 Xenofon Spafaridis
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law... |
Remove reference to old demo. | // Demo components.
import "./src/CalendarDayMoonPhase.js";
import "./src/CarouselComboBox.js";
import "./src/CountryListBox.js";
import "./src/CustomCarousel2.js";
import "./src/CustomDrawer.js";
import "./src/LabeledColorSwatch.js";
import "./src/LocaleSelector.js";
import "./src/MessageListBox.js";
import "./src/Mes... | // Demo components.
import "./src/CalendarDayMoonPhase.js";
import "./src/CarouselComboBox.js";
import "./src/CountryListBox.js";
import "./src/CustomCarousel2.js";
import "./src/CustomDrawer.js";
import "./src/FocusVisibleTest.js";
import "./src/LabeledColorSwatch.js";
import "./src/LocaleSelector.js";
import "./src/M... |
Replace browser router with hash router to avoid hadling routing on server side | import React from 'react'
import {render} from 'react-dom'
import {Provider} from 'react-redux'
import Home from './components/home/Home'
import {
HashRouter as Router,
Route,
Link
} from 'react-router-dom'
import ArticleForm from './components/article/ArticleForm'
import configureStore from './redux/common/con... | import React from 'react'
import {render} from 'react-dom'
import {Provider} from 'react-redux'
import Home from './components/home/Home'
import {
BrowserRouter as Router,
Route,
Link
} from 'react-router-dom'
import ArticleForm from './components/article/ArticleForm'
import configureStore from './redux/common/... |
Send email to hippo when user acknowledge his/her AWS. | <?php
include_once( "header.php" );
include_once( "methods.php" );
include_once( 'tohtml.php' );
include_once( "check_access_permissions.php" );
mustHaveAnyOfTheseRoles( Array( 'USER' ) );
echo userHTML( );
$user = $_SESSION[ 'user' ];
if( $_POST )
{
$data = array( 'speaker' => $user );
$data = array_merge( ... | <?php
include_once( "header.php" );
include_once( "methods.php" );
include_once( 'tohtml.php' );
include_once( "check_access_permissions.php" );
mustHaveAnyOfTheseRoles( Array( 'USER' ) );
echo userHTML( );
$user = $_SESSION[ 'user' ];
if( $_POST )
{
$data = array( 'speaker' => $user );
$data = array_merge( ... |
Remove not required logging from multiselect | function cachedScript(url, options) {
// Allow user to set any option except for dataType, cache, and url
options = $.extend(options || {}, {
dataType: "script",
cache: true,
url: url
});
// Use $.ajax() since it is more flexible than $.getScript
// Return the jqXHR object so we can chain callb... | function cachedScript(url, options) {
// Allow user to set any option except for dataType, cache, and url
options = $.extend(options || {}, {
dataType: "script",
cache: true,
url: url
});
// Use $.ajax() since it is more flexible than $.getScript
// Return the jqXHR object so we can chain callb... |
Fix port for Sip Heartbeat.
git-svn-id: 41af2ad439860065ec011fd0c01969868ab46825@14954 ab1d8caa-1f67-47f1-9e81-24633a41865c | /*
* Copyright (C) 2008 Pingtel Corp., certain elements licensed under a Contributor Agreement.
* Contributors retain copyright to elements licensed under a Contributor Agreement.
* Licensed to the User under the LGPL license.
*
*/
package org.sipfoundry.sipxbridge;
import gov.nist.javax.sip.ListeningPointExt... | /*
* Copyright (C) 2008 Pingtel Corp., certain elements licensed under a Contributor Agreement.
* Contributors retain copyright to elements licensed under a Contributor Agreement.
* Licensed to the User under the LGPL license.
*
*/
package org.sipfoundry.sipxbridge;
import gov.nist.javax.sip.ListeningPointExt... |
Clarify the rational for the ToLower(key) call | package otgrpc
import (
"strings"
opentracing "github.com/opentracing/opentracing-go"
"github.com/opentracing/opentracing-go/ext"
"google.golang.org/grpc/metadata"
)
var (
// Morally a const:
gRPCComponentTag = opentracing.Tag{string(ext.Component), "gRPC"}
)
// metadataReaderWriter satisfies both the opentra... | package otgrpc
import (
"strings"
opentracing "github.com/opentracing/opentracing-go"
"github.com/opentracing/opentracing-go/ext"
"google.golang.org/grpc/metadata"
)
var (
// Morally a const:
gRPCComponentTag = opentracing.Tag{string(ext.Component), "gRPC"}
)
// metadataReaderWriter satisfies both the opentra... |
Make it possible to manually override version numbers | #!/usr/bin/python
import time
from datetime import date
from setuptools import setup
from pagekite.common import APPVER
import os
try:
# This borks sdist.
os.remove('.SELF')
except:
pass
setup(
name="pagekite",
version=os.getenv(
'PAGEKITE_VERSION',
APPVER.replace('github', 'dev%d' % (12... | #!/usr/bin/python
import time
from datetime import date
from setuptools import setup
from pagekite.common import APPVER
import os
try:
# This borks sdist.
os.remove('.SELF')
except:
pass
setup(
name="pagekite",
version=APPVER.replace('github', 'dev%d' % (120*int(time.time()/120))),
license="AGPLv3+"... |
Add test for JSON parse method | /**
* IMDBHandlerTest.java
*
* @author Johan Brook
* @copyright (c) 2012 Johan Brook
* @license MIT
*/
package se.chalmers.watchmetest.net;
import org.json.JSONArray;
import org.json.JSONObject;
import se.chalmers.watchme.net.IMDBHandler;
import se.chalmers.watchme.utils.MovieHelper;
import junit.framework.TestCase;... | /**
* IMDBHandlerTest.java
*
* @author Johan Brook
* @copyright (c) 2012 Johan Brook
* @license MIT
*/
package se.chalmers.watchmetest.net;
import org.json.JSONArray;
import org.json.JSONObject;
import se.chalmers.watchme.net.IMDBHandler;
import junit.framework.TestCase;
public class IMDBHandlerTest extends TestCas... |
Modify Fuse require statement to hopefully fit with exporting logic | require('cloud/app.js');
var Fuse = require('cloud/fuse.min.js');
/*
* Provides Cloud Functions for Rice Maps.
*/
Parse.Cloud.define("placesSearch", function(request, response) {
console.log("Search Query: " + request.params.query);
// Define Parse cloud query that retrieves all Place objects and matches them t... | require('cloud/app.js');
require('cloud/fuse.min.js');
/*
* Provides Cloud Functions for Rice Maps.
*/
Parse.Cloud.define("placesSearch", function(request, response) {
console.log("Search Query: " + request.params.query);
// Define Parse cloud query that retrieves all Place objects and matches them to a search
... |
Insert filename only, not path | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
from downstream_node.config import config
from downstream_node.models import Challenges, Files
from heartbeat import Heartbeat
from downstream_node.startup import db
__all__ = ['create_token', 'delete_token', 'add_file', 'remove_file',
'gen_challenge... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from downstream_node.config import config
from downstream_node.models import Challenges, Files
from heartbeat import Heartbeat
from downstream_node.startup import db
__all__ = ['create_token', 'delete_token', 'add_file', 'remove_file',
'gen_challenges', 'updat... |
Add tracking for lessons 1, 2, 3 | # See also examples/example_track/track_meta.py for a longer, commented example
track = dict(
author_username='ryanholbrook',
course_name='Computer Vision',
course_url='https://www.kaggle.com/ryanholbrook/computer-vision'
)
lessons = [
{'topic': topic_name} for topic_name in
[
'The Convolut... | # See also examples/example_track/track_meta.py for a longer, commented example
track = dict(
author_username='ryanholbrook',
course_name='computer_vision',
course_url='https://www.kaggle.com/ryanholbrook/computer-vision'
)
lessons = [
dict(
# By convention, this should be a lowercase n... |
Change string singlequotes to doublequotes | var hexcolor = document.getElementById('hexcolor');
var clock = document.getElementById('clock');
var hexColor = document.getElementById('hex-color');
function colorClock() {
var time = new Date();
var day = time.getDay();
var hours = time.getHours().toString();
var minutes = time.getMinutes().toString();
va... | var hexcolor = document.getElementById('hexcolor');
var clock = document.getElementById('clock');
var hexColor = document.getElementById('hex-color');
function colorClock() {
var time = new Date();
var day = time.getDay();
var hours = time.getHours().toString();
var minutes = time.getMinutes().toString();
va... |
Add warning for missing Ora i18n driver independent of DB version | package org.utplsql.cli;
import org.utplsql.api.DBHelper;
import org.utplsql.api.Version;
import org.utplsql.api.compatibility.OptionalFeatures;
import java.sql.Connection;
import java.sql.SQLException;
/** Helper class to check several circumstances with RunCommand. Might need refactoring.
*
* @author pesse
*/
c... | package org.utplsql.cli;
import org.utplsql.api.DBHelper;
import org.utplsql.api.Version;
import org.utplsql.api.compatibility.OptionalFeatures;
import java.sql.Connection;
import java.sql.SQLException;
/** Helper class to check several circumstances with RunCommand. Might need refactoring.
*
* @author pesse
*/
c... |
WebsocketConnection: Fix saga (call -> takeEvery) | import { put, takeEvery, call } from 'redux-saga/effects';
import { SEND_REQUEST } from './constants';
import { sendRequestSuccess, sendRequestFail } from './actions'
import { getWebsocket } from './websocket'
function* sendRequest(action) {
let websocket = getWebsocket()
const request = action.request
const r... | import { put, takeEvery, call } from 'redux-saga/effects';
import { SEND_REQUEST } from './constants';
import { sendRequestSuccess, sendRequestFail } from './actions'
import { getWebsocket } from './websocket'
function* sendRequest(action) {
let websocket = getWebsocket()
const request = action.request
const r... |
Remove the PHP 5.5 `::class` usage | <?php
namespace spec\Dock\Docker\Dns;
use Dock\Docker\Dns\ContainerAddressResolver;
use PhpSpec\ObjectBehavior;
use Prophecy\Argument;
class DnsDockResolverSpec extends ObjectBehavior
{
function it_is_a_container_address_resolve()
{
$this->shouldImplement('Dock\Docker\Dns\ContainerAddressResolver');
... | <?php
namespace spec\Dock\Docker\Dns;
use Dock\Docker\Dns\ContainerAddressResolver;
use PhpSpec\ObjectBehavior;
use Prophecy\Argument;
class DnsDockResolverSpec extends ObjectBehavior
{
function it_is_a_container_address_resolve()
{
$this->shouldImplement(ContainerAddressResolver::class);
}
... |
Add some new spell result types | package com.elmakers.mine.bukkit.api.spell;
/**
* Every Spell will return a SpellResult when cast. This result
* will determine the messaging and effects used, as well as whether
* or not the Spell cast consumes its CastingCost costs.
*
* A Spell that fails to cast will not consume costs or register for cooldo... | package com.elmakers.mine.bukkit.api.spell;
/**
* Every Spell will return a SpellResult when cast. This result
* will determine the messaging and effects used, as well as whether
* or not the Spell cast consumes its CastingCost costs.
*
* A Spell that fails to cast will not consume costs or register for cooldo... |
Add installation of repository dependencies for tools | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from bioblend import galaxy
from bioblend import toolshed
if __name__ == '__main__':
gi_url = "http://172.21.23.6:8080/"
ts_url = "http://172.21.23.6:9009/"
name = "qiime"
owner = "iuc"
tool_panel_section_id = "qiime_rRNA_taxonomic_assignation"
g... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from bioblend import galaxy
from bioblend import toolshed
if __name__ == '__main__':
gi_url = "http://172.21.23.6:8080/"
ts_url = "http://172.21.23.6:9009/"
name = "qiime"
owner = "iuc"
tool_panel_section_id = "qiime_rRNA_taxonomic_assignation"
g... |
Add option to display the VWP version | const Path = require('path')
const action = process.argv[2]
var args = process.argv.slice(3)
var env = process.env.NODE_ENV
var webpack
switch (action) {
case 'build':
webpack = 'webpack'
env = env || 'production'
break
case 'dist':
webpack = 'webpack'
env = env || 'production'
args.push(... | const Path = require('path')
const action = process.argv[2]
var args = process.argv.slice(3)
var env = process.env.NODE_ENV
var webpack
switch (action) {
case 'build':
webpack = 'webpack'
env = env || 'production'
break
case 'dist':
webpack = 'webpack'
env = env || 'production'
args.push(... |
Update Flask version to 1.0.2 | from setuptools import setup, find_packages
requirements = [
'Flask==1.0.2',
]
setup(
name='flask-pundit',
version='1.1.0',
license='MIT',
url='https://github.com/anurag90x/flask-pundit',
author='Anurag Chaudhury',
author_email='anuragchaudhury@gmail.com',
description='Simple library ... | from setuptools import setup, find_packages
requirements = [
'Flask==0.10.1',
]
setup(
name='flask-pundit',
version='1.1.0',
license='MIT',
url='https://github.com/anurag90x/flask-pundit',
author='Anurag Chaudhury',
author_email='anuragchaudhury@gmail.com',
description='Simple library... |
Fix error when profile is not present | 'use strict';
angular.module('mean.icu.ui.profile', [])
.controller('ProfileController', function($scope, $state, me, UsersService) {
$scope.me = me;
if (!$scope.me.profile) {
$scope.me.profile = {};
}
$scope.avatar = $scope.me.profile.avatar || 'http://placehold.it/250x250';
$scope.hash ... | 'use strict';
angular.module('mean.icu.ui.profile', [])
.controller('ProfileController', function($scope, $state, me, UsersService) {
$scope.me = me;
$scope.avatar = $scope.me.profile.avatar || 'http://placehold.it/250x250';
$scope.hash = new Date().getTime();
$scope.uploadAvatar = function(files) {
... |
Improve error handling by returning the `statusCode` and including the failed URL in the rejected Error | import { get, defaults, compact } from 'lodash';
import request from 'request';
import config from '../../config';
export default (url, options = {}) => {
return new Promise((resolve, reject) => {
const opts = defaults(options, {
method: 'GET',
timeout: config.REQUEST_TIMEOUT_MS,
});
request... | import { defaults } from 'lodash';
import request from 'request';
import config from '../../config';
export default (url, options = {}) => {
return new Promise((resolve, reject) => {
const opts = defaults(options, {
method: 'GET',
timeout: config.REQUEST_TIMEOUT_MS,
});
request(url, opts, (e... |
Fix error where DATABASE_URL does not exist in environment | var Sequelize = require('sequelize'),
pg = require('pg').native;
module.exports = function(opts) {
if (!opts.DATABASE_URL) {
throw(new Error('Must specify DATABASE_URL in config.json or as environment variable'));
}
// TODO Support other databases
var match = opts.DATABASE_URL.match(/postgres:\/\/([^:]... | var Sequelize = require('sequelize'),
pg = require('pg').native;
module.exports = function(opts) {
if (!opts.DATABASE_URL) {
throw(new Error('Must specify DATABASE_URL in config.json or as environment variable'));
}
// TODO Support other databases
var match = process.env.DATABASE_URL.match(/postgres:\/... |
Adjust the helperfunction for a lazy map component to use the correct xtype. | function getMap(){
var map = new OpenLayers.Map({
layers: [
new OpenLayers.Layer.WMS(
"OpenLayers WMS",
"http://vmap0.tiles.osgeo.org/wms/vmap0",
{
layers: "basic"
}
)
]
});
return m... | function getMap(){
var map = new OpenLayers.Map({
layers: [
new OpenLayers.Layer.WMS(
"OpenLayers WMS",
"http://vmap0.tiles.osgeo.org/wms/vmap0",
{
layers: "basic"
}
)
]
});
return m... |
Fix crashing bug: Compare Libya | import { createSelector } from 'reselect';
import isEmpty from 'lodash/isEmpty';
import {
parseSelectedLocations,
getSelectedLocationsFilter,
addSelectedNameToLocations
} from 'selectors/compare';
// values from search
const getSelectedLocations = state => state.selectedLocations || null;
const getContentOvervie... | import { createSelector } from 'reselect';
import isEmpty from 'lodash/isEmpty';
import {
parseSelectedLocations,
getSelectedLocationsFilter,
addSelectedNameToLocations
} from 'selectors/compare';
// values from search
const getSelectedLocations = state => state.selectedLocations || null;
const getContentOvervie... |
Test over export and import functions added. | "use strict";
var PLS = require("../src/pls");
var Matrix = require("ml-matrix");
describe("PLS-DA algorithm", function () {
var training = [[0.1, 0.02], [0.25, 1.01] ,[0.95, 0.01], [1.01, 0.96]];
var predicted = [[1, 0], [1, 0], [1, 0], [0, 1]];
var pls = new PLS(training, predicted);
it("test with ... | "use strict";
var PLS = require("../src/pls");
var Matrix = require("ml-matrix");
describe("PLS-DA algorithm", function () {
it("test with a pseudo-AND operator", function () {
var training = [[0.1, 0.02], [0.25, 1.01] ,[0.95, 0.01], [1.01, 0.96]];
var predicted = [[1, 0], [1, 0], [1, 0], [0, 1]];... |
Use find_packages to discover packages. | #!/usr/bin/env python
# coding=utf8
import os
import sys
from setuptools import setup, find_packages
if sys.version_info < (2, 7):
tests_require = ['unittest2', 'mock']
test_suite = 'unittest2.collector'
else:
tests_require = ['mock']
test_suite = 'unittest.collector'
def read(fname):
return op... | #!/usr/bin/env python
# coding=utf8
import os
import sys
from setuptools import setup
if sys.version_info < (2, 7):
tests_require = ['unittest2', 'mock']
test_suite = 'unittest2.collector'
else:
tests_require = ['mock']
test_suite = 'unittest.collector'
def read(fname):
return open(os.path.join... |
Allow AWS client against non-https servers
I want to test my application against a "fake" local S3. It is not running HTTPS. This change allows me to specify a non-HTTPS connection by passing { protocol: 'http://' } to the client creation as an option. | /*
* client.js: Storage client for AWS S3
*
* (C) 2011 Nodejitsu Inc.
*
*/
var utile = require('utile'),
urlJoin = require('url-join'),
xml2js = require('xml2js'),
auth = require('../../../common/auth'),
amazon = require('../../client');
var Client = exports.Client = function (options) {
this.s... | /*
* client.js: Storage client for AWS S3
*
* (C) 2011 Nodejitsu Inc.
*
*/
var utile = require('utile'),
urlJoin = require('url-join'),
xml2js = require('xml2js'),
auth = require('../../../common/auth'),
amazon = require('../../client');
var Client = exports.Client = function (options) {
this.s... |
Fix audit for cash flow | package ee.tuleva.onboarding.audit;
import ee.tuleva.onboarding.auth.principal.Person;
import lombok.RequiredArgsConstructor;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Before;
import org.springframework.stereotype.Component;
@Aspect
@Component
@RequiredArgsConstructor
public class ... | package ee.tuleva.onboarding.audit;
import ee.tuleva.onboarding.auth.principal.Person;
import lombok.RequiredArgsConstructor;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Before;
import org.springframework.stereotype.Component;
@Aspect
@Component
@RequiredArgsConstructor
public class ... |
Fix typo in command description | <?php
namespace Command\Zray;
use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Input\ArrayInput;
use Symfony\Component\Console\Output\OutputInterface;
use Symfony\Component\Console\Output\NullOutput;
class Enable extends Zray
{
protec... | <?php
namespace Command\Zray;
use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Input\ArrayInput;
use Symfony\Component\Console\Output\OutputInterface;
use Symfony\Component\Console\Output\NullOutput;
class Enable extends Zray
{
protec... |
Make sure template paths are resolved | var nodePath = require('path');
var fs = require('fs');
var Module = require('module').Module;
var raptorTemplatesCompiler = require('../../compiler');
var cwd = process.cwd();
function loadSource(templatePath, compiledSrc) {
var templateModulePath = templatePath + '.js';
var templateModule = new Module(templ... | var nodePath = require('path');
var fs = require('fs');
var Module = require('module').Module;
var raptorTemplatesCompiler = require('../../compiler');
function loadSource(templatePath, compiledSrc) {
var templateModulePath = templatePath + '.js';
var templateModule = new Module(templateModulePath, module);
... |
Remove pointer problems by making shallow copy before parsing schema | import {fields} from './elements/index';
/**
* Parse an object into a {@link Field}.
* @param {String} id The ID for the field.
* @param {Object} obj The parameters for the field.
* @param {Field} [parent] The parent of the new field.
* @return {Field} The field created from the given dat... | import {fields} from './elements/index';
/**
* Parse an object into a {@link Field}.
* @param {String} id The ID for the field.
* @param {Object} obj The parameters for the field.
* @param {Field} [parent] The parent of the new field.
* @return {Field} The field created from the given dat... |
[test] Add `deviceName` field for Android | 'use strict';
const sauceBrowsers = require('sauce-browsers');
const run = require('sauce-test');
const path = require('path');
const pkg = require('../package');
const platforms = sauceBrowsers([
{ name: 'android', version: ['oldest', 'latest'] },
{ name: 'chrome', version: ['oldest', 'latest'] },
{ name: 'fi... | 'use strict';
const sauceBrowsers = require('sauce-browsers');
const run = require('sauce-test');
const path = require('path');
const pkg = require('../package');
const platforms = sauceBrowsers([
{ name: 'android', version: ['oldest', 'latest'] },
{ name: 'chrome', version: ['oldest', 'latest'] },
{ name: 'fi... |
Fix regression when setting custom attributes on DOM elements | var $ = require('jquery');
var _ = require('./utils.js');
// When passed to the template evaluator,
// its render method will create actual DOM elements
var DOMInterface = function() {
return {
createFragment: function() {
return document.createDocumentFragment();
},
createDOMElement: function(ta... | var $ = require('jquery');
var _ = require('./utils.js');
// When passed to the template evaluator,
// its render method will create actual DOM elements
var DOMInterface = function() {
return {
createFragment: function() {
return document.createDocumentFragment();
},
createDOMElement: function(ta... |
Rewrite to use jquery svg | define([
'jquery',
'jquerySvgDom',
'underscore',
'backbone',
'views/KeyView',
'router',
'text!/../images/piano.svg'
], function ($, svgDom, _, Backbone, KeyView, Router, KeyboardTemplate) {
var KeyboardView = Backbone.View.extend({
initialize: function (options) {
this.listenTo(this.model, 'c... | define([
'jquery',
'underscore',
'backbone',
'views/KeyView',
'router'
], function ($, _, Backbone, KeyView, Router) {
var KeyboardView = Backbone.View.extend({
el: $('#keyboard'),
initialize: function (options) {
var self = this;
this.router = options.router;
$('#keyboard > .ke... |
Load app view as default | import * as Backbone from 'backbone';
import Items from '../collections/items';
import SearchBoxView from '../views/searchBox-view';
import SearchResultsView from '../views/searchResults-view';
import AppView from '../views/app-view';
import DocumentSet from '../helpers/search';
import dispatcher from '../helpers/dispa... | import * as Backbone from 'backbone';
import Items from '../collections/items';
import SearchBoxView from '../views/searchBox-view';
import SearchResultsView from '../views/searchResults-view';
import DocumentSet from '../helpers/search';
import dispatcher from '../helpers/dispatcher';
class AppRouter extends Backbone... |
Clean up to reference correct names of classes and related methods | <?php
/**
* mbc-transactional-digest
*
* Collect transactional campaign sign up message requests in a certain time period and
* compose a single digest message request.
*/
date_default_timezone_set('America/New_York');
define('CONFIG_PATH', __DIR__ . '/messagebroker-config');
// Load up the Composer autoload ma... | <?php
/**
* mbc-transactional-digest
*
* Collect user .
*/
date_default_timezone_set('America/New_York');
define('CONFIG_PATH', __DIR__ . '/messagebroker-config');
// The number of messages for the consumer to reserve with each callback
// See consumeMwessage for further details.
// Necessary for parallel process... |
Fix bug with missing iri | /*
* VowlThing.java
*
*/
package de.uni_stuttgart.vis.vowl.owl2vowl.model.entities.nodes.classes;
import de.uni_stuttgart.vis.vowl.owl2vowl.constants.NodeType;
import de.uni_stuttgart.vis.vowl.owl2vowl.constants.Standard_Iris;
import de.uni_stuttgart.vis.vowl.owl2vowl.model.annotation.Annotation;
import de.uni_st... | /*
* VowlThing.java
*
*/
package de.uni_stuttgart.vis.vowl.owl2vowl.model.entities.nodes.classes;
import de.uni_stuttgart.vis.vowl.owl2vowl.constants.NodeType;
import de.uni_stuttgart.vis.vowl.owl2vowl.constants.Standard_Iris;
import de.uni_stuttgart.vis.vowl.owl2vowl.model.annotation.Annotation;
import de.uni_st... |
Use DecimalFormat to replace DecimalFormat because of DecimalFormat will add a comma in formatted result when value greater than 1000. | /*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may ... | /*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may ... |
Add parameter to service controller example | <?php
require __DIR__.'/../vendor/autoload.php';
class HelloController
{
private $name;
public function __construct($name)
{
$this->name = $name;
}
public function worldAction($request)
{
return "Hello, I'm {$this->name}.\n";
}
}
$container = Yolo\createContainer(
[
... | <?php
require __DIR__.'/../vendor/autoload.php';
class HelloController
{
public function worldAction($request)
{
return "Hallo welt, got swag yo!\n";
}
}
$container = Yolo\createContainer(
[
'debug' => true,
],
[
new Yolo\DependencyInjection\MonologExtension(),
... |
Include mock classes in test class file | <?php
/**
* Definition of class DICTest
*
* @copyright 2015-today Justso GmbH
* @author j.schirrmacher@justso.de
* @package justso\justapi\test
*/
namespace justso\justapi\test;
use justso\justapi\Bootstrap;
use justso\justapi\DependencyContainer;
use justso\justapi\testutil\FileSystemSandbox;
require ... | <?php
/**
* Definition of class DICTest
*
* @copyright 2015-today Justso GmbH
* @author j.schirrmacher@justso.de
* @package justso\justapi\test
*/
namespace justso\justapi\test;
use justso\justapi\Bootstrap;
use justso\justapi\DependencyContainer;
use justso\justapi\testutil\FileSystemSandbox;
/**
* C... |
Store date format into a constant | <?php
/**
* Created by Pierre-Henry Soria
*/
namespace PFBC\Validation;
use PH7\Framework\Date\CDateTime;
use PH7\Framework\Mvc\Model\DbConfig;
class BirthDate extends \PFBC\Validation
{
const DATE_PATTERN = 'm/d/Y';
/** @var int */
protected $iMin;
/** @var int */
protected $iMax;
publi... | <?php
/**
* Created by Pierre-Henry Soria
*/
namespace PFBC\Validation;
use PH7\Framework\Date\CDateTime;
use PH7\Framework\Mvc\Model\DbConfig;
class BirthDate extends \PFBC\Validation
{
/** @var int */
protected $iMin;
/** @var int */
protected $iMax;
public function __construct()
{
... |
Add a class alias for the legacy Extensions class | <?php
/**
* Autoloaded file to handle deprecation such as class aliases.
*
* NOTE:
* If for any reason arrays are required in this file, only ever use array()
* syntax to prevent breakage on PHP < 5.4 and allow the legacy warnings.
*/
// Class aliases for BC
class_alias('\Bolt\Asset\Target', '\Bolt\Extensions\S... | <?php
/**
* Autoloaded file to handle deprecation such as class aliases.
*
* NOTE:
* If for any reason arrays are required in this file, only ever use array()
* syntax to prevent breakage on PHP < 5.4 and allow the legacy warnings.
*/
// Class aliases for BC
class_alias('\Bolt\Asset\Target', '\Bolt\Extensions\S... |
Allow attribute to be customized in TagRegistered | """
meta.py
Some useful metaclasses.
"""
from __future__ import unicode_literals
class LeafClassesMeta(type):
"""
A metaclass for classes that keeps track of all of them that
aren't base classes.
"""
_leaf_classes = set()
def __init__(cls, name, bases, attrs):
if not hasattr(cls, '_leaf_classes'):
cls._... | """
meta.py
Some useful metaclasses.
"""
from __future__ import unicode_literals
class LeafClassesMeta(type):
"""
A metaclass for classes that keeps track of all of them that
aren't base classes.
"""
_leaf_classes = set()
def __init__(cls, name, bases, attrs):
if not hasattr(cls, '_leaf_classes'):
cls._... |
Use the version number in pyproject.toml as the single source of truth
From Python 3.8 on we can use importlib.metadata.version('package_name')
to get the current version. | """Rename audio files from metadata tags."""
import sys
from importlib import metadata
from .args import fields, parse_args
from .batch import Batch
from .job import Job
from .message import job_info, stats
fields
__version__: str = metadata.version('audiorename')
def execute(*argv: str):
"""Main function
... | """Rename audio files from metadata tags."""
import sys
from .args import fields, parse_args
from .batch import Batch
from .job import Job
from .message import job_info, stats
fields
__version__: str = '0.0.0'
def execute(*argv: str):
"""Main function
:param list argv: The command line arguments specifie... |
Fix activation code to string | <?php namespace Maatwebsite\Usher\Domain\Users\Activations;
use Doctrine\ORM\Mapping as ORM;
use Maatwebsite\Usher\Services\CodeGenerator;
use Maatwebsite\Usher\Domain\Shared\Embeddables\Date;
use Maatwebsite\Usher\Contracts\Users\Activiations\ActivationCode as ActivationCodeInterface;
/**
* @ORM\Embeddable
*/
clas... | <?php namespace Maatwebsite\Usher\Domain\Users\Activations;
use Doctrine\ORM\Mapping as ORM;
use Maatwebsite\Usher\Services\CodeGenerator;
use Maatwebsite\Usher\Domain\Shared\Embeddables\Date;
use Maatwebsite\Usher\Contracts\Users\Activiations\ActivationCode as ActivationCodeInterface;
/**
* @ORM\Embeddable
*/
clas... |
Use built-in _format to enable xml output | <?php
namespace Kunstmaan\SitemapBundle\Controller;
use Kunstmaan\AdminBundle\Helper\Security\Acl\Permission\PermissionMap;
use Kunstmaan\NodeBundle\Helper\NodeMenu;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template;
use Symfony\Bundle\FrameworkB... | <?php
namespace Kunstmaan\SitemapBundle\Controller;
use Kunstmaan\AdminBundle\Helper\Security\Acl\Permission\PermissionMap;
use Kunstmaan\NodeBundle\Helper\NodeMenu;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template;
use Symfony\Bundle\FrameworkB... |
Update package info for `query` package | /*
* Copyright 2017, TeamDev Ltd. All rights reserved.
*
* Redistribution and use in source and/or binary forms, with or without
* modification, must retain the above copyright notice and the following
* disclaimer.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRES... | /*
* Copyright 2017, TeamDev Ltd. All rights reserved.
*
* Redistribution and use in source and/or binary forms, with or without
* modification, must retain the above copyright notice and the following
* disclaimer.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRES... |
Add tmp dir to protractor-sauce | var fs = require('fs');
var specs = JSON.parse(fs.readFileSync('tests/end2end/specs.json'));
var browser_capabilities = JSON.parse(process.env.SELENIUM_BROWSER_CAPABILITIES);
browser_capabilities['name'] = 'GlobaLeaks-E2E';
browser_capabilities['tunnel-identifier'] = process.env.TRAVIS_JOB_NUMBER;
browser_capabilities... | var fs = require('fs');
var specs = JSON.parse(fs.readFileSync('tests/end2end/specs.json'));
var browser_capabilities = JSON.parse(process.env.SELENIUM_BROWSER_CAPABILITIES);
browser_capabilities['name'] = 'GlobaLeaks-E2E';
browser_capabilities['tunnel-identifier'] = process.env.TRAVIS_JOB_NUMBER;
browser_capabilities... |
Fix bug where loading dialog continues to show on invalid sessionID in URL | angular.module('dcs.controllers').controller('MainController', ['$scope', '$state', '$stateParams', 'session', '$timeout', '$mdDialog',
function($scope, $state, $stateParams, session, $timeout, $mdDialog)
{
$scope.init =
function()
{
if(typeof($stateParams["sessionID"]) !== 'string' || $stateParams["sess... | angular.module('dcs.controllers').controller('MainController', ['$scope', '$state', '$stateParams', 'session', '$timeout', '$mdDialog',
function($scope, $state, $stateParams, session, $timeout, $mdDialog)
{
$scope.init =
function()
{
if(typeof($stateParams["sessionID"]) !== 'string' || $stateParams["sess... |
Bump to next development cycle | from setuptools import setup
from os import path
here = path.abspath(path.dirname(__file__))
with open(path.join(here, 'README.md')) as f:
jgo_long_description = f.read()
setup(
name='jgo',
version='0.1.1.dev0',
author='Philipp Hanslovsky, Curtis Rueden',
author_email='hanslovskyp@janelia.hhmi.or... | from setuptools import setup
from os import path
here = path.abspath(path.dirname(__file__))
with open(path.join(here, 'README.md')) as f:
jgo_long_description = f.read()
setup(
name='jgo',
version='0.1.0',
author='Philipp Hanslovsky, Curtis Rueden',
author_email='hanslovskyp@janelia.hhmi.org',
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.