text stringlengths 17 1.47k | positive stringlengths 673 4.43k | negative stringlengths 677 2.81k |
|---|---|---|
Use pluginLoader in contextual extension
If a contextual module is defined passing a string as the `definer`
parameter, the `pluginLoader` needs to be used to dynamically load the
`definer` function; otherwise steal-tools won't build the app.
Closes #952 | addStealExtension(function (loader) {
loader._contextualModules = {};
loader.setContextual = function(moduleName, definer){
this._contextualModules[moduleName] = definer;
};
var normalize = loader.normalize;
loader.normalize = function(name, parentName){
var loader = this;
var pluginLoader = loader... | addStealExtension(function (loader) {
loader._contextualModules = {};
loader.setContextual = function(moduleName, definer){
this._contextualModules[moduleName] = definer;
};
var normalize = loader.normalize;
loader.normalize = function(name, parentName){
var loader = this;
if (parentName) {
... |
Fix bug with the laravel4 paginator | <?php
namespace Michaeljennings\Carpenter\Pagination\Laravel4;
use Michaeljennings\Carpenter\Contracts\Paginator as PaginatorContract;
class Illuminate implements PaginatorContract
{
/**
* An instance of the IOC container.
*
* @var mixed
*/
protected $app;
/**
* The illuminate p... | <?php
namespace Michaeljennings\Carpenter\Pagination\Laravel4;
use Michaeljennings\Carpenter\Contracts\Paginator as PaginatorContract;
class Illuminate implements PaginatorContract
{
/**
* An instance of the IOC container.
*
* @var mixed
*/
protected $app;
/**
* The illuminate p... |
Move to using methods that are not deprecated and unescape the hash
when using it as default value. | import functionalText from "functional-text";
window.addEventListener("DOMContentLoaded", function () {
let inputNode = document.querySelector("#input");
let outputHtmlNode = document.querySelector("#output-html");
let str = window.location.hash.length > 0 ?
decodeURI(window.location.hash.substr(1... | import functionalText from "functional-text";
window.addEventListener("DOMContentLoaded", function () {
let inputNode = document.querySelector("#input");
let outputHtmlNode = document.querySelector("#output-html");
let str = window.location.hash.length > 0 ?
window.location.hash.substr(1) :
... |
Make preprocess testset argument accessible through API | from .io import preprocess
from .train import train
from .network import autoencoder
from .encode import encode
def autoencode(count_matrix, kfold=None, dimreduce=True, reconstruct=True,
mask=None, type='normal', activation='relu', testset=False,
learning_rate=1e-2, hidden_size=(256,64,2... | from .io import preprocess
from .train import train
from .network import autoencoder
from .encode import encode
def autoencode(count_matrix, kfold=None, dimreduce=True, reconstruct=True,
mask=None, type='normal', activation='relu',
learning_rate=1e-2, hidden_size=(256,64,256), l2_coef=0.... |
Fix loading issue for reactions | package dev.nincodedo.ninbot.components.reaction;
import lombok.Data;
import net.dv8tion.jda.api.entities.Message;
import net.dv8tion.jda.api.entities.MessageChannel;
import net.dv8tion.jda.api.events.message.MessageReceivedEvent;
import java.util.List;
@Data
class ReactionResponse {
protected String response;
... | package dev.nincodedo.ninbot.components.reaction;
import lombok.Data;
import lombok.NoArgsConstructor;
import net.dv8tion.jda.api.entities.Message;
import net.dv8tion.jda.api.entities.MessageChannel;
import net.dv8tion.jda.api.events.message.MessageReceivedEvent;
import java.util.List;
@NoArgsConstructor
@Data
abstr... |
Add get_absolute_url on notification model | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import json
from django.db import models
from django.utils.translation import ugettext_lazy as _
from opps.core.models import Publishable
from opps.db import Db
NOTIFICATION_TYPE = (
(u'json', _(u'JSON')),
(u'text', _(u'Text')),
(u'html', _(u'HTML')),
)
cla... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import json
from django.db import models
from django.utils.translation import ugettext_lazy as _
from opps.core.models import Publishable
from opps.db import Db
NOTIFICATION_TYPE = (
(u'json', _(u'JSON')),
(u'text', _(u'Text')),
(u'html', _(u'HTML')),
)
cla... |
Fix issue with loading of files due to wrong filepath | import javafx.fxml.FXML;
import javafx.scene.canvas.Canvas;
import javafx.scene.canvas.GraphicsContext;
import javafx.scene.layout.AnchorPane;
import javafx.scene.paint.Color;
import javafx.stage.FileChooser;
import javafx.stage.Stage;
import java.io.File;
import java.io.IOException;
/**
* Created by TUDelft SID on ... | import javafx.fxml.FXML;
import javafx.scene.canvas.Canvas;
import javafx.scene.canvas.GraphicsContext;
import javafx.scene.layout.AnchorPane;
import javafx.scene.paint.Color;
import javafx.stage.FileChooser;
import javafx.stage.Stage;
import java.io.File;
import java.io.IOException;
/**
* Created by TUDelft SID on ... |
Add secret check and remove response code. | var express = require('express');
var router = express.Router();
var request = require('request');
router.get('/', function(req, res) {
if (req.query.secret !== process.env.SECRET) {
res.sendStatus(404).end();
} else {
request({
url: 'https://status.heroku.com/api/v3/current-status',
method: 'G... | var express = require('express');
var router = express.Router();
var request = require('request');
router.get('/', function(req, res) {
request({
url: 'https://status.heroku.com/api/v3/current-status',
method: 'GET'
}, function(error, response, body) {
var result = JSON.parse(body);
var color;
... |
Add branding and spanish wording | <html>
<head>
<link href='//fonts.googleapis.com/css?family=Lato:100' rel='stylesheet' type='text/css'>
<style>
body {
margin: 0;
padding: 0;
width: 100%;
height: 100%;
color: #B0BEC5;
displa... | <html>
<head>
<link href='//fonts.googleapis.com/css?family=Lato:100' rel='stylesheet' type='text/css'>
<style>
body {
margin: 0;
padding: 0;
width: 100%;
height: 100%;
color: #B0BEC5;
displa... |
Fix tests related to result collection | from kernel.kernel import Kernel
from modules import AbstractModule
from kernel.config import Config
from kernel.result import Result
from kernel.module_chain import ModuleChain
import glob
import os
import json
def test_get_module():
mod = Kernel.get_module('modules', 'file.Extension')
assert isinstance(mod,... | from kernel.kernel import Kernel
from modules import AbstractModule
from kernel.module_chain import ModuleChain
import glob
import os
import json
def test_get_module():
mod = Kernel.get_module('modules', 'file.Extension')
assert isinstance(mod, AbstractModule)
try:
mod = Kernel.get_module('module... |
Change discover page layout a little | import React, { Component } from 'react';
import {
View,
ScrollView,
} from 'react-native';
import _ from 'lodash'
import { observer } from 'mobx-react/native'
import { BarMapView } from './BarMap.js'
import { BarCard } from './BarCard.js'
import { DownloadResultView } from './HTTP.js'
import { T } from './AppText... | import React, { Component } from 'react';
import {
View,
ScrollView,
} from 'react-native';
import _ from 'lodash'
import { observer } from 'mobx-react/native'
import { BarMapView } from './BarMap.js'
import { BarCard } from './BarCard.js'
import { DownloadResultView } from './HTTP.js'
import { T } from './AppText... |
Fix overflow menu reopening immediately after selecting an item
Was caused by mouseout toggling, instead of closing | import React, { Component, PropTypes, cloneElement } from 'react';
import styles from './OverFlowMenu.module.scss';
export class OverflowItem extends Component {
onClick(e) {
this.props.onClick(e);
this.props.onClicked();
}
render() {
return (
<div className={styles.item} {...this.props} onCli... | import React, { Component, PropTypes, cloneElement } from 'react';
import styles from './OverFlowMenu.module.scss';
export class OverflowItem extends Component {
onClick(e) {
this.props.onClick(e);
this.props.onClicked();
}
render() {
return (
<div className={styles.item} {...this.props} onCli... |
Fix capital O missing umlaut | # coding=utf-8
from __future__ import unicode_literals
from ..internet import Provider as InternetProvider
import re
class Provider(InternetProvider):
free_email_domains = (
'web.de', 'gmail.com', 'hotmail.de', 'yahoo.de', 'googlemail.com',
'aol.de', 'gmx.de'
)
tlds = ('com', 'com', 'com... | # coding=utf-8
from __future__ import unicode_literals
from ..internet import Provider as InternetProvider
import re
class Provider(InternetProvider):
free_email_domains = (
'web.de', 'gmail.com', 'hotmail.de', 'yahoo.de', 'googlemail.com',
'aol.de', 'gmx.de'
)
tlds = ('com', 'com', 'com... |
Set jshint to ignore minified files. | module.exports = function (grunt) {
require('load-grunt-tasks')(grunt);
grunt.initConfig({
handlebars: {
compile: {
options: {
amd: ['handlebars', 'handlebars.helpers'],
namespace: 'templates',
partialRegex: /.*... | module.exports = function (grunt) {
require('load-grunt-tasks')(grunt);
grunt.initConfig({
handlebars: {
compile: {
options: {
amd: ['handlebars', 'handlebars.helpers'],
namespace: 'templates',
partialRegex: /.*... |
Use the right name for the profile role's values. | from django.shortcuts import render_to_response
from pytask.profile import models as profile_models
def show_msg(user, message, redirect_url=None, url_desc=None):
""" simply redirect to homepage """
return render_to_response('show_msg.html',{'user': user,
'mess... | from django.shortcuts import render_to_response
def show_msg(user, message, redirect_url=None, url_desc=None):
""" simply redirect to homepage """
return render_to_response('show_msg.html',{'user': user,
'message': message,
... |
Update route on interval drop-down changes. | define([], function() {
'use strict';
return Backbone.View.extend({
jqplotId: null,
initialize: function(options) {
this.render();
var view = this;
diana.helpers.Event.on('DashboardTimeIntervalChange', function(interval) {
view.options.dashArgs.interval = interval;
vie... | define([], function() {
'use strict';
return Backbone.View.extend({
jqplotId: null,
initialize: function(options) {
this.render();
var view = this;
diana.helpers.Event.on('DashboardTimeIntervalChange', function(interval) {
view.options.dashArgs.interval = interval;
view... |
Read the correct package name
We can't read the package name from the cordova interface since that is in the
org.apache.cordova package. Instead, we get it from the cordova activity. So as
long as the new screen is in the same package as the cordova activity, we are
fine. | package edu.berkeley.eecs.emission.cordova.launchnative;
import org.apache.cordova.*;
import org.json.JSONArray;
import org.json.JSONException;
import android.content.Intent;
public class LaunchNative extends CordovaPlugin {
@Override
public boolean execute(String action, JSONArray data, CallbackContext call... | package edu.berkeley.eecs.emission.cordova.launchnative;
import org.apache.cordova.*;
import org.json.JSONArray;
import org.json.JSONException;
import android.content.Intent;
public class LaunchNative extends CordovaPlugin {
@Override
public boolean execute(String action, JSONArray data, CallbackContext call... |
Move all the process creation in a new function
This reduces the size of code. | import os
import sys
import time
from multiprocessing import Process, Event
import mfhclient
import server
import update
from arguments import parse
from settings import HONEYPORT, HIVEPORT
def main():
update_event = Event()
client = create_process("client", mfhclient.main, args, update_event)
serv = c... | import os
import sys
import time
from multiprocessing import Process, Event
import mfhclient
import server
import update
from arguments import parse
from settings import HONEYPORT, HIVEPORT
def main():
update_event = Event()
mfhclient_process = Process(
args=(args, update_event,),
name="mfh... |
Use correct method to get classname of self | import os.path
from utils import file_sha1sum
class Artefact(object):
def __init__(self, filename, extension):
if not filename.endswith(extension):
raise ValueError
self._filename = filename
self._ext_length = len(extension)
self._abspath = os.path.abspath(filename)
... | import os.path
from utils import file_sha1sum
class Artefact(object):
def __init__(self, filename, extension):
if not filename.endswith(extension):
raise ValueError
self._filename = filename
self._ext_length = len(extension)
self._abspath = os.path.abspath(filename)
... |
Use a constant to specify the number of child threads to create.
Instead of assuming that the number process ids of the threads is the
same as the process id of the controlling process, use a copy of the
dictionary and check for changes in the process ids of the threads
from the thread's process ids in the parent proc... | """This test checks for correct fork() behavior.
We want fork1() semantics -- only the forking thread survives in the
child after a fork().
On some systems (e.g. Solaris without posix threads) we find that all
active threads survive in the child after a fork(); this is an error.
"""
import os, sys, time, thread
LO... | """This test checks for correct fork() behavior.
We want fork1() semantics -- only the forking thread survives in the
child after a fork().
On some systems (e.g. Solaris without posix threads) we find that all
active threads survive in the child after a fork(); this is an error.
"""
import os, sys, time, thread
LO... |
Add the Javascript half of the new Geolocation code | var constructGeolocationLink = function constructGeolocationLink($wrapper){
var geolocationIsSupported = false;
if ("geolocation" in navigator) {
geolocationIsSupported = true;
}
if(geolocationIsSupported) {
var t1 = $wrapper.attr('data-link-text') || 'Use my current location';
... | var constructGeolocationLink = function constructGeolocationLink($wrapper){
var geolocationIsSupported = false;
if ("geolocation" in navigator) {
geolocationIsSupported = true;
}
if(geolocationIsSupported) {
var t1 = $wrapper.attr('data-link-text') || 'Use my current location';
... |
feat: Add koan about object duplicate properties | describe("About Objects", function () {
describe("Shorthand Syntax", function () {
it('should understand initailiser shorthand', function() {
function passThrough(one, two) {
return {
one,
two
}
}
var data = passThrough('one', 'two');
expect(typeof ... | describe("About Objects", function () {
describe("Shorthand Syntax", function () {
it('should understand initailiser shorthand', function() {
function passThrough(one, two) {
return {
one,
two
}
}
var data = passThrough('one', 'two');
expect(typeof ... |
Upgrade Facebook API to v. 2.10 | klimaChallenge.controller('newsCtrl', function($scope, $http, $sce) {
$scope.facebookImages = Array();
$http.get('https://graph.facebook.com/v2.10/klimachallenge/photos/uploaded?fields=link,width,name,images&limit=10&access_token=846767055411205|UKF39DbxTvvEeA9BuKkWsJgiuLE').
success(function(data, status, h... | klimaChallenge.controller('newsCtrl', function($scope, $http, $sce) {
$scope.facebookImages = Array();
$http.get('https://graph.facebook.com/v2.4/klimachallenge/photos/uploaded?fields=link,width,name,images&limit=10&access_token=846767055411205|UKF39DbxTvvEeA9BuKkWsJgiuLE').
success(function(data, status, he... |
Include watching config.json for changes | 'use strict';
module.exports = function (grunt) {
grunt.initConfig({
jshint: {
options: {
jshintrc: '.jshintrc'
},
gruntfile: {
src: 'Gruntfile.js'
},
lib: {
src: ['./*.js', 'routes/*.js', 'models/*.js']
}
},
watch: {
gruntfile: {
... | 'use strict';
module.exports = function (grunt) {
grunt.initConfig({
jshint: {
options: {
jshintrc: '.jshintrc'
},
gruntfile: {
src: 'Gruntfile.js'
},
lib: {
src: ['./*.js', 'routes/*.js', 'models/*.js']
}
},
watch: {
gruntfile: {
... |
Fix bug where dependencies aren't part of the context | import lodash from 'lodash';
export function listeningTo(storeNames, getterMethodName = 'getStateFromDependencies') {
return decorator;
function decorator(fn) {
const originalCDM = fn.prototype.componentDidMount;
const originalCWU = fn.prototype.componentWillUnmount;
fn.prototype.comp... | import lodash from 'lodash';
export function listeningTo(storeNames, getterMethodName = 'getStateFromDependencies') {
return decorator;
function decorator(fn) {
const originalCDM = fn.prototype.componentDidMount;
const originalCWU = fn.prototype.componentWillUnmount;
fn.prototype.comp... |
Throw an error if no Client-ID is given | var http = require("https");
var querystring = require("querystring");
var ImgurProto = {
gallery: function(params, callback) {
var qs = querystring.stringify(params);
var options = {
hostname: "api.imgur.com",
path: ["/3/gallery.json", qs].join("?"),
headers: {
"Authorization": ["C... | var http = require("https");
var querystring = require("querystring");
var ImgurProto = {
gallery: function(params, callback) {
var qs = querystring.stringify(params);
var options = {
hostname: "api.imgur.com",
path: ["/3/gallery.json", qs].join("?"),
headers: {
"Authorization": ["C... |
Change default value to use UTC time | from datetime import datetime, timedelta
RESOURCE_METHODS = ['GET', 'POST', 'DELETE']
ITEM_METHODS = ['GET', 'PATCH', 'PUT', 'DELETE']
DATE_FORMAT = '%Y-%m-%d %H:%M:%S GMT'
schema = {
'name': {
'type': 'string',
'minlength': 3,
'maxlength': 50,
'required': True,
},
'occurre... | from datetime import datetime, timedelta
RESOURCE_METHODS = ['GET', 'POST', 'DELETE']
ITEM_METHODS = ['GET', 'PATCH', 'PUT', 'DELETE']
DATE_FORMAT = '%Y-%m-%d %H:%M:%S GMT'
schema = {
'name': {
'type': 'string',
'minlength': 3,
'maxlength': 50,
'required': True,
},
'occurre... |
Add shebang and make file executable | #!/usr/bin/env python
import argparse
import binascii
import datetime
import gzip
import json
import magic
import os
import pymongo
import sys
def read_gzip(filename):
with gzip.open(filename) as file:
content = file.read()
return content
def read_plain(filename):
with open(filename) as file:
... | import argparse
import binascii
import datetime
import gzip
import json
import magic
import os
import pymongo
import sys
def read_gzip(filename):
with gzip.open(filename) as file:
content = file.read()
return content
def read_plain(filename):
with open(filename) as file:
content = file.... |
ADD the new parameter for specify ident service ids | <?php
/**
* Contact Common model class
*/
namespace SecucardConnect\Product\Common\Model;
/**
* Contact Data Model class
*
*/
class Contact
{
/**
* @var string
*/
public $salutation;
/**
* @var string
*/
public $title;
/**
* @var string
*/
public $forename;... | <?php
/**
* Contact Common model class
*/
namespace SecucardConnect\Product\Common\Model;
/**
* Contact Data Model class
*
*/
class Contact
{
/**
* @var string
*/
public $salutation;
/**
* @var string
*/
public $title;
/**
* @var string
*/
public $forename;... |
Update child fn name to onItemSelect from clickHandler | import {Dropdown} from 'reactjs-components';
import React from 'react';
import Icon from './Icon';
const getMenuItems = (children) => {
return [
{
className: 'hidden',
html: <Icon id="ellipsis-vertical" size="mini" />,
id: 'trigger'
},
...React.Children.map(children, getDropdownItemFro... | import {Dropdown} from 'reactjs-components';
import React from 'react';
import Icon from './Icon';
const getMenuItems = (children) => {
return [
{
className: 'hidden',
html: <Icon id="ellipsis-vertical" size="mini" />,
id: 'trigger'
},
...React.Children.map(children, getDropdownItemFro... |
Disable errors in Ace Editor
I did this as errors always seem to show in the editor and this can be very offputting for the end user | function component( args ) {
/*
base_component_id("editorComponent")
load_once_from_file(true)
*/
//alert(JSON.stringify(args,null,2))
var uid = uuidv4()
var uid2 = uuidv4()
var mm = Vue.component(uid, {
data: function () {
return {
text: args.text,
uid2: uid2
... | function component( args ) {
/*
base_component_id("editorComponent")
load_once_from_file(true)
*/
//alert(JSON.stringify(args,null,2))
var uid = uuidv4()
var uid2 = uuidv4()
var mm = Vue.component(uid, {
data: function () {
return {
text: args.text,
uid2: uid2
... |
Convert the file to UTF-8 | package com.fewlaps.mentiondetector;
import org.junit.Before;
import org.junit.Test;
import static org.assertj.core.api.Assertions.assertThat;
public class RemovePunctuationMarksTest {
RemovePunctuationMarks removePunctuationMarks;
@Before
public void setup() {
removePunctuationMarks = new Remo... | package com.fewlaps.mentiondetector;
import org.junit.Before;
import org.junit.Test;
import static org.assertj.core.api.Assertions.assertThat;
public class RemovePunctuationMarksTest {
RemovePunctuationMarks removePunctuationMarks;
@Before
public void setup() {
removePunctuationMarks = new Remo... |
Add fee_account to BuildingData of legacy test base | # Copyright (c) 2015 The Pycroft Authors. See the AUTHORS file.
# This file is part of the Pycroft project and licensed under the terms of
# the Apache License, Version 2.0. See the LICENSE file for details.
from fixture import DataSet
from .address import AddressData
from .finance import AccountData
class SiteData(... | # Copyright (c) 2015 The Pycroft Authors. See the AUTHORS file.
# This file is part of the Pycroft project and licensed under the terms of
# the Apache License, Version 2.0. See the LICENSE file for details.
from fixture import DataSet
from .address import AddressData
class SiteData(DataSet):
class dummy:
... |
Use the dots reporter for karms tests | module.exports = function(config) {
config.set({
frameworks: ['jasmine', 'browserify', 'source-map-support'],
reporters: ['dots'],
files: [
'src/js/Application.js',
'src/modules/**/*.html',
'src/html/**/*.html',
'src/test/**/*.js'
],
... | module.exports = function(config) {
config.set({
frameworks: ['jasmine', 'browserify', 'source-map-support'],
files: [
'src/js/Application.js',
'src/modules/**/*.html',
'src/html/**/*.html',
'src/test/**/*.js'
],
exclude: [
... |
Add null check of BGC at execute() on first | package com.uxxu.konashi.lib.action;
import android.bluetooth.BluetoothGattCharacteristic;
import android.bluetooth.BluetoothGattService;
import com.uxxu.konashi.lib.KonashiErrorType;
import java.util.UUID;
import info.izumin.android.bletia.BletiaErrorType;
import info.izumin.android.bletia.BletiaException;
import ... | package com.uxxu.konashi.lib.action;
import android.bluetooth.BluetoothGattCharacteristic;
import android.bluetooth.BluetoothGattService;
import com.uxxu.konashi.lib.KonashiErrorType;
import java.util.UUID;
import info.izumin.android.bletia.BletiaErrorType;
import info.izumin.android.bletia.BletiaException;
import ... |
Add Schemes to JSON preview | import {header} from './header';
import {mime} from './mime';
import {security} from './security';
import {tags} from './tags';
import {paths} from './paths';
import {types} from './types';
export const fieldsToShow = {
'header': [
'info',
'contact',
'license',
'host',
'basePath',
'schemes'
... | import {header} from './header';
import {mime} from './mime';
import {security} from './security';
import {tags} from './tags';
import {paths} from './paths';
import {types} from './types';
export const fieldsToShow = {
'header': [
'info',
'contact',
'license',
'host',
'basePath'
],
'types': ... |
Make this a bit cleaner. | <?php
namespace ComplexPie\Atom10;
class Feed
{
private static $aliases = array(
'description' => 'subtitle',
'tagline' => 'subtitle',
'copyright' => 'rights',
);
private static $elements = array(
'title' => array(
'element' => 'atom:title',
'con... | <?php
namespace ComplexPie\Atom10;
class Feed
{
private static $aliases = array(
'description' => 'subtitle',
'tagline' => 'subtitle',
'copyright' => 'rights',
);
private static $elements = array(
'title' => array(
'element' => 'atom:title',
'typ... |
Disable tab stop on password show/hide links | <style type="text/css">
a.show-password{
color: #2196f3;
font-size: 0.9em;
margin-top: 10px;
position: absolute;
right: 0;
top: 0;
transition: all .8s linear;
}
a.show-password:hover{
transition: all .8s linear;
}
</style>
<script>
... | <style type="text/css">
a.show-password{
color: #2196f3;
font-size: 0.9em;
margin-top: 10px;
position: absolute;
right: 0;
top: 0;
transition: all .8s linear;
}
a.show-password:hover{
transition: all .8s linear;
}
</style>
<script>
... |
Add user agent to Blizzard visit log | <?php
namespace BNETDocs\Libraries;
use \BNETDocs\Libraries\Authentication;
use \BNETDocs\Libraries\EventTypes;
use \BNETDocs\Libraries\Logger;
use \CarlBennett\MVC\Libraries\Common;
use \CarlBennett\MVC\Libraries\IP;
class BlizzardChecker {
/**
* Block instantiation of this object.
*/
private function _... | <?php
namespace BNETDocs\Libraries;
use \BNETDocs\Libraries\Authentication;
use \BNETDocs\Libraries\EventTypes;
use \BNETDocs\Libraries\Logger;
use \CarlBennett\MVC\Libraries\Common;
use \CarlBennett\MVC\Libraries\IP;
class BlizzardChecker {
/**
* Block instantiation of this object.
*/
private function _... |
Use array_is_list() function when available
Suggested by Alexander M. Turek <me@derrabus.de> in https://github.com/sebastianbergmann/phpunit/pull/4818#pullrequestreview-830852046 | <?php declare(strict_types=1);
/*
* This file is part of PHPUnit.
*
* (c) Sebastian Bergmann <sebastian@phpunit.de>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace PHPUnit\Framework\Constraint;
use function array_is_list... | <?php declare(strict_types=1);
/*
* This file is part of PHPUnit.
*
* (c) Sebastian Bergmann <sebastian@phpunit.de>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace PHPUnit\Framework\Constraint;
use function is_array;
/*... |
Fix the regexp that ate the quiz page | function getParameterByName(name) {
var match = RegExp('[?&]' + name + '=([^&]*)').exec(window.location.search);
return match && decodeURIComponent(match[1].replace(/\+/g, ' '));
}
function fixPath (path) {
var match = RegExp('https?://[^/]*/(.*?)([?#]|$)').exec(window.location.href);
// If a stub exis... | function getParameterByName(name) {
var match = RegExp('[?&]' + name + '=([^&]*)').exec(window.location.search);
return match && decodeURIComponent(match[1].replace(/\+/g, ' '));
}
function fixPath (path) {
var match = RegExp('https?://[^/]*/(.*?)([?#]|$)').exec(window.location.href);
// If a stub exis... |
Upgrade django-local-settings 1.0a12 => 1.0a13 | import sys
from setuptools import find_packages, setup
VERSION = '2.0.dev0'
install_requires = [
'django-local-settings>=1.0a13',
'stashward',
]
if sys.version_info[:2] < (3, 4):
install_requires.append('enum34')
setup(
name='django-arcutils',
version=VERSION,
url='https://github.com/PSU... | import sys
from setuptools import find_packages, setup
VERSION = '2.0.dev0'
install_requires = [
'django-local-settings>=1.0a12',
'stashward',
]
if sys.version_info[:2] < (3, 4):
install_requires.append('enum34')
setup(
name='django-arcutils',
version=VERSION,
url='https://github.com/PSU... |
Add simplejson as requirement for python 2.5 | """
Flask-MongoKit
--------------
Flask-MongoKit simplifies to use MongoKit, a powerful MongoDB ORM in Flask
applications.
Links
`````
* `documentation <http://packages.python.org/Flask-MongoKit>`_
* `development version <http://github.com/jarus/flask-mongokit/zipball/master#egg=Flask-MongoKit-dev>`_
* `MongoKit <ht... | """
Flask-MongoKit
--------------
Flask-MongoKit simplifies to use MongoKit, a powerful MongoDB ORM in Flask
applications.
Links
`````
* `documentation <http://packages.python.org/Flask-MongoKit>`_
* `development version <http://github.com/jarus/flask-mongokit/zipball/master#egg=Flask-MongoKit-dev>`_
* `MongoK... |
Use browser test file with grunt connect | module.exports = function(grunt) {
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
bower: grunt.file.readJSON('bower.json'),
uglify: {
options: {
banner: '/*! This is hwcrypto.js <%= bower.version %> <%= grunt.template.today("yyyy-mm-dd") %> */\n',
... | module.exports = function(grunt) {
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
bower: grunt.file.readJSON('bower.json'),
uglify: {
options: {
banner: '/*! This is hwcrypto.js <%= bower.version %> <%= grunt.template.today("yyyy-mm-dd") %> */\n',
... |
Make workload optional when editing vacancies | from flask_wtf import Form
from flask_babel import lazy_gettext as _ # noqa
from wtforms import StringField, SubmitField, TextAreaField, \
DateField, SelectField
from wtforms.validators import InputRequired
class VacancyForm(Form):
title = StringField(_('Title'), validators=[InputRequired(
message=_(... | from flask_wtf import Form
from flask_babel import lazy_gettext as _ # noqa
from wtforms import StringField, SubmitField, TextAreaField, \
DateField, SelectField
from wtforms.validators import InputRequired
class VacancyForm(Form):
title = StringField(_('Title'), validators=[InputRequired(
message=_(... |
Check to see if browserify has modified process to check for browser environment. | var write = require('./write'),
geojson = require('./geojson'),
prj = require('./prj'),
JSZip = require('jszip');
module.exports = function(gj, options) {
var zip = new JSZip(),
layers = zip.folder(options && options.folder ? options.folder : 'layers');
[geojson.point(gj), geojson.line(gj... | var write = require('./write'),
geojson = require('./geojson'),
prj = require('./prj'),
JSZip = require('jszip');
module.exports = function(gj, options) {
var zip = new JSZip(),
layers = zip.folder(options && options.folder ? options.folder : 'layers');
[geojson.point(gj), geojson.line(gj... |
Add a loading indicator on the auth page | const React = require('react');
const Utils = require('../utils');
const AuthentificationPage = React.createClass({
getInitialState() { return { loading: false }; },
openAuthWindow() {
this.setState({ loading: true });
Utils.Socket.emit('youtube/auth');
},
render() {
if (this.state.loading) {
... | const React = require('react');
const Utils = require('../utils');
const AuthentificationPage = React.createClass({
getInitialState() { return { loading: false }; },
openAuthWindow() {
this.setState({ loading: true });
Utils.Socket.emit('youtube/auth');
},
render() {
if (this.state.loading) {
... |
Fix unicode source code on py3 | import json
from . import _dukpy
try:
from collections.abc import Iterable
except ImportError:
from collections import Iterable
try: # pragma: no cover
unicode
string_types = (str, unicode)
jscode_type = str
except NameError: # pragma: no cover
string_types = (bytes, str)
jscode_type = s... | import json
from . import _dukpy
try:
from collections.abc import Iterable
except ImportError:
from collections import Iterable
try: # pragma: no cover
unicode
string_types = (str, unicode)
except NameError: # pragma: no cover
string_types = (bytes, str)
class JSInterpreter(object):
"""Jav... |
Fix passing arguments to async() blocks | <?php
namespace CrystalPlanet\Redshift\EventLoop;
class EventLoop
{
/**
* @var array
*/
private $queue = [];
/**
* Adds a new task to the queue.
*
* @param callable $callback
* @param mixed ...$args Arguments to be supplied to the $callback
* at th... | <?php
namespace CrystalPlanet\Redshift\EventLoop;
class EventLoop
{
/**
* @var array
*/
private $queue = [];
/**
* Adds a new task to the queue.
*
* @param callable $callback
* @param mixed ...$args Arguments to be supplied to the $callback
* at th... |
Use the correct type for numbers! | package main
import (
"encoding/json"
"fmt"
"os"
)
func parseObj(in interface{}, out map[string]interface{}, prefix string) {
switch vv := in.(type) {
case map[string]interface{}:
for key, value := range vv {
parseObj(value, out, fmt.Sprintf("%s.%s", prefix, key))
}
... | package main
import (
"encoding/json"
"fmt"
"os"
)
func parseObj(in interface{}, out map[string]interface{}, prefix string) {
switch vv := in.(type) {
case map[string]interface{}:
for key, value := range vv {
parseObj(value, out, fmt.Sprintf("%s.%s", prefix, key))
}
... |
Revert "Bump version to 0.2.0"
This reverts commit 189e4bc4bcd7a6764740d9974a633996f6ba1fc7. | import os.path
import sys
from setuptools import setup, find_packages
from build_manpage import build_manpage
HOME=os.path.expanduser('~')
setup(
name='popup',
version='0.1.0',
author='Jay Edwards',
cmdclass={'build_manpage': build_manpage},
author_email='jay@meangrape.com',
packages=['PopupS... | import os.path
import sys
from setuptools import setup, find_packages
from build_manpage import build_manpage
HOME=os.path.expanduser('~')
setup(
name='popup',
version='0.2.0',
author='Jay Edwards',
cmdclass={'build_manpage': build_manpage},
author_email='jay@meangrape.com',
packages=['PopupS... |
Change search type to cross_fields and operator to and | var module = angular.module('JGivenApp',['ngSanitize']);
var elasticSearchHost = 'localhost'
module.controller(
'ApplicationController',
['$scope', '$http',
function( $scope, $http ) {
$scope.getScenarios = function() {
console.log("Searching for "+$scope.search);
data ... | var module = angular.module('JGivenApp',['ngSanitize']);
var elasticSearchHost = 'localhost'
module.controller(
'ApplicationController',
['$scope', '$http',
function( $scope, $http ) {
$scope.getScenarios = function() {
console.log("Searching for "+$scope.search);
data ... |
Use trait methods to get column names | <?php
namespace Yajra\Auditable;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Support\Facades\Schema;
class AuditableTraitObserver
{
/**
* Model's creating event hook.
*
* @param Model $model
*/
public function creating(Model $model)
{
$createdBy = $model->getCreated... | <?php
namespace Yajra\Auditable;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Support\Facades\Schema;
class AuditableTraitObserver
{
/**
* Model's creating event hook.
*
* @param Model $model
*/
public function creating(Model $model)
{
if (! $model->created_by) {
... |
Add platform type to dao | package org.pdxfinder.graph.dao;
import org.neo4j.ogm.annotation.GraphId;
import org.neo4j.ogm.annotation.NodeEntity;
import org.neo4j.ogm.annotation.Relationship;
import java.util.Set;
/**
* Created by jmason on 21/07/2017.
*/
@NodeEntity
public class Platform {
@GraphId
private Long id;
private Stri... | package org.pdxfinder.graph.dao;
import org.neo4j.ogm.annotation.GraphId;
import org.neo4j.ogm.annotation.NodeEntity;
import org.neo4j.ogm.annotation.Relationship;
import java.util.Set;
/**
* Created by jmason on 21/07/2017.
*/
@NodeEntity
public class Platform {
@GraphId
private Long id;
private Stri... |
[core] ENHANCE: Add UserInputSource as a InputProviderSource | package org.museautomation.core.task.input;
import org.museautomation.core.task.state.*;
/**
* @author Christopher L Merrill (see LICENSE.txt for license details)
*/
public abstract class ResolvedInputSource
{
public abstract String getDescription();
public static class TaskStateSource extends Resolved... | package org.museautomation.core.task.input;
import org.museautomation.core.task.state.*;
/**
* @author Christopher L Merrill (see LICENSE.txt for license details)
*/
public abstract class ResolvedInputSource
{
public abstract String getDescription();
public static class TaskStateSource extends Resolved... |
Throw exception if null is provided as service interfaces array. | /**
* This file is part of Everit - Component Metadata.
*
* Everit - Component Metadata is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any l... | /**
* This file is part of Everit - Component Metadata.
*
* Everit - Component Metadata is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any l... |
Make handle_read a private method | # -*- coding: utf-8 -*-
import logging
import time
from kafka.client import KafkaClient
from kafka.consumer import SimpleConsumer
class KafkaReader(object):
def __init__(self, host, port, group, topic, reconnect_wait_time=2):
"""
Initialize Kafka reader
"""
self.host = host
... | # -*- coding: utf-8 -*-
import logging
import time
from kafka.client import KafkaClient
from kafka.consumer import SimpleConsumer
class KafkaReader(object):
def __init__(self, host, port, group, topic, reconnect_wait_time=2):
"""
Initialize Kafka reader
"""
self.host = host
... |
Fix method to always return a value. | Application.Services.factory('Events', ['$filter', EventsService]);
function EventsService($filter) {
var service = {
date: '',
addConvertedTime: function (project) {
project.reviews = service.update(project.open_reviews);
project.samples = service.update(project.samples);... | Application.Services.factory('Events', ['$filter', EventsService]);
function EventsService($filter) {
var service = {
date: '',
addConvertedTime: function (project) {
project.reviews = service.update(project.open_reviews);
project.samples = service.update(project.samples);... |
Format JavaScript files with Prettier: scripts/draft-js/__github__/src
Differential Revision: D32201648
fbshipit-source-id: f94342845cbe6454bb7ae4f02814e788fb25de9f | /**
* Copyright 2004-present Facebook. All Rights Reserved.
*
* @emails oncall+ads_integration_management
* @flow strict-local
* @format
*/
'use strict';
const MAX_ASCII_CHARACTER = 127;
/**
* Serializes strings with non-ASCII characters to their Unicode escape
* sequences (eg. \u2022), to avoid hitting this... | /**
* Copyright 2004-present Facebook. All Rights Reserved.
*
* @emails oncall+ads_integration_management
* @flow strict-local
* @format
*/
'use strict';
const MAX_ASCII_CHARACTER = 127;
/**
* Serializes strings with non-ASCII characters to their Unicode escape
* sequences (eg. \u2022), to avoid hitting this... |
Make outlook emit single files | import logging
from followthemoney import model
from ingestors.ingestor import Ingestor
from ingestors.support.temp import TempFileSupport
from ingestors.support.shell import ShellSupport
from ingestors.support.ole import OLESupport
from ingestors.directory import DirectoryIngestor
log = logging.getLogger(__name__)
... | import logging
from followthemoney import model
from ingestors.ingestor import Ingestor
from ingestors.support.temp import TempFileSupport
from ingestors.support.shell import ShellSupport
from ingestors.support.ole import OLESupport
from ingestors.directory import DirectoryIngestor
log = logging.getLogger(__name__)
... |
refactor: Change userPos func to build API url | // use strict:
"use strict";
// Function gets the location of the user provided the user opts in
// Function for geolocation, success and error adapted from Sitepoint;
// URL https://www.sitepoint.com/html5-geolocation
if (navigator.geolocation) {
navigator.geolocation.getCurrentPosition(userPosition, showError);
} e... | // use strict:
"use strict";
// Function gets the location of the user provided the user opts in
// function adapted from Sitepoint; https://www.sitepoint.com/html5-geolocation
if (navigator.geolocation) {
navigator.geolocation.getCurrentPosition(userPosition, showError);
} else {
alert('Geolocation is not sup... |
Use padding on the index | from typing import Iterable, Tuple
def gallery(samples: Iterable[Tuple[str, str]], *, refresh: bool = False) -> str:
lines = []
for url, template in samples:
if refresh:
url += "?time=0"
else:
url += "?width=300&height=300"
lines.append(
f"""
... | from typing import Iterable, Tuple
def gallery(samples: Iterable[Tuple[str, str]], *, refresh: bool = False) -> str:
lines = []
for url, template in samples:
if refresh:
url += "?time=0"
lines.append(
f"""
<a href="{template or url}">
<img s... |
Add element identifier in laralytics_custom table | <?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
/**
* Class CreateLaralyticsCustomTable
*/
class CreateLaralyticsCustomTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public funct... | <?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
/**
* Class CreateLaralyticsCustomTable
*/
class CreateLaralyticsCustomTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public funct... |
Enforce consistent artisan command tag namespacing | <?php
declare(strict_types=1);
namespace Rinvex\Attributes\Console\Commands;
use Illuminate\Console\Command;
class PublishCommand extends Command
{
/**
* The name and signature of the console command.
*
* @var string
*/
protected $signature = 'rinvex:publish:attributes {--f|force : Overw... | <?php
declare(strict_types=1);
namespace Rinvex\Attributes\Console\Commands;
use Illuminate\Console\Command;
class PublishCommand extends Command
{
/**
* The name and signature of the console command.
*
* @var string
*/
protected $signature = 'rinvex:publish:attributes {--f|force : Overw... |
Remove Message typehint for testing convenience | <?php
namespace CodeZero\Mailer;
use Illuminate\Contracts\Mail\MailQueue;
class LaravelMailer implements Mailer
{
/**
* Laravel Mail Queue
*
* @var MailQueue
*/
private $mail;
/**
* Create a new instance of LaravelMailer.
*
* @param MailQueue $mail
*/
public f... | <?php
namespace CodeZero\Mailer;
use Illuminate\Contracts\Mail\MailQueue;
use Illuminate\Mail\Message;
class LaravelMailer implements Mailer
{
/**
* Laravel Mail Queue
*
* @var MailQueue
*/
private $mail;
/**
* Create a new instance of LaravelMailer.
*
* @param MailQue... |
Change turn rest api endpoint. | var Https = require('https');
var Common = require('./common');
exports.main = {
handler: function (request, reply) {
var params = Common.getRoomParameters(request, null, null, null);
reply.view('index_template', params);
}
};
exports.turn = {
handler: function (request, reply) {
var getOptions = {... | var Https = require('https');
var Common = require('./common');
exports.main = {
handler: function (request, reply) {
var params = Common.getRoomParameters(request, null, null, null);
reply.view('index_template', params);
}
};
exports.turn = {
handler: function (request, reply) {
var getOptions = {... |
Make it more easy to compare locale | <?php
namespace Common;
use InvalidArgumentException;
use Serializable;
abstract class Locale implements Serializable
{
/**
* @var string
*/
protected $locale;
/**
* @param string $locale
*/
protected function __construct($locale)
{
$this->setLocale($locale);
}
... | <?php
namespace Common;
use InvalidArgumentException;
use Serializable;
abstract class Locale implements Serializable
{
/**
* @var string
*/
protected $locale;
/**
* @param string $locale
*/
protected function __construct($locale)
{
$this->setLocale($locale);
}
... |
Drop unnecessary reference to popped elements to allow finalization through GC (XSTR-264).
git-svn-id: fe6d842192ccfb78748eb71580d1ce65f168b559@649 9830eeb5-ddf4-0310-9ef7-f4b9a3e3227e | package com.thoughtworks.xstream.core.util;
public final class FastStack {
private Object[] stack;
private int pointer;
public FastStack(int initialCapacity) {
stack = new Object[initialCapacity];
}
public Object push(Object value) {
if (pointer + 1 >= stack.length) {
... | package com.thoughtworks.xstream.core.util;
public final class FastStack {
private Object[] stack;
private int pointer;
public FastStack(int initialCapacity) {
stack = new Object[initialCapacity];
}
public Object push(Object value) {
if (pointer + 1 >= stack.length) {
... |
Add a missing newline character | <?php
namespace Kevinrob\GuzzleCache;
class KeyValueHttpHeader
{
const REGEX_SPLIT = '/^([^=]*)=(.*)$/';
/**
* @var string[]
*/
protected $values = [];
/**
* @param array $values
*/
public function __construct(array $values)
{
foreach ($values as $value) {
... | <?php
namespace Kevinrob\GuzzleCache;
class KeyValueHttpHeader
{
const REGEX_SPLIT = '/^([^=]*)=(.*)$/';
/**
* @var string[]
*/
protected $values = [];
/**
* @param array $values
*/
public function __construct(array $values)
{
foreach ($values as $value) {
... |
Remove defunct exchanges from example config | <?php
namespace CryptoMarketTest;
class ConfigDataExample
{
const MONGODB_URI = 'mongodb://localhost';
const MONGODB_DBNAME = 'coindata';
const ACCOUNTS_CONFIG = array(
// 'Btce' => array(
// 'key' => '',
// 'secret' => ''
// ),
'Bitfinex'=> array(
... | <?php
namespace CryptoMarketTest;
class ConfigDataExample
{
const MONGODB_URI = 'mongodb://localhost';
const MONGODB_DBNAME = 'coindata';
const ACCOUNTS_CONFIG = array(
'Btce' => array(
'key' => '',
'secret' => ''
),
'Bitfinex'=> array(
'key' =>... |
Fix typo resulting in NameError | from functools import wraps
import subprocess
_SELECTIONS = {
'+': 'clipboard',
'*': 'primary',
}
def _store_selection(data, selection):
with subprocess.Popen(['xclip',
'-selection', selection],
stdin=subprocess.PIPE) as xclip:
xclip.stdin.wri... | from functools import wraps
import subprocess
_SELECTIONS = {
'+': 'clipboard',
'*': 'primary',
}
def _store_selection(data, selection):
with subprocess.Popen(['xclip',
'-selection', selection],
stdin=subprocess.PIPE) as xclip:
xclip.stdin.wri... |
Update contact activity query to remove Incomplete registrations | const contactActivityQuery = (
from,
size,
email,
contactId,
objectTypes,
sortOrder
) => {
return {
from,
size,
query: {
bool: {
must: [
{
bool: {
should: [
{
bool: {
must: [
... | const contactActivityQuery = (
from,
size,
email,
contactId,
objectTypes,
sortOrder
) => {
return {
from,
size,
query: {
bool: {
must: [
{
bool: {
should: [
{
bool: {
must: [
... |
Fix the test 1 at case 5 | ;((rc) => {
'use strict';
var tagContent = 'router2-content';
var tagView = 'router2-view';
var div = document.createElement('div');
div.innerHTML = `
<${tagContent} id="case5-1" hash="case5-1">
Case 5-1
<div>
<div>
<div>
<${tagContent} id="case5-11" hash="case5-11">
... | ;((rc) => {
'use strict';
var tagContent = 'router2-content';
var tagView = 'router2-view';
var div = document.createElement('div');
div.innerHTML = `
<${tagContent} id="case5-1" hash="case5-1">
Case 5-1
<div>
<div>
<div>
<${tagContent} id="case5-11" hash="case5-11">
... |
Remove extra label for user | import logging, urllib2
from lighter.util import merge, build_request
class HipChat(object):
def __init__(self, url, token):
self._url = url or 'https://api.hipchat.com'
self._token = token
self_rooms = []
self._sender = 'Lighter'
self._message_attribs = {
'color... | import logging, urllib2
from lighter.util import merge, build_request
class HipChat(object):
def __init__(self, url, token):
self._url = url or 'https://api.hipchat.com'
self._token = token
self_rooms = []
self._sender = 'Lighter'
self._message_attribs = {
'from'... |
Use raw string for Windows paths
This avoids:
DeprecationWarning: invalid escape sequence \P
_search_path.append('C:\Program Files') | import os
import platform
from .generic import MeshScript
from ..constants import log
from distutils.spawn import find_executable
_search_path = os.environ['PATH']
if platform.system() == 'Windows':
# split existing path by delimiter
_search_path = [i for i in _search_path.split(';') if len(i) > 0]
_sear... | import os
import platform
from .generic import MeshScript
from ..constants import log
from distutils.spawn import find_executable
_search_path = os.environ['PATH']
if platform.system() == 'Windows':
# split existing path by delimiter
_search_path = [i for i in _search_path.split(';') if len(i) > 0]
_sear... |
BAP-10985: Update the rules displaying autocomplete result for business unit owner field | <?php
namespace Oro\Bundle\OrganizationBundle\Form\Transformer;
use Doctrine\Common\Collections\Collection;
use Oro\Bundle\OrganizationBundle\Entity\BusinessUnit;
use Oro\Bundle\OrganizationBundle\Entity\Manager\BusinessUnitManager;
use Symfony\Component\Form\DataTransformerInterface;
class BusinessUnitTreeTransform... | <?php
namespace Oro\Bundle\OrganizationBundle\Form\Transformer;
use Doctrine\Common\Collections\Collection;
use Oro\Bundle\OrganizationBundle\Entity\BusinessUnit;
use Oro\Bundle\OrganizationBundle\Entity\Manager\BusinessUnitManager;
use Symfony\Component\Form\DataTransformerInterface;
class BusinessUnitTreeTransform... |
Fix new NASM number regexp | Prism.languages.nasm = {
'comment': /;.*$/m,
'string': /("|'|`)(\\?.)*?\1/gm,
'label': {
pattern: /^\s*[A-Za-z\._\?\$][\w\.\?\$@~#]*:/m,
alias: 'function'
},
'keyword': [
/\[?BITS (16|32|64)\]?/m,
/^\s*section\s*[a-zA-Z\.]+:?/im,
/(?:extern|global)[^;]*/im,
... | Prism.languages.nasm = {
'comment': /;.*$/m,
'string': /("|'|`)(\\?.)*?\1/gm,
'label': {
pattern: /^\s*[A-Za-z\._\?\$][\w\.\?\$@~#]*:/m,
alias: 'function'
},
'keyword': [
/\[?BITS (16|32|64)\]?/m,
/^\s*section\s*[a-zA-Z\.]+:?/im,
/(?:extern|global)[^;]*/im,
... |
Fix title+artists check in event-add-form | <?php
class Denkmal_FormAction_EventAdd_Create extends CM_FormAction_Abstract {
protected function _getRequiredFields() {
return array('venue', 'date', 'fromTime');
}
protected function _checkData(CM_Params $params, CM_Response_View_Form $response, CM_Form_Abstract $form) {
$event = Denkm... | <?php
class Denkmal_FormAction_EventAdd_Create extends CM_FormAction_Abstract {
protected function _getRequiredFields() {
return array('venue', 'date', 'fromTime');
}
protected function _checkData(CM_Params $params, CM_Response_View_Form $response, CM_Form_Abstract $form) {
$event = Denkm... |
Use values_list instead of iterating over | from corehq.apps.products.models import SQLProduct
from custom.ewsghana.handlers import HELP_TEXT
from custom.ilsgateway.tanzania.handlers.keyword import KeywordHandler
class HelpHandler(KeywordHandler):
def help(self):
self.respond(HELP_TEXT)
def handle(self):
topic = self.args[0].lower()
... | from corehq.apps.products.models import SQLProduct
from custom.ewsghana.handlers import HELP_TEXT
from custom.ilsgateway.tanzania.handlers.keyword import KeywordHandler
class HelpHandler(KeywordHandler):
def help(self):
self.respond(HELP_TEXT)
def handle(self):
topic = self.args[0].lower()
... |
Return null instead of setting content to null | import React from 'react'
import { Box, Grid, Typography, Card, CardContent } from '@material-ui/core'
import { Edit, Delete } from '@material-ui/icons'
export default function TravelObject(props) {
let content = null;
switch (props.type) {
case 'event':
content = <Typography variant="h4" g... | import React from 'react'
import { Box, Grid, Typography, Card, CardContent } from '@material-ui/core'
import { Edit, Delete } from '@material-ui/icons'
export default function TravelObject(props) {
let content = null;
switch (props.type) {
case 'event':
content = <Typography variant="h4" g... |
Revert version update made for our mirror. | import os
from setuptools import setup, find_packages
version = '1.5.0'
def read(fname):
return open(os.path.join(os.path.dirname(__file__), fname)).read()
setup(name='django-cas-client',
version=version,
description="Django Cas Client",
long_description=read('README.md'),
classifiers=... | import os
from setuptools import setup, find_packages
version = '1.5.0_patch1'
def read(fname):
return open(os.path.join(os.path.dirname(__file__), fname)).read()
setup(name='django-cas-client',
version=version,
description="Django Cas Client",
long_description=read('README.md'),
class... |
Work around phpcs fail while unpacking $msg for debug purposes | <?php
/**
* Consumes RabbitMQ messages and dumps them.
*/
namespace Graviton\MessageBundle\Service;
use OldSound\RabbitMqBundle\RabbitMq\ConsumerInterface;
use PhpAmqpLib\Message\AMQPMessage;
/**
* Consumes RabbitMQ messages and dumps them.
*
* @author List of contributors <https://github.com/libgraviton/gra... | <?php
/**
* Consumes RabbitMQ messages and dumps them.
*/
namespace Graviton\MessageBundle\Service;
use OldSound\RabbitMqBundle\RabbitMq\ConsumerInterface;
use PhpAmqpLib\Message\AMQPMessage;
/**
* Consumes RabbitMQ messages and dumps them.
*
* @author List of contributors <https://github.com/libgraviton/gra... |
Add find by class name support for IE8
If you'd like to support IE8, with the class selector, this should do it. | (function (root, factory) {
if (typeof define === 'function' && define.amd) {
define([], factory);
} else {
root.ess = factory();
}
}(this, function () {
function s(selector, context) {
var elements = [];
if (selector.indexOf(' ') !== -1) {
var parts = selecto... | (function (root, factory) {
if (typeof define === 'function' && define.amd) {
define([], factory);
} else {
root.ess = factory();
}
}(this, function () {
function s(selector, context) {
var elements = [];
if (selector.indexOf(' ') !== -1) {
var parts = selecto... |
Test for sleep(dt) without extra arg. | """Tests for tasks.py."""
import time
import unittest
from . import events
from . import futures
from . import tasks
class TaskTests(unittest.TestCase):
def setUp(self):
self.event_loop = events.new_event_loop()
events.set_event_loop(self.event_loop)
def tearDown(self):
self.event_... | """Tests for tasks.py."""
import time
import unittest
from . import events
from . import futures
from . import tasks
class TaskTests(unittest.TestCase):
def setUp(self):
self.event_loop = events.new_event_loop()
events.set_event_loop(self.event_loop)
def tearDown(self):
self.event_... |
Set max condition depth to 3 due to limited width | module.exports = {
DEBUG: <%= DEBUG %>,
INPUT_DELAY_BEFORE_SAVE: 500, // in milliseconds
SITE_TITLE: 'Sana Protocol Builder',
APP_NAMESPACE: 'spb',
API_BASE: '<%= API_BASE %>',
LOCALES_SUPPORTED: [
{
code: 'en',
name: 'English',
}, {
code... | module.exports = {
DEBUG: <%= DEBUG %>,
INPUT_DELAY_BEFORE_SAVE: 500, // in milliseconds
SITE_TITLE: 'Sana Protocol Builder',
APP_NAMESPACE: 'spb',
API_BASE: '<%= API_BASE %>',
LOCALES_SUPPORTED: [
{
code: 'en',
name: 'English',
}, {
code... |
Rename returned interface to control and init to inView | import Registry from './registry';
const inView = () => {
const getElements = (selector) =>
[].slice.call(document.querySelectorAll(selector));
const inViewport = (element, offset = 0) => {
let bounds = element.getBoundingClientRect();
return bounds.bottom > offset
&& boun... | import Registry from './registry';
const initInView = () => {
const getElements = (selector) =>
[].slice.call(document.querySelectorAll(selector));
const inViewport = (element, offset = 0) => {
let bounds = element.getBoundingClientRect();
return bounds.bottom > offset
&& ... |
Refactor test case into two classes | import os
import unittest
import tempfile
# Local modules
import library.server as server
class ServerTestCase(unittest.TestCase):
@classmethod
def setUp(self):
self.db_fd, server.app.config['DATABASE'] = tempfile.mkstemp()
server.app.config['TESTING'] = True
self.app = server.app.te... | import os
import unittest
import tempfile
# Local modules
import library.server as server
class ServerTestCase(unittest.TestCase):
@classmethod
def setUp(self):
self.db_fd, server.app.config['DATABASE'] = tempfile.mkstemp()
server.app.config['TESTING'] = True
self.app = server.app.te... |
Update email address confirmation subject | <?php namespace Flarum\Core\Handlers\Events;
use Illuminate\Mail\Mailer;
use Flarum\Core\Events\UserWasRegistered;
use Flarum\Core\Events\EmailWasChanged;
use Config;
use Illuminate\Contracts\Events\Dispatcher;
class EmailConfirmationMailer
{
protected $mailer;
public function __construct(Mailer $mailer)
... | <?php namespace Flarum\Core\Handlers\Events;
use Illuminate\Mail\Mailer;
use Flarum\Core\Events\UserWasRegistered;
use Flarum\Core\Events\EmailWasChanged;
use Config;
use Illuminate\Contracts\Events\Dispatcher;
class EmailConfirmationMailer
{
protected $mailer;
public function __construct(Mailer $mailer)
... |
Disable notification in browser-sync as it caused issues with layout | var gulp = require('gulp');
var elm = require('gulp-elm');
var plumber = require('gulp-plumber');
var del = require('del');
var browserSync = require('browser-sync');
// builds elm files and static resources (i.e. html and css) from src to dist folder
var paths = {
dest: 'dist',
elm: 'src/*.elm',
staticAss... | var gulp = require('gulp');
var elm = require('gulp-elm');
var plumber = require('gulp-plumber');
var del = require('del');
var browserSync = require('browser-sync');
// builds elm files and static resources (i.e. html and css) from src to dist folder
var paths = {
dest: 'dist',
elm: 'src/*.elm',
staticAss... |
Bump version for stip_binary flag | """Setuptools configuration for rpmvenv."""
from setuptools import setup
from setuptools import find_packages
with open('README.rst', 'r') as readmefile:
README = readmefile.read()
setup(
name='rpmvenv',
version='0.16.0',
url='https://github.com/kevinconway/rpmvenv',
description='RPM packager f... | """Setuptools configuration for rpmvenv."""
from setuptools import setup
from setuptools import find_packages
with open('README.rst', 'r') as readmefile:
README = readmefile.read()
setup(
name='rpmvenv',
version='0.15.1',
url='https://github.com/kevinconway/rpmvenv',
description='RPM packager f... |
Add dicts and models to package | # coding: utf-8
from __future__ import unicode_literals
from setuptools import (
setup,
find_packages,
)
setup(
name='natasha',
version='0.8.1',
description='Named-entity recognition for russian language',
url='https://github.com/natasha/natasha',
author='Natasha contributors',
author_... | # coding: utf-8
from __future__ import unicode_literals
from setuptools import (
setup,
find_packages,
)
setup(
name='natasha',
version='0.8.1',
description='Named-entity recognition for russian language',
url='https://github.com/natasha/natasha',
author='Natasha contributors',
author_... |
Remove skippable key in local storage on reset | // @flow
import UserState from './UserState';
import Raven from 'raven-js';
import storageService from '../storageService';
class UserStateService {
userState: UserState;
constructor() {
const data = this.load();
const name = data && data.name;
const age = data && data.age;
th... | // @flow
import UserState from './UserState';
import Raven from 'raven-js';
import storageService from '../storageService';
class UserStateService {
userState: UserState;
constructor() {
const data = this.load();
const name = data && data.name;
const age = data && data.age;
th... |
Change to _.each that is awesome!!!. | define([
'underscore',
'views/proto/paged-collection',
'views/event/box',
'text!templates/event-collection.html'
], function (_, PagedCollection, EventBox, html) {
return PagedCollection.extend({
template: _.template(html),
tag: 'div',
listSelector: '.events-list',
... | define([
'underscore',
'views/proto/paged-collection',
'views/event/box',
'text!templates/event-collection.html'
], function (_, PagedCollection, EventBox, html) {
return PagedCollection.extend({
template: _.template(html),
tag: 'div',
listSelector: '.events-list',
... |
Fix issue where non localhost headless clouds werent calling finish
Signed-off-by: Adam Stokes <49c255c1d074742f60d19fdba5e2aa5a34add567@users.noreply.github.com> | from conjureup import controllers, events, juju, utils
from conjureup.app_config import app
from conjureup.consts import cloud_types
from .common import BaseCloudController
class CloudsController(BaseCloudController):
def __controller_exists(self, controller):
return juju.get_controller(controller) is no... | from conjureup import controllers, events, juju, utils
from conjureup.app_config import app
from conjureup.consts import cloud_types
from .common import BaseCloudController
class CloudsController(BaseCloudController):
def __controller_exists(self, controller):
return juju.get_controller(controller) is no... |
Update request status to 'accepted' | Projects = new Mongo.Collection('projects');
Meteor.methods({
insertProject: function(projectAttributes) {
check(Meteor.userId(), String);
check(projectAttributes, {
name: Match.Where(function(val) {
check(val, String);
return val.length > 0;
}),
description: String
});
... | Projects = new Mongo.Collection('projects');
Meteor.methods({
insertProject: function(projectAttributes) {
check(Meteor.userId(), String);
check(projectAttributes, {
name: Match.Where(function(val) {
check(val, String);
return val.length > 0;
}),
description: String
});
... |
Fix stray zmq import in egg_info | # -*- coding: utf-8 -*-
from __future__ import absolute_import
import glob
import os
import copy
from distutils.core import Extension
def get_extensions(**kwargs):
"""Get the Cython extensions"""
import zmq
this_directory = os.path.dirname(__file__)
this_name = __name__.split(".")[:-1]
... | # -*- coding: utf-8 -*-
from __future__ import absolute_import
import glob
import os
import copy
import zmq
from distutils.core import Extension
def get_extensions(**kwargs):
"""Get the Cython extensions"""
this_directory = os.path.dirname(__file__)
this_name = __name__.split(".")[:-1]
extension... |
Allow coverage version 6+ . | from setuptools import setup
long_description = "".join(open("README.rst").readlines())
setup(
name="pytest-testmon",
description="selects tests affected by changed files and methods",
long_description=long_description,
version="1.1.2",
license="AGPL",
platforms=["linux", "osx", "win32"],
... | from setuptools import setup
long_description = "".join(open("README.rst").readlines())
setup(
name="pytest-testmon",
description="selects tests affected by changed files and methods",
long_description=long_description,
version="1.1.2",
license="AGPL",
platforms=["linux", "osx", "win32"],
... |
Fix georgian locale syntax error | /**
* Select2 Georgian (Kartuli) translation.
*
* Author: Dimitri Kurashvili dimakura@gmail.com
*/
(function ($) {
"use strict";
$.extend($.fn.select2.defaults, {
formatNoMatches: function () { return "ვერ მოიძებნა"; },
formatInputTooShort: function (input, min) { var n = min - input.lengt... | /**
* Select2 Georgian (Kartuli) translation.
*
* Author: Dimitri Kurashvili dimakura@gmail.com
*/
(function ($) {
"use strict";
$.extend($.fn.select2.defaults, {
formatNoMatches: function () { return "ვერ მოიძებნა"; },
formatInputTooShort: function (input, min) { var n = min - input.lengt... |
Unify handling of arrival and departure prognosis
In response to #113 | <?php
namespace Transport\Entity\Schedule;
class Prognosis
{
public $platform;
public $arrival;
public $departure;
public $capacity1st;
public $capacity2nd;
static public function createFromXml(\SimpleXMLElement $xml, \DateTime $date, $isArrival, Prognosis $obj = null)
{
if (!$obj... | <?php
namespace Transport\Entity\Schedule;
class Prognosis
{
public $platform;
public $arrival;
public $departure;
public $capacity1st;
public $capacity2nd;
static public function createFromXml(\SimpleXMLElement $xml, \DateTime $date, $isArrival, Prognosis $obj = null)
{
if (!$obj... |
Remove console.log from GifMe module | // $ GifMe
// $ Authors: victorgama
// $ Created on: Mon Mar 14 15:29:14 BRT 2016
// - Gif( me) <categoria>: Pesquisa por gifs contendo a categoria especificada
// no giphy.com e retorna um resultado aleatório.
var Base = require('../src/base_module');
var GifMe = function(bot) {
Base.call(this, bot);
this.re... | // $ GifMe
// $ Authors: victorgama
// $ Created on: Mon Mar 14 15:29:14 BRT 2016
// - Gif( me) <categoria>: Pesquisa por gifs contendo a categoria especificada
// no giphy.com e retorna um resultado aleatório.
var Base = require('../src/base_module');
var GifMe = function(bot) {
Base.call(this, bot);
this.re... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.