text stringlengths 17 1.47k | positive stringlengths 673 4.43k | negative stringlengths 677 2.81k |
|---|---|---|
Use irclib 0.4.6, which is available via pip | #!/usr/bin/env python
# Require setuptools. See http://pypi.python.org/pypi/setuptools for
# installation instructions, or run the ez_setup script found at
# http://peak.telecommunity.com/dist/ez_setup.py
from setuptools import setup, find_packages
setup(
name = "cobe",
version = "2.0.0",
author = "Peter ... | #!/usr/bin/env python
# Require setuptools. See http://pypi.python.org/pypi/setuptools for
# installation instructions, or run the ez_setup script found at
# http://peak.telecommunity.com/dist/ez_setup.py
from setuptools import setup, find_packages
setup(
name = "cobe",
version = "2.0.0",
author = "Peter ... |
Set unit tests not depending on real profile file | <?php
use Karma\Application;
use Gaufrette\Adapter\InMemory;
use Karma\Console;
use Symfony\Component\Console\Tester\CommandTester;
abstract class CommandTestCase extends PHPUnit_Framework_TestCase
{
protected
$app,
$commandTester;
protected function setUp()
{
$masterContent = <<<... | <?php
use Karma\Application;
use Gaufrette\Adapter\InMemory;
use Karma\Console;
use Symfony\Component\Console\Tester\CommandTester;
abstract class CommandTestCase extends PHPUnit_Framework_TestCase
{
protected
$app,
$commandTester;
protected function setUp()
{
$masterContent = <<<... |
Use plum and shadow_plum from colors.xml | package mozilla.org.webmaker.activity;
import android.app.ActionBar;
import android.content.res.Resources;
import android.graphics.Color;
import android.graphics.drawable.ColorDrawable;
import android.os.Bundle;
import android.view.Menu;
import android.view.Window;
import android.view.WindowManager;
import android.wid... | package mozilla.org.webmaker.activity;
import android.app.ActionBar;
import android.graphics.Color;
import android.graphics.drawable.ColorDrawable;
import android.os.Bundle;
import android.view.Menu;
import android.view.Window;
import android.view.WindowManager;
import android.widget.RelativeLayout;
import mozilla.org... |
Replace 3rd and 4th panes | $(function() {
"use strict";
window.AppConfig = {
srcBase: 'https://graphite-phx.mozilla.org/render/?',
globalGraphOptions: {
hideLegend: false,
from: '-24hour'
},
defaultGraphs: {
'SUMOES': [
{
target: ['stats.timers.sumo.view.search.views.search.GET.upper_90',... | $(function() {
"use strict";
window.AppConfig = {
srcBase: 'https://graphite-phx.mozilla.org/render/?',
globalGraphOptions: {
hideLegend: false,
from: '-24hour'
},
defaultGraphs: {
'SUMOES': [
{
target: ['stats.timers.sumo.view.search.views.search.GET.upper_90',... |
Fix integration tests on Mint 20 | from . import *
# MSBuild backend doesn't support generated_source yet.
@skip_if_backend('msbuild')
class TestQt(IntegrationTest):
def run_executable(self, exe):
if env.host_platform.genus == 'linux':
output = self.assertPopen([exe], extra_env={'DISPLAY': ''},
... | from . import *
# MSBuild backend doesn't support generated_source yet.
@skip_if_backend('msbuild')
class TestQt(IntegrationTest):
def run_executable(self, exe):
if env.host_platform.genus == 'linux':
output = self.assertPopen([exe], extra_env={'DISPLAY': ''},
... |
Add some global variables. this will be handy when we change to production environment. just have to change a few variables. | angular.module('fleetonrails.services.login-service', [])
.service('LoginService', ['$http', 'GlobalSettings', function ($http, GlobalSettings) {
var loginWithPassword = function (email, password) {
var params = {
'grant_type' : 'password',
'client_id' : GlobalSe... | angular.module('fleetonrails.services.login-service', [])
.service('LoginService', ['$http', 'GlobalSettings', function ($http, GlobalSettings) {
var loginWithPassword = function (email, password) {
var params = {
'grant_type': 'password',
'client_id': GlobalSett... |
Select search input on focus instead of click. | import React from 'react'
import P from 'prop-types'
export default class AppSearchInput extends React.Component {
constructor(props) {
super(props)
this.state = {searchValue: null}
}
startTimeout() {
this.clearTimeout()
this.timeoutID = window.setTimeout(this.triggerLoad.bind(this), 400)
}
... | import React from 'react'
import P from 'prop-types'
export default class AppSearchInput extends React.Component {
constructor(props) {
super(props)
this.state = {searchValue: null}
}
startTimeout() {
this.clearTimeout()
this.timeoutID = window.setTimeout(this.triggerLoad.bind(this), 400)
}
... |
Disable HTML entity encoding in some tests | <?php
namespace Tests\Functional;
use App\Models\User;
use Illuminate\Foundation\Testing\DatabaseMigrations;
use Illuminate\Foundation\Testing\DatabaseTransactions;
class NavigationTest extends \Tests\TestCase {
use DatabaseMigrations;
public function testGuestNavigation()
{
$this->get('/')
... | <?php
namespace Tests\Functional;
use App\Models\User;
use Illuminate\Foundation\Testing\DatabaseMigrations;
use Illuminate\Foundation\Testing\DatabaseTransactions;
class NavigationTest extends \Tests\TestCase {
use DatabaseMigrations;
public function testGuestNavigation()
{
$this->get('/')
... |
Remove site dependency from tagmeta; works cross-site now | from collections import OrderedDict
import datetime
import settings
# Django
from django import template
from django.template import resolve_variable, NodeList
from django.template.defaultfilters import stringfilter
from django.contrib.auth.models import User, Group
from django.utils.timesince import timesince
# Extern... | from collections import OrderedDict
import datetime
import settings
# Django
from django import template
from django.template import resolve_variable, NodeList
from django.template.defaultfilters import stringfilter
from django.contrib.auth.models import User, Group
from django.utils.timesince import timesince
# Extern... |
Fix typo in JSON property name. | package io.dropwizard.bundles.apikey;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.google.common.base.Optional;
import com.google.common.collect.Maps;
import java.util.Map;
import static com.google.common.base.Preconditions.checkNotNull;
public... | package io.dropwizard.bundles.apikey;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.google.common.base.Optional;
import com.google.common.collect.Maps;
import java.util.Map;
import static com.google.common.base.Preconditions.checkNotNull;
public... |
Update to turn down logging level of UUID Maven plugin |
package info.freelibrary.maven;
import java.util.UUID;
import org.apache.maven.plugin.AbstractMojo;
import org.apache.maven.plugin.MojoExecutionException;
import org.apache.maven.plugin.MojoFailureException;
import org.apache.maven.plugins.annotations.LifecyclePhase;
import org.apache.maven.plugins.annotations.Mojo;... |
package info.freelibrary.maven;
import java.util.UUID;
import org.apache.maven.plugin.AbstractMojo;
import org.apache.maven.plugin.MojoExecutionException;
import org.apache.maven.plugin.MojoFailureException;
import org.apache.maven.plugins.annotations.LifecyclePhase;
import org.apache.maven.plugins.annotations.Mojo;... |
Make sure the application doesn't continue without a config | import os
from twisted.internet import reactor
from heufybot import HeufyBot, HeufyBotFactory
from config import Config
class BotHandler(object):
factories = {}
globalConfig = None
def __init__(self):
print "--- Loading configs..."
self.globalConfig = Config("globalconfig.yml")
... | import os
from twisted.internet import reactor
from heufybot import HeufyBot, HeufyBotFactory
from config import Config
class BotHandler(object):
factories = {}
globalConfig = None
def __init__(self):
print "--- Loading configs..."
self.globalConfig = Config("globalconfig.yml")
sel... |
Fix the name on the package from brew to brewday | from setuptools import find_packages
from setuptools import setup
setup(
name='brewday',
version='0.0.1',
author='Chris Gilmer',
author_email='chris.gilmer@gmail.com',
maintainer='Chris Gilmer',
maintainer_email='chris.gilmer@gmail.com',
description='Brew Day Tools',
url='https://github... | from setuptools import find_packages
from setuptools import setup
setup(
name='brew',
version='0.0.1',
author='Chris Gilmer',
author_email='chris.gilmer@gmail.com',
maintainer='Chris Gilmer',
maintainer_email='chris.gilmer@gmail.com',
description='Brew Day Tools',
url='https://github.co... |
Use updated corner plot API | import numpy as np
import corner
import astropy.io.ascii as ascii
import matplotlib.pyplot as plt
pyout = ascii.read('test.pyout')
idlout = ascii.read('test.idlout')
fig, axarr = plt.subplots(9, 9, figsize=(10, 10))
fig.suptitle("Black = python, red = IDL")
corner.corner(np.array([pyout['alpha'], pyout['beta'], pyout... | import numpy as np
import triangle
import astropy.io.ascii as ascii
import matplotlib.pyplot as plt
pyout = ascii.read('test.pyout')
idlout = ascii.read('test.idlout')
fig, axarr = plt.subplots(9, 9, figsize=(10, 10))
fig.suptitle("Black = python, red = IDL")
triangle.corner(np.array([pyout['alpha'], pyout['beta'], p... |
Change the command name of grunt to build | module.exports = function(grunt) {
grunt.loadNpmTasks('grunt-typescript');
grunt.loadNpmTasks('grunt-mocha-phantomjs');
grunt.initConfig({
typescript: {
main: {
src: ['src/mml2miku.ts'],
dest: 'js/mml2miku.js',
options: {
... | module.exports = function(grunt) {
grunt.loadNpmTasks('grunt-typescript');
grunt.loadNpmTasks('grunt-mocha-phantomjs');
grunt.initConfig({
typescript: {
main: {
src: ['src/mml2miku.ts'],
dest: 'js/mml2miku.js',
options: {
... |
Fix a :bug: due to changes in ipcActions from previosly | import React, {Component, PropTypes} from 'react';
import styles from './DatabaseDropdown.css';
import Select from 'react-select';
/*
Displays in a dropdown menu all available databases/schemes
using `ipc`.
Permits to alter the `configuration` database parameter once
user selects an option.
Sends a... | import React, {Component, PropTypes} from 'react';
import styles from './DatabaseDropdown.css';
import Select from 'react-select';
/*
Displays in a dropdown menu all available databases/schemes
using `ipc`.
Permits to alter the `configuration` database parameter once
user selects an option.
Sends a... |
Add preventDefault on clicks on the 'edit' button next to the theme toggle in the page action popup. Without it, clicking edit actually toggles whether or not the theme is enabled which is incorrect. | // Adds toggle for custom theme to Page Action.
//
// This file *only* controls that toggle,
// the logic behind enabling/disabling the theme is found in
// core/js/customThemeHandler.js
var customThemeToggle = (function(){
var optionsLink = document.getElementById("options-link");
var enableTheme = document.getE... | // Adds toggle for custom theme to Page Action.
//
// This file *only* controls that toggle,
// the logic behind enabling/disabling the theme is found in
// core/js/customThemeHandler.js
var customThemeToggle = (function(){
var optionsLink = document.getElementById("options-link");
var enableTheme = document.getE... |
Remove 'u' prefix from strings | import json
import unittest
import awacs.aws as aws
import awacs.s3 as s3
class TestConditions(unittest.TestCase):
def test_for_all_values(self):
c = aws.Condition(
aws.ForAllValuesStringLike(
"dynamodb:requestedAttributes", ["PostDateTime", "Message", "Tags"]
)
... | import json
import unittest
import awacs.aws as aws
import awacs.s3 as s3
class TestConditions(unittest.TestCase):
def test_for_all_values(self):
c = aws.Condition(
aws.ForAllValuesStringLike(
"dynamodb:requestedAttributes", ["PostDateTime", "Message", "Tags"]
)
... |
Add retry for opening RabbitMQ connection (cluster start) | import json
import pika
import time
from twython import TwythonStreamer
class TwitterConfiguration:
def __init__(self):
with open('twitter_key.json') as jsonData:
data = json.load(jsonData)
self.consumer_key = data['consumer_key']
self.consumer_secret = data['consumer_secret']
... | import json
import pika
from twython import TwythonStreamer
class TwitterConfiguration:
def __init__(self):
with open('twitter_key.json') as jsonData:
data = json.load(jsonData)
self.consumer_key = data['consumer_key']
self.consumer_secret = data['consumer_secret']
self... |
Use Type::hasType to check for existing type | <?php
namespace Ident\Test\Doctrine;
use Doctrine\DBAL\Types\Type;
/**
* Class AbstractUuidTypeTest
*/
abstract class AbstractUuidTypeTest extends \PHPUnit_Framework_TestCase
{
/**
* @var mixed
*/
private $signature;
/**
* @var \Ident\IdentifiesObjects
*/
private $identifier;
... | <?php
namespace Ident\Test\Doctrine;
use Doctrine\DBAL\Types\Type;
/**
* Class AbstractUuidTypeTest
*/
abstract class AbstractUuidTypeTest extends \PHPUnit_Framework_TestCase
{
/**
* @var mixed
*/
private $signature;
/**
* @var \Ident\IdentifiesObjects
*/
private $identifier;
... |
Fix a bug where scheme with uppercase is not handled | <?php
namespace HomoChecker\Model;
use TrueBV\Punycode;
class Status
{
public function __construct(HomoInterface $homo, string $icon = null, string $status = null, float $duration = null)
{
$this->homo = (object)[
'screen_name' => $homo->screen_name,
'url' => $homo->url... | <?php
namespace HomoChecker\Model;
use TrueBV\Punycode;
class Status
{
public function __construct(HomoInterface $homo, string $icon = null, string $status = null, float $duration = null)
{
$this->homo = (object)[
'screen_name' => $homo->screen_name,
'url' => $homo->url... |
Rename a variable in Matcher.__repr__() to make the code less confusing.
Even though there is technically no name clash, the code is now less confusing. | #
# Project: retdec-python
# Copyright: (c) 2015 by Petr Zemek <s3rvac@gmail.com> and contributors
# License: MIT, see the LICENSE file for more details
#
"""Tests for the library and tools."""
import abc
class Matcher(metaclass=abc.ABCMeta):
"""A base class of all matchers."""
@abc.abstractmethod
... | #
# Project: retdec-python
# Copyright: (c) 2015 by Petr Zemek <s3rvac@gmail.com> and contributors
# License: MIT, see the LICENSE file for more details
#
"""Tests for the library and tools."""
import abc
class Matcher(metaclass=abc.ABCMeta):
"""A base class of all matchers."""
@abc.abstractmethod
... |
Revert "adding 2013 to search query" | from haystack import indexes
from respondants.models import Institution
class InstitutionIndex(indexes.SearchIndex, indexes.Indexable):
"""Search Index associated with an institution. Allows for searching by
name or lender id"""
text = indexes.CharField(document=True, model_attr='name')
text_auto = i... | from haystack import indexes
from respondants.models import Institution
class InstitutionIndex(indexes.SearchIndex, indexes.Indexable):
"""Search Index associated with an institution. Allows for searching by
name or lender id"""
text = indexes.CharField(document=True, model_attr='name')
text_auto = i... |
Fix missing semi-colon bug in javascript file | import 'jquery-ui-dist/jquery-ui';
$(() => {
// Is there already one prefix section on this Phase?
//
// draggableSections - A jQuery object, the sortable element.
//
// Returns Boolean
function prefixSectionExists(draggableSections) {
return !!draggableSections
.has('[data-modifiable=true]:nth-c... | import 'jquery-ui-dist/jquery-ui';
$(() => {
// Is there already one prefix section on this Phase?
//
// draggableSections - A jQuery object, the sortable element.
//
// Returns Boolean
function prefixSectionExists(draggableSections) {
return !!draggableSections
.has('[data-modifiable=true]:nth-c... |
Add finals to TestMethidFilter properties | package fi.vincit.multiusertest.util;
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
import java.util.Objects;
import org.junit.runners.model.FrameworkMethod;
import fi.vincit.multiusertest.annotation.TestUsers;
public class TestMethodFilter {
private final UserIdent... | package fi.vincit.multiusertest.util;
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
import java.util.Objects;
import org.junit.runners.model.FrameworkMethod;
import fi.vincit.multiusertest.annotation.TestUsers;
public class TestMethodFilter {
private UserIdentifier ... |
Fix missing up button on settings page | package com.marverenic.music.ui.settings;
import android.content.Context;
import android.content.Intent;
import android.os.Build;
import android.os.Bundle;
import android.support.v7.app.ActionBar;
import com.marverenic.music.R;
import com.marverenic.music.ui.BaseActivity;
public class SettingsActivity extends BaseAc... | package com.marverenic.music.ui.settings;
import android.content.Context;
import android.content.Intent;
import android.os.Build;
import android.os.Bundle;
import android.view.MenuItem;
import com.marverenic.music.R;
import com.marverenic.music.ui.BaseActivity;
public class SettingsActivity extends BaseActivity {
... |
Make problemsets display as verticals rather than sequences | from setuptools import setup, find_packages
setup(
name="XModule",
version="0.1",
packages=find_packages(),
install_requires=['distribute'],
package_data={
'': ['js/*']
},
# See http://guide.python-distribute.org/creation.html#entry-points
# for a description of entry_points
... | from setuptools import setup, find_packages
setup(
name="XModule",
version="0.1",
packages=find_packages(),
install_requires=['distribute'],
package_data={
'': ['js/*']
},
# See http://guide.python-distribute.org/creation.html#entry-points
# for a description of entry_points
... |
Clear subtitles and display ip address when network settings are changed | package com.spaceout;
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.widget.TextView;
public class MainActivity extends Activity {
private static final int REQUEST_CODE = 1;
private String ipAddress;... | package com.spaceout;
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
public class MainActivity extends Activity {
private static final int REQUEST_CODE = 1;
private String ipAddress;
@Override
protected voi... |
Fix bug where null images were generating collidable tiles | import Phaser from 'phaser'
import Waypoint from './Waypoint'
export default class MapTile extends Phaser.Sprite {
constructor(game, x = 0, y = 0, key = null, frame = null, rotation = 0) {
super(game, x, y, key, frame);
this.game = game;
this.angle = rotation;
this.pivot.x = 256;
... | import Phaser from 'phaser'
import Waypoint from './Waypoint'
export default class MapTile extends Phaser.Sprite {
constructor(game, x = 0, y = 0, key = null, frame = null, rotation = 0) {
super(game, x, y, key, frame);
this.game = game;
this.angle = rotation;
this.pivot.x = 256;
... |
Create two promises per social media request. Heroku deployment. | module.exports = (function(){
// GET /users/:id/media?lat=<LAT>&lng=<LNG>&time=<TIME>
return function* collection(id) {
var Q = require('q');
var TwitterManager = require('../media/twitter');
var InstagramManager = require('../media/instagram');
// Twitter Requests
var twitterDef = Q.defer()... | module.exports = (function(){
// GET /users/:id/media?lat=<LAT>&lng=<LNG>&time=<TIME>
return function* collection(id) {
var Q = require('q');
var TwitterManager = require('../media/twitter');
var InstagramManager = require('../media/instagram');
// Twitter Requests
var twitterDef = Q.defer()... |
Remove code alignment, add trailing comma, add EOF newline | var gulp = require('gulp'),
csslint = require('gulp-csslint'),
jshint = require('gulp-jshint'),
rename = require('gulp-rename'),
uglify = require('gulp-uglify'),
autoprefixer = require('gulp-autoprefixer'),
minifyCSS = require('gulp-minify-css'),
stylish = require('jshint-stylish');
gulp.ta... | var gulp = require('gulp'),
csslint = require('gulp-csslint'),
jshint = require('gulp-jshint'),
rename = require('gulp-rename'),
uglify = require('gulp-uglify'),
autoprefixer = require('gulp-autoprefixer'),
minifyCSS = require('gulp-minify-c... |
Make spinner reappear on subsequent visits | Template.duplicates.onRendered(function() {
Session.set('loadedDuplicates', false);
var playlist_id = Router.current().params['_id']
Meteor.call('getDuplicateTracksFromPlaylist', playlist_id, function(err, response) {
console.log(response);
Session.set('duplicateTracks', response);
... | Template.duplicates.onRendered(function() {
var playlist_id = Router.current().params['_id']
Meteor.call('getDuplicateTracksFromPlaylist', playlist_id, function(err, response) {
console.log(response);
Session.set('duplicateTracks', response);
Session.set('loadedDuplicates', true);
... |
Remove exception for mixin linting now that they've all been removed. | module.exports = {
root: true,
parser: 'babel-eslint',
parserOptions: {
ecmaVersion: 2018,
sourceType: 'module',
ecmaFeatures: {
legacyDecorators: true
}
},
plugins: [
'ember'
],
extends: [
'eslint:recommended',
'plugin:ember/recommended'
],
env: {
browser: true
... | module.exports = {
root: true,
parser: 'babel-eslint',
parserOptions: {
ecmaVersion: 2018,
sourceType: 'module',
ecmaFeatures: {
legacyDecorators: true
}
},
plugins: [
'ember'
],
extends: [
'eslint:recommended',
'plugin:ember/recommended'
],
env: {
browser: true
... |
Move step-by-step direction details into element | (function () {
'use strict';
/* ngInject */
function RowDetail($compile) {
// TODO: Animate the row appearing
var template = [
'<div class="block" ng-show="visible">',
'<ul class="list-unstyled">',
'<li ng-repeat="feature in item.directions.f... | (function () {
'use strict';
/* ngInject */
function RowDetail($compile) {
// TODO: Animate the row appearing
var template = [
'<tr ng-show="visible"><td colspan="2">',
'<ul class="list-unstyled">',
'<li ng-repeat="feature in item.directions.... |
[AC-7743] Change the user role key from userv to name | # Generated by Django 2.2.10 on 2020-04-09 21:24
from django.db import migrations
def add_deferred_user_role(apps, schema_editor):
DEFERRED_MENTOR = 'Deferred Mentor'
UserRole = apps.get_model('accelerator', 'UserRole')
Program = apps.get_model('accelerator', 'Program')
ProgramRole = apps.get_model('... | # Generated by Django 2.2.10 on 2020-04-09 21:24
from django.db import migrations
def add_deferred_user_role(apps, schema_editor):
DEFERRED_MENTOR = 'Deferred Mentor'
UserRole = apps.get_model('accelerator', 'UserRole')
Program = apps.get_model('accelerator', 'Program')
ProgramRole = apps.get_model('... |
Fix red highlighting in GitHub diff | import React, { Component } from 'react';
import { action } from '@kadira/storybook';
import { DraftJSEditor, Renderer, defaultBlocks } from '../../src';
const draftRenderer = new Renderer(defaultBlocks);
class SetStateExample extends Component {
state = {
content: {
entityMap: {},
blocks: [
... | import React, { Component } from 'react';
import { action } from '@kadira/storybook';
import { DraftJSEditor, Renderer, defaultBlocks } from '../../src';
const draftRenderer = new Renderer(defaultBlocks);
class SetStateExample extends Component {
state = {
content: {
entityMap: {},
blocks: [
... |
[OW] Fix bad spelling of reaper and forgetting sombra
- fixes #93 | <?php
namespace Onyx\Overwatch\Helpers\Game;
/**
* Class Character
* @package Onyx\Overwatch\Helpers\Game
*/
class Character
{
public static function getValidCharacter(string $char) : string
{
switch ($char)
{
case 'reinhardt':
case 'rein':
return 'rei... | <?php
namespace Onyx\Overwatch\Helpers\Game;
/**
* Class Character
* @package Onyx\Overwatch\Helpers\Game
*/
class Character
{
public static function getValidCharacter(string $char) : string
{
switch ($char)
{
case 'reinhardt':
case 'rein':
return 'rei... |
Add the check for status | package org.vietabroader.controller;
import org.vietabroader.model.GlobalState;
import org.vietabroader.model.VASpreadsheet;
import javax.swing.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
public class SpreadsheetConnectControll... | package org.vietabroader.controller;
import org.vietabroader.model.GlobalState;
import org.vietabroader.model.VASpreadsheet;
import javax.swing.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
public class SpreadsheetConnectControll... |
Revert "Fix lines in border backgrounds."
This ended up not being the cause of the off-by-one issue I observed.
This reverts commit 582d6ed113e5ad4df971008671a9d07220028bf0. | //
// Triple Play - utilities for use in PlayN-based games
// Copyright (c) 2011, Three Rings Design, Inc. - All rights reserved.
// http://github.com/threerings/tripleplay/blob/master/LICENSE
package tripleplay.ui.bgs;
import playn.core.ImmediateLayer;
import playn.core.PlayN;
import playn.core.Surface;
import pytha... | //
// Triple Play - utilities for use in PlayN-based games
// Copyright (c) 2011, Three Rings Design, Inc. - All rights reserved.
// http://github.com/threerings/tripleplay/blob/master/LICENSE
package tripleplay.ui.bgs;
import playn.core.ImmediateLayer;
import playn.core.PlayN;
import playn.core.Surface;
import pytha... |
Add a change to method. | package ru.job4j.even.numbers.iterator;
import java.util.Iterator;
import java.util.NoSuchElementException;
public class EvenNumbersIterator implements Iterator {
private int[] numbers;
private int index = 0;
private int size;
public EvenNumbersIterator(final int[] numbers) {
this.numbers = n... | package ru.job4j.even.numbers.iterator;
import java.util.Iterator;
import java.util.NoSuchElementException;
public class EvenNumbersIterator implements Iterator {
private int[] numbers;
private int index = 0;
private int size;
public EvenNumbersIterator(final int[] numbers) {
this.numbers = n... |
Update tests to use 0.14.0 modules | import React from 'react';
import TestUtils from 'react-addons-test-utils';
import jsdom from 'mocha-jsdom';
import expect from 'expect';
import Notification from '../src/notification';
const MOCK = {
message: 'Test',
action: 'Dismiss',
onClick: function handleClick() {
return;
},
style: {
bar: {
... | import React from 'react/addons';
import ExecutionEnvironment from 'react/lib/ExecutionEnvironment';
import jsdom from 'mocha-jsdom';
import expect from 'expect';
import Notification from '../src/notification';
let TestUtils = React.addons.TestUtils;
const MOCK = {
message: 'Test',
action: 'Dismiss',
onClick: f... |
Use right result for determining success | <?php
namespace Endroid\Tests\Sudoku;
use Endroid\Sudoku\Puzzle;
class PuzzleTest extends \PHPUnit_Framework_TestCase
{
public function testSolveEasy()
{
// An easy puzzle
$values = '
003020600
900305001
001806400
008102900
700000008... | <?php
namespace Endroid\Tests\Sudoku;
use Endroid\Sudoku\Puzzle;
class PuzzleTest extends \PHPUnit_Framework_TestCase
{
public function testSolveEasy()
{
// An easy puzzle
$values = '
003020600
900305001
001806400
008102900
700000008... |
Fix hljs reference not found in browser | const path = require('path');
const webpack = require('webpack');
module.exports = {
entry: {
app: path.resolve(__dirname, 'app/Resources/assets/js/app.js')
},
output: {
path: path.resolve(__dirname, 'web/builds'),
filename: 'bundle.js',
publicPath: '/builds/'
},
mod... | const path = require('path');
const webpack = require('webpack');
module.exports = {
entry: {
app: path.resolve(__dirname, 'app/Resources/assets/js/app.js')
},
output: {
path: path.resolve(__dirname, 'web/builds'),
filename: 'bundle.js',
publicPath: '/builds/'
},
mod... |
Update documentation link on PyPI to flask-script.readthedocs.org | """
Flask-Script
--------------
Flask support for writing external scripts.
Links
`````
* `documentation <http://flask-script.readthedocs.org>`_
"""
from setuptools import setup
# Hack to prevent stupid TypeError: 'NoneType' object is not callable error on
# exit of python setup.py test # in multiprocessing/util.... | """
Flask-Script
--------------
Flask support for writing external scripts.
Links
`````
* `documentation <http://packages.python.org/Flask-Script>`_
"""
from setuptools import setup
# Hack to prevent stupid TypeError: 'NoneType' object is not callable error on
# exit of python setup.py test # in multiprocessing/u... |
Rename task callbacks to match Gulp standards | /* jshint bitwise: true,
curly: true,
eqeqeq: true,
esversion: 6,
forin: true,
freeze: true,
latedef: nofunc,
noarg: true,
nocomma: true,
node: true,
nonbsp: true,
nonew: true,
plusplus: true,
... | /* jshint bitwise: true,
curly: true,
eqeqeq: true,
esversion: 6,
forin: true,
freeze: true,
latedef: nofunc,
noarg: true,
nocomma: true,
node: true,
nonbsp: true,
nonew: true,
plusplus: true,
... |
Test fix, remove invalid owner | /*
* Copyright (C) 2013 salesforce.com, 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 ... | /*
* Copyright (C) 2013 salesforce.com, 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 ... |
Use callback to display raw results
* Move invariants out of request structure
* Move request operation to dedicated sendRequest fn
* TODO: Remove deprecated comment | 'use strict';
var request = require('request');
var opts = parseOptions(process.argv[2]);
sendRequest(opts, function (out) {
console.log(out)
});
/*
* Verify param is present, and just return it.
* TODO
* Check for multiple params, and check validity
* as well as presence.
*/
function parseParams(params... | 'use strict';
var request = require('request');
var opts = parseOptions(process.argv[2]);
request(opts, function (err, res, body) {
if (err) throw new Error(err);
var format = '[%s]: %s %s %s';
for (var i = 0; i < body.length; i++) {
/*
* TODO return something like this as JSON
... |
Move hooks directory to a constant
That way one could ask for the default directory from its code while still
extend the class and change the path to another one. | <?php
namespace PhpGitHooks\Module\Configuration\Infrastructure\Hook;
use Symfony\Component\Process\Process;
class HookCopier
{
public const DEFAULT_GIT_HOOKS_DIR = '.git/hooks';
protected $hookDir = self::DEFAULT_GIT_HOOKS_DIR;
public function copyPreCommitHook(): void
{
$this->copyHookFil... | <?php
namespace PhpGitHooks\Module\Configuration\Infrastructure\Hook;
use Symfony\Component\Process\Process;
class HookCopier
{
protected $hookDir = '.git/hooks/';
public function copyPreCommitHook(): void
{
$this->copyHookFile('pre-commit');
}
public function copyCommitMsgHook(): void
... |
Adjust testapp migration dependency to be valid on 1.6.x | # -*- coding: utf-8 -*-
# Generated by Django 1.10.1 on 2016-09-21 11:37
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
import wagtail.wagtailcore.blocks
import wagtail.wagtailcore.fields
import wagtail.wagtailimages.blocks
class Migration(migrations... | # -*- coding: utf-8 -*-
# Generated by Django 1.10.1 on 2016-09-21 11:37
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
import wagtail.wagtailcore.blocks
import wagtail.wagtailcore.fields
import wagtail.wagtailimages.blocks
class Migration(migrations... |
Hide header if no matches found | /* global browser:readonly */
"use strict";
function parseReceivedHeader(headerStr, regexp) {
const capturedSubstr = headerStr.match(new RegExp(regexp));
if (capturedSubstr === null || typeof capturedSubstr[1] === "undefined")
return null;
return capturedSubstr[1];
}
function parseReceivedHeaders... | /* global browser:readonly */
"use strict";
function parseReceivedHeader(headerStr, regexp) {
const capturedSubstr = headerStr.match(new RegExp(regexp));
if (capturedSubstr === null || typeof capturedSubstr[1] === "undefined")
return null;
return capturedSubstr[1];
}
function parseReceivedHeaders... |
Handle recreating soft deleted pages | <?php
namespace Metrique\Building\Http\Requests;
use Illuminate\Database\Eloquent\Builder;
use Illuminate\Foundation\Http\FormRequest;
use Illuminate\Validation\Rule;
use Metrique\Building\Rules\AbsoluteUrlPathRule;
class PageRequest extends FormRequest
{
/**
* Determine if the user is authorized to make th... | <?php
namespace Metrique\Building\Http\Requests;
use Illuminate\Foundation\Http\FormRequest;
use Illuminate\Validation\Rule;
use Metrique\Building\Rules\AbsoluteUrlPathRule;
class PageRequest extends FormRequest
{
/**
* Determine if the user is authorized to make this request.
*
* @return bool
... |
Improve test coverage of functional.py. | import unittest
from transducer.functional import compose, true, identity, false
class TestComposition(unittest.TestCase):
def test_single(self):
"""
compose(f)(x) -> f(x)
"""
f = lambda x: x * 2
c = compose(f)
# We can't test the equivalence of functions complet... | import unittest
from transducer.functional import compose
class TestComposition(unittest.TestCase):
def test_single(self):
"""
compose(f)(x) -> f(x)
"""
f = lambda x: x * 2
c = compose(f)
# We can't test the equivalence of functions completely, so...
self... |
Fix implementation of overlapping rectangles | # -*- coding: utf-8 -*-
from collections import namedtuple
Size = namedtuple("Size", ["width", "height"])
class Rectangle(namedtuple("Rectangle", ["x0", "y0", "x1", "y1"])):
def __contains__(self, other):
"""Check if this rectangle and `other` overlaps eachother.
Essentially this is a bit of a ha... | # -*- coding: utf-8 -*-
from collections import namedtuple
Size = namedtuple("Size", ["width", "height"])
class Rectangle(namedtuple("Rectangle", ["x0", "y0", "x1", "y1"])):
def __contains__(self, other):
"""Check if this rectangle and `other` overlaps eachother.
Essentially this is a bit of a ha... |
Implement the ypdate form controller | <?php
namespace App\Http\Controllers;
use App\mailingUsers;
use Illuminate\Http\Request;
use App\Http\Requests;
class MailingController extends Controller
{
/**
* MailingController constructor.
*
* Here the following middleware will be set.
*/
public function __construct()
{
... | <?php
namespace App\Http\Controllers;
use App\mailingUsers;
use Illuminate\Http\Request;
use App\Http\Requests;
class MailingController extends Controller
{
/**
* MailingController constructor.
*
* Here the following middleware will be set.
*/
public function __construct()
{
... |
Add createdAt when logging a message and sort results by createdAt date | $(document).ready(function () {
$(document).on('keyloaded', function () {
var hostname = $('#hostname').val();
$.ajax({
url: appConfig.getUrl('/log/' + hostname),
dataType: 'jsonp',
method: 'GET'
}).done(function (data) {
var hasHeader = fals... | $(document).ready(function () {
$(document).on('keyloaded', function () {
var hostname = $('#hostname').val();
$.ajax({
url: appConfig.getUrl('/log/' + hostname),
dataType: 'jsonp',
method: 'GET'
}).done(function (data) {
var hasHeader = fals... |
Change the default __getattr_ value | class Card:
"""
A wrapper around a Scryfall json card object.
"""
def __init__(self, cardData):
self._data = cardData
def __getattr__(self, attr):
"""
A hack that makes all attributes inaccessible,
and instead returns the stored json values
"""
if at... | class Card:
"""
A wrapper around a Scryfall json card object.
"""
def __init__(self, cardData):
self._data = cardData
def __getattr__(self, attr):
"""
A hack that makes all attributes inaccessible,
and instead returns the stored json values
"""
if at... |
Add isNew function to determine if user is on news section | import React from 'react';
import PropTypes from 'prop-types';
import { FormattedMessage } from 'react-intl';
import { NavLink } from 'react-router-dom';
import './Sidenav.less';
const isNews = (match, location) => location.pathname !== '/';
const Sidenav = ({ username }) =>
(<div>
{username &&
<ul classN... | import React from 'react';
import PropTypes from 'prop-types';
import { FormattedMessage } from 'react-intl';
import { NavLink } from 'react-router-dom';
import './Sidenav.less';
const Sidenav = ({ username }) =>
(<div>
{username &&
<ul className="Sidenav">
<li>
<NavLink to={`/@${username... |
Add coveralls back to list of plugins | module.exports = function(config){
config.set({
basePath : './',
files : [
'app/bower_components/angular/angular.min.js',
'app/bower_components/angular-ui-router/release/angular-ui-router.min.js',
'app/bower_components/angular-resource/angular-resource.min.js',
'app/bower_components/... | module.exports = function(config){
config.set({
basePath : './',
files : [
'app/bower_components/angular/angular.min.js',
'app/bower_components/angular-ui-router/release/angular-ui-router.min.js',
'app/bower_components/angular-resource/angular-resource.min.js',
'app/bower_components/... |
Fix ordering bug in NGO edit
Fix issue #126 | class CmsNgosListController{
constructor(NgoService, $filter, $state, DialogService){
'ngInject';
var vm = this;
this.$filter = $filter;
this.$state = $state;
this.DialogService = DialogService;
this.NgoService = NgoService;
this.listOrderByColumn = '-organisa... | class CmsNgosListController{
constructor(NgoService, $filter, $state, DialogService){
'ngInject';
var vm = this;
this.$filter = $filter;
this.$state = $state;
this.DialogService = DialogService;
this.NgoService = NgoService;
this.NgoService.fetchAll().then(fun... |
Add minimum target browser versions | /**
* WSO2 NOTES:
* Add targets -> node -> current for test config
* as per this comment https://github.com/babel/babel/issues/5085#issuecomment-363242788
* Add minimum browser compatibility for production builds as per https://babeljs.io/docs/en/babel-preset-env#targets
* Related github issue: https://g... | /**
* Add targets -> node -> current as per this comment https://github.com/babel/babel/issues/5085#issuecomment-363242788
*/
module.exports = {
env: {
test: {
presets: [
[
'@babel/preset-env',
{
targets: {
... |
Use loop.create_future if it exists | import asyncio
from .protocol import Protocol
__all__ = ('connect',)
class Connection:
def __init__(self, protocol, transport, loop):
self._protocol = protocol
self._transport = transport
self._loop = loop
def get_settings(self):
return self._protocol.get_settings()
as... | import asyncio
from .protocol import Protocol
__all__ = ('connect',)
class Connection:
def __init__(self, protocol, transport, loop):
self._protocol = protocol
self._transport = transport
self._loop = loop
def get_settings(self):
return self._protocol.get_settings()
as... |
Use brackets for array declaration | <?php
namespace Emergence\People;
use HandleBehavior;
class Invitation extends \ActiveRecord
{
public static $tableName = 'invitations';
public static $singularNoun = 'invitation';
public static $pluralNoun = 'invitations';
public static $fields = [
'RecipientID' => [
'type' => '... | <?php
namespace Emergence\People;
use HandleBehavior;
class Invitation extends \ActiveRecord
{
public static $tableName = 'invitations';
public static $singularNoun = 'invitation';
public static $pluralNoun = 'invitations';
public static $fields = array(
'RecipientID' => [
'type'... |
Update base view tests to use Jasmine | define(['views/base_view'], function (baseView) {
jasmine.getFixtures().fixturesPath = 'tests/html_fixtures';
describe("BaseView", function () {
beforeEach(function() {
loadFixtures('components/base_view.html');
});
it("Test BaseView rendering of compiled template", function () {
... | define(['views/base_view'], function (baseView) {
var run = function () {
module("BaseView");
test("Test BaseView rendering of compiled template", function () {
var test_model = new Backbone.Model({name: "Test"}),
TestView = baseView.extend({
templa... |
Convert gulp coverage spawnSyncs to chained spawns. | const gulp = require('gulp');
const spawn = require('child_process').spawn;
gulp.task('test', function(cb) {
let command = [ 'run', 'python', 'manage.py', 'test' ];
let args = process.argv;
if (args[3] == '--test' && args[4]) {
command.push(args[4]);
}
spawn(
'pipenv',
com... | const gulp = require('gulp');
const spawn = require('child_process').spawn;
const spawnSync = require('child_process').spawnSync;
gulp.task('test', function(cb) {
let command = [ 'run', 'python', 'manage.py', 'test' ];
let args = process.argv;
if (args[3] == '--test' && args[4]) {
command.push(ar... |
Allow reading static resources from jars | package j2html.tags;
import java.io.FileInputStream;
import java.io.InputStream;
import java.util.Scanner;
import j2html.Config;
import static j2html.TagCreator.*;
public class InlineStaticResource {
public enum TargetFormat {CSS_MIN, CSS, JS_MIN, JS}
public static ContainerTag get(String path, TargetForm... | package j2html.tags;
import java.io.BufferedReader;
import java.io.FileReader;
import java.io.IOException;
import j2html.Config;
import j2html.utils.CSSMin;
import j2html.utils.JSMin;
import static j2html.TagCreator.*;
public class InlineStaticResource {
public enum TargetFormat {CSS_MIN, CSS, JS_MIN, JS}
... |
Throw better exceptions on invalid data | <?php
namespace GraphiteAlert;
use Guzzle\Http\Client;
class GraphiteData
{
protected $config;
protected $client;
public function __construct($config)
{
$this->config = $config;
$this->client = new Client($config['url']);
}
public function fetch($target, $lookback)
{
... | <?php
namespace GraphiteAlert;
use Guzzle\Http\Client;
class GraphiteData
{
protected $config;
protected $client;
public function __construct($config)
{
$this->config = $config;
$this->client = new Client($config['url']);
}
public function fetch($target, $lookback)
{
... |
Remove commented out console.log lines | class MCWorkflowGraphComponentController {
/*@ngInject*/
constructor(processGraph, cyGraph) {
this.processGraph = processGraph;
this.cyGraph = cyGraph;
this.state = {
processes: [],
samples: [],
cy: null,
};
}
$onChanges(changes) {
... | class MCWorkflowGraphComponentController {
/*@ngInject*/
constructor(processGraph, cyGraph) {
this.processGraph = processGraph;
this.cyGraph = cyGraph;
this.state = {
processes: [],
samples: [],
cy: null,
};
}
$onChanges(changes) {
... |
Add graph node ordering test | "use strict";
define([
'knockout3',
'lib/knockout-dependency-graph'
], function(ko, KoDependencyGraph) {
describe('Functional tests', function () {
describe('Basic usage', function () {
it('Should track observable creation', function () {
var graph = new KoDependencyGrap... | "use strict";
define([
'knockout3',
'lib/knockout-dependency-graph'
], function(ko, KoDependencyGraph) {
describe('Functional tests', function () {
describe('Basic usage', function () {
it('Should track observable creation', function () {
var graph = new KoDependencyGrap... |
Check stopped torrents when cleaning | import datetime
import textwrap
import transmissionrpc
from axel import config
from axel import pb_notify
def clean():
transmission_client = transmissionrpc.Client(
config['transmission']['host'], port=config['transmission']['port']
)
torrents = transmission_client.get_torrents()
now = datet... | import datetime
import textwrap
import transmissionrpc
from axel import config
from axel import pb_notify
def clean():
transmission_client = transmissionrpc.Client(
config['transmission']['host'], port=config['transmission']['port']
)
torrents = transmission_client.get_torrents()
now = datet... |
Remove header from top 500 domains in examples | <?php
require __DIR__ . "/../vendor/autoload.php";
use Amp\Dns;
use Amp\Loop;
print "Downloading top 500 domains..." . PHP_EOL;
$domains = file_get_contents("https://moz.com/top500/domains/csv");
$domains = array_map(function ($line) {
return trim(explode(",", $line)[1], '"/');
}, array_filter(explode("\n", $do... | <?php
require __DIR__ . "/../vendor/autoload.php";
use Amp\Dns;
use Amp\Loop;
print "Downloading top 500 domains..." . PHP_EOL;
$domains = file_get_contents("https://moz.com/top500/domains/csv");
$domains = array_map(function ($line) {
return trim(explode(",", $line)[1], '"/');
}, array_filter(explode("\n", $do... |
Hide preferences button for now. | from gi.repository import Gio, Gtk
from rsr.commands import commands
class HeaderBar(Gtk.HeaderBar):
def __init__(self, win):
super(HeaderBar, self).__init__()
self.win = win
self.set_show_close_button(True)
self.set_title('RunSQLRun')
self.set_subtitle('Database query t... | from gi.repository import Gio, Gtk
from rsr.commands import commands
class HeaderBar(Gtk.HeaderBar):
def __init__(self, win):
super(HeaderBar, self).__init__()
self.win = win
self.set_show_close_button(True)
self.set_title('RunSQLRun')
self.set_subtitle('Database query t... |
Set the route for text wallposts to the model passed as a parameter | App.WallRouteMixin = Em.Mixin.create({
parentId: Em.K(),
parentType: Em.K(),
// This way the ArrayController won't hold an immutable array thus it can be extended with more wallposts.
setupController: function(controller, model) {
// Only reload wall-posts if switched to another project.
... | App.WallRouteMixin = Em.Mixin.create({
parentId: Em.K(),
parentType: Em.K(),
// This way the ArrayController won't hold an immutable array thus it can be extended with more wallposts.
setupController: function(controller, model) {
// Only reload wall-posts if switched to another project.
... |
Change code to use array_helper | <?php namespace Laravel\Socialite\Two;
use Symfony\Component\HttpFoundation\RedirectResponse;
class GithubProvider extends AbstractProvider implements ProviderInterface
{
/**
* The scopes being requested.
*
* @var array
*/
protected $scopes = ['user:email'];
/**
* {@inheritdoc}
... | <?php namespace Laravel\Socialite\Two;
use Symfony\Component\HttpFoundation\RedirectResponse;
class GithubProvider extends AbstractProvider implements ProviderInterface
{
/**
* The scopes being requested.
*
* @var array
*/
protected $scopes = ['user:email'];
/**
* {@inheritdoc}
... |
Remove referencing Backbone.Model's attributes internal structure
We should *never* use `attributes` as it violates the contract Models:
http://backbonejs.org/#Model-attributes
The contract of a Backbone.Model is that you access the properties held
in it via `.get('attr-name')`
Here, I mean for properties & attribu... | import React from 'react/addons';
import Backbone from 'backbone';
import Router from 'react-router';
import stores from 'stores';
import Stats from './Stats.react';
export default React.createClass({
displayName: "ProvidersList",
render: function () {
let providers = this.props.providers;
le... | import React from 'react/addons';
import Backbone from 'backbone';
import Router from 'react-router';
import stores from 'stores';
import Stats from './Stats.react';
export default React.createClass({
displayName: "ProvidersList",
render: function () {
let providers = this.props.providers;
let Provid... |
Hide splash when needed (when running install) | <?php
namespace Bluora\LaravelDatasets\Traits;
trait CommandTrait
{
public function splash($text, $hide_splash = false)
{
if (!$hide_splash) {
$this->line('');
$this->line(' ___ _ _ _ _ __ _ ');
... | <?php
namespace Bluora\LaravelDatasets\Traits;
trait CommandTrait
{
public function splash($text)
{
$this->line('');
$this->line(' ___ _ _ _ _ __ _ ');
$this->line(' / \ __ _ | |_ __ _ ___ ___ | |_ ___... |
Enable HTTPS for localhost dev | const gulp = require('gulp'),
browserSync = require('browser-sync').get('PGR2015'),
inject = require('gulp-inject'),
modRewrite = require('connect-modrewrite'),
wiredep = require('wiredep').stream;
module.exports = function () {
browserSync.init({
server: {
baseDir: ['./.tmp'],
... | const gulp = require('gulp'),
browserSync = require('browser-sync').get('PGR2015'),
inject = require('gulp-inject'),
modRewrite = require('connect-modrewrite'),
wiredep = require('wiredep').stream;
module.exports = function () {
browserSync.init({
server: {
baseDir: ['./.tmp'],
... |
Paste job definition to clipboard as text and not as HTML.
Change-Id: I158ee4527d74d8cbd03c90d83398c9a6b5a9e2dd | create_tmp_element = function (text) {
// create temporary textarea in order to copy it's contents.
var tmp_element = $('<textarea />');
tmp_element.css("fontSize", "12pt");
tmp_element.css("border", "0");
tmp_element.css("padding", "0");
tmp_element.css("margin", "0");
// Move element out o... | create_tmp_element = function (text) {
// create temporary textarea in order to copy it's contents.
var tmp_element = $('<textarea />');
tmp_element.css("fontSize", "12pt");
tmp_element.css("border", "0");
tmp_element.css("padding", "0");
tmp_element.css("margin", "0");
// Move element out o... |
BAP-10874: Apply select2-autocomplete component for field Organization Structure of form create/edit user | <?php
namespace Oro\Bundle\OrganizationBundle\EventListener;
use Oro\Bundle\SearchBundle\Event\IndexerPrepareQueryEvent;
use Oro\Bundle\SecurityBundle\SecurityFacade;
class IndexerPrepareQueryListener
{
const BUSINESS_UNIT_STRUCTURE_ORGANIZATION = 'business_units_search_handler';
/** @var SecurityFacade */
... | <?php
namespace Oro\Bundle\OrganizationBundle\EventListener;
use Oro\Bundle\SearchBundle\Event\IndexerPrepareQueryEvent;
use Oro\Bundle\SecurityBundle\SecurityFacade;
class IndexerPrepareQueryListener
{
const BUSINESS_UNIT_STRUCTURE_ORGANIZATION = 'business_units_search_handler';
/** @var SecurityFacade */
... |
Fix default values of Argument Parser | # -*- coding: utf-8 -*-
from queries import Grok
def print_monthly_views(site, pages, year, month):
grok = Grok(site)
for page in pages:
result = grok.get_views_for_month(page, year, month)
print result['daily_views']
def main():
""" main script. """
from argparse import ArgumentPar... | # -*- coding: utf-8 -*-
from queries import Grok
def print_monthly_views(site, pages, year, month):
grok = Grok(site)
for page in pages:
result = grok.get_views_for_month(page, year, month)
print result['daily_views']
def main():
""" main script. """
from argparse import ArgumentPar... |
Fix the displayed error message in V2 API
Change-Id: I07c3f1ed79fa507dbe9b76eb8f5964475516754c | # Copyright 2014 Hewlett-Packard Development Company, L.P.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requir... | # Copyright 2014 Hewlett-Packard Development Company, L.P.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requir... |
Return `value` as `null` when done.
Closes #75. | module.exports = function (paginator, filter) {
const iterator = paginator[Symbol.asyncIterator]()
let done = false
return {
[Symbol.asyncIterator]: function () {
return this
},
next: async function () {
if (done) {
return { done: true, valu... | module.exports = function (paginator, filter) {
const iterator = paginator[Symbol.asyncIterator]()
let done = false
return {
[Symbol.asyncIterator]: function () {
return this
},
next: async function () {
if (done) {
return { done: true }
... |
Remove Risky warning in Tests | <?php
/**
* Novactive Collection.
*
* @author Luke Visinoni <l.visinoni@novactive.us, luke.visinoni@gmail.com>
* @author Sébastien Morel <s.morel@novactive.us, morel.seb@gmail.com>
* @copyright 2017 Novactive
* @license MIT
*/
declare(strict_types=1);
namespace Novactive\Tests;
use Novactive\Collection... | <?php
/**
* Novactive Collection.
*
* @author Luke Visinoni <l.visinoni@novactive.us, luke.visinoni@gmail.com>
* @author Sébastien Morel <s.morel@novactive.us, morel.seb@gmail.com>
* @copyright 2017 Novactive
* @license MIT
*/
declare(strict_types=1);
namespace Novactive\Tests;
use Novactive\Collection... |
Clear queries list instead of overwriting it. | import functools
import unicodedata
from django.core.cache import get_cache
from django.conf import settings
def normalize_unicode(u):
"""Replace non-ASCII characters with closest ASCII equivalents
where possible.
"""
return unicodedata.normalize('NFKD', u).encode('ascii', 'ignore')
def cache_... | import functools
import unicodedata
from django.core.cache import get_cache
from django.conf import settings
def normalize_unicode(u):
"""Replace non-ASCII characters with closest ASCII equivalents
where possible.
"""
return unicodedata.normalize('NFKD', u).encode('ascii', 'ignore')
def cache_... |
Fix diffing on Py3 by comparing unicode strings | # coding=utf-8
from __future__ import unicode_literals
from io import BytesIO
from .marc import Record
from .util import etree, parse_xml, show_diff
class Bib(object):
""" An Alma Bib record """
def __init__(self, alma, xml):
self.alma = alma
self.orig_xml = xml
self.init(xml)
... | # coding=utf-8
from __future__ import unicode_literals
from io import BytesIO
from .marc import Record
from .util import etree, parse_xml, show_diff
class Bib(object):
""" An Alma Bib record """
def __init__(self, alma, xml):
self.alma = alma
self.orig_xml = xml.encode('utf-8')
sel... |
Fix required value prop failing on null values | import AdvancedSelect, {
propTypes as advancedSelectPropTypes
} from "components/advancedSelectWidget/AdvancedSelect"
import { AdvancedSingleSelectOverlayTable } from "components/advancedSelectWidget/AdvancedSelectOverlayTable"
import * as FieldHelper from "components/FieldHelper"
import _isEmpty from "lodash/isEmpty... | import AdvancedSelect, {
propTypes as advancedSelectPropTypes
} from "components/advancedSelectWidget/AdvancedSelect"
import { AdvancedSingleSelectOverlayTable } from "components/advancedSelectWidget/AdvancedSelectOverlayTable"
import * as FieldHelper from "components/FieldHelper"
import _isEmpty from "lodash/isEmpty... |
Add first pass at "none" koan. One test left. | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Based on AboutNil in the Ruby Koans
#
from runner.koan import *
class AboutNone(Koan):
def test_none_is_an_object(self):
"Unlike NULL in a lot of languages"
self.assertEqual(True, isinstance(None, object))
def test_none_is_universal(self):
... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Based on AboutNil in the Ruby Koans
#
from runner.koan import *
class AboutNone(Koan):
def test_none_is_an_object(self):
"Unlike NULL in a lot of languages"
self.assertEqual(__, isinstance(None, object))
def test_none_is_universal(self):
... |
Remove if(this.viewHeight){} since block is empty. | class MCShowSampleComponentController {
/*@ngInject*/
constructor($stateParams, samplesService, toast, $mdDialog) {
this.projectId = $stateParams.project_id;
this.samplesService = samplesService;
this.toast = toast;
this.$mdDialog = $mdDialog;
this.viewHeight = this.viewH... | class MCShowSampleComponentController {
/*@ngInject*/
constructor($stateParams, samplesService, toast, $mdDialog) {
this.projectId = $stateParams.project_id;
this.samplesService = samplesService;
this.toast = toast;
this.$mdDialog = $mdDialog;
this.viewHeight = this.viewH... |
Change wording of nomination submit | // @flow
import * as React from 'react';
import HouseholdForm from './form/head-of-household';
import AddressForm from './form/address';
import PhoneNumbers from './form/phone-numbers';
import ChildForm from './form/child';
import { Row, Col, Button } from 'react-bootstrap';
import { Form } from 'neoform';
import { Fo... | // @flow
import * as React from 'react';
import HouseholdForm from './form/head-of-household';
import AddressForm from './form/address';
import PhoneNumbers from './form/phone-numbers';
import ChildForm from './form/child';
import { Row, Col, Button } from 'react-bootstrap';
import { Form } from 'neoform';
import { Fo... |
Fix travis by removing abc metaclass. | import sublime
import sublime_plugin
from ..helpers import is_js_source
class BaseCommand(sublime_plugin.TextCommand):
"""Common properties and methods for children commands."""
def get_content(self):
"""Return file content."""
return self.view.substr(sublime.Region(0, self.view.size()))
... | import abc
import sublime
import sublime_plugin
from ..helpers import is_js_source
class BaseCommand(sublime_plugin.TextCommand, metaclass=abc.ABCMeta):
"""Common properties and methods for children commands."""
def get_content(self):
"""Return file content."""
return self.view.substr(subli... |
Improve indented code block parsing. | <?php
namespace FluxBB\CommonMark\Parser\Block;
use FluxBB\CommonMark\Common\Text;
use FluxBB\CommonMark\Node\CodeBlock;
use FluxBB\CommonMark\Node\Container;
use FluxBB\CommonMark\Parser\AbstractBlockParser;
class CodeBlockParser extends AbstractBlockParser
{
/**
* Parse the given content.
*
* A... | <?php
namespace FluxBB\CommonMark\Parser\Block;
use FluxBB\CommonMark\Common\Text;
use FluxBB\CommonMark\Node\CodeBlock;
use FluxBB\CommonMark\Node\Container;
use FluxBB\CommonMark\Parser\AbstractBlockParser;
class CodeBlockParser extends AbstractBlockParser
{
/**
* Parse the given content.
*
* A... |
Fix workshop loading spinner not showing properly | import React, { Component } from 'react'
import Radium from 'radium'
import Helmet from 'react-helmet'
import Axios from 'axios'
import { NavBar, LoadingSpinner } from '../../components'
import { NotFound } from '../../containers'
const baseUrl = 'https://api.hackclub.com/v1/workshops/'
class WorkshopWrapper extends ... | import React, { Component } from 'react'
import Radium from 'radium'
import Helmet from 'react-helmet'
import Axios from 'axios'
import { NavBar, LoadingSpinner } from '../../components'
import { NotFound } from '../../containers'
const baseUrl = 'https://api.hackclub.com/v1/workshops/'
class WorkshopWrapper extends ... |
Update comments to be clearer | 'use strict';
var glimpse = require('glimpse');
var requestRepository = require('../repository/request-repository');
// TODO: Not sure I need to store the requests
var _requests = {};
var _viewModel = {
selectedId: null,
request: null
};
function requestChanged(targetRequests) {
glimpse.emit('shell.reque... | 'use strict';
var glimpse = require('glimpse');
var requestRepository = require('../repository/request-repository');
// TODO: Not sure I need to store the requests
var _requests = {};
var _viewModel = {
selectedId: null,
request: null
};
function requestChanged(targetRequests) {
glimpse.emit('shell.reque... |
Add missing bucket for local fs | <?php
return function (CM_Config_Node $config) {
$awsBucket = '<%= @aws_bucket %>';
$awsRegion = '<%= @aws_region %>';
$awsKey = '<%= @aws_key %>';
$awsSecret = '<%= @aws_secret %>';
$config->services['s3export-filesystem-original'] = array(
'class' => 'CM_File_Filesystem_Factory',
... | <?php
return function (CM_Config_Node $config) {
$awsBucket = '<%= @aws_bucket %>';
$awsRegion = '<%= @aws_region %>';
$awsKey = '<%= @aws_key %>';
$awsSecret = '<%= @aws_secret %>';
$config->services['s3export-filesystem-original'] = array(
'class' => 'CM_File_Filesystem_Factory',
... |
Fix jshint and jscs errors. | /*jshint node: true*/
'use strict';
module.exports = {
options: {
indent: ' '
},
npm: {
src: '<%= meta.cwd %>package.json',
dest: '<%= meta.build %>package.json',
fields: {
'name': null,
'version': null,
'description': null,
... | /*jshint node: true*/
'use strict';
module.exports = {
options: {
indent: ' '
},
npm: {
src: '<%= meta.cwd %>package.json',
dest: '<%= meta.build %>package.json',
fields: {
'name': null,
'version': null,
'description': null,
... |
Fix logic error in request handler
Was rejecting in simple mode if the response was a valid status code,
instead of when it wasn't. | 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'... |
Change Sphinx dependency to 1.1
According to @nyergler 1.1 should be sufficient, I hadn't thought to
check travis or tox's conf files for the information. | from setuptools import setup, find_packages
import os
here = os.path.abspath(os.path.dirname(__file__))
README = open(os.path.join(here, 'README.rst')).read()
NEWS = open(os.path.join(here, 'NEWS.txt')).read()
version = '0.7'
install_requires = [
"Sphinx >= 1.1",
"six",
]
setup(name='hieroglyph',
ve... | from setuptools import setup, find_packages
import os
here = os.path.abspath(os.path.dirname(__file__))
README = open(os.path.join(here, 'README.rst')).read()
NEWS = open(os.path.join(here, 'NEWS.txt')).read()
version = '0.7'
install_requires = [
"Sphinx >= 1.2",
"six",
]
setup(name='hieroglyph',
ve... |
Fix typo causing error in imports. | from __future__ import absolute_import
from ._version import __version__
from . import styles
from . import examples
from . import datasets
from . import embed
from .widgets import (Mesh,
Scatter,
Volume,
Figure,
quickquiver,
... | from __future__ import absolute_import
from ._version import __version__
from . import styles
from . import examples
from . import datasets
from . import embed
from .widgets import (Mesh,
Scatter,
Volume,
Figure,
quickquiver,
... |
Fix distance for margin title on layout | /*
* Code to display coderwall.com badges
*/
$(document).ready(function(){
var member = $('#github_user').text();
var coderwallJSONurl ="http://www.coderwall.com/" + member + ".json?callback=?";
var height = 75;
var width = 75;
$.getJSON(coderwallJSONurl, function(data) {
... | /*
* Code to display coderwall.com badges
*/
$(document).ready(function(){
var member = $('#github_user').text();
var coderwallJSONurl ="http://www.coderwall.com/" + member + ".json?callback=?";
var height = 75;
var width = 75;
$.getJSON(coderwallJSONurl, function(data) {
... |
Remove default arguments for user_id, client_id and type | from .rest import RestClient
class DeviceCredentials(object):
"""Auth0 connection endpoints
Args:
domain (str): Your Auth0 domain, e.g: 'username.auth0.com'
jwt_token (str): An API token created with your account's global
keys. You can create one by using the token generator in ... | from .rest import RestClient
class DeviceCredentials(object):
"""Auth0 connection endpoints
Args:
domain (str): Your Auth0 domain, e.g: 'username.auth0.com'
jwt_token (str): An API token created with your account's global
keys. You can create one by using the token generator in ... |
Fix recursive deep merge of context data | 'use strict';
const _ = require('lodash');
const utils = require('../utils');
const Log = require('../log');
const mix = require('../mixins/mix');
const Heritable = require('../mixins/heritable');
const EntityMixin = require('../mixins/entity');
module.exports = class Entity extends mix(Heritable, EntityMixin) {
... | 'use strict';
const _ = require('lodash');
const utils = require('../utils');
const Log = require('../log');
const mix = require('../mixins/mix');
const Heritable = require('../mixins/heritable');
const EntityMixin = require('../mixins/entity');
module.exports = class Entity extends mix(Heritable, EntityMixin) {
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.