text stringlengths 17 1.47k | positive stringlengths 673 4.43k | negative stringlengths 677 2.81k |
|---|---|---|
Add function can now have the ' character | package seedu.scheduler.model.entry;
import seedu.scheduler.commons.exceptions.IllegalValueException;
/**
* Represents an Entry's name in the scheduler.
* Guarantees: immutable; is valid as declared in {@link #isValidName(String)}
*/
public class Name {
public static final String MESSAGE_NAME_CONSTRAINTS = "E... | package seedu.scheduler.model.entry;
import seedu.scheduler.commons.exceptions.IllegalValueException;
/**
* Represents an Entry's name in the scheduler.
* Guarantees: immutable; is valid as declared in {@link #isValidName(String)}
*/
public class Name {
public static final String MESSAGE_NAME_CONSTRAINTS = "E... |
GREEN: Test now uses correct value. | package de.itemis.mosig.racecar.tirepressure;
import org.junit.Before;
import org.junit.Test;
import org.mockito.Mockito;
import static org.junit.Assert.assertEquals;
public class AlarmTest {
private static final double PRESSURE_INTERVAL_LOWER_BOUND = 17d;
private Sensor mockedSensor;
private Alarm un... | package de.itemis.mosig.racecar.tirepressure;
import org.junit.Before;
import org.junit.Test;
import org.mockito.Mockito;
import static org.junit.Assert.assertEquals;
public class AlarmTest {
private static final double PRESSURE_INTERVAL_LOWER_BOUND = 17d;
private Sensor mockedSensor;
private Alarm un... |
Modify data source to HDFS | package com.parquet;
import com.richstonedt.nokia_api.peopleflow.Record;
import org.apache.spark.SparkConf;
import org.apache.spark.SparkContext;
import org.apache.spark.api.java.function.MapPartitionsFunction;
import org.apache.spark.sql.Encoder;
import org.apache.spark.sql.Encoders;
import org.apache.spark.sql.SaveM... | package com.parquet;
import com.richstonedt.nokia_api.peopleflow.Record;
import org.apache.spark.SparkConf;
import org.apache.spark.SparkContext;
import org.apache.spark.api.java.function.MapPartitionsFunction;
import org.apache.spark.sql.Encoder;
import org.apache.spark.sql.Encoders;
import org.apache.spark.sql.SaveM... |
Save taxon root at end | <?php
namespace Tests\SitemapPlugin\Controller;
use Lakion\ApiTestCase\XmlApiTestCase;
use Sylius\Component\Core\Model\Product;
use Sylius\Component\Core\Model\Taxon;
/**
* @author Stefan Doorn <stefan@efectos.nl>
*/
class SitemapTaxonControllerApiTest extends XmlApiTestCase
{
/**
* @before
*/
pu... | <?php
namespace Tests\SitemapPlugin\Controller;
use Lakion\ApiTestCase\XmlApiTestCase;
use Sylius\Component\Core\Model\Product;
use Sylius\Component\Core\Model\Taxon;
/**
* @author Stefan Doorn <stefan@efectos.nl>
*/
class SitemapTaxonControllerApiTest extends XmlApiTestCase
{
/**
* @before
*/
pu... |
Fix the token request and log level | <?php
namespace APIBundle\Controller;
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\JsonResponse;
use Symfony\Component\HttpFoundation\Response;
use FOS\RestBundle\Controller\Annotations as Rest;
use Nelmio\ApiDocBundle\Ann... | <?php
namespace APIBundle\Controller;
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\JsonResponse;
use Symfony\Component\HttpFoundation\Response;
use FOS\RestBundle\Controller\Annotations as Rest;
use Nelmio\ApiDocBundle\Ann... |
:no_entry: Stop page repositioning after using my location | (function (global) {
'use strict';
var $ = global.jQuery;
var $geoLocate = $('.geo-locate');
var $geoLocateDenied = $('.geo-locate--denied');
var $geoLocateError = $('.geo-locate--error');
var $geoLocateLocate = $('.geo-locate--locate');
var $geoLocateSearching = $('.geo-locate--searching');
var window ... | (function (global) {
'use strict';
var $ = global.jQuery;
var $geoLocate = $('.geo-locate');
var $geoLocateDenied = $('.geo-locate--denied');
var $geoLocateError = $('.geo-locate--error');
var $geoLocateLocate = $('.geo-locate--locate');
var $geoLocateSearching = $('.geo-locate--searching');
var window ... |
Copy entrypoint config to new app/config/ | <?php
/**
* @package jelix
* @subpackage jsoap module
* @author Laurent Jouanneau
* @contributor
* @copyright 2009-2015 Laurent Jouanneau
* @link http://www.jelix.org
* @licence GNU Lesser General Public Licence see LICENCE file or http://www.gnu.org/licenses/lgpl.html
*/
class jsoapModuleInsta... | <?php
/**
* @package jelix
* @subpackage jsoap module
* @author Laurent Jouanneau
* @contributor
* @copyright 2009-2015 Laurent Jouanneau
* @link http://www.jelix.org
* @licence GNU Lesser General Public Licence see LICENCE file or http://www.gnu.org/licenses/lgpl.html
*/
class jsoapModuleInsta... |
Delete button issue now fixed | import React from "react";
import { Button, Popup, Input, Header, Divider } from 'semantic-ui-react';
export default class DayEditBox extends React.Component {
render(){
var myId = "dayedit-" + this.props.id + "-text";
var content = (
<div>
<Input focus placeholder={this... | import React from "react";
import { Button, Popup, Input, Heading, Divider } from 'semantic-ui-react';
export default class DayEditBox extends React.Component {
render(){
var myId = "dayedit-" + this.props.id + "-text";
var content = (
<div>
<Input focus placeholder={thi... |
Return 404 not found if user or research entity doesn't exist when getting the profile image | /**
* TagLabelController
*
* @description :: Server-side logic for managing Journals
* @help :: See http://sailsjs.org/#!/documentation/concepts/Controllers
*/
const path = require('path');
const fs = require('fs');
module.exports = {
getProfileImage: async function (req, res, next) {
const us... | /**
* TagLabelController
*
* @description :: Server-side logic for managing Journals
* @help :: See http://sailsjs.org/#!/documentation/concepts/Controllers
*/
const path = require('path');
const fs = require('fs');
module.exports = {
getProfileImage: async function (req, res, next) {
const us... |
Add a bit more JavaDoc | package org.dstadler.commoncrawl;
/**
* Which extensions we are interested in.
*
* If you want to change which files are downloaded, just can
* set a different list of file-extensions here, e.g.
*
* <pre>
".pdf"
</pre>
*
* would find and download PDF documents.
*/
public class Extensions {
... | package org.dstadler.commoncrawl;
/**
* Which extensions we are interested in.
*
* @author dominik.stadler
*/
public class Extensions {
private static final String[] EXTENSIONS = new String[] {
// Excel
".xls",
".xlsx",
".xlsm",
".xltx",
".xlsb",
// Wor... |
Install ember-sinon as an addon. | /* globals module */
var EOL = require('os').EOL;
module.exports = {
description: 'Register test helpers',
afterInstall: function( options ) {
// Import statement
var firstFile = 'tests/helpers/start-app.js';
var firstText = "import slRegisterTestHelpers from './sl/register-test-helpe... | /* globals module */
var EOL = require('os').EOL;
module.exports = {
description: 'Register test helpers',
afterInstall: function( options ) {
// Import statement
var firstFile = 'tests/helpers/start-app.js';
var firstText = "import slRegisterTestHelpers from './sl/register-test-helpe... |
Fix: Use headless Chrome for Angular tests again. | // Karma configuration file, see link for more information
// https://karma-runner.github.io/1.0/config/configuration-file.html
module.exports = function (config) {
config.set({
basePath: '',
frameworks: ['jasmine', '@angular-devkit/build-angular'],
plugins: [
require('karma-jasmine'),
requir... | // Karma configuration file, see link for more information
// https://karma-runner.github.io/1.0/config/configuration-file.html
module.exports = function (config) {
config.set({
basePath: '',
frameworks: ['jasmine', '@angular-devkit/build-angular'],
plugins: [
require('karma-jasmine'),
requir... |
Convert Hamburger component to stateless function | import React from 'react';
import styled from 'styled-components';
import theme from 'theme';
const StyledHamburger = styled.div`
position: relative;
width: 15px;
height: 13px;
`;
export const Bar = styled.div`
position: absolute;
height: 3px;
background: ${theme.black};
overflow: hidden;
... | import React from 'react';
import styled from 'styled-components';
import theme from 'theme';
const StyledHamburger = styled.div`
position: relative;
width: 15px;
height: 13px;
`;
export const Bar = styled.div`
position: absolute;
height: 3px;
background: ${theme.black};
overflow: hidden;
... |
Add predicate to check CSRF token | from pyramid.view import (
view_config,
view_defaults,
)
from pyramid.httpexceptions import HTTPSeeOther
from pyramid.security import (
remember,
forget,
)
@view_defaults(accept='application/json', renderer='json', context='..traversal.User')
class User(object):
de... | from pyramid.view import (
view_config,
view_defaults,
)
from pyramid.httpexceptions import HTTPSeeOther
from pyramid.security import (
remember,
forget,
)
@view_defaults(accept='application/json', renderer='json', context='..traversal.User')
class User(object):
de... |
Check when session is null | /* global SolidAuthClient, SolidUtils, $rdf */
TweeFiUtils = {
TweetUri: class {
constructor(value) {
// Regex-pattern to check URLs against:
// https://twitter.com/<twitteruser>/status/<long number>
var urlRegex = /^https:\/\/twitter.com\/([a-zA-Z _.,!"'/$]+)\/status\... | /* global SolidAuthClient, SolidUtils, $rdf */
TweeFiUtils = {
TweetUri: class {
constructor(value) {
// Regex-pattern to check URLs against:
// https://twitter.com/<twitteruser>/status/<long number>
var urlRegex = /^https:\/\/twitter.com\/([a-zA-Z _.,!"'/$]+)\/status\... |
Fix filter bug on empty value | <?php
/*
* This file is part of the Sonata package.
*
* (c) Thomas Rabaix <thomas.rabaix@sonata-project.org>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Sonata\AdminBundle\Filter\ORM;
use Symfony\Component\Form\For... | <?php
/*
* This file is part of the Sonata package.
*
* (c) Thomas Rabaix <thomas.rabaix@sonata-project.org>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Sonata\AdminBundle\Filter\ORM;
use Symfony\Component\Form\For... |
[Guice] Remove use of deprecated constants | package io.cucumber.guice;
import com.google.inject.Guice;
import com.google.inject.Stage;
import java.util.Map;
import static java.text.MessageFormat.format;
final class InjectorSourceFactory {
static final String GUICE_INJECTOR_SOURCE_KEY = "guice.injector-source";
private final Map<String, String> prope... | package io.cucumber.guice;
import com.google.inject.Guice;
import com.google.inject.Stage;
import java.util.Map;
import static java.text.MessageFormat.format;
final class InjectorSourceFactory {
static final String GUICE_INJECTOR_SOURCE_KEY = "guice.injector-source";
private final Map<String, String> prope... |
FIX moved bio script to misc.bio_utils | from setuptools import setup
console_scripts = [
'extract-metagene-profiles=riboutils.extract_metagene_profiles:main',
'estimate-metagene-profile-bayes-factors=riboutils.estimate_metagene_profile_bayes_factors:main',
'select-periodic-offsets=riboutils.select_periodic_offsets:main'
]
def readme():
with... | from setuptools import setup
def readme():
with open('README.md') as f:
return f.read()
setup(name='riboutils',
version='0.1',
description="This package contains utilities for other ribosome profiling projects.",
long_description=readme(),
keywords="ribosome profiling utili... |
Add "use strict" + code cleanup | "use strict";
var argv = require("optimist")
.boolean(['fetchtags'])
.default('url', 'http://downloads.vagrantup.com')
.default('file', 'checksums.json')
.default('tag', 'v1.3.3')
.default('tagpath', '/tags/')
.argv;
var request = require("request")
, cheerio = require("cheerio")
, crypto = ... | var argv = require("optimist")
.boolean(['fetchtags'])
.default('url', 'http://downloads.vagrantup.com')
.default('file', 'checksums.json')
.default('tag', 'v1.3.3')
.default('tagpath', '/tags/')
.argv;
var request = require("request")
, cheerio = require("cheerio")
, crypto = require("crypto"... |
Fix logic for validating viewBox prop | const meetOrSliceTypes = {
meet: 0,
slice: 1,
none: 2,
};
const alignEnum = [
"xMinYMin",
"xMidYMin",
"xMaxYMin",
"xMinYMid",
"xMidYMid",
"xMaxYMid",
"xMinYMax",
"xMidYMax",
"xMaxYMax",
"none",
].reduce((prev, name) => {
prev[name] = name;
return prev;
}, {})... | const meetOrSliceTypes = {
meet: 0,
slice: 1,
none: 2,
};
const alignEnum = [
"xMinYMin",
"xMidYMin",
"xMaxYMin",
"xMinYMid",
"xMidYMid",
"xMaxYMid",
"xMinYMax",
"xMidYMax",
"xMaxYMax",
"none",
].reduce((prev, name) => {
prev[name] = name;
return prev;
}, {})... |
Add a reset button into the search section.
:) | <?php
use yii\helpers\Html;
use yii\helpers\Url;
use yii\bootstrap\ActiveForm;
/* @var $this yii\web\View */
/* @var $model app\models\CttStaticdataLanguagesSearch */
/* @var $form yii\widgets\ActiveForm */
?>
<div class="ctt-staticdata-languages-search">
<?php $form = ActiveForm::begin([
'action' => ['... | <?php
use yii\helpers\Html;
use yii\bootstrap\ActiveForm;
/* @var $this yii\web\View */
/* @var $model app\models\CttStaticdataLanguagesSearch */
/* @var $form yii\widgets\ActiveForm */
?>
<div class="ctt-staticdata-languages-search">
<?php $form = ActiveForm::begin([
'action' => ['index'],
'met... |
[base] Remove faulty keypress condition in input text component
See https://github.com/driebit/ginger/commit/d4f55200359e4534c528b967c2d85188196778da#commitcomment-23920421 | $.widget("ui.search_cmp_input_text", {
_create: function() {
var me = this,
widgetElement = $(me.element);
me.widgetElement = widgetElement;
me.type = 'qs';
me.widgetElement.keypress(function(event) {
if (event.keyCode === 13) {
event.preve... | $.widget("ui.search_cmp_input_text", {
_create: function() {
var me = this,
widgetElement = $(me.element);
me.widgetElement = widgetElement;
me.type = 'qs';
me.widgetElement.keypress(function(event) {
if (event.keyCode == 13) {
var onSeachP... |
Add /firefox/nightly/all/ to download link tests | # This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
from bs4 import BeautifulSoup
import pytest
import requests
def pytest_generate_tests(metafunc):
if 'not headless'... | # This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
from bs4 import BeautifulSoup
import pytest
import requests
def pytest_generate_tests(metafunc):
if 'not headless'... |
Change project name to cljsbook. | import paver
from paver.easy import *
import paver.setuputils
paver.setuputils.install_distutils_tasks()
import os, sys
from sphinxcontrib import paverutils
sys.path.append(os.getcwd())
updateProgressTables = True
try:
from runestone.server.chapternames import populateChapterInfob
except ImportError:
updateP... | import paver
from paver.easy import *
import paver.setuputils
paver.setuputils.install_distutils_tasks()
import os, sys
from sphinxcontrib import paverutils
sys.path.append(os.getcwd())
updateProgressTables = True
try:
from runestone.server.chapternames import populateChapterInfob
except ImportError:
updateP... |
Remove debugging graph from JsonUl test | /*global describe, it*/
var expect = require('../unexpected-with-plugins'),
AssetGraph = require('../../lib');
describe('relations/JsonUrl', function () {
it('should get the href correctly', function (done) {
new AssetGraph({root: __dirname + '/../../testdata/relations/JsonUrl/'})
.loadAsse... | /*global describe, it*/
var expect = require('../unexpected-with-plugins'),
AssetGraph = require('../../lib');
describe('relations/JsonUrl', function () {
it('should get the href correctly', function (done) {
new AssetGraph({root: __dirname + '/../../testdata/relations/JsonUrl/'})
.loadAsse... |
Fix tooltip message for titles | const React = require('react');
const classNames = require('classnames');
const { BLOCKS } = require('markup-it');
const TAGS = {
[BLOCKS.HEADING_1]: 'h1',
[BLOCKS.HEADING_2]: 'h2',
[BLOCKS.HEADING_3]: 'h3',
[BLOCKS.HEADING_4]: 'h4',
[BLOCKS.HEADING_5]: 'h5',
[BLOCKS.HEADING_6]: 'h6'
};
... | const React = require('react');
const classNames = require('classnames');
const { BLOCKS } = require('markup-it');
const TAGS = {
[BLOCKS.HEADING_1]: 'h1',
[BLOCKS.HEADING_2]: 'h2',
[BLOCKS.HEADING_3]: 'h3',
[BLOCKS.HEADING_4]: 'h4',
[BLOCKS.HEADING_5]: 'h5',
[BLOCKS.HEADING_6]: 'h6'
};
... |
Add character encoding meta tag
Signed-off-by: Eddie Ringle <bacc1c505cb1756c59242c0a8ee25cd990a210e9@eringle.net> | <!DOCTYPE html>
<html>
<head>
<title>Layout Test</title>
<meta charset="utf-8" />
<link rel="stylesheet" type="text/css" href="<?php bloginfo('template_directory'); ?>/style.css" />
<?php
wp_head();
comments_popup_script(400, 400);
?>
</head>
<body>
<div id="wrapper">
<div id="header-wrap">
<d... | <!DOCTYPE html>
<html>
<head>
<title>Layout Test</title>
<link rel="stylesheet" type="text/css" href="<?php bloginfo('template_directory'); ?>/style.css" />
<?php
wp_head();
comments_popup_script(400, 400);
?>
</head>
<body>
<div id="wrapper">
<div id="header-wrap">
<div id="header">
... |
Make curl work in py3 again | import logging
import os
from twisted.web import server, guard, resource
from twisted.cred import portal
from lbrynet import conf
from .auth import PasswordChecker, HttpPasswordRealm
from .util import initialize_api_key_file
log = logging.getLogger(__name__)
class AuthJSONRPCResource(resource.Resource):
def __... | import logging
import os
from twisted.web import server, guard, resource
from twisted.cred import portal
from lbrynet import conf
from .auth import PasswordChecker, HttpPasswordRealm
from .util import initialize_api_key_file
log = logging.getLogger(__name__)
class AuthJSONRPCResource(resource.Resource):
def __... |
Fix crash when Arg "Enter Number" field is left empty. | package eu.f3rog.blade.sample.arg;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.widget.EditText;
import android.widget.Toast;
import java.util.Random;
import blade.Blade;
import blade.F;
import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.OnCli... | package eu.f3rog.blade.sample.arg;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.widget.EditText;
import java.util.Random;
import blade.Blade;
import blade.F;
import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.OnClick;
import eu.f3rog.blade.sam... |
Replace baseURL with data provider.
git-svn-id: 4e353c0944fe8da334633afc35765ef362dec675@8663 b4e469a2-07ce-4b26-9273-4d7d95a670c7 | package org.helioviewer.jhv.timelines.data;
import java.util.HashMap;
public class BandType {
private String label;
private String name;
private String unitLabel;
private final HashMap<String, Double> warnLevels = new HashMap<>();
private double min;
private double max;
private boolean is... | package org.helioviewer.jhv.timelines.data;
import java.util.HashMap;
public class BandType {
private String baseURL;
private String label;
private String name;
private String unitLabel;
private final HashMap<String, Double> warnLevels = new HashMap<>();
private double min;
private double... |
Reduce the number of assets cached in the service worker | const webpack = require("webpack");
const merge = require("webpack-merge");
const workboxPlugin = require("workbox-webpack-plugin");
const GitRevisionPlugin = require("git-revision-webpack-plugin");
const UglifyJsPlugin = require("uglifyjs-webpack-plugin");
const common = require("./webpack.common.js");
const gitRevis... | const webpack = require("webpack");
const merge = require("webpack-merge");
const workboxPlugin = require("workbox-webpack-plugin");
const GitRevisionPlugin = require("git-revision-webpack-plugin");
const UglifyJsPlugin = require("uglifyjs-webpack-plugin");
const common = require("./webpack.common.js");
const gitRevis... |
Fix get non-object on product detail | <?php namespace Octommerce\Octommerce\Components;
use Cms\Classes\ComponentBase;
use Octommerce\Octommerce\Models\Product as ProductModel;
class ProductDetail extends ComponentBase
{
public function componentDetails()
{
return [
'name' => 'ProductDetail Component',
'des... | <?php namespace Octommerce\Octommerce\Components;
use Cms\Classes\ComponentBase;
use Octommerce\Octommerce\Models\Product as ProductModel;
class ProductDetail extends ComponentBase
{
public function componentDetails()
{
return [
'name' => 'ProductDetail Component',
'des... |
BUGFIX: Fix deprecated e modifier in preg_replace
With PHP 7, Faker issued the following warning:
preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead | <?php
namespace KDambekalns\Faker;
/* *
* This script belongs to the Flow package "Faker". *
* */
/**
* Faker class for the Faker package
*
* The Fak... | <?php
namespace KDambekalns\Faker;
/* *
* This script belongs to the Flow package "Faker". *
* */
/**
* Faker class for the Faker package
*
* The Fak... |
Switch api service to prod | import axios from 'axios';
class WldApi {
constructor() {
if(!WldApi.instance) {
this.baseURL = 'http://wld-backend.herokuapp.com';
//this.baseURL = 'http://localhost:3001';
this.token = localStorage.getItem('token');
WldApi.instance = this;
}
return WldApi.instance;
}
setT... | import axios from 'axios';
class WldApi {
constructor() {
if(!WldApi.instance) {
// this.baseURL = 'http://wld-backend.herokuapp.com';
this.baseURL = 'http://localhost:3001';
this.token = localStorage.getItem('token');
WldApi.instance = this;
}
return WldApi.instance;
}
set... |
BAP-687: Delete confirmation message is not useful
- added "Cancel" button on delete modal | $(function() {
$('#btn-apigen').on('click', function(e) {
var el = $(this);
$.get(el.attr('href'), function (data) {
el.prev().text(data);
})
return false;
});
$('#btn-remove-profile').on('click', function(e) {
var el = $(this),
message = el... | $(function() {
$('#btn-apigen').on('click', function(e) {
var el = $(this);
$.get(el.attr('href'), function (data) {
el.prev().text(data);
})
return false;
});
$('#btn-remove-profile').on('click', function(e) {
var el = $(this),
message = el... |
Fix round trip for testing JdkInflate / JdkDeflate
The Inflater and Deflater calls need to be aligned on whether or not
the compressed output includes the ZLIB header and checksum fields. | /*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distribut... | /*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distribut... |
Set up MonkeyTestJS and make all tests pass | (function(global) {
global.monkeytestjs = {
"facebookId": "000000000000000",
"local": {
"env": ["DEV URL OR PART OF"]
},
"stage": {
"env": ["STAGE URL OR PART OF"],
"facebookId": "222222222222222"
},
"beta": {
"env": ["... | (function(global) {
global.monkeytestjs = {
"facebookId": "000000000000000",
"local": {
"env": ["DEV URL OR PART OF"]
},
"stage": {
"env": ["STAGE URL OR PART OF"],
"facebookId": "222222222222222"
},
"beta": {
"env": ["... |
Use config for API url | define([
'Class', 'uri', 'bluebird',
'map/services/DataService'
], function(Class, UriTemplate, Promise, ds) {
'use strict';
var GET_REQUEST_ID = 'GeostoreService:get',
SAVE_REQUEST_ID = 'GeostoreService:save';
var URL = window.gfw.config.GFW_API_HOST + '/api/geostore/{id}';
var GeostoreService = ... | define([
'Class', 'uri', 'bluebird',
'map/services/DataService'
], function(Class, UriTemplate, Promise, ds) {
'use strict';
var GET_REQUEST_ID = 'GeostoreService:get',
SAVE_REQUEST_ID = 'GeostoreService:save';
var URL = window.gfw.config.GFW_API_HOST + '/geostore/{id}';
var GeostoreService = Clas... |
Return false for undefined functions, not null | <?php
namespace ZfcTwig\Service;
use RuntimeException;
use Twig_Environment;
use Zend\ServiceManager\FactoryInterface;
use Zend\ServiceManager\ServiceLocatorInterface;
use ZfcTwig\Twig\Func\ViewHelper;
class TwigEnvironmentFactory implements FactoryInterface
{
/**
* Create service
*
* @param Servi... | <?php
namespace ZfcTwig\Service;
use RuntimeException;
use Twig_Environment;
use Zend\ServiceManager\FactoryInterface;
use Zend\ServiceManager\ServiceLocatorInterface;
use ZfcTwig\Twig\Func\ViewHelper;
class TwigEnvironmentFactory implements FactoryInterface
{
/**
* Create service
*
* @param Servi... |
Use asyncCoroutine instead of manual rethrow + new Coroutine | #!/usr/bin/env php
<?php
require __DIR__ . '/../../vendor/autoload.php';
use Amp\Delayed;
use Amp\Emitter;
use Amp\Loop;
use function Amp\asyncCoroutine;
Loop::run(function () {
try {
$emitter = new Emitter;
$iterator = $emitter->iterate();
$generator = function (Emitter $emitter) {
... | #!/usr/bin/env php
<?php
require __DIR__ . '/../../vendor/autoload.php';
use Amp\Coroutine;
use Amp\Delayed;
use Amp\Emitter;
use Amp\Loop;
use Amp\Promise;
Loop::run(function () {
try {
$emitter = new Emitter;
$iterator = $emitter->iterate();
$generator = function (Emitter $emitter) {
... |
Add missing semicolon to ExperimentManager | 'use strict';
// Trial Data service used to persist data for individual trials
angular.module('core').factory('ExperimentManager', ['TrialData', '$q', '$http', '$state',
function (TrialData, $q, $http, $state) {
var experimentManager = {
advanceSlide: function () {
TrialData.data.state.currentSli... | 'use strict';
// Trial Data service used to persist data for individual trials
angular.module('core').factory('ExperimentManager', ['TrialData', '$q', '$http', '$state',
function (TrialData, $q, $http, $state) {
var experimentManager = {
advanceSlide: function () {
TrialData.data.state.currentSli... |
Correct the Mistral lexer entry point | import setuptools
setuptools.setup(
name="discode-server",
version="0.0.1",
url="https://github.com/d0ugal/discode-server",
license="BSD",
description="Quick code review",
long_description="TODO",
author="Dougal Matthews",
author_email="dougal@dougalmatthews.com",
keywords='code rev... | import setuptools
setuptools.setup(
name="discode-server",
version="0.0.1",
url="https://github.com/d0ugal/discode-server",
license="BSD",
description="Quick code review",
long_description="TODO",
author="Dougal Matthews",
author_email="dougal@dougalmatthews.com",
keywords='code rev... |
Fix path issues and this scoping issues. | const tmp = require('tmp');
const fs = require('fs');
function isReactComponent(source = '') {
return source.indexOf('(_react.Component)') > -1;
}
function WebpackAccessibilityPlugin(options) {
this.createElement = options.createElement;
this.renderMarkup = options.renderMarkup;
}
WebpackAccessibilityPlugin.pr... | const tmp = require('tmp');
const fs = require('fs');
function isReactComponent(source = '') {
return source.indexOf('(_react.Component)') > -1;
}
function WebpackAccessibilityPlugin(options) {
this.createElement = options.createElement;
this.renderMarkup = options.renderMarkup;
}
WebpackAccessibilityPlugin.pr... |
Fix strings route on test. | <?php
namespace Nobox\LazyStrings\Tests;
use Illuminate\Support\Facades\Config;
use Nobox\LazyStrings\LazyStrings;
use Orchestra\Testbench\TestCase;
class LazyStringsServiceProviderTest extends TestCase
{
public function setUp()
{
parent::setUp();
}
protected function getPackageProviders($ap... | <?php
namespace Nobox\LazyStrings\Tests;
use Illuminate\Support\Facades\Config;
use Nobox\LazyStrings\LazyStrings;
use Orchestra\Testbench\TestCase;
class LazyStringsServiceProviderTest extends TestCase
{
public function setUp()
{
parent::setUp();
}
protected function getPackageProviders($ap... |
Add handling for failed setup | class TestResult(object):
def __init__(self):
self.runCount = 0
self.errorCount = 0
self.setUpErrorCount = 0
def summary(self):
return "{} run, {} failed, {} setups failed".format(self.runCount,
self.errorCount,
... | class TestResult(object):
def __init__(self):
self.runCount = 0
self.errorCount = 0
def summary(self):
return "{} run, {} failed".format(self.runCount, self.errorCount)
def testStarted(self):
self.runCount += 1
def testFailed(self):
self.errorCount += 1
class... |
Fix php5.5 bug with unsuported boolean or in argument default | <?php
namespace Sandhje\Spanner\Filesystem;
/**
* Filesystem wrapper
*
* @author Sandhje
*
*/
class Filesystem
{
/**
* Equals PATHINFO_DIRNAME | PATHINFO_BASENAME | PATHINFO_EXTENSION | PATHINFO_FILENAME
*
* @var int
*/
const PATHINFO_ALL = 15;
/**
* is_file wrap... | <?php
namespace Sandhje\Spanner\Filesystem;
/**
* Filesystem wrapper
*
* @author Sandhje
*
*/
class Filesystem
{
/**
* is_file wrapper
*
* @param string $filename
*/
public function is_file($filename)
{
return is_file($filename);
}
/**
* is_dir w... |
Break infix coordination only if there is one | __author__ = 's7a'
# All imports
from nltk.tree import Tree
# The infix coordination class
class InfixCoordination:
# Constructor for the infix coordination
def __init__(self):
self.has_infix_coordination = False
self.slice_point = -1
self.subtree_list = []
# Break the tree
... | __author__ = 's7a'
# All imports
from nltk.tree import Tree
# The infix coordination class
class InfixCoordination:
# Constructor for the infix coordination
def __init__(self):
self.has_infix_coordination = False
self.slice_point = -1
self.subtree_list = []
# Break the tree
... |
Correct set policy on bag.
Had been missing create constraint. | """
Establish the data structures representing the bags and recipes needed
by this plugin.
"""
store_contents = {}
store_structure = {}
store_contents['_default_errors'] = [
'src/_errors/index.recipe',
]
store_structure['recipes'] = {}
store_structure['bags'] = {}
store_structure['recipes']['_errors... |
store_contents = {}
store_structure = {}
store_contents['_default_errors'] = [
'src/_errors/index.recipe',
]
store_structure['recipes'] = {}
store_structure['bags'] = {}
store_structure['recipes']['_errors'] = {
'desc': 'Pretty Errors Error Tiddlers',
'recipe': [
('_defau... |
Add github token to model | from bson.objectid import ObjectId
from humbledb import Mongo, Document
class ClassProperty (property):
"""Subclass property to make classmethod properties possible"""
def __get__(self, cls, owner):
return self.fget.__get__(None, owner)()
class User(Document):
username = ''
password = ''
... | from bson.objectid import ObjectId
from humbledb import Mongo, Document
class ClassProperty (property):
"""Subclass property to make classmethod properties possible"""
def __get__(self, cls, owner):
return self.fget.__get__(None, owner)()
class User(Document):
username = ''
password = ''
... |
Change read_chrom_sizes to read from a FAIDX index if available | import os
from wrappers import bowtie2, picard, samtools
def create_reference_indices(ref_fn):
'''
For a given reference FASTA file, generate several indices.
'''
bowtie2.build(ref_fn)
samtools.faidx_index(ref_fn)
picard.create_sequence_dictionary(ref_fn)
def read_chrom_sizes(... | from wrappers import bowtie2, picard, samtools
def create_reference_indices(ref_fn):
'''
For a given reference FASTA file, generate several indices.
'''
bowtie2.build(ref_fn)
samtools.faidx_index(ref_fn)
picard.create_sequence_dictionary(ref_fn)
def read_chrom_sizes(reference_ass... |
Use the local createQueryBuilder with alias | <?php
namespace NS\SentinelBundle\Repository;
use NS\SecurityBundle\Doctrine\SecuredEntityRepository;
use NS\UtilBundle\Service\AjaxAutocompleteRepositoryInterface;
/**
* Description of Common
*
* @author gnat
*/
class Common extends SecuredEntityRepository implements AjaxAutocompleteRepositoryInterface
{
pu... | <?php
namespace NS\SentinelBundle\Repository;
use NS\SecurityBundle\Doctrine\SecuredEntityRepository;
use NS\UtilBundle\Service\AjaxAutocompleteRepositoryInterface;
/**
* Description of Common
*
* @author gnat
*/
class Common extends SecuredEntityRepository implements AjaxAutocompleteRepositoryInterface
{
pu... |
Use double quotes on help string | from flask import request
from flask_restful import Resource, Api, abort, reqparse
from .models import db, Comment, Lecture
api = Api()
class CommentListResource(Resource):
def get(self, lecture_id):
db_lecture = Lecture.query.filter(Lecture.id == lecture_id).first()
if not db_lecture:
... | from flask import request
from flask_restful import Resource, Api, abort, reqparse
from .models import db, Comment, Lecture
api = Api()
class CommentListResource(Resource):
def get(self, lecture_id):
db_lecture = Lecture.query.filter(Lecture.id == lecture_id).first()
if not db_lecture:
... |
Add response object to the reject, too. | var Promise = require('bluebird'),
request = require('request');
function rp(options) {
var statusCodes = {
'GET' : [200],
'HEAD' : [200],
'PUT' : [200, 201],
'POST' : [200, 201],
'DELETE' : [200, 201]
}, c = {simple: true}, i;
if (typeof options === 'string'... | var Promise = require('bluebird'),
request = require('request');
function rp(options) {
var statusCodes = {
'GET' : [200],
'HEAD' : [200],
'PUT' : [200, 201],
'POST' : [200, 201],
'DELETE' : [200, 201]
}, c = {simple: true}, i;
if (typeof options === 'string'... |
Use `html.escape` instead of the deprecated `cgi.escape`. | # -*- coding: utf-8 -*-
"""
byceps.blueprints.board.formatting
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
:Copyright: 2006-2015 Jochen Kupperschmidt
:License: Modified BSD, see LICENSE for details.
"""
from html import escape
import bbcode
try:
from .smileys import get_smileys
except ImportError:
get_smileys = lam... | # -*- coding: utf-8 -*-
"""
byceps.blueprints.board.formatting
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
:Copyright: 2006-2015 Jochen Kupperschmidt
:License: Modified BSD, see LICENSE for details.
"""
from cgi import escape
import bbcode
try:
from .smileys import get_smileys
except ImportError:
get_smileys = lamb... |
Use ColorSchemeunit new run with package API
Re: https://github.com/gerardroche/sublime-color-scheme-unit/issues/18
The new API allows to run with package name so Unittesting doesn't need
to open any files before running the tests.
I also added an async parameter which allows to run the tests in non
async mode and g... | import sublime
from sublime_plugin import ApplicationCommand
from .mixin import UnitTestingMixin
from .const import DONE_MESSAGE
try:
from ColorSchemeUnit.lib.runner import ColorSchemeUnit
except Exception:
print('ColorSchemeUnit runner could not be imported')
class UnitTestingColorSchemeCommand(ApplicationC... | import sublime
from sublime_plugin import ApplicationCommand
from .mixin import UnitTestingMixin
from .const import DONE_MESSAGE
try:
from ColorSchemeUnit.lib.runner import ColorSchemeUnit
except Exception:
print('ColorSchemeUnit runner could not be imported')
class UnitTestingColorSchemeCommand(ApplicationC... |
Include url message when fail to run urlparser | from modules import *
import re
import urllib2
import traceback
try:
import simplejson as json
except ImportError:
import json
from unidecode import unidecode
from twitter import Twitter
from bitly import Bitly
from youtube import Youtube
class Urlparser(Module):
"""Checks incoming messages for possible... | from modules import *
import re
import urllib2
import traceback
try:
import simplejson as json
except ImportError:
import json
from unidecode import unidecode
from twitter import Twitter
from bitly import Bitly
from youtube import Youtube
class Urlparser(Module):
"""Checks incoming messages for possible... |
Print stack trace when initialization fails | package org.galibier.messaging.benchmark.zookeeper;
import com.netflix.curator.framework.CuratorFramework;
import com.netflix.curator.framework.CuratorFrameworkFactory;
import com.netflix.curator.retry.RetryOneTime;
import org.apache.zookeeper.KeeperException;
import org.galibier.messaging.benchmark.Message;
import or... | package org.galibier.messaging.benchmark.zookeeper;
import com.netflix.curator.framework.CuratorFramework;
import com.netflix.curator.framework.CuratorFrameworkFactory;
import com.netflix.curator.retry.RetryOneTime;
import org.apache.zookeeper.KeeperException;
import org.galibier.messaging.benchmark.Message;
import or... |
Fix java generatino of DAOSink. | /**
* @license
* Copyright 2016 Google Inc. All Rights Reserved.
*
* 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 requir... | /**
* @license
* Copyright 2016 Google Inc. All Rights Reserved.
*
* 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 requir... |
Remove debug kit from unit tests | <?php
namespace App\Test\TestCase;
use Cake\Core\Configure;
use Cake\Core\Plugin;
use Cake\TestSuite\TestCase;
class AppTest extends TestCase
{
/**
* @dataProvider pluginProvider
*/
public function testLoadedPlugins($plugin, $config)
{
if (empty($config)) {
$this->assertTrue(... | <?php
namespace App\Test\TestCase;
use Cake\Core\Configure;
use Cake\Core\Plugin;
use Cake\TestSuite\TestCase;
class AppTest extends TestCase
{
/**
* @dataProvider pluginProvider
*/
public function testLoadedPlugins($plugin, $config)
{
if (empty($config)) {
$this->assertTrue(... |
Fix problem with ws host:port mismatch on heroku | var Reflux = require('reflux');
var config = require('./../../../config');
var ApiActions = require('./../actions/ApiActions');
var buffer = [];
var ws;
var ApiStore = Reflux.createStore({
init: function () {
ws = new WebSocket('ws://' + window.document.location.host);
ws.onmessage = funct... | var Reflux = require('reflux');
var config = require('./../../../config');
var ApiActions = require('./../actions/ApiActions');
var buffer = [];
var ws;
var ApiStore = Reflux.createStore({
init: function () {
ws = new WebSocket('ws://' + config.host + ':' + config.port);
ws.onmessage = fun... |
Stop inserting semicolons during concat | module.exports = function(grunt) {
grunt.initConfig({
concat: {
dist: {
src: ['lib/osteo.js', 'lib/*.js'],
dest: 'osteo.js'
}
},
jshint: {
options: {
jshintrc: true
},
beforeconcat: ['lib/*.js'],
afterconcat: ['osteo.js']
},
uglify: {
... | module.exports = function(grunt) {
grunt.initConfig({
concat: {
options: {
separator: ';',
},
dist: {
src: ['lib/osteo.js', 'lib/*.js'],
dest: 'osteo.js'
}
},
jshint: {
options: {
jshintrc: true
},
beforeconcat: ['lib/*.js'],
... |
psqcppconan: Allow the use of .exe | # /ciscripts/check/psqcppconan/check.py
#
# Run tests and static analysis checks on a polysquare conan c++ project.
#
# See /LICENCE.md for Copyright information
"""Run tests and static analysis checks on a polysquare conan c++ project."""
import argparse
import os
def run(cont, util, shell, argv=None):
"""Run ... | # /ciscripts/check/psqcppconan/check.py
#
# Run tests and static analysis checks on a polysquare conan c++ project.
#
# See /LICENCE.md for Copyright information
"""Run tests and static analysis checks on a polysquare conan c++ project."""
import argparse
import os
def run(cont, util, shell, argv=None):
"""Run ... |
Revert "return json of message being sent to debug mail issue" | from django.shortcuts import redirect
from django.http import JsonResponse
from django.core.mail import EmailMessage
from django.middleware import csrf
from rest_framework.decorators import api_view
@api_view(['POST', 'GET'])
def send_contact_message(request):
if request.method == 'POST':
to_address = re... | from django.shortcuts import redirect
from django.http import JsonResponse
from django.core.mail import EmailMessage
from django.middleware import csrf
from rest_framework.decorators import api_view
@api_view(['POST', 'GET'])
def send_contact_message(request):
if request.method == 'POST':
to_address = re... |
Move table name literal out of query | var mysql = require('mysql');
var connectionParams = require('../../config/connectionParams');
function getConnection() {
var connection = mysql.createConnection(connectionParams);
return connection;
}
function Calibration(databaseRow) {
for(var propertyName in databaseRow) {
this[propertyName] = data... | var mysql = require('mysql');
var connectionParams = require('../../config/connectionParams');
function getConnection() {
var connection = mysql.createConnection(connectionParams);
return connection;
}
function Calibration(databaseRow) {
for(var propertyName in databaseRow) {
this[propertyName] = data... |
Make sure pull requests are sorted in descending order (earliest first) | const Repository = require("../models/repository").model;
module.exports = {
createRepository: function (repo, issues, pullRequests) {
return Repository.create({
_id: `${repo.owner}:${repo.name}`,
name: repo.name,
owner: repo.owner,
url: repo.url,
... | const Repository = require("../models/repository").model;
module.exports = {
createRepository: function (repo, issues, pullRequests) {
return Repository.create({
_id: `${repo.owner}:${repo.name}`,
name: repo.name,
owner: repo.owner,
url: repo.url,
... |
Fix bad return `return { state }` > `return state` | import { CONNECT, GET_CURRENT_USER_SUCCESS } from './actionTypes'
import { combineReducers } from 'redux'
let isNewLoginValue = false
export const nuxeoReducer = combineReducers({
connect: (state = { isConnected: false }, action = {}) => {
switch (action.type) {
case CONNECT:
return {
...... | import { CONNECT, GET_CURRENT_USER_SUCCESS } from './actionTypes'
import { combineReducers } from 'redux'
let isNewLoginValue = false
export const nuxeoReducer = combineReducers({
connect: (state = { isConnected: false }, action = {}) => {
switch (action.type) {
case CONNECT:
return {
...... |
Add on click listener in on submit function | package br.com.bloder.blormlib;
import android.view.View;
import java.util.ArrayList;
import java.util.List;
import br.com.bloder.blormlib.validation.Validate;
import br.com.bloder.blormlib.validation.Validation;
/**
* Created by bloder on 05/06/16.
*/
public class Blorm {
public static class Builder {
pr... | package br.com.bloder.blormlib;
import android.view.View;
import java.util.ArrayList;
import java.util.List;
import br.com.bloder.blormlib.validation.Validate;
import br.com.bloder.blormlib.validation.Validation;
/**
* Created by bloder on 05/06/16.
*/
public class Blorm {
public static class Builder {
pr... |
Fix the wildcards in watch task | module.exports = function(grunt) {
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
watch: {
react: {
files: ['components/**/*.jsx', 'dashboards/**/*.jsx'],
tasks: ['browserify']
}
},
browserify: {
options: {
transform: [ require('grunt-react').b... | module.exports = function(grunt) {
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
watch: {
react: {
files: ['components/*.jsx', 'dashboards/*.jsx'],
tasks: ['browserify']
}
},
browserify: {
options: {
transform: [ require('grunt-react').browser... |
Use PHP 8 constructor property promotion | <?php
declare(strict_types = 1);
/**
* /src/EventSubscriber/DoctrineExtensionSubscriber.php
*
* @author TLe, Tarmo Leppänen <tarmo.leppanen@pinja.com>
*/
namespace App\EventSubscriber;
use App\Security\UserTypeIdentification;
use Doctrine\ORM\NonUniqueResultException;
use Gedmo\Blameable\BlameableListener;
use Sy... | <?php
declare(strict_types = 1);
/**
* /src/EventSubscriber/DoctrineExtensionSubscriber.php
*
* @author TLe, Tarmo Leppänen <tarmo.leppanen@pinja.com>
*/
namespace App\EventSubscriber;
use App\Security\UserTypeIdentification;
use Doctrine\ORM\NonUniqueResultException;
use Gedmo\Blameable\BlameableListener;
use Sy... |
BAP-10771: Migrate data audit command to be executed in new message queue
- fix tests | <?php
namespace Oro\Bundle\DataAuditBundle\Service;
use Doctrine\Common\Util\ClassUtils;
use Metadata\ClassMetadata;
use Metadata\PropertyMetadata;
use Oro\Bundle\EntityConfigBundle\Provider\ConfigProvider;
class GetEntityAuditMetadataService
{
/**
* @var ConfigProvider
*/
private $auditConfigProvid... | <?php
namespace Oro\Bundle\DataAuditBundle\Service;
use Doctrine\Common\Util\ClassUtils;
use Metadata\ClassMetadata;
use Metadata\PropertyMetadata;
use Oro\Bundle\EntityConfigBundle\Provider\ConfigProvider;
class GetEntityAuditMetadataService
{
/**
* @var ConfigProvider
*/
private $auditConfigProvid... |
Use user instead of username | <?php
/*
* This file is part of Slim HTTP Basic Authentication middleware
*
* Copyright (c) 2013-2014 Mika Tuupola
*
* Licensed under the MIT license:
* http://www.opensource.org/licenses/mit-license.php
*
* Project home:
* https://github.com/tuupola/slim-basic-auth
*
*/
namespace Slim\Middleware\HttpB... | <?php
/*
* This file is part of Slim HTTP Basic Authentication middleware
*
* Copyright (c) 2013-2014 Mika Tuupola
*
* Licensed under the MIT license:
* http://www.opensource.org/licenses/mit-license.php
*
* Project home:
* https://github.com/tuupola/slim-basic-auth
*
*/
namespace Slim\Middleware\HttpB... |
Disable scroll on number fields | (function(){
'use strict';
angular.module('cla.controllers')
.controller('LayoutCtrl',
['$rootScope', '$scope', '$window', 'History', 'user', 'hotkeys', 'localStorageService',
function($rootScope, $scope, $window, History, user, hotkeys, localStorageService){
var offStateChange = $rootS... | (function(){
'use strict';
angular.module('cla.controllers')
.controller('LayoutCtrl',
['$rootScope', '$scope', '$window', 'History', 'user', 'hotkeys', 'localStorageService',
function($rootScope, $scope, $window, History, user, hotkeys, localStorageService){
var offStateChange = $rootS... |
QS-1015: Fix show statistics in question list (own profile) | import React, { PropTypes, Component } from 'react';
import Question from './Question';
export default class QuestionList extends Component {
static propTypes = {
questions : PropTypes.object.isRequired,
ownPicture : PropTypes.string.isRequired,
defaultPicture: PropTypes.string.isReq... | import React, { PropTypes, Component } from 'react';
import Question from './Question';
export default class QuestionList extends Component {
static propTypes = {
questions : PropTypes.object.isRequired,
ownPicture : PropTypes.string.isRequired,
defaultPicture: PropTypes.string.isReq... |
Handle baseDir option to resolve include paths before rendering; | "use strict";
var sass = require("node-sass");
var through = require("through");
var path = require("path");
var extend = require('util')._extend;
module.exports = function (fileName, globalOptions) {
if (!/(\.scss|\.css)$/i.test(fileName)) {
return through();
}
var inputString = "";
return ... | "use strict";
var sass = require("node-sass");
var through = require("through");
var path = require("path");
var extend = require('util')._extend;
module.exports = function (fileName, globalOptions) {
if (!/(\.scss|\.css)$/i.test(fileName)) {
return through();
}
var inputString = "";
return ... |
CRM-3997: Make all mailboxes available under System organization
- fix jscs | define(function(require) {
'use strict';
var $ = require('jquery');
var _ = require('underscore');
var BaseComponent = require('oroui/js/app/components/base/component');
var CheckConnectionView = require('../views/check-connection-view');
var CheckConnectionModel = require('../models/check-conn... | define(function(require) {
'use strict';
var $ = require('jquery');
var BaseComponent = require('oroui/js/app/components/base/component');
var CheckConnectionView = require('../views/check-connection-view');
var CheckConnectionModel = require('../models/check-connection-model');
var CheckConnec... |
Fix order of migration in operations | # -*- coding: utf-8 -*-
# Generated by Django 1.11.22 on 2019-10-31 16:33
from __future__ import unicode_literals
from django.db import migrations, OperationalError, ProgrammingError
def fix_fee_product_index(apps, schema_editor):
try:
schema_editor.execute(
'DROP INDEX IF EXISTS idx_16977_pro... | # -*- coding: utf-8 -*-
# Generated by Django 1.11.22 on 2019-10-31 16:33
from __future__ import unicode_literals
from django.db import migrations, OperationalError, ProgrammingError
def fix_fee_product_index(apps, schema_editor):
try:
schema_editor.execute(
'DROP INDEX IF EXISTS idx_16977_pro... |
Remove newline at end of hostname | <?php
class Kwf_Assets_WebpackConfig
{
public static function getDevServerPort()
{
if (!Kwf_Config::getValue('debug.webpackDevServer')) {
return null;
}
if ($port = Kwf_Config::getValue('debug.webpackDevServerPort')) {
return $port;
}
$port = null... | <?php
class Kwf_Assets_WebpackConfig
{
public static function getDevServerPort()
{
if (!Kwf_Config::getValue('debug.webpackDevServer')) {
return null;
}
if ($port = Kwf_Config::getValue('debug.webpackDevServerPort')) {
return $port;
}
$port = null... |
Print message for pull success. | import os
import traceback
from django.utils import timezone
from django_git.management.commands.git_pull_utils.git_folder_enum import enum_git_repo
from django_git.management.commands.git_pull_utils.git_synchronizer import GitSynchronizer
from djangoautoconf.cmd_handler_base.msg_process_cmd_base import DjangoCmdBase... | import os
import traceback
from django.utils import timezone
from django_git.management.commands.git_pull_utils.git_folder_enum import enum_git_repo
from django_git.management.commands.git_pull_utils.git_synchronizer import GitSynchronizer
from djangoautoconf.cmd_handler_base.msg_process_cmd_base import DjangoCmdBase... |
Add warning when subscribe is not difined | import { Meteor } from 'meteor/meteor';
import { subscribe } from 'graphql';
import forAwaitEach from '../common/forAwaitEach';
import {
DEFAULT_PUBLICATION,
} from '../common/defaults';
export function createGraphQLPublication({
schema,
publication = DEFAULT_PUBLICATION,
} = {}) {
if (!subscribe) {
consol... | import { Meteor } from 'meteor/meteor';
import { subscribe } from 'graphql';
import forAwaitEach from '../common/forAwaitEach';
import {
DEFAULT_PUBLICATION,
} from '../common/defaults';
export function createGraphQLPublication({
schema,
publication = DEFAULT_PUBLICATION,
} = {}) {
Meteor.publish(publication, ... |
Use the declared first and second variables | (function ($) {
$.fn.dragster = function (options) {
var settings = $.extend({
enter: function () { },
leave: function () { }
}, options);
return this.each(function () {
var first = false,
second = false;
$(this).on('dragente... | (function ($) {
$.fn.dragster = function (options) {
var settings = $.extend({
enter: function () { },
leave: function () { }
}, options);
return this.each(function () {
var first = false,
second = false;
$(this).on('dragente... |
Make the automatic object to array transformer generate deep arrays | <?php
namespace FOQ\ElasticaBundle\Transformer;
use RuntimeException;
use Traversable;
use ArrayAccess;
/**
* AutomaticObjectToArrayTransformer
* Tries to convert objects by generating getters
* based on the required keys
*/
class ObjectToArrayAutomaticTransformer implements ObjectToArrayTransformerInterface
{
... | <?php
namespace FOQ\ElasticaBundle\Transformer;
use RuntimeException;
use Traversable;
use ArrayAccess;
/**
* AutomaticObjectToArrayTransformer
* Tries to convert objects by generating getters
* based on the required keys
*/
class ObjectToArrayAutomaticTransformer implements ObjectToArrayTransformerInterface
{
... |
Raise minimum requirement to force minimum TG version | from setuptools import setup, find_packages
import os
version = '0.5.4'
here = os.path.abspath(os.path.dirname(__file__))
try:
README = open(os.path.join(here, 'README.txt')).read()
CHANGES = open(os.path.join(here, 'docs/HISTORY.txt')).read()
except IOError:
README = CHANGES = ''
setup(name='tgext.admin'... | from setuptools import setup, find_packages
import os
version = '0.5.4'
here = os.path.abspath(os.path.dirname(__file__))
try:
README = open(os.path.join(here, 'README.txt')).read()
CHANGES = open(os.path.join(here, 'docs/HISTORY.txt')).read()
except IOError:
README = CHANGES = ''
setup(name='tgext.admin'... |
Use benchmark directory to load skeleton | import os
from contextlib import contextmanager
from collections import OrderedDict
from time import process_time
import numpy as np
from skan import csr
rundir = os.path.dirname(__file__)
@contextmanager
def timer():
time = []
t0 = process_time()
yield time
t1 = process_time()
time.append(t1 ... | import os
from contextlib import contextmanager
from collections import OrderedDict
from time import process_time
import numpy as np
from skan import csr
rundir = os.path.dirname(__file__)
@contextmanager
def timer():
time = []
t0 = process_time()
yield time
t1 = process_time()
time.append(t1 ... |
Put eval in setTimeout as an attempt to ensure that the page is really rendered | /**
* @fileoverview Run the bootstrap service
*/
var port = 3020,
system = require('system'),
page = require('webpage').create(),
serverObj = require('./server').create(port),
util = require('./util'),
module = system.args[1],
config = system.args[2];
if (!module) {
console.error('missin... | /**
* @fileoverview Run the bootstrap service
*/
var port = 3020,
system = require('system'),
page = require('webpage').create(),
serverObj = require('./server').create(port),
util = require('./util'),
module = system.args[1],
config = system.args[2];
if (!module) {
console.error('missin... |
Fix to avoid infinite loop when ob_end_clean() failed. | <?php
namespace Ouzo;
class Error
{
static public function exceptionHandler(\Exception $exception)
{
self::_handleError($exception->getMessage(), $exception->getTraceAsString());
}
static public function errorHandler($errno, $errstr, $errfile, $errline)
{
self::_handleError("$errst... | <?php
namespace Ouzo;
class Error
{
static public function exceptionHandler(\Exception $exception)
{
self::_handleError($exception->getMessage(), $exception->getTraceAsString());
}
static public function errorHandler($errno, $errstr, $errfile, $errline)
{
self::_handleError("$errst... |
Fix issue with post with no tag | import needle from 'needle';
import { SiteConf, getDate } from 'base';
export const postsApiHandler = (req, res) => {
needle('get', SiteConf.PostsApi)
.then(resp => {
const data = resp.body;
const filter = req.params.filter;
const pagination = data.meta.pagination;
const posts = PostList... | import needle from 'needle';
import { SiteConf, getDate } from 'base';
export const postsApiHandler = (req, res) => {
needle('get', SiteConf.PostsApi)
.then(resp => {
const data = resp.body;
const filter = req.params.filter;
const pagination = data.meta.pagination;
const posts = PostList... |
Stop installing the 'forum' demo project (but still ship it in the release tarball). | import os
from setuptools import setup, find_packages
overview = file('docs/overview.txt')
data = overview.read()
overview.close()
setup(
name='dinette',
description='Dinette is a forum application in the spirit of PunBB.',
keywords='django, forum',
packages=find_packages(exclude=["forum", "forum.*"])... | import os
from setuptools import setup, find_packages
overview = file('docs/overview.txt')
data = overview.read()
overview.close()
setup(
name='dinette',
description='Dinette is a forum application in the spirit of PunBB.',
keywords='django, forum',
packages=find_packages(),
include_package_data=T... |
Update model with new mycosti value. | /**
* Class Sliders
*/
Humble( function () {
var Sliders = function (node, model) {
this.model = model;
this.node = node;
this.sliders = {};
this.render();
}
Sliders.prototype = {
render : function () {
var items = this.model.getIte... | /**
* Class Sliders
*/
Humble( function () {
var Sliders = function (node, model) {
this.model = model;
this.node = node;
this.sliders = {};
this.render();
}
Sliders.prototype = {
render : function () {
var items = this.model.getIte... |
chore: Refactor classnames usage a little bit | import React, { PropTypes } from 'react'
import { Link } from 'react-router'
import classnames from 'classnames'
import Date from '../../components/Date'
import Tag from '../../components/Tag'
import styles from './PostItem.scss'
const PostItem = ({__url, date, title, draft, tags, description}) => {
const articleCl... | import React, { PropTypes } from 'react'
import { Link } from 'react-router'
import classnames from 'classnames'
import Date from '../../components/Date'
import Tag from '../../components/Tag'
import styles from './PostItem.scss'
const PostItem = ({__url, date, title, draft, tags, description}) => {
const articleCl... |
Add some info and outfile to prepare function | #!/usr/bin/env python
# encoding: utf-8
import sys
import re
import argparse
from argparse import RawDescriptionHelpFormatter
from patterns import pre_patterns
def prepare(infile, outfile=sys.stdout):
"""
Apply pre_patterns from patterns to infile
:infile: input file
"""
try:
for line ... | #!/usr/bin/env python
# encoding: utf-8
import sys
import re
import argparse
from patterns import pre_patterns
def prepare(infile):
"""
Apply pre_patterns from patterns to infile
:infile: input file
"""
try:
for line in infile:
result = line
for pattern in pre_p... |
Add paragraph tag in hello template. | "use strict";
(function (app) {
app.HttpService = ng.core
.Class({
constructor: function () {},
http: function () {
return new ng.http.Http(
new ng.http.XHRBackend(
new ng.http.BrowserXhr()),
... | "use strict";
(function (app) {
app.HttpService = ng.core
.Class({
constructor: function () {},
http: function () {
return new ng.http.Http(
new ng.http.XHRBackend(
new ng.http.BrowserXhr()),
... |
Fix for "No module named decorator" on fresh environment installs.
Fixes regression from 4b26b5837ced0c2f76495b05b87e63e05f81c2af. | #! /usr/bin/env python
from distutils.core import setup
setup(
name = 'qless-py',
version = '0.10.0',
description = 'Redis-based Queue Management',
long_description = '''
Redis-based queue management, with heartbeating, job tracking,
stats, notifications, and ... | #! /usr/bin/env python
from distutils.core import setup
setup(
name = 'qless-py',
version = '0.10.0',
description = 'Redis-based Queue Management',
long_description = '''
Redis-based queue management, with heartbeating, job tracking,
stats, notifications, and ... |
Correct URL used for refunding application fees
Fixes #208.
See also stripe/stripe-ruby#351. | <?php
namespace Stripe;
class ApplicationFee extends ApiResource
{
/**
* This is a special case because the application fee endpoint has an
* underscore in it. The parent `className` function strips underscores.
*
* @return string The name of the class.
*/
public static function cl... | <?php
namespace Stripe;
class ApplicationFee extends ApiResource
{
/**
* This is a special case because the application fee endpoint has an
* underscore in it. The parent `className` function strips underscores.
*
* @return string The name of the class.
*/
public static function cl... |
Remove " " from log name | # -*- coding: utf-8 -*-
import datetime
import logging
import os
import hashlib
from utils.settings_handler import settings
def set_up_logging():
"""
Logger for tenhou communication and AI output
"""
logs_directory = os.path.join(os.path.dirname(os.path.realpath(__file__)), '..', 'logs')
if not ... | # -*- coding: utf-8 -*-
import datetime
import logging
import os
import hashlib
from utils.settings_handler import settings
def set_up_logging():
"""
Logger for tenhou communication and AI output
"""
logs_directory = os.path.join(os.path.dirname(os.path.realpath(__file__)), '..', 'logs')
if not ... |
Use local json-rpc.php file for mysql demo | <?php
require('json-rpc.php');
if (function_exists('xdebug_disable')) {
xdebug_disable();
}
$link = new mysqli('localhost', 'user', 'password', 'db_name');
class MysqlDemo {
public function query($query) {
global $link;
if (preg_match("/create|drop/", $query)) {
throw new Exception("Sorry you ar... | <?php
require('json-rpc/json-rpc.php');
if (function_exists('xdebug_disable')) {
xdebug_disable();
}
$link = new mysqli('localhost', 'user', 'password', 'db_name');
class MysqlDemo {
public function query($query) {
global $link;
if (preg_match("/create|drop/", $query)) {
throw new Exception("Sor... |
Add better handling of temp file | import time
import os
import tempfile
from sys import platform as _platform
from gtts import gTTS
from pygame import mixer
from .playsound import playsound
from ..components import _BaseComponent
class TextToSpeech(_BaseComponent):
def __init__(self, queues):
super().__init__(queues)
self.queue... | import time
import os
from tempfile import NamedTemporaryFile
from sys import platform as _platform
from gtts import gTTS
from pygame import mixer
from .playsound import playsound
from ..components import _BaseComponent
class TextToSpeech(_BaseComponent):
def __init__(self, queues):
super().__init__(qu... |
Change timeout requirement to use semver comparator | import os
from setuptools import find_packages, setup
from asgiref import __version__
# We use the README as the long_description
readme_path = os.path.join(os.path.dirname(__file__), "README.rst")
setup(
name='asgiref',
version=__version__,
url='http://github.com/django/asgiref/',
author='Django So... | import os
from setuptools import find_packages, setup
from asgiref import __version__
# We use the README as the long_description
readme_path = os.path.join(os.path.dirname(__file__), "README.rst")
setup(
name='asgiref',
version=__version__,
url='http://github.com/django/asgiref/',
author='Django So... |
GH-35: Update for rename of default branch to main | /*
A handlebars helper to allow us to safely output object content from within a template. See the docs for details:
https://github.com/fluid-project/fluid-handlebars/blob/main/docs/jsonifyHelper.md
*/
/* eslint-env node */
"use strict";
var fluid = fluid || require("infusion");
fluid.registerNamespace("fl... | /*
A handlebars helper to allow us to safely output object content from within a template. See the docs for details:
https://github.com/fluid-project/fluid-handlebars/blob/master/docs/jsonifyHelper.md
*/
/* eslint-env node */
"use strict";
var fluid = fluid || require("infusion");
fluid.registerNamespace("... |
Add identifier property to mixin. | # -*- coding: utf-8 -*-
from .models import Translation
from .utils.i18n import get_cache_key
class LinguistMixin(object):
def clear_translations_cache(self):
self._linguist.clear()
@property
def identifier(self):
return self._linguist.identifier
@property
def language(self):
... | # -*- coding: utf-8 -*-
from .models import Translation
from .utils import get_cache_key
class LinguistMixin(object):
def clear_translations_cache(self):
self._linguist.clear()
@property
def language(self):
return self._linguist.language
@language.setter
def language(self, value... |
Fix chunkhash not allowed in development | // Used to run webpack dev server to test the demo in local
const webpack = require('webpack');
const path = require('path');
const HtmlWebpackPlugin = require('html-webpack-plugin');
module.exports = (env, options) => ({
mode: options.mode,
devtool: 'source-map',
entry: path.resolve(__dirname, 'demo/js/de... | // Used to run webpack dev server to test the demo in local
const webpack = require('webpack');
const path = require('path');
const HtmlWebpackPlugin = require('html-webpack-plugin');
module.exports = (env, options) => ({
mode: options.mode,
devtool: 'source-map',
entry: path.resolve(__dirname, 'demo/js/de... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.