text stringlengths 16 4.96k | positive stringlengths 321 2.24k | negative stringlengths 310 2.21k |
|---|---|---|
Add test for getLastError selector | import * as selectors from '../src/selectors'
describe('selectors', () => {
it('includes selector to get session data', () => {
const state = {
session: {
data: { token: 'abcde' }
}
}
const result = selectors.getSessionData(state)
expect(result).toEqual({ token: 'abcde' })
})
... | import * as selectors from '../src/selectors'
describe('selectors', () => {
it('includes selector to get session data', () => {
const state = {
session: {
data: { token: 'abcde' }
}
}
const result = selectors.getSessionData(state)
expect(result).toEqual({ token: 'abcde' })
})
... |
Update tag for search on StackOverflow
Since the emberjs tag has been renamed to ember.js. A search for the "old" tag doesn't return any results... | require('dashboard/core');
Dashboard.DataSource = Ember.Object.extend({
getLatestTweets: function(callback) {
Ember.$.getJSON('http://search.twitter.com/search.json?callback=?&q=ember.js%20OR%20emberjs%20OR%20ember-data%20OR%20emberjs', callback);
},
getLatestStackOverflowQuestions: function(callb... | require('dashboard/core');
Dashboard.DataSource = Ember.Object.extend({
getLatestTweets: function(callback) {
Ember.$.getJSON('http://search.twitter.com/search.json?callback=?&q=ember.js%20OR%20emberjs%20OR%20ember-data%20OR%20emberjs', callback);
},
getLatestStackOverflowQuestions: function(callb... |
Fix a bug that will lead to error when external_login() is called | import requests
from flask import abort, session
from webViews.log import logger
endpoint = "http://0.0.0.0:9000"
class dockletRequest():
@classmethod
def post(self, url = '/', data = {}):
#try:
data = dict(data)
data['token'] = session['token']
logger.info ("Docklet Request:... | import requests
from flask import abort, session
from webViews.log import logger
endpoint = "http://0.0.0.0:9000"
class dockletRequest():
@classmethod
def post(self, url = '/', data = {}):
#try:
data = dict(data)
data['token'] = session['token']
logger.info ("Docklet Request:... |
Correct inconsistent quote usage, release 0.1.0. | #!/usr/bin/env python
from setuptools import setup
setup(
name="Tigger",
version="0.1.0",
packages=["tigger",],
license="MIT",
description="Command-line tagging tool.",
long_description="Tigger is a command-line tagging tool written in " +
"python, intended f... | #!/usr/bin/env python
from setuptools import setup
setup(
name='Tigger',
version='0.1.0',
packages=['tigger',],
license='MIT',
description="Command-line tagging tool.",
long_description="Tigger is a command-line tagging tool written in " +
"python, intended f... |
Switch to paorwise method for PopcornTime | // @flow
const Rx = require('rx')
const _ = require('lodash')
const PopcornTime = require('../../sources/PopcornTime')
// const INTERVAL: number = 1000 * 60 * 60 // 1 hour TODO: Move to config
const INTERVAL: number = 1000 * 5 // 5 seconds
// every INTERVAL seconds, check the source for inputs, diff the incoming inp... | // @flow
const Rx = require('rx')
const _ = require('lodash')
const PopcornTime = require('../../sources/PopcornTime')
const INTERVAL: number = 1000 * 60 * 60 // 1 hour
// const INTERVAL: number = 1000 * 5 // 5 seconds
// every INTERVAL seconds, check the source for inputs, diff the incoming inputs with a stored pre... |
Make longer line by default for divider option.
svn commit r2832 | <?php
require_once 'Swat/SwatFlydownOption.php';
/**
* A class representing a divider in a flydown
*
* This class is for semantic purposed only. The flydown handles all the
* displaying of dividers and regular flydown options.
*
* @package Swat
* @copyright 2005 silverorange
* @license http://www.gnu.org/... | <?php
require_once 'Swat/SwatFlydownOption.php';
/**
* A class representing a divider in a flydown
*
* This class is for semantic purposed only. The flydown handles all the
* displaying of dividers and regular flydown options.
*
* @package Swat
* @copyright 2005 silverorange
* @license http://www.gnu.org/... |
Check for file and line before assignment
If the file, line, or both are missing, this breaks completely. | <?php
namespace Airbrake\Errors;
/**
* Error wrapper that mimics Exception API. For internal usage.
*/
class Base
{
private $message;
private $file;
private $line;
private $trace;
public function __construct($message, $trace = [])
{
$this->message = $message;
$frame = array_... | <?php
namespace Airbrake\Errors;
/**
* Error wrapper that mimics Exception API. For internal usage.
*/
class Base
{
private $message;
private $file;
private $line;
private $trace;
public function __construct($message, $trace = [])
{
$this->message = $message;
$frame = array_... |
Move cortex:autoload & cortex:activate commands to cortex/foundation module responsibility | <?php
declare(strict_types=1);
namespace Cortex\Foundation\Console\Commands;
use Illuminate\Console\Command;
class InstallCommand extends Command
{
/**
* The name and signature of the console command.
*
* @var string
*/
protected $signature = 'cortex:install:foundation {--f|force : Force... | <?php
declare(strict_types=1);
namespace Cortex\Foundation\Console\Commands;
use Illuminate\Console\Command;
class InstallCommand extends Command
{
/**
* The name and signature of the console command.
*
* @var string
*/
protected $signature = 'cortex:install:foundation {--f|force : Force... |
Load service w/ apt items | // Module dependencies.
var express = require('express');
var router = express.Router();
var api = {};
// ALL
api.appointmentItems = function(req) {
return req.store.recordCollection('AppointmentItem', {include: ['service']});
};
// GET
api.appointmentItem = function(req) {
return req.store.recordItemById('Appoin... | // Module dependencies.
var express = require('express');
var router = express.Router();
var api = {};
// ALL
api.appointmentItems = function(req) {
return req.store.recordCollection('AppointmentItem');
};
// GET
api.appointmentItem = function(req) {
return req.store.recordItemById('AppointmentItem', req.params.i... |
Make create a class method. | import re
class RegexFactory(object):
"""Generates a regex pattern."""
WORD_GROUP = '({0}|\*)'
SEP = '/'
def _generate_pattern(self, path):
"""Generates a regex pattern."""
# Split the path up into a list using the forward slash as a
# delimiter.
words = (word for word... | import re
class RegexFactory(object):
"""Generates a regex pattern."""
WORD_GROUP = '({0}|\*)'
SEP = '/'
def _generate_pattern(self, path):
"""Generates a regex pattern."""
# Split the path up into a list using the forward slash as a
# delimiter.
words = (word for word... |
Add target _blank to ahref | import React from 'react';
/**
* Header Component.
*/
const Header = () =>
<nav>
<div className="nav-wrapper teal darken-3">
<div className="container">
<a href="/nepali-names" className="brand-logo">
Nepali Names
</a>
<a
className="grey-text text-lighten-4 rig... | import React from 'react';
/**
* Header Component.
*/
const Header = () => (
<nav>
<div className="nav-wrapper teal darken-3">
<div className="container">
<a href="/nepali-names" className="brand-logo">
Nepali Names
</a>
<a
className="grey-text text-lighten-4 r... |
Fix to allow more flexible version numbers | #!/usr/bin/python
from subprocess import check_output as co
from sys import exit
# Actually run bin/mn rather than importing via python path
version = 'Mininet ' + co( 'PYTHONPATH=. bin/mn --version', shell=True )
version = version.strip()
# Find all Mininet path references
lines = co( "egrep -or 'Mininet [0-9\.]+\w... | #!/usr/bin/python
from subprocess import check_output as co
from sys import exit
# Actually run bin/mn rather than importing via python path
version = 'Mininet ' + co( 'PYTHONPATH=. bin/mn --version', shell=True )
version = version.strip()
# Find all Mininet path references
lines = co( "grep -or 'Mininet \w\+\.\w\+\... |
Disable some annoying JSCS stuff | // server.js
//jscs:disable requireTrailingComma, disallowQuotedKeysInObjects
'use strict';
const express = require('express');
const app = express();
const mongoose = require('mongoose');
const morgan = require('morgan');
const bodyParser = require('body-parser'); // Pull inf... | // server.js
'use strict';
const express = require('express');
const app = express();
const mongoose = require('mongoose');
const morgan = require('morgan');
const bodyParser = require('body-parser'); // Pull info from HTML POST
const methodOverride = require('method-override')... |
Add style to the attendee | import React, { Component } from 'react';
import PropTypes from 'prop-types';
import './Attendee.css';
import Clap from '../../components/Clap/Clap.container';
class Atendee extends Component {
constructor(props) {
super(props);
this.confettiClass = 'button button--large button--circle button--withChrome u... | import React, { Component } from 'react';
import PropTypes from 'prop-types';
import './Attendee.css';
import Clap from '../../components/Clap/Clap.container';
class Atendee extends Component {
constructor(props) {
super(props);
this.confettiClass = 'button button--large button--circle button--withChrome u... |
[chore] Add ngAnimate module to uploadcontroller.js | angular.module('upload', [
'utils',
'ngAnimate'
])
.controller('uploadController', [
'$scope',
'$http',
'$stateParams',
'$rootScope',
'fileTransfer',
'webRTC',
'packetHandlers',
'fileUpload',
function($scope, $http, $stateParams, $rootScope, fileTransfer, webRTC, packetHandlers, fileUpload) {
... | angular.module('upload', [
'utils'
])
.controller('uploadController', [
'$scope',
'$http',
'$stateParams',
'$rootScope',
'fileTransfer',
'webRTC',
'packetHandlers',
'fileUpload',
function($scope, $http, $stateParams, $rootScope, fileTransfer, webRTC, packetHandlers, fileUpload) {
console.log('u... |
Make namespace check more robust | import {NAMESPACE, PREFIX} from './constants';
const ast = require('parametric-svg-ast');
const arrayFrom = require('array-from');
const startsWith = require('starts-with');
const ELEMENT_NODE = 1;
const getChildren = ({children, childNodes}) => (children ?
arrayFrom(children) :
arrayFrom(childNodes).filter(({no... | import {NAMESPACE, PREFIX} from './constants';
const ast = require('parametric-svg-ast');
const arrayFrom = require('array-from');
const startsWith = require('starts-with');
const ELEMENT_NODE = 1;
const getChildren = ({children, childNodes}) => (children ?
arrayFrom(children) :
arrayFrom(childNodes).filter(({no... |
Use get for loading dialog. | <?php
/**
* Copyright (c) 2012 Thomas Tanghus <thomas@tanghus.net>
* This file is licensed under the Affero General Public License version 3 or
* later.
* See the COPYING-README file.
*/
function bailOut($msg) {
OC_JSON::error(array('data' => array('message' => $msg)));
OC_Log::write('core', 'ajax/vcategories/ad... | <?php
/**
* Copyright (c) 2012 Thomas Tanghus <thomas@tanghus.net>
* This file is licensed under the Affero General Public License version 3 or
* later.
* See the COPYING-README file.
*/
function bailOut($msg) {
OC_JSON::error(array('data' => array('message' => $msg)));
OC_Log::write('core', 'ajax/vcategories/ad... |
Fix the keywords, url, and description. |
#! /usr/bin/env python
import os
from setuptools import setup, find_packages
# with open(os.path.join(os.path.dirname(__file__), 'README.md')) as readme:
# README = readme.read()
# allow setup.py to be run from any path
os.chdir(os.path.normpath(os.path.join(os.path.abspath(__file__), os.pardir)))
setup(
n... |
#! /usr/bin/env python
import os
from setuptools import setup, find_packages
# with open(os.path.join(os.path.dirname(__file__), 'README.md')) as readme:
# README = readme.read()
# allow setup.py to be run from any path
os.chdir(os.path.normpath(os.path.join(os.path.abspath(__file__), os.pardir)))
setup(
n... |
Add showcase flag in networkset. | package org.ndexbio.model.object;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.UUID;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
@JsonIgnoreProperties(ignoreUnknown = true)
public class NetworkSet extends NdexExternalObject {
... | package org.ndexbio.model.object;
import java.util.ArrayList;
import java.util.List;
import java.util.UUID;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
@JsonIgnoreProperties(ignoreUnknown = true)
public class NetworkSet extends NdexExternalObject {
private String name;
private String descriptio... |
Add placeholder link to workshop fold | 'use strict';
import React from 'react';
import { Link } from 'react-router';
var WorkshopFold = React.createClass({
displayName: 'WorkshopFold',
render: function () {
return (
<section className='workshop-fold'>
<div className='inner'>
<header className='workshop-fold__header'>
... | 'use strict';
import React from 'react';
var WorkshopFold = React.createClass({
displayName: 'WorkshopFold',
render: function () {
return (
<section className='workshop-fold'>
<div className='inner'>
<header className='workshop-fold__header'>
<h1 className='workshop-fold__t... |
Fix preserve3d's IE11/Win10 false positive | /*!
{
"name": "CSS Transform Style preserve-3d",
"property": "preserve3d",
"authors": ["denyskoch", "aFarkas"],
"tags": ["css"],
"notes": [{
"name": "MDN Docs",
"href": "https://developer.mozilla.org/en-US/docs/Web/CSS/transform-style"
},{
"name": "Related Github Issue",
"href": "https://git... | /*!
{
"name": "CSS Transform Style preserve-3d",
"property": "preserve3d",
"authors": ["denyskoch", "aFarkas"],
"tags": ["css"],
"notes": [{
"name": "MDN Docs",
"href": "https://developer.mozilla.org/en-US/docs/Web/CSS/transform-style"
},{
"name": "Related Github Issue",
"href": "https://git... |
Fix bug from previous PR. | import immutable from 'immutable';
import authStore from '../auth/store';
import intlStore from '../intl/store';
import todosStore from '../todos/store';
import usersStore from '../users/store';
export default function(state, action, payload) {
// Create immutable from JSON asap to prevent side effects accidents.
... | import immutable from 'immutable';
import authStore from '../auth/store';
import intlStore from '../intl/store';
import todosStore from '../todos/store';
import usersStore from '../users/store';
export default function(state, action, payload) {
// Create immutable from JSON asap to prevent side effects accidents.
... |
Fix spelling errors in test names | from hypothesis import (
given,
settings,
)
from eth_abi import (
encode_abi,
decode_abi,
encode_single,
decode_single,
)
from tests.common.strategies import (
multi_strs_values,
single_strs_values,
)
@settings(max_examples=1000)
@given(multi_strs_values)
def test_multi_abi_reversibi... | from hypothesis import (
given,
settings,
)
from eth_abi import (
encode_abi,
decode_abi,
encode_single,
decode_single,
)
from tests.common.strategies import (
multi_strs_values,
single_strs_values,
)
@settings(max_examples=1000)
@given(multi_strs_values)
def test_multi_abi_reversabi... |
Change delimiter detection to allow string "---" to appear in front matter | <?php
namespace Spatie\YamlFrontMatter;
use Exception;
use Symfony\Component\Yaml\Yaml;
class Parser
{
protected $yamlParser;
public function __construct()
{
$this->yamlParser = new Yaml();
}
public function parse(string $content) : Document
{
$pattern = '/[\s\r\n]---[\s\r\... | <?php
namespace Spatie\YamlFrontMatter;
use Exception;
use Symfony\Component\Yaml\Yaml;
class Parser
{
protected $yamlParser;
public function __construct()
{
$this->yamlParser = new Yaml();
}
public function parse(string $content) : Document
{
// Parser regex borrowed from t... |
Handle the empty er folder and blank ER case properly. | var JSONDumper = function() {
this.onBrowserLog = function(browser, log, type) {
if( type != "dump" ) {
return;
}
var objectMerge = require( 'object-merge' );
var fs = require( 'fs' );
var logObj = JSON.parse(log.substring(1, log.length-1));
var fileObj;
var data;
for( var file in logObj ) {
da... | var JSONDumper = function() {
this.onBrowserLog = function(browser, log, type) {
if( type != "dump" ) {
return;
}
var objectMerge = require( 'object-merge' );
var fs = require( 'fs' );
var logObj = JSON.parse(log.substring(1, log.length-1));
var fileObj;
var data;
for( var file in logObj ) {
da... |
Add unit test for iteration loop parsing | from tests.infrastructure.test_utils import parse_local, validate_types
from thinglang.lexer.values.numeric import NumericValue
from thinglang.lexer.values.identifier import Identifier
from thinglang.parser.blocks.iteration_loop import IterationLoop
from thinglang.parser.blocks.loop import Loop
from thinglang.parser.va... | from tests.infrastructure.test_utils import parse_local, validate_types
from thinglang.lexer.values.numeric import NumericValue
from thinglang.lexer.values.identifier import Identifier
from thinglang.parser.blocks.loop import Loop
from thinglang.parser.values.binary_operation import BinaryOperation
from thinglang.parse... |
Set NODE_ENV correctly in prod to speed up React | import { remote } from 'electron';
import '../rendererEmitter';
import './core';
import SettingsController from '../../main/utils/Settings';
if (process.env['TEST_SPEC']) { // eslint-disable-line
global.Settings = new SettingsController('.test', true);
} else {
global.Settings = new SettingsController();
}
Settin... | import '../rendererEmitter';
import './core';
import SettingsController from '../../main/utils/Settings';
if (process.env['TEST_SPEC']) { // eslint-disable-line
global.Settings = new SettingsController('.test', true);
} else {
global.Settings = new SettingsController();
}
Settings.uncouple();
require(`./${proces... |
Add refreshTokenLifetime and accessTokenLifetime for token lifetime | // Reference : http://danialk.github.io/blog/2013/02/23/authentication-using-passportjs/
var CONFIG = module.exports = {};
var LocalStrategy = require('passport-local').Strategy;
var oauthserver = require('node-oauth2-server');
var memorystore = require("../model/oauth.js");
CONFIG.passport = function (passport) {
... | // Reference : http://danialk.github.io/blog/2013/02/23/authentication-using-passportjs/
var CONFIG = module.exports = {};
var LocalStrategy = require('passport-local').Strategy;
var oauthserver = require('node-oauth2-server');
var memorystore = require("../model/oauth.js");
CONFIG.passport = function (passport) {
... |
Upgrade to OpenSSL 1.0.1g to avoid heartbleed bug | import winbrew
class Openssl(winbrew.Formula):
url = 'http://www.openssl.org/source/openssl-1.0.1g.tar.gz'
homepage = 'http://www.openssl.org'
sha1 = ''
build_deps = ()
deps = ()
def install(self):
self.system('perl Configure VC-WIN32 no-asm --prefix=C:\\Winbrew\\lib\\OpenSSL')
... | import winbrew
class Openssl(winbrew.Formula):
url = 'http://www.openssl.org/source/openssl-1.0.1f.tar.gz'
homepage = 'http://www.openssl.org'
sha1 = ''
build_deps = ()
deps = ()
def install(self):
self.system('perl Configure VC-WIN32 no-asm --prefix=C:\\Winbrew\\lib\\OpenSSL')
... |
:new: Add a message key helper; also cleanup unused | 'use babel'
import minimatch from 'minimatch'
export function showError(e) {
atom.notifications.addError(`[Linter] ${e.message}`, {
detail: e.stack,
dismissable: true
})
}
export function shouldTriggerLinter(linter, wasTriggeredOnChange, scopes) {
if (wasTriggeredOnChange && !linter.lintOnFly) {
re... | 'use babel'
import minimatch from 'minimatch'
export function showError(e) {
atom.notifications.addError(`[Linter] ${e.message}`, {
detail: e.stack,
dismissable: true
})
}
export function shouldTriggerLinter(linter, wasTriggeredOnChange, scopes) {
if (wasTriggeredOnChange && !linter.lintOnFly) {
re... |
Replace condition to patch distutils.dist.log
As `distutils.log.Log` was backfilled for compatibility we no longer can
use this as a condition. | import sys
import inspect
import logging
import distutils.log
from . import monkey
def _not_warning(record):
return record.levelno < logging.WARNING
def configure():
"""
Configure logging to emit warning and above to stderr
and everything else to stdout. This behavior is provided
for compatibili... | import sys
import logging
import distutils.log
from . import monkey
def _not_warning(record):
return record.levelno < logging.WARNING
def configure():
"""
Configure logging to emit warning and above to stderr
and everything else to stdout. This behavior is provided
for compatibility with distuti... |
Handle fast forward in update-coverity-branch.py | #!/usr/bin/env python
# Update the coverity branch from the master branch.
# It is not done automatically because Coverity Scan limits
# the number of submissions per day.
from __future__ import print_function
import shutil, tempfile
from subprocess import check_output, STDOUT
class Git:
def __init__(self, dir):
... | #!/usr/bin/env python
# Update the coverity branch from the master branch.
# It is not done automatically because Coverity Scan limits
# the number of submissions per day.
from __future__ import print_function
import shutil, tempfile
from subprocess import check_call
class Git:
def __init__(self, dir):
self.dir... |
Fix Tap constructor, pass start and end time via command line arguments. | // this needs to be modified to work with the new java 7 date class
package tap.sample;
import tap.*;
import quantbench.Candle;
public class Subscribe {
// Usage: hadoop jar yourjar.jar -s 2011-01-03 10:40:00.000 -e 2011-01-03 10:50:00.000
public static main(String[] args) throws Exception {
Com... |
// this needs to be modified to work with the new java 7 date class
package tap.sample;
import tap.*;
import quantbench.Candle;
public class Subscribe {
public static main(String[] args) throws Exception {
Tap tap = new Tap();
tap.startTime("2011-01-03 10:40:00.000");
tap.endTime("2011-0... |
Build proper dnslink, pass recordName as parameter | var DigitalOcean = require('do-wrapper')
var Promise = require('bluebird')
module.exports = function initializeModule (options) {
var api = Promise.promisifyAll(new DigitalOcean(options.DOApiKey, 10))
function testAccountKey () {
api.account(function (err, res, body) {
if (err) { console.log(err) }
... | var DigitalOcean = require('do-wrapper')
var Promise = require('bluebird')
module.exports = function initializeModule (options) {
var api = Promise.promisifyAll(new DigitalOcean(options.DOApiKey, 10))
function testAccountKey () {
api.account(function (err, res, body) {
if (err) { console.log(err) }
... |
Fix typo in variable name in formatNumber | // Copyright 2016 Albert Nigmatzianov. All rights reserved.
// Use of this source code is governed by a MIT-style
// license that can be found in the LICENSE file.
package util
import (
"os"
"path/filepath"
"strconv"
"strings"
)
const (
millisecondsInSecond = 1000
secondsInMinute = 60
minutesInHour ... | // Copyright 2016 Albert Nigmatzianov. All rights reserved.
// Use of this source code is governed by a MIT-style
// license that can be found in the LICENSE file.
package util
import (
"os"
"path/filepath"
"strconv"
"strings"
)
const (
millisecondsInSecond = 1000
secondsInMinute = 60
minutesInHour ... |
Update example plot script with new API | import os
import matplotlib.pyplot as plt
plt.style.use("ggplot")
plt.rcParams["figure.figsize"] = 10, 5
plt.rcParams["font.family"] = "serif"
plt.rcParams["font.size"] = 12
import pyhector
from pyhector import rcp26, rcp45, rcp60, rcp85
path = os.path.join(os.path.dirname(__file__),
'./example-p... | import os
import matplotlib.pyplot as plt
plt.style.use("ggplot")
plt.rcParams["figure.figsize"] = 10, 5
plt.rcParams["font.family"] = "serif"
plt.rcParams["font.size"] = 12
import pyhector
from pyhector import rcp26, rcp45, rcp60, rcp85
path = os.path.join(os.path.dirname(__file__),
'./example-p... |
Fix redundant declaration of the same variable. | 'use strict';
var expect = require('chai').expect;
var angular = require('angular');
var calculatorModule = require('./calculator.service');
describe('calculator', function() {
var calculator;
beforeEach(function() {
angular.mock.module(calculatorModule.moduleName);
angular.mock.inject([calculatorModule.facto... | 'use strict';
var expect = require('chai').expect;
var angular = require('angular');
var calculatorModule = require('./calculator.service');
describe('calculator', function() {
var calculator;
beforeEach(function() {
angular.mock.module(calculatorModule.moduleName);
angular.mock.inject([calculatorModule.facto... |
Make Calendar events and recurrence types optional. | <?php
namespace Plummer\Calendar;
class Calendar
{
protected $name;
protected $events;
protected $recurrenceTypes;
protected function __construct($name, array $events, array $recurrenceTypes)
{
$this->name = $name;
$this->addEvents($events);
$this->addRecurrenceTypes($recurrenceTypes);
}
public stati... | <?php
namespace Plummer\Calendar;
class Calendar
{
protected $name;
protected $events;
protected $recurrenceTypes;
protected function __construct($name, array $events, array $recurrenceTypes)
{
$this->name = $name;
$this->addEvents($events);
$this->addRecurrenceTypes($recurrenceTypes);
}
public stati... |
Fix home page logic error | ( function ( mw, $ ) {
$( function () {
// For some odd reason, these had fixed min-style:600px
// That sucks. Removing it (they're handled at HitchwikiVector/resources/styles/forms.less instead)
$(".sf-select2-container").attr("style", "");
// Don't allow adding new content for non logged in users... | ( function ( mw, $ ) {
$( function () {
// For some odd reason, these had fixed min-style:600px
// That sucks. Removing it (they're handled at HitchwikiVector/resources/styles/forms.less instead)
$(".sf-select2-container").attr("style", "");
// Don't allow adding new content for non logged in users... |
Refactor output for zip archive and download | """
Utilities for downloading historical data in a given AOI.
Python 3.5
"""
import requests
import io
import zipfile
import os
from time import strftime
import logging
import yaml
from model import aircraft_report
from model import report_receiver
from utils import postgres as pg_utils
logger = logging.getLogger(__... | """
Utilities for downloading historical data in a given AOI.
Python 3.5
"""
import requests
import io
import zipfile
import os
from time import strftime
import logging
import yaml
from model import aircraft_report
from model import report_receiver
from utils import postgres as pg_utils
logger = logging.getLogger(__... |
[security][symfony] Fix fatal error on old symfony versions.
PHP Fatal error: Undefined class constant 'ABSOLUTE_URL' in .... | <?php
namespace Payum\Core\Bridge\Symfony\Security;
use Payum\Core\Registry\StorageRegistryInterface;
use Payum\Core\Security\AbstractGenericTokenFactory;
use Payum\Core\Storage\StorageInterface;
use Symfony\Component\Routing\Generator\UrlGeneratorInterface;
class TokenFactory extends AbstractGenericTokenFactory
{
... | <?php
namespace Payum\Core\Bridge\Symfony\Security;
use Payum\Core\Registry\StorageRegistryInterface;
use Payum\Core\Security\AbstractGenericTokenFactory;
use Payum\Core\Security\TokenInterface;
use Payum\Core\Storage\StorageInterface;
use Symfony\Component\Routing\Generator\UrlGeneratorInterface;
class TokenFactory ... |
Change client login route to avoid conflicting with laravel bootstrap route | <?php
$this->router->get('admin/login', [
'as' => 'admin.login',
'uses' => 'Admin\Auth\LoginController@showLoginForm',
]);
$this->router->post('admin/login', [
'uses'=> 'Admin\Auth\LoginController@login',
]);
$this->router->get('login', [
'as' => 'client.login',
'uses' => 'Client\Auth\LoginController@showLo... | <?php
$this->router->get('admin/login', [
'as' => 'admin.login',
'uses' => 'Admin\Auth\LoginController@showLoginForm',
]);
$this->router->post('admin/login', [
'uses'=> 'Admin\Auth\LoginController@login',
]);
$this->router->get('/', [
'as' => 'client.login',
'uses' => 'Client\Auth\LoginController@showLoginF... |
Add tests requirements to install requirements | #!/usr/bin/python
# -*- coding: utf8 -*-
import os
from setuptools import setup, find_packages
here = os.path.abspath(os.path.dirname(__file__))
test_requirements = [
'factory_boy == 1.1.5',
]
setup(
name='caminae',
version='1.0.dev0',
author='Makina Corpus',
author_email='geobi@makina-corpus.co... | #!/usr/bin/python
# -*- coding: utf8 -*-
import os
from setuptools import setup, find_packages
here = os.path.abspath(os.path.dirname(__file__))
setup(
name='caminae',
version='1.0.dev0',
author='Makina Corpus',
author_email='geobi@makina-corpus.com',
url='http://makina-corpus.com',
descriptio... |
Fix JSON parsing bug, ingredients displayed correctly again. | $('#suggestions').typed({
strings: ["chocolate chip cookies", "brownies", "pancakes"],
typeSpeed: 50,
backSpeed: 15,
backDelay: 1500,
loop: true
});
$('#recipe-form').submit(function() {
get_recipe($('#recipe-title').val());
return false;
});
function get_recipe(title) {
var url = '/re... | $('#suggestions').typed({
strings: ["chocolate chip cookies", "brownies", "pancakes"],
typeSpeed: 50,
backSpeed: 15,
backDelay: 1500,
loop: true,
});
$('#recipe-form').submit(function() {
get_recipe($('#recipe-title').val());
return false;
});
function get_recipe(title) {
var url = '/recipe/sea... |
Allow for data as well as file upload. | <?php
namespace Metrique\Plonk\Http\Requests;
use Metrique\Plonk\Http\Requests\Request;
class PlonkStoreRequest extends Request
{
/**
* Determine if the user is authorized to make this request.
*
* @return bool
*/
public function authorize()
{
return true;
}
/**
... | <?php
namespace Metrique\Plonk\Http\Requests;
use Metrique\Plonk\Http\Requests\Request;
class PlonkStoreRequest extends Request
{
/**
* Determine if the user is authorized to make this request.
*
* @return bool
*/
public function authorize()
{
return true;
}
/**
... |
Fix vista de nuevo permiso por portafolio |
<h1>Entregar Permisos Portafolio</h1>
<a href="<?php echo base_url()?>portafolio">Volver</a>
<?php
if ($this->session->flashdata('ControllerMessage')!='') {
?>
<p style="color:red;"><?php echo $this->session->flashdata('ControllerMessage'); ?></p>
<?php
}
?>
<?php
$atributos = array('id'=>'nuevopermiso','name'=... |
<h1>Entregar Permisos Portafolio</h1>
<a href="<?php echo base_url()?>portafolio">Volver</a>
<?php
if ($this->session->flashdata('ControllerMessage')!='') {
?>
<p style="color:red;"><?php echo $this->session->flashdata('ControllerMessage'); ?></p>
<?php
}
?>
<?php
$atributos = array('id'=>'nuevopermiso','name'=... |
Use numeric value to turn off no-process-exit rule | #!/usr/bin/env node
// reason: this is the main entry to the module walker. if something
// goes wrong it has to decide what exit code to return. hence, it
// has to be able to use process.exit()
/* eslint no-process-exit: 0 */
import cli from 'commander';
import main from './lib/main';
import {loadConfigFromCLI} fro... | #!/usr/bin/env node
// reason: this is the main entry to the module walker. if something
// goes wrong it has to decide what exit code to return. hence, it
// has to be able to use process.exit()
/* eslint no-process-exit: "off" */
import cli from 'commander';
import main from './lib/main';
import {loadConfigFromCLI}... |
Add method to fetch a single event | from base import BaseClient
EVENTS_API_VERSION = 'v1'
class EventsClient(BaseClient):
def _get_path(self, subpath):
return 'events/%s/%s' % (EVENTS_API_VERSION, subpath)
def get_events(self, **options):
return self._call('events', **options)
def get_event(self, event_id, **optio... | from base import BaseClient
EVENTS_API_VERSION = 'v1'
class EventsClient(BaseClient):
def _get_path(self, subpath):
return 'events/%s/%s' % (EVENTS_API_VERSION, subpath)
def get_events(self, **options):
return self._call('events', **options)
def create_event(self, description,... |
Revert "Don't make dirs on startup"
This reverts commit 17243b31fc6c8d8f4bb0dc7e11e2601800e80bb0. | import os
from decimal import Decimal
from pockets.autolog import log
from uber._version import __version__ # noqa: F401
def on_load():
"""
Called by sideboard when the uber plugin is loaded.
"""
# Note: The following imports have side effects
from uber import config # noqa: F401
from uber... | import os
from decimal import Decimal
from pockets.autolog import log
from uber._version import __version__ # noqa: F401
def on_load():
"""
Called by sideboard when the uber plugin is loaded.
"""
# Note: The following imports have side effects
from uber import config # noqa: F401
from uber... |
Fix type name of initial content element of new sections
`editableTextBlock` was a temporary name.
REDMINE-17338, REDMINE-17339 | import Backbone from 'backbone';
import {
configurationContainer,
entryTypeEditorControllerUrls,
failureTracking,
delayedDestroying,
ForeignKeySubsetCollection
} from 'pageflow/editor';
export const Chapter = Backbone.Model.extend({
mixins: [
configurationContainer({
autoSave: true,
includ... | import Backbone from 'backbone';
import {
configurationContainer,
entryTypeEditorControllerUrls,
failureTracking,
delayedDestroying,
ForeignKeySubsetCollection
} from 'pageflow/editor';
export const Chapter = Backbone.Model.extend({
mixins: [
configurationContainer({
autoSave: true,
includ... |
Update and refactor MainCtrl spec
Whoops, #197 broke that spec. Used the opportunity to refactor the file
a bit. | "use strict";
describe('MainCtrl', function() {
beforeEach(module('arethusa'));
it('sets scope values', inject(function($controller, $rootScope) {
var scope = $rootScope.$new();
var state = {
init: function() {},
allLoaded: false
};
var notifier = {
init: function() {},
suc... | "use strict";
describe('MainCtrl', function() {
beforeEach(module('arethusa'));
it('sets scope values', inject(function($controller, $rootScope) {
var scope = $rootScope.$new();
var mystate = {
init: function() {},
allLoaded: false
};
var notifier = {
init: function() {},
s... |
Set heights after images have loaded | if (typeof jQuery === 'undefined') {
throw new Error('The jQuery equal height extension requires jQuery!');
}
jQuery.fn.equalHeight = function() {
var $ = jQuery;
var that = this;
var setHeights = function() {
var elems = {};
var cont = $(that);
// Reset the elements heights
cont.each(function() {
$... | if (typeof jQuery === 'undefined') {
throw new Error('The jQuery equal height extension requires jQuery!');
}
jQuery.fn.equalHeight = function() {
var $ = jQuery;
var that = this;
var setHeights = function() {
var elems = {};
var cont = $(that);
// Reset the elements heights
cont.each(function() {
$... |
Update placeholder in translation string. | <?php
namespace Crud\Error\Exception;
use Cake\Error\Exception;
use Cake\ORM\Entity;
use Cake\Utility\Hash;
/**
* Exception containing validation errors from the model. Useful for API
* responses where you need an error code in response
*
*/
class ValidationException extends Exception {
/**
* List of validation... | <?php
namespace Crud\Error\Exception;
use Cake\Error\Exception;
use Cake\ORM\Entity;
use Cake\Utility\Hash;
/**
* Exception containing validation errors from the model. Useful for API
* responses where you need an error code in response
*
*/
class ValidationException extends Exception {
/**
* List of validation... |
Correct font format terminology; PostScript (a.k.a. Type 1) is a different thing. | 'use strict';
var assert = require('assert');
var mocha = require('mocha');
var describe = mocha.describe;
var it = mocha.it;
var opentype = require('../src/opentype.js');
describe('OpenType.js', function() {
it('can load a TrueType font', function() {
var font = opentype.loadSync('./fonts/Roboto-Black.tt... | 'use strict';
var assert = require('assert');
var mocha = require('mocha');
var describe = mocha.describe;
var it = mocha.it;
var opentype = require('../src/opentype.js');
describe('OpenType.js', function() {
it('can load a TrueType font', function() {
var font = opentype.loadSync('./fonts/Roboto-Black.tt... |
Fix Image Admin for components where multiple exist for one db id | <?php
class Kwc_Abstract_Image_ImageFile extends Kwf_Form_Field_File
{
public function __construct($fieldname = null, $fieldLabel = null)
{
parent::__construct($fieldname, $fieldLabel);
$this->setXtype('kwc.imagefile');
$this->setAllowOnlyImages(true);
}
public function load($ro... | <?php
class Kwc_Abstract_Image_ImageFile extends Kwf_Form_Field_File
{
public function __construct($fieldname = null, $fieldLabel = null)
{
parent::__construct($fieldname, $fieldLabel);
$this->setXtype('kwc.imagefile');
$this->setAllowOnlyImages(true);
}
public function load($ro... |
Fix notification preferences not being enabled by default | <?php namespace Flarum\Extend;
use Illuminate\Foundation\Application;
use Flarum\Core\Models\Notification;
use Flarum\Core\Models\User;
class NotificationType implements ExtenderInterface
{
protected $class;
protected $enabled = [];
public function __construct($class)
{
$this->class = $class... | <?php namespace Flarum\Extend;
use Illuminate\Foundation\Application;
use Flarum\Core\Models\Notification;
use Flarum\Core\Models\User;
class NotificationType implements ExtenderInterface
{
protected $class;
protected $enabled = [];
public function __construct($class)
{
$this->class = $class... |
Adjust spacing between Page.Actions items | // @flow
import baseStyles from '../../../styles/resets/baseStyles.css.js'
import styled from '../../styled'
export const config = {
marginBottom: 100,
padding: '12px 0',
spacing: 10,
}
export const ActionsUI = styled('div')`
${baseStyles} display: flex;
flex-direction: row-reverse;
margin-left: -${config... | // @flow
import baseStyles from '../../../styles/resets/baseStyles.css.js'
import styled from '../../styled'
export const config = {
marginBottom: 100,
padding: '12px 0',
spacing: 5,
}
export const ActionsUI = styled('div')`
${baseStyles} display: flex;
flex-direction: row-reverse;
margin-left: -${config.... |
Add locale formatting to stats numbers
This addresses issue #10. | import React from 'react'
import injectSheet from 'react-jss'
import styles from './styles'
const GenResults = ({ classes, newLine, results, stats }) => {
let joinedResults = Array.prototype.join.call(results, `${newLine ? '\n' : ' '}`).trim()
let words = stats.words
let maxWords = stats.maxWords
let filtered... | import React from 'react'
import injectSheet from 'react-jss'
import styles from './styles'
const GenResults = ({ classes, newLine, results, stats }) => {
let joinedResults = Array.prototype.join.call(results, `${newLine ? '\n' : ' '}`).trim()
let words = stats.words
let maxWords = stats.maxWords
let filtered... |
Fix help docstring and glob parsing | #!/usr/bin/env python
import argparse
import glob
import os
from pytrthree import TRTHIterator
from corintick import Corintick, ValidationError
def main(args):
db = Corintick(args.config)
files = glob.glob(os.path.expanduser(args.files))
for ric, df in TRTHIterator(files):
cols = args.columns if ... | #!/usr/bin/env python
import argparse
import glob
from pytrthree import TRTHIterator
from corintick import Corintick, ValidationError
def main(args):
db = Corintick(args.config)
files = glob.glob(args.files)
for ric, df in TRTHIterator(files):
cols = args.columns if args.columns else df.columns
... |
Fix issue with nested headers on page in admin area | 'use strict';
(function ($) {
var showBanner = function (content) {
if (content) {
$('header.site-header').after(content)
}
}
var getBannerHost = function () {
var local = window.location.host.startsWith('ckan-gateway')
if (local) {
return 'http://localhost:8000'
}
var produ... | 'use strict';
(function ($) {
var showBanner = function (content) {
if (content) {
$('header').after(content)
}
}
var getBannerHost = function () {
var local = window.location.host.startsWith('ckan-gateway')
if (local) {
return 'http://localhost:8000'
}
var production = wind... |
Add a service to get the posts | // we don't need to use a variable
// or the from keyword when importing a css/styl file
// thanks the the styles loader it gets added as a
// <style> tag in the head by default but can be changed
import 'normalize.css';
import {appDirective} from './app.directive';
// the angular libs are just common js
// and therefo... | // we don't need to use a variable
// or the from keyword when importing a css/styl file
// thanks the the styles loader it gets added as a
// <style> tag in the head by default but can be changed
import 'normalize.css';
import {appDirective} from './app.directive';
// the angular libs are just common js
// and therefo... |
Update SimpleMap to hash both keys and values for benefit; Hashable is Hasher; Don't assume go-wire | package merkle
type Tree interface {
Size() (size int)
Height() (height int8)
Has(key []byte) (has bool)
Proof(key []byte) (value []byte, proof []byte, exists bool) // TODO make it return an index
Get(key []byte) (index int, value []byte, exists bool)
GetByIndex(index int) (key []byte, value []byte)
Set(key []b... | package merkle
type Tree interface {
Size() (size int)
Height() (height int8)
Has(key []byte) (has bool)
Proof(key []byte) (value []byte, proof []byte, exists bool) // TODO make it return an index
Get(key []byte) (index int, value []byte, exists bool)
GetByIndex(index int) (key []byte, value []byte)
Set(key []b... |
Update docs versions for 2.x | # Global configuration information used across all the
# translations of documentation.
#
# Import the base theme configuration
from cakephpsphinx.config.all import *
# The version info for the project you're documenting, acts as replacement for
# |version| and |release|, also used in various other places throughout t... | # Global configuration information used across all the
# translations of documentation.
#
# Import the base theme configuration
from cakephpsphinx.config.all import *
# The version info for the project you're documenting, acts as replacement for
# |version| and |release|, also used in various other places throughout t... |
SDC-9109: Add RUNNING_ERROR to pipeline states available for notifications.
Change-Id: Idb02918672c1057a1bb94653c6f100374373cd89
Reviewed-on: https://review.streamsets.net/14850
Reviewed-by: Jarcec Cecho <df2d427dacaa504f2ede0aed47c4cdf043778b95@streamsets.com>
Tested-by: StreamSets CI <809627f37325a679986bd660c771347... | /*
* Copyright 2017 StreamSets Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed... | /*
* Copyright 2017 StreamSets Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed... |
Add reflection to problem execution | package com.ejpm.euler;
import com.ejpm.euler.problem.Problem;
import java.util.logging.Level;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
public class App {
@SuppressWarnings("unused")
private static final Logger LOGGER = LoggerFactory.getLogger(App.class);
public static void main(String[]... | package com.ejpm.euler;
import com.ejpm.euler.problem.impl.Problem1;
import com.ejpm.euler.problem.impl.Problem2;
import com.ejpm.euler.problem.impl.Problem3;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
public class App {
@SuppressWarnings("unused")
private static final Logger LOGGER = LoggerFac... |
Add the function (not class) to actions as is now required | from twisted.words.protocols import irc
from txircd.modbase import Command, Module
class PassCommand(Command, Module):
def onUse(self, user, params):
if user.registered == 0:
user.sendMessage(irc.ERR_ALREADYREGISTRED, ":Unauthorized command (already registered)")
return
if not params:
user.sendMessage(ir... | from twisted.words.protocols import irc
from txircd.modbase import Command, Module
class PassCommand(Command, Module):
def onUse(self, user, params):
if user.registered == 0:
user.sendMessage(irc.ERR_ALREADYREGISTRED, ":Unauthorized command (already registered)")
return
if not params:
user.sendMessage(ir... |
Fix - icon alignment in onboarding modal (calendar ready) | import { Alert, Icon } from 'react-components';
import { c } from 'ttag';
import React from 'react';
import calendarSvg from 'design-system/assets/img/pm-images/calendar.svg';
const CalendarReady = () => {
const supportIcon = <Icon key="support-icon" name="support1" className="alignsub" />;
return (
<>... | import { Alert, Icon } from 'react-components';
import { c } from 'ttag';
import React from 'react';
import calendarSvg from 'design-system/assets/img/pm-images/calendar.svg';
const CalendarReady = () => {
const supportIcon = <Icon key="support-icon" name="support1" />;
return (
<>
<Alert>{... |
Allow all languages on pretix | from pretix.settings import * # noqa
SECRET_KEY = "{{secret_key}}"
LOGGING["handlers"]["mail_admins"]["include_html"] = True # noqa
STATICFILES_STORAGE = (
"django.contrib.staticfiles.storage.ManifestStaticFilesStorage" # noqa
)
DATABASES = {
"default": {
"ENGINE": "django.db.backends.postgresql",... | from pretix.settings import * # noqa
SECRET_KEY = "{{secret_key}}"
LOGGING["handlers"]["mail_admins"]["include_html"] = True # noqa
STATICFILES_STORAGE = (
"django.contrib.staticfiles.storage.ManifestStaticFilesStorage" # noqa
)
DATABASES = {
"default": {
"ENGINE": "django.db.backends.postgresql",... |
Add cy-GB and es-ES languages | 'use strict';
module.exports = {
defaultLangTag: 'en',
primary: [
'ar',
'da',
'de',
'en',
'es',
'fi',
'fr',
'ja',
'ko',
'nb',
'nl',
'pt',
'sv',
'tr',
'zh'
],
regions: [
'ar-SA',
'cy-GB',
'da-DK',
'de-DE',
'en-CA',
'en-GB',
'en-US',
'es-MX',
'es-ES',
'fi-FI',
'fr-... | 'use strict';
module.exports = {
defaultLangTag: 'en',
primary: [
'ar',
'da',
'de',
'en',
'es',
'fi',
'fr',
'ja',
'ko',
'nb',
'nl',
'pt',
'sv',
'tr',
'zh'
],
regions: [
'ar-SA',
'da-DK',
'de-DE',
'en-CA',
'en-GB',
'en-US',
'es-MX',
'fi-FI',
'fr-CA',
'fr-FR',
'fr-... |
Use .attr instead of .data to get json selector. Prevents evaluation of [x] as array | // ===================================================
// DOM Outline with event handlers
// ===================================================
$(function(){
var $selector_box = $("#selector");
var selector_val = "";
var DomOutlineHandlers = {
'click': function(e){
selector_val = $(e).... | // ===================================================
// DOM Outline with event handlers
// ===================================================
$(function(){
var $selector_box = $("#selector");
var selector_val = "";
var DomOutlineHandlers = {
'click': function(e){
selector_val = $(e).... |
Remove compression (done at NGINX level) | /* jshint node: true, browser: false */
'use strict';
// CREATE HTTP SERVER AND PROXY
var app = require('express')();
var proxy = require('http-proxy').createProxyServer({});
proxy.on('error', function(e) {
console.error(e);
}); //ignore errors
// LOAD CONFIGURATION
var oneDay = 86400000;
var cacheTag ... | /* jshint node: true, browser: false */
'use strict';
// CREATE HTTP SERVER AND PROXY
var app = require('express')();
var proxy = require('http-proxy').createProxyServer({});
proxy.on('error', function(e) {
console.error(e);
}); //ignore errors
// LOAD CONFIGURATION
var oneDay = 86400000;
var cacheTag ... |
Update measured Focal Lengths for C920. | # Calculate the distance to an object of known size.
# We need to know the perceived focal length for this to work.
#
# Known Focal Length values for calibrated cameras
# Logitech C920: H622 V625
# Microsoft Lifecam HD-3000: H652 V?
#
PFL_H_C920 = 622
PFL_V_C920 = 625
PFL_H_LC3000 = 652
PF... | # Calculate the distance to an object of known size.
# We need to know the perceived focal length for this to work.
#
# Known Focal Length values for calibrated cameras
# Logitech C920: H620 V?
# Microsoft Lifecam HD-3000: H652 V?
#
class TriangleSimilarityDistanceCalculator:
knownSize = 0... |
Fix shape unpacking ((height, width), not (w, h)). | """
=================
Template Matching
=================
In this example, we use template matching to identify the occurrence of an
image patch (in this case, a sub-image centered on the camera man's head).
Since there's only a single match, the maximum value in the `match_template`
result` corresponds to the head lo... | """
=================
Template Matching
=================
In this example, we use template matching to identify the occurrence of an
image patch (in this case, a sub-image centered on the camera man's head).
Since there's only a single match, the maximum value in the `match_template`
result` corresponds to the head lo... |
Fix over writing previous addToResult calls
I noticed that multiple calls to the addToResult method in the org.apache.camel.component.aws.ddb.AbstractDdbCommand within the child class org.apache.camel.component.aws.ddb.ScanCommand caused the next call to over write the previous calls to addToResult in the header resul... | /**
* 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... |
Switch pytest fixture to function scope
Still use the class's get_data method for fixture data | # coding: utf-8
from __future__ import absolute_import, division, print_function, unicode_literals
import pytest
import rethinkdb
from mockthink import MockThink
from mockthink.test.common import as_db_and_table, load_stock_data
def pytest_addoption(parser):
group = parser.getgroup("mockthink", "Mockthink Test... | # coding: utf-8
from __future__ import absolute_import, division, print_function, unicode_literals
import pytest
import rethinkdb
from mockthink import MockThink
from mockthink.test.common import as_db_and_table, load_stock_data
def pytest_addoption(parser):
group = parser.getgroup("mockthink", "Mockthink Test... |
Add translation URLs as required by Oscar
Fixes #5. | from django.contrib import admin
from django.conf import settings
from django.conf.urls import patterns, include, url
from oscar.app import shop
from oscar_mws.dashboard.app import application as mws_app
admin.autodiscover()
urlpatterns = patterns(
'',
url(r'^admin/', include(admin.site.urls)),
# i18n U... | from django.contrib import admin
from django.conf import settings
from django.conf.urls import patterns, include, url
from oscar.app import shop
from oscar_mws.dashboard.app import application as mws_app
admin.autodiscover()
urlpatterns = patterns(
'',
url(r'^admin/', include(admin.site.urls)),
url(r'^d... |
Update comment & expose transformDecl
That will allow direct usage un a plugin to avoid multiple loop to
apply transformation directly in a global plugin | /**
* Module dependencies.
*/
var reduceCSSCalc = require("reduce-css-calc")
/**
* Expose plugin & helper
*/
module.exports = plugin
module.exports.transformDecl = transformDecl
/**
* PostCSS plugin to reduce calc() function calls.
*/
function plugin() {
return function(style) {
style.eachDecl(transformDe... | /**
* Module dependencies.
*/
var reduceCSSCalc = require("reduce-css-calc")
/**
* Expose `plugin`.
*/
module.exports = plugin
/**
* Plugin to convert all function calls.
*
* @param {Object} stylesheet
*/
function plugin() {
return function(style) {
style.eachDecl(function declaration(dec) {
if ... |
Rename referral portal -> Acute admissions | """
Referral routes for OPAL acute
"""
from referral import ReferralRoute
from acute import models
class ClerkingRoute(ReferralRoute):
name = 'Acute Take'
description = 'Add a patient to the Acute Take list'
page_title = 'Acute Admissions'
target_teams = ['take']
success_link = '/#/lis... | """
Referral routes for OPAL acute
"""
from referral import ReferralRoute
from acute import models
class ClerkingRoute(ReferralRoute):
name = 'Acute Take'
description = 'Add a patient to the Acute Take list'
target_teams = ['take']
success_link = '/#/list/take'
verb = 'Book in'
progr... |
Add serial number incrementation method | package org.cryptonit.cloud.timestamping;
import java.math.BigInteger;
import java.security.*;
import java.security.cert.X509Certificate;
import org.bouncycastle.tsp.*;
import org.bouncycastle.util.Store;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/**
* @author Mathias Brossard
*/
public class Authori... | package org.cryptonit.cloud.timestamping;
import org.bouncycastle.tsp.*;
import org.bouncycastle.util.Store;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.security.*;
import java.security.cert.X509Certificate;
/**
* @author Mathias Brossard
*/
public class Authority {
private static Logger... |
Index the URL of the WidgyPage.
This way, you don't have to fetch the page object when you want to put a
link in the search results. | from haystack import indexes
from widgy.contrib.widgy_mezzanine import get_widgypage_model
from widgy.templatetags.widgy_tags import render_root
from widgy.utils import html_to_plaintext
from .signals import widgypage_pre_index
WidgyPage = get_widgypage_model()
class PageIndex(indexes.SearchIndex, indexes.Indexabl... | from haystack import indexes
from widgy.contrib.widgy_mezzanine import get_widgypage_model
from widgy.templatetags.widgy_tags import render_root
from widgy.utils import html_to_plaintext
from .signals import widgypage_pre_index
WidgyPage = get_widgypage_model()
class PageIndex(indexes.SearchIndex, indexes.Indexabl... |
Use python2 pyyaml instead of python3. | import os
import sys
def fix_imports():
here = os.path.dirname(__file__)
dirs = [
os.path.normpath(os.path.join(here, '..', '..')),
os.path.normpath(os.path.join(here, 'babel')),
os.path.normpath(os.path.join(here, 'dulwich')),
os.path.normpath(os.path.join(here, 'google-apputils-python'))... | import os
import sys
def fix_imports():
here = os.path.dirname(__file__)
dirs = [
os.path.normpath(os.path.join(here, '..', '..')),
os.path.normpath(os.path.join(here, 'babel')),
os.path.normpath(os.path.join(here, 'dulwich')),
os.path.normpath(os.path.join(here, 'google-apputils-python'))... |
Remove useless spacing in the tests | var replace = require("../str-replace");
var expect = require("expect.js");
describe("Replace first", function() {
it("should replace first occurrences", function() {
expect(replace("a").from("aa").with("e")).to.be("ea");
});
it("should replace first occurrences ignoring the case", function() {
expect(re... | var replace = require("../str-replace");
var expect = require("expect.js");
describe("Replace first", function() {
it("should replace first occurrences", function() {
expect(replace("a").from("aa").with("e")).to.be("ea");
});
it("should replace first occurrences ignoring the case", function() {
expect(... |
Update User model class with flask-login methods | from flask_login import UserMixin
from werkzeug.security import generate_password_hash, check_password_hash
class User(UserMixin):
"""Represents a user who can Create, Read, Update & Delete his own bucketlists"""
counter = 0
users = {}
def __init__(self, email, username, password):
"""Constru... | from werkzeug.security import generate_password_hash, check_password_hash
class User(object):
"""represents a user who can CRUD his own bucketlists"""
users = {}
def __init__(self, email, username, password):
"""Constructor class to initialize class"""
self.email = email
self.use... |
Fix to input handler to support space -> underscore conversion. | /*
* Copyright 2013 MovingBlocks
*
* 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 t... | /*
* Copyright 2013 MovingBlocks
*
* 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 t... |
chore(pins): Update pins for dictionary to release tag
- Update pins for dictionary to release tag | from setuptools import setup, find_packages
setup(
name='gdcdatamodel',
packages=find_packages(),
install_requires=[
'pytz==2016.4',
'graphviz==0.4.2',
'jsonschema==2.5.1',
'psqlgraph',
'gdcdictionary',
'cdisutils',
'python-dateutil==2.4.2',
],
... | from setuptools import setup, find_packages
setup(
name='gdcdatamodel',
packages=find_packages(),
install_requires=[
'pytz==2016.4',
'graphviz==0.4.2',
'jsonschema==2.5.1',
'psqlgraph',
'gdcdictionary',
'cdisutils',
'python-dateutil==2.4.2',
],
... |
Revert "make some changes that will be undone"
This reverts commit 0321c6fc0d445be8db71fee1a09b7c5f952d7ca8. | 'use strict';
/**
* Module dependencies.
*/
var init = require('./config/init')(),
config = require('./config/config'),
mongoose = require('mongoose'),
chalk = require('chalk');
/**
* Main application entry file.
* Please note that the order of loading is important.
*/
// Bootstrap db connection
var db = mong... | 'use strict';
/**
* Module dependencies.
*/
var init = require('./config/init')(),
config = require('./config/config'),
mongoose = require('mongoose'),
chalk = require('chalk');
/**
* Main application entry file.
* Please note that the order of loading is important.
*/
// Bootstrap db connection
var db = mong... |
Add uploads form laguage composer | <?php
namespace Milax\Mconsole\Providers;
use Illuminate\Support\ServiceProvider;
class ViewComposersServiceProvider extends ServiceProvider
{
/**
* Bootstrap the application events.
*
* @return void
*/
public function boot()
{
//
}
/**
* Register the service... | <?php
namespace Milax\Mconsole\Providers;
use Illuminate\Support\ServiceProvider;
class ViewComposersServiceProvider extends ServiceProvider
{
/**
* Bootstrap the application events.
*
* @return void
*/
public function boot()
{
//
}
/**
* Register the service... |
Change confusing blob data string
(from "ten-bytes!" into "1234567890") | 'use strict'
describe('/#/complain', function () {
protractor.beforeEach.login({ email: 'admin@juice-sh.op', password: 'admin123' })
describe('challenge "uploadSize"', function () {
it('should be possible to upload files greater 100 KB', function () {
browser.executeScript(function () {
var over... | 'use strict'
describe('/#/complain', function () {
protractor.beforeEach.login({ email: 'admin@juice-sh.op', password: 'admin123' })
describe('challenge "uploadSize"', function () {
it('should be possible to upload files greater 100 KB', function () {
browser.executeScript(function () {
var over... |
Use escape byte encoded in hex and not in octal | var CLI = require('../lib/clui.js'),
clc = require('cli-color');
var Line = CLI.Line;
Progress = CLI.Progress;
var statuses = [0, 0, 0, 0, 0];
var lengths = [10, 20, 30, 40, 50];
console.log('\nCtrl/Command + C to quit...\n\n\n\n\n\n\n\n\n');
function drawProgress () {
process.stdout.wri... | var CLI = require('../lib/clui.js'),
clc = require('cli-color');
var Line = CLI.Line;
Progress = CLI.Progress;
var statuses = [0, 0, 0, 0, 0];
var lengths = [10, 20, 30, 40, 50];
console.log('\nCtrl/Command + C to quit...\n\n\n\n\n\n\n\n\n');
function drawProgress () {
process.stdout.wri... |
AndroidResource: Add a UiautoApk resource type.
When moving to Uiautomation 2, tests are now complied into apk files rather than
jar files. To avoid conflicts with regular workload apks a new resource type is
added to retrieve the test files which will be renamed to have the extension
.uiautoapk | # Copyright 2014-2015 ARM Limited
#
# 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 w... | # Copyright 2014-2015 ARM Limited
#
# 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 w... |
Debug On. Remove needless tasks. | /*
* svg_fallback
*
*
* Copyright (c) 2014 yoksel
* Licensed under the MIT license.
*/
'use strict';
module.exports = function(grunt) {
// Project configuration.
grunt.initConfig({
// Configuration to be run (and then tested).
svg_fallback: {
options: {
debu... | /*
* svg_fallback
*
*
* Copyright (c) 2014 yoksel
* Licensed under the MIT license.
*/
'use strict';
module.exports = function(grunt) {
// Project configuration.
grunt.initConfig({
// Configuration to be run (and then tested).
svg_fallback: {
your_target: {
src: 'test/sources/'... |
Return NONE connection type for null. | package com.intellij.remote;
import com.intellij.openapi.diagnostic.Logger;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
/**
* This class denotes the type of the source to obtain remote credentials.
*
* @author traff
*/
public enum RemoteConnectionType {
/**
* Curren... | package com.intellij.remote;
import com.intellij.openapi.diagnostic.Logger;
/**
* This class denotes the type of the source to obtain remote credentials.
*
* @author traff
*/
public enum RemoteConnectionType {
/**
* Currently selected SDK (e.g. <Project default>)
*/
DEFAULT_SDK,
/**
* Web deploy... |
ESLint: Disable failing rules for now | module.exports = {
root: true,
parser: 'babel-eslint',
parserOptions: {
ecmaVersion: 2018,
sourceType: 'module',
ecmaFeatures: {
legacyDecorators: true,
},
},
plugins: ['ember', 'prettier'],
extends: ['eslint:recommended', 'plugin:ember/recommended', 'plugin:prettier/recommended'],
e... | module.exports = {
root: true,
parser: 'babel-eslint',
parserOptions: {
ecmaVersion: 2018,
sourceType: 'module',
ecmaFeatures: {
legacyDecorators: true,
},
},
plugins: ['ember', 'prettier'],
extends: ['eslint:recommended', 'plugin:ember/recommended', 'plugin:prettier/recommended'],
e... |
Add body parser to test server
- previously handlers called in tests did not receive request.body | import {defer} from 'q';
import {createServer, bodyParser} from 'restify';
import registerResources from '../src/register';
import {spyOnServer, stopSpyingOnServer} from './serverSpying';
export default async (resource) => {
const server = await startServer(resource);
return {
server,
async stop()... | import {defer} from 'q';
import {createServer} from 'restify';
import registerResources from '../src/register';
import {spyOnServer, stopSpyingOnServer} from './serverSpying';
export default async (resource) => {
const server = await startServer(resource);
return {
server,
async stop() {
st... |
Add comment describing what does the method do | #
# Perl (Inline::Perl) helpers
#
# FIXME MC_REWRITE_TO_PYTHON: remove after porting all Perl code to Python
def decode_string_from_bytes_if_needed(string):
"""Convert 'bytes' string to 'unicode' if needed.
(http://search.cpan.org/dist/Inline-Python/Python.pod#PORTING_YOUR_INLINE_PYTHON_CODE_FROM_2_TO_3)"""
... | #
# Perl (Inline::Perl) helpers
#
# FIXME MC_REWRITE_TO_PYTHON: remove after porting all Perl code to Python
def decode_string_from_bytes_if_needed(string):
"""Convert 'bytes' string to 'unicode' if needed.
(http://search.cpan.org/dist/Inline-Python/Python.pod#PORTING_YOUR_INLINE_PYTHON_CODE_FROM_2_TO_3)"""
... |
Change reports URLs to extend from /children/<slug>. | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.conf.urls import url
from . import views
urlpatterns = [
url(r'^children/(?P<slug>[^/.]+)/reports/changes/lifetimes/$',
views.DiaperChangeLifetimesChildReport.as_view(),
name='report-diaperchange-lifetimes-child'),
ur... | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.conf.urls import url
from . import views
urlpatterns = [
url(r'^reports/changes/lifetimes/(?P<slug>[^/.]+)/$',
views.DiaperChangeLifetimesChildReport.as_view(),
name='report-diaperchange-lifetimes-child'),
url(r'^repo... |
Set Rocker default version to 1.3.0 | package nu.studer.gradle.rocker;
import org.gradle.api.Project;
import java.util.Objects;
final class RockerVersion {
private static final String PROJECT_PROPERTY = "rockerVersion";
private static final String DEFAULT = "1.3.0";
private final String versionString;
private RockerVersion(String vers... | package nu.studer.gradle.rocker;
import org.gradle.api.Project;
import java.util.Objects;
final class RockerVersion {
private static final String PROJECT_PROPERTY = "rockerVersion";
private static final String DEFAULT = "1.2.2";
private final String versionString;
private RockerVersion(String vers... |
Use keys from filter object in allowed properties. | var evals = [ 'undefined', 'null', 'false', 'true' ];
var _filters = {
regex: function(value) {
return new RegExp(value, 'i');
},
exists: function(value) {
if(value === true)
return { $ne: null };
else
return { $eq: null };
}
};
module.exports = function(properties, filters) {
properties = _.union(... | var evals = [ 'undefined', 'null', 'false', 'true' ];
var _filters = {
regex: function(value) {
return new RegExp(value, 'i');
},
exists: function(value) {
if(value === true)
return { $ne: null };
else
return { $eq: null };
}
};
module.exports = function(properties, filters) {
filters = _.mapValues... |
Remove lock file before installing | <?php
namespace MaxBucknell\Gulp\Console\Command;
use MaxBucknell\Gulp\Model\Filesystem;
use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Output\OutputInterface;
class Install extends Com... | <?php
namespace MaxBucknell\Gulp\Console\Command;
use MaxBucknell\Gulp\Model\Filesystem;
use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Output\OutputInterface;
class Install extends Com... |
Check for multiple target routes for deciding when to transition. | var route = Ember.Route.extend({
model: function() {
return this.store.all('task');
},
afterModel: function(tasks, transition) {
if (transition.targetName == "tasks.index" || transition.targetName == "tasks") {
if($(document).width() > 700) {
Ember.run.next(this, ... | var route = Ember.Route.extend({
model: function() {
return this.store.all('task');
},
afterModel: function(tasks, transition) {
if (transition.targetName == "tasks.index") {
if($(document).width() > 700) {
Ember.run.next(this, function(){
var ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.