text stringlengths 16 4.96k | positive stringlengths 321 2.24k | negative stringlengths 310 2.21k |
|---|---|---|
Remove props param to get current mobilization selector | import React, { PropTypes } from 'react'
import { connect } from 'react-redux'
// Global module dependencies
import { SettingsPageLayout } from '../../../components/Layout'
// Parent module dependencies
import * as MobilizationSelectors from '../../mobilizations/selectors'
// Current module dependencies
import * as ... | import React, { PropTypes } from 'react'
import { connect } from 'react-redux'
// Global module dependencies
import { SettingsPageLayout } from '../../../components/Layout'
// Parent module dependencies
import * as MobilizationSelectors from '../../mobilizations/selectors'
// Current module dependencies
import * as ... |
Use kadira:blaze-layout version for Meteor 1.2.
Use versin 2.1.0 of kadira:blaze-layout which adds missing jquery dependency that is required when using Meteor 1.2. | // Package metadata for Meteor.js web platform (https://www.meteor.com/)
// This file is defined within the Meteor documentation at
//
// http://docs.meteor.com/#/full/packagejs
//
// and it is needed to define a Meteor package
'use strict';
Package.describe({
name: 'useraccounts:flow-routing',
summary: 'UserAcc... | // Package metadata for Meteor.js web platform (https://www.meteor.com/)
// This file is defined within the Meteor documentation at
//
// http://docs.meteor.com/#/full/packagejs
//
// and it is needed to define a Meteor package
'use strict';
Package.describe({
name: 'useraccounts:flow-routing',
summary: 'UserAcc... |
Fix typo on line 15 | # Copyright (c) 2013 Tom McLoughlin
import socket
# Configuration
myNick = "Bot"
myIdent = "Bot"
myReal = "Bot"
myIRC = "irc.example.org"
myPort = "6667"
myChan = "#example" # only supports a single channel
# Do not edit below this line
socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
socket.connect(my... | # Copyright (c) 2013 Tom McLoughlin
import socket
# Configuration
myNick = "Bot"
myIdent = "Bot"
myReal = "Bot"
myIRC = "irc.example.org"
myPort = "6667"
myChan = "#example" # only supports a single channel
# Do not edit below this line
socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
socket.connect(my... |
Fix Facebook crawler crashing app when no cookies file provided | package crawlers.facebook;
import org.apache.commons.io.IOUtils;
import java.io.*;
import org.jsoup.Connection;
import org.jsoup.Jsoup;
import org.jsoup.nodes.Document;
import play.Logger;
class FacebookSession {
private static final String COOKIES_FILENAME = "/facebook_cookies";
private String cookies;
... | package crawlers.facebook;
import org.apache.commons.io.IOUtils;
import java.io.*;
import org.jsoup.Connection;
import org.jsoup.Jsoup;
import org.jsoup.nodes.Document;
import play.Logger;
class FacebookSession {
private static final String COOKIES_FILENAME = "/facebook_cookies";
private String cookies;
... |
Hide hint button on click | // View
BustinBash.Hints.View = function() {}
BustinBash.Hints.View.prototype = {
render: function(hint) {
var source = $("#hints-template").html();
var template = Handlebars.compile(source);
var context = {hint: hint}
var text = template(context);
$('.hints').html(text)
},
hideHint: fu... | // Model
BustinBash.Hints.Model = function() {}
// View
BustinBash.Hints.View = function() {}
BustinBash.Hints.View.prototype = {
render: function(hint) {
var source = $("#hints-template").html();
var template = Handlebars.compile(source);
var context = {hint: hint}
var text = template(context)... |
Add CopyToQuerySet to available imports | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from django.db import models
from django.db import connection
from .copy_from import CopyMapping
from .copy_to import SQLCopyToCompiler, CopyToQuery
__version__ = '2.0.0'
class CopyQuerySet(models.QuerySet):
"""
Subclass of QuerySet that adds from_csv and to_csv m... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from django.db import models
from django.db import connection
from .copy_from import CopyMapping
from .copy_to import SQLCopyToCompiler, CopyToQuery
__version__ = '2.0.0'
class CopyQuerySet(models.QuerySet):
"""
Subclass of QuerySet that adds from_csv and to_csv m... |
Fix test so that is uses regex to check the text returned. | /* jshint -W117, -W030 */
describe('dataservice', function() {
beforeEach(function() {
bard.appModule('app.core');
bard.inject('$http','$httpBackend','$q','dataservice','$rootScope');
});
it('exists' , function(){
expect(dataservice).to.exist;
});
it('getMessageCount returns a value' , function(... | /* jshint -W117, -W030 */
describe('dataservice', function() {
beforeEach(function() {
bard.appModule('app.core');
bard.inject('$http','$httpBackend','$q','dataservice','$rootScope');
});
it('exists' , function(){
expect(dataservice).to.exist;
});
it('getMessageCount returns a value' , function(... |
Fix signature of test case | from hypothesis_auto import auto_pytest_magic
from isort import parse
from isort.settings import Config
TEST_CONTENTS = """
import xyz
import abc
def function():
pass
"""
def test_file_contents():
(
in_lines,
out_lines,
import_index,
place_imports,
import_placements... | from hypothesis_auto import auto_pytest_magic
from isort import parse
from isort.settings import Config
TEST_CONTENTS = """
import xyz
import abc
def function():
pass
"""
def test_file_contents():
(
in_lines,
out_lines,
import_index,
place_imports,
import_placements... |
Add another example of a line that is thicker | package main
import (
"../../../drawer"
"fmt"
"image"
"image/color"
"image/png"
"os"
)
func main() {
src := image.NewRGBA(image.Rect(0, 0, 100, 100))
drawer.Fill(src, color.RGBA{0, 255, 255, 255})
ld := drawer.NewLineDrawer(src, image.Pt(100, 100), image.Pt(0, 0), color.RGBA{255, 0, 0, 255}).Draw()
draw(ld... | package main
import (
"../../../drawer"
"fmt"
"image"
"image/color"
"image/png"
"os"
)
func main() {
src := image.NewRGBA(image.Rect(0, 0, 100, 100))
drawer.Fill(src, color.RGBA{0, 255, 255, 255})
start := image.Pt(100, 100)
end := image.Pt(0, 0)
ld := drawer.NewLineDrawer(src, start, end, color.RGBA{255,... |
Fix merge conflict with origin branch | /**
* Has Vowels
*
* hasVowel tests if the String calling the function has a vowels
*
* @param {void}
* @return {Boolean} returns true or false indicating if the string
* has a vowel or not
*/
String.prototype.hasVowels = function() {
var inputString = this;
return /[aeiou]/gi.test(inputString);
};
/... | /**
* Has Vowels
*
* hasVowel tests if the String calling the function has a vowels
*
* @param {void}
* @return {Boolean} returns true or false indicating if the string
* has a vowel or not
*/
String.prototype.hasVowels = function() {
var inputString = this;
return /[aeiou]/gi.test(inputString);
};
/... |
Make the screen scroll less frequently
…it's a bit intense | (function(GOVUK, GDM) {
var $page = $("html, body"),
delayInSeconds = 16,
generateScrollTo = function($sections, index) {
return function() {
scrollPage($sections.eq(index).offset().top);
setTimeout(
generateScrollTo(
$sections, (index + 1 == $sect... | (function(GOVUK, GDM) {
var $page = $("html, body"),
delayInSeconds = 8,
generateScrollTo = function($sections, index) {
return function() {
scrollPage($sections.eq(index).offset().top);
setTimeout(
generateScrollTo(
$sections, (index + 1 == $secti... |
Reduce location cutoff and make it in seconds. Avoids issues with out of date locations. | <?php
use Carbon\Carbon;
class CharacterLocation
{
public $character_id;
public $system_id;
public $updated_at;
public function __construct($props)
{
foreach ($props as $key => $value)
{
$this->$key = $value;
}
}
public static function find(int $id)
{
$data = DB::query(Database::SELECT, 'SELECT... | <?php
use Carbon\Carbon;
class CharacterLocation
{
public $character_id;
public $system_id;
public $updated_at;
public function __construct($props)
{
foreach ($props as $key => $value)
{
$this->$key = $value;
}
}
public static function find(int $id)
{
$data = DB::query(Database::SELECT, 'SELECT... |
Add missing include, and switch to exclude projects with HIDDEN status from public display | # This file is part of the FragDev Website.
#
# the FragDev Website is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# the FragDev W... | # This file is part of the FragDev Website.
#
# the FragDev Website is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# the FragDev W... |
Make test method name understandable | <?php
namespace MS\PHPMD\Tests\Functional\CleanCode;
use MS\PHPMD\Tests\Functional\AbstractProcessTest;
/**
* Class SuperfluousCommentTest
*
* @package MS\PHPMD\Tests\Functional\CleanCode
*/
class SuperfluousCommentTest extends AbstractProcessTest
{
/**
* @covers MS\PHPMD\Rule\CleanCode\SuperfluousComme... | <?php
namespace MS\PHPMD\Tests\Functional\CleanCode;
use MS\PHPMD\Tests\Functional\AbstractProcessTest;
/**
* Class SuperfluousCommentTest
*
* @package MS\PHPMD\Tests\Functional\CleanCode
*/
class SuperfluousCommentTest extends AbstractProcessTest
{
/**
* @covers MS\PHPMD\Rule\CleanCode\SuperfluousComme... |
Make it possible to define other values for the headers X-Frame-Options, X-XSS-Protection, X-Content-Type-Options if you realy want to
The current implementation uses an iframe this change makes it possible to use that again | <?php
namespace Common\EventListener;
use Symfony\Component\HttpKernel\Event\FilterResponseEvent;
class ResponseSecurer
{
/**
* Add some headers to the response to make our application more secure
* see https://www.owasp.org/index.php/List_of_useful_HTTP_headers
*
* @param FilterResponseEvent... | <?php
namespace Common\EventListener;
use Symfony\Component\HttpKernel\Event\FilterResponseEvent;
class ResponseSecurer
{
/**
* Add some headers to the response to make our application more secure
* see https://www.owasp.org/index.php/List_of_useful_HTTP_headers
*
* @param FilterResponseEvent... |
Rename the test on watcher API to have something more specific | describe('using the watcher API to dispose and watch again', function() {
require('./fixtures/bootstrap.js');
beforeEach(h.clean);
afterEach(h.clean);
var visible = false;
var element;
var watcher;
beforeEach(function(done) {
element = h.createTest({
style: {
top: '10000px'
}
... | describe('asking if a visible div scrolled', function() {
require('./fixtures/bootstrap.js');
beforeEach(h.clean);
afterEach(h.clean);
var visible = false;
var element;
var watcher;
beforeEach(function(done) {
element = h.createTest({
style: {
top: '10000px'
}
});
h.inser... |
Change parameter names in acquire.
Add some doc. | # -*- encoding: utf-8 -*-
import os
import fcntl
class FileLock(object):
def __init__(self, fd):
# the fd is borrowed, so do not close it
self.fd = fd
def acquire(self, ex=False, nb=True):
"""
Acquire a lock on the fd.
:param ex (optional): default False, acquire a... | # -*- encoding: utf-8 -*-
import os
import fcntl
class FileLock(object):
def __init__(self, fd):
# the fd is borrowed, so do not close it
self.fd = fd
def acquire(self, write=False, block=False):
try:
lock_flags = fcntl.LOCK_EX if write else fcntl.LOCK_SH
... |
Make sure the tumblr url fixer is location implementation agnostic | App.RawTransform = DS.Transform.extend({
deserialize: function(serialized) {
return serialized;
},
serialize: function(deserialized) {
return deserialized;
}
});
App.ArrayTransform = App.RawTransform.extend({});
App.TimestampTransform = DS.NumberTransform.extend({});
App.ChoiceTransform = DS.StringTran... | App.RawTransform = DS.Transform.extend({
deserialize: function(serialized) {
return serialized;
},
serialize: function(deserialized) {
return deserialized;
}
});
App.ArrayTransform = App.RawTransform.extend({});
App.TimestampTransform = DS.NumberTransform.extend({});
App.ChoiceTransform = DS.StringTran... |
Add new line in the end of the file | import networkx as nx
class ConnectedComponents:
"""This is a class for connected component detection method to cluster event logs [1]_.
.. [1] H. Studiawan, B. A. Pratomo, and R. Anggoro, Connected component detection for authentication log
clustering, in Proceedings of the International Seminar on S... | import networkx as nx
class ConnectedComponents:
"""This is a class for connected component detection method to cluster event logs [1]_.
.. [1] H. Studiawan, B. A. Pratomo, and R. Anggoro, Connected component detection for authentication log
clustering, in Proceedings of the International Seminar on S... |
Update check to look for presence, not equality (order unnecessary) | import chai from 'chai';
import irc from 'irc';
import discord from 'discord.js';
import Bot from '../lib/bot';
import config from './fixtures/single-test-config.json';
import caseConfig from './fixtures/case-sensitivity-config.json';
import DiscordStub from './stubs/discord-stub';
import ClientStub from './stubs/irc-c... | import chai from 'chai';
import irc from 'irc';
import discord from 'discord.js';
import Bot from '../lib/bot';
import config from './fixtures/single-test-config.json';
import caseConfig from './fixtures/case-sensitivity-config.json';
import DiscordStub from './stubs/discord-stub';
import ClientStub from './stubs/irc-c... |
Add a couple more items to the default whitelist. | const DEFAULT_WHITELISTED_URL_REGEXPS = [
'abcnews.go.com\/.+',
'arstechnica.com\/.+',
'bbc.co.uk\/.+',
'bbc.com\/.+',
'business-standard.com\/.+',
'cnn.com\/.+',
'economist.com\/.+',
'forbes.com\/.+',
'guardian.co.uk\/.+',
'hollywoodreporter.com\/.+',
'huffingtonpost.com\/.+',
'independent.co.u... | const DEFAULT_WHITELISTED_URL_REGEXPS = [
'abcnews.go.com\/.+',
'arstechnica.com\/.+',
'bbc.co.uk\/.+',
'bbc.com\/.+',
'business-standard.com\/.+',
'cnn.com\/.+',
'economist.com\/.+',
'guardian.co.uk\/.+',
'theguardian.com\/.+',
'hollywoodreporter.com\/.+',
'huffingtonpost.com\/.+',
'irishtimes.... |
Test console method and revert to log if method not present. Handles node environment | /**
* Project: LekkerApps - Logging
* Copyright 2016 Ashley G Ramdass <agramdass@gmail.com>
*
* 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/LICE... | /**
* Project: LekkerApps - Logging
* Copyright 2016 Ashley G Ramdass <agramdass@gmail.com>
*
* 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/LICE... |
Put example code in comment block. | // Made by Tim Caswell, https://gist.github.com/creationix/bb1474fd018076862c6b
module.exports = asyncMap;
// This will loop through an array calling fn(item, callback) for each item.
// It assumes that the callback will always be called eventually with (err) or (null, value)
// Once all the callbacks have been called... | // Made by Tim Caswell, https://gist.github.com/creationix/bb1474fd018076862c6b
module.exports = asyncMap;
// This will loop through an array calling fn(item, callback) for each item.
// It assumes that the callback will always be called eventually with (err) or (null, value)
// Once all the callbacks have been called... |
Change 'goodbye' handler to use proper exit methodology.
System.exit() works but is less graceful than asking the server
to stop. | package com.deweysasser.example.webserver;
import java.io.IOException;
import java.io.OutputStream;
import java.io.OutputStreamWriter;
import java.io.PrintWriter;
import com.sun.net.httpserver.HttpExchange;
import com.sun.net.httpserver.HttpHandler;
/** Serve up a basic Hello World page
*
* @author De... | package com.deweysasser.example.webserver;
import java.io.IOException;
import java.io.OutputStream;
import java.io.OutputStreamWriter;
import java.io.PrintWriter;
import com.sun.net.httpserver.HttpExchange;
import com.sun.net.httpserver.HttpHandler;
/** Serve up a basic Hello World page
*
* @author De... |
chore: Add attrs as project requirement | from setuptools import setup
setup(
name='xwing',
version='0.0.1.dev0',
url='https://github.com/victorpoluceno/xwing',
license='ISC',
description='Xwing is a Python library writen using that help '
'to distribute connect to a single port to other process',
author='Victor Poluceno',
... | from setuptools import setup
setup(
name='xwing',
version='0.0.1.dev0',
url='https://github.com/victorpoluceno/xwing',
license='ISC',
description='Xwing is a Python library writen using that help '
'to distribute connect to a single port to other process',
author='Victor Poluceno',
... |
Fix build with newer dependencies. | from distutils.core import setup
ext_files = ["pyreBloom/bloom.c"]
kwargs = {}
try:
from Cython.Distutils import build_ext
from Cython.Distutils import Extension
print "Building from Cython"
ext_files.append("pyreBloom/pyreBloom.pyx")
kwargs['cmdclass'] = {'build_ext': build_ext}
except ImportErr... | from distutils.core import setup
ext_files = ["pyreBloom/bloom.c"]
kwargs = {}
try:
from Cython.Distutils import build_ext
from Cython.Distutils import Extension
print "Building from Cython"
ext_files.append("pyreBloom/pyreBloom.pyx")
kwargs['cmdclass'] = {'build_ext': build_ext}
except ImportErr... |
Add conditional to avoid duplicate messages, fix EachIf block. | var l10n_file = __dirname + '/../l10n/commands/say.yml';
var l10n = require('../src/l10n')(l10n_file);
var CommandUtil = require('../src/command_util').CommandUtil;
exports.command = function(rooms, items, players, npcs, Commands) {
return function(args, player) {
if (args) {
player.sayL10n(l10n, 'YOU_SAY',... | var l10n_file = __dirname + '/../l10n/commands/say.yml';
var l10n = require('../src/l10n')(l10n_file);
var CommandUtil = require('../src/command_util').CommandUtil;
exports.command = function(rooms, items, players, npcs, Commands) {
return function(args, player) {
if (args) {
player.sayL10n(l10n, 'YOU_SAY',... |
Add note that Struct's field collection is an OrderedDict | """
All the different types that the compiler handles.
"""
from collections import namedtuple
IntegerType = namedtuple('IntegerType', [])
Integer = IntegerType()
ByteType = namedtuple('ByteType', [])
Byte = ByteType()
PointerTo = namedtuple('PointerTo', ['type'])
ArrayOf = namedtuple('ArrayOf', ['type', 'count'])
Fu... | """
All the different types that the compiler handles.
"""
from collections import namedtuple
IntegerType = namedtuple('IntegerType', [])
Integer = IntegerType()
ByteType = namedtuple('ByteType', [])
Byte = ByteType()
PointerTo = namedtuple('PointerTo', ['type'])
ArrayOf = namedtuple('ArrayOf', ['type', 'count'])
Fu... |
Test Emotes: Equals assert for search by id. | <?php
class ApiFastTest extends TestCase
{
protected $baseUrl = '';
/**
* ApiFastTest constructor.
*/
public function __construct()
{
parent::__construct();
}
/**
* A basic functional test example.
*
* @return void
*/
public function testEmotes()
{
// WoTlk
$this->json('GET', '/api/v1/dbc/e... | <?php
class ApiFastTest extends TestCase
{
protected $baseUrl = '';
/**
* ApiFastTest constructor.
*/
public function __construct()
{
parent::__construct();
}
/**
* A basic functional test example.
*
* @return void
*/
public function testEmotes()
{
// WoTlk
$this->json('GET', '/api/v1/dbc/e... |
Allow API access from anywhere | <?php
require_once("../../lib/dao/DrugDAO.class.php");
header("Content-Type: application/json; charset=UTF-8");
header("Access-Control-Allow-Origin: *");
if (isset($_REQUEST['n'])) {
$num = max($_REQUEST['n'], 1);
} else {
$num = 1;
}
if (isset($_REQUEST['form'])) {
$form = $_REQUEST['form'];
}
$dao = n... | <?php
require_once("../../lib/dao/DrugDAO.class.php");
header("Content-Type: application/json; charset=UTF-8");
if (isset($_REQUEST['n'])) {
$num = max($_REQUEST['n'], 1);
} else {
$num = 1;
}
if (isset($_REQUEST['form'])) {
$form = $_REQUEST['form'];
}
$dao = new DrugDAO();
if (isset($form)) {
$dru... |
Remove git status! when check semver.valid result | (function () {
const semver = require('semver')
/**
* Install plugin
* @param app
* @param axios
*/
function plugin(app, axios) {
if (plugin.installed) {
return
}
if (!axios) {
console.error('You have to install axios')
return
}
if (semver.valid(app.version) == null) {
console.error('Un... | (function () {
const semver = require('semver')
/**
* Install plugin
* @param app
* @param axios
*/
function plugin(app, axios) {
if (plugin.installed) {
return
}
if (!axios) {
console.error('You have to install axios')
return
}
if (!!!semver.valid(app.version)) {
console.error('Unkown ... |
Regex: Remove leading and trailing .*
With no pinning of the pattern to the start or end of a string, the leading and trailing `.*` are redundant. | <?php
namespace WP_CLI;
/**
* Class AutoloadSplitter.
*
* This class is used to provide the splitting logic to the
* `wp-cli/autoload-splitter` Composer plugin.
*
* @package WP_CLI
*/
class AutoloadSplitter {
/**
* Check whether the current class should be split out into a separate
* autoloader.
*
* ... | <?php
namespace WP_CLI;
/**
* Class AutoloadSplitter.
*
* This class is used to provide the splitting logic to the
* `wp-cli/autoload-splitter` Composer plugin.
*
* @package WP_CLI
*/
class AutoloadSplitter {
/**
* Check whether the current class should be split out into a separate
* autoloader.
*
* ... |
Add Check for numba in base anaconda distribution. If not found issue meaningful warning message | """
Import the main names to top level.
"""
try:
import numba
except:
raise ImportError("Cannot import numba from current anaconda distribution. Please run `conda install numba` to install the latest version.")
from .compute_fp import compute_fixed_point
from .discrete_rv import DiscreteRV
from .ecdf import ECDF
fr... | """
Import the main names to top level.
"""
from .compute_fp import compute_fixed_point
from .discrete_rv import DiscreteRV
from .ecdf import ECDF
from .estspec import smooth, periodogram, ar_periodogram
from .graph_tools import DiGraph
from .gridtools import cartesian, mlinspace
from .kalman import Kalman
from .lae i... |
Set ignoreHidden to false to allow TinyMCE editor validation to function properly. | /*
---
description: Monkey patching the Form.Validator to alter its behavior and extend it into doing more
requires:
- MooTools More
license: @TODO
...
*/
if(!Koowa) var Koowa = {};
(function($){
Koowa.Validator = new Class({
Extends: Form.Validator.Inline,
options: {
... | /*
---
description: Monkey patching the Form.Validator to alter its behavior and extend it into doing more
requires:
- MooTools More
license: @TODO
...
*/
if(!Koowa) var Koowa = {};
(function($){
Koowa.Validator = new Class({
Extends: Form.Validator.Inline,
options: {
... |
Add constructor and implement MyViewHolder constructor | package pl.komunikator.komunikator;
import android.support.v7.widget.RecyclerView;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.TextView;
import java.util.List;
import pl.komunikator.komunikator.entity.User;
/**
* Created by adrian on 19.04.2017.
... | package pl.komunikator.komunikator;
import android.support.v7.widget.RecyclerView;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.TextView;
import java.util.List;
import pl.komunikator.komunikator.entity.User;
/**
* Created by adrian on 19.04.2017.
... |
Apply style changes to maintenance emails | @extends('layout.emails')
@section('preheader')
{!! trans('cachet.subscriber.email.maintenance.html-preheader', ['app_name' => Setting::get('app_name')]) !!}
@stop
@section('content')
<div style="text-align: center; border-bottom: 1px solid black; height: 100%;">
<h2>
<a href="http://status.cl... | @extends('layout.emails')
@section('preheader')
{!! trans('cachet.subscriber.email.maintenance.html-preheader', ['app_name' => Setting::get('app_name')]) !!}
@stop
@section('content')
{!! trans('cachet.subscriber.email.maintenance.html', ['app_name' => Setting::get('app_name')]) !!}
<p>
{!! $status !... |
Fix logout logger no username | <?php
/**
* Created by PhpStorm.
* User: rahman
* Date: 11/5/14
* Time: 8:47 AM
*/
Event::listen('auth.login', function($user)
{
Event::fire('logger', array(array('login',array('username'=>$user->username),3)));
});
Event::listen('auth.logout', function($user)
{
$username = $user ? $user->username : '-';... | <?php
/**
* Created by PhpStorm.
* User: rahman
* Date: 11/5/14
* Time: 8:47 AM
*/
Event::listen('auth.login', function($user)
{
Event::fire('logger', array(array('login',array('username'=>$user->username),3)));
});
Event::listen('auth.logout', function($user)
{
$username = $user ? $user->username : '-';... |
Configure eslint - make 4 space indent mandatory. | // https://eslint.org/docs/user-guide/configuring
module.exports = {
root: true,
parser: 'babel-eslint',
parserOptions: {
sourceType: 'module'
},
env: {
browser: true,
},
// https://github.com/standard/standard/blob/master/docs/RULES-en.md
extends: 'standard',
// required to lint *.vue files
... | // https://eslint.org/docs/user-guide/configuring
module.exports = {
root: true,
parser: 'babel-eslint',
parserOptions: {
sourceType: 'module'
},
env: {
browser: true,
},
// https://github.com/standard/standard/blob/master/docs/RULES-en.md
extends: 'standard',
// required to lint *.vue files
... |
Remove unnecessary and incorrect import | package org.amc.servlet.listener;
/**
*
* @author Adrian Mclaughlin
* @version 1
*/
import org.apache.log4j.Logger;
import javax.servlet.ServletContext;
import javax.servlet.annotation.WebListener;
import javax.servlet.http.HttpSessionEvent;
import javax.servlet.http.HttpSessionListener;
@WebListener
public cl... | package org.amc.servlet.listener;
/**
*
* @author Adrian Mclaughlin
* @version 1
*/
import org.apache.log4j.Logger;
import javax.servlet.ServletContext;
import javax.servlet.annotation.WebListener;
import javax.servlet.http.HttpSession;
import javax.servlet.http.HttpSessionEvent;
import javax.servlet.http.HttpS... |
Restructure the creation of the AST | 'use strict';
const fs = require('fs');
const util = require('util');
const _ = require('lodash');
const LineTokens = require('./LineTokens');
const AbstractSyntaxTree = require('./AbstractSyntaxTree');
class MUMPSCompiler {
readFile(fileName) {
return fs.readFileSync(fileName, 'utf8').split('\n');
}
... | 'use strict';
const fs = require('fs');
const util = require('util');
const _ = require('lodash');
const LineTokens = require('./LineTokens');
const AbstractSyntaxTree = require('./AbstractSyntaxTree');
class MUMPSCompiler {
readFile(fileName) {
return fs.readFileSync(fileName, 'utf8').split('\n');
}
... |
Add category id filtering to subcategories | from django.shortcuts import render
from django.views.generic import TemplateView
from rest_framework import viewsets, filters
from books.models import Book, Category, SubCategory
from books.serializers import BookSerializer, CategorySerializer, SubCategorySerializer
class HomeTemplateView(TemplateView, ):
templat... | from django.shortcuts import render
from django.views.generic import TemplateView
from rest_framework import viewsets, filters
from books.models import Book, Category, SubCategory
from books.serializers import BookSerializer, CategorySerializer, SubCategorySerializer
class HomeTemplateView(TemplateView, ):
templat... |
Use process.cwd() to serve static files | var express = require('express'),
bodyParser = require('body-parser'),
session = require('express-session'),
passport = require('passport'),
jwt = require('jwt-simple');
var User = require('../app/models/user.server.model');
module.exports = function() {
var app = express();
// Use middleware
a... | var express = require('express'),
bodyParser = require('body-parser'),
session = require('express-session'),
passport = require('passport'),
jwt = require('jwt-simple');
var User = require('../app/models/user.server.model');
module.exports = function() {
var app = express();
// Use middleware
a... |
[FIX] Send logging output to stdout
Fixes #557 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*-
# vi: set ft=python sts=4 ts=4 sw=4 et:
"""
The mriqc package provides a series of :abbr:`NR (no-reference)`,
:abbr:`IQMs (image quality metrics)` to used in :abbr:`QAPs (quality
assessment protocols)... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*-
# vi: set ft=python sts=4 ts=4 sw=4 et:
"""
The mriqc package provides a series of :abbr:`NR (no-reference)`,
:abbr:`IQMs (image quality metrics)` to used in :abbr:`QAPs (quality
assessment protocols)... |
Change URL from ScraperWiki > source | from distutils.core import setup
setup(name='dshelpers',
version='1.1.0',
description="Provides some helpers functions used by the ScraperWiki Data Services team.",
long_description="Provides some helpers functions used by the ScraperWiki Data Services team.",
classifiers=["Development Status ::... | from distutils.core import setup
setup(name='dshelpers',
version='1.1.0',
description="Provides some helpers functions used by the ScraperWiki Data Services team.",
long_description="Provides some helpers functions used by the ScraperWiki Data Services team.",
classifiers=["Development Status ::... |
Set the default prefix for ProjectSurveys to gsoc_program. | #!/usr/bin/python2.5
#
# Copyright 2009 the Melange authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable... | #!/usr/bin/python2.5
#
# Copyright 2009 the Melange authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable... |
Fix Strict error again :) | <?php
/*
* This file is part of PsySH
*
* (c) 2012 Justin Hileman
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Psy\Formatter;
use Psy\Formatter\RecursiveFormatter;
/**
* A pretty-printer for arrays..
*/
class Arr... | <?php
/*
* This file is part of PsySH
*
* (c) 2012 Justin Hileman
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Psy\Formatter;
use Psy\Formatter\RecursiveFormatter;
/**
* A pretty-printer for arrays..
*/
class Arr... |
Disable drag and drop event for document | 'use strict';
function init() {
// Disable drag + drop event for document.
document.addEventListener('dragover', function(event) {
event.preventDefault();
return false;
}, false);
document.addEventListener('drop', function(event) {
event.preventDefault();
return false;
}, false);... | 'use strict';
function init() {
// Drag and Drop holder.
const holder = document.getElementById('holder');
// Placehold text in holder.
const dragText = document.getElementById('drag-text');
holder.ondragover = function() {
return false;
};
holder.ondragleave = holder.... |
Add test to ensure only one conn object is created | # coding: utf-8
from pysuru.base import BaseAPI, ObjectMixin
def test_baseapi_headers_should_return_authorization_header():
api = BaseAPI(None, 'TOKEN')
assert {'Authorization': 'bearer TOKEN'} == api.headers
def test_baseapi_conn_should_return_same_object():
api = BaseAPI(None, None)
obj1 = api.con... | # coding: utf-8
from pysuru.base import BaseAPI, ObjectMixin
def test_baseapi_headers_should_return_authorization_header():
api = BaseAPI(None, 'TOKEN')
assert {'Authorization': 'bearer TOKEN'} == api.headers
def test_build_url_should_return_full_api_endpoint():
api = BaseAPI('http://example.com/', None... |
Add docblock for fromIncomingIrcMessage function
Signed-off-by: Yoshi2889 <77953cd64cc4736aae27fa116356e02d2d97f7ce@gmail.com> | <?php
/*
WildPHP - a modular and easily extendable IRC bot written in PHP
Copyright (C) 2016 WildPHP
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at you... | <?php
/*
WildPHP - a modular and easily extendable IRC bot written in PHP
Copyright (C) 2016 WildPHP
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at you... |
Rearrange express config according to docs | var express = require('express'),
path = require('path'),
config = require('config'),
setupPassport = require('./setupPassport'),
flash = require('connect-flash'),
appRouter = require('./routers/appRouter.js')(express),
session = require('express-session'),
bodyParser = require('body-parser'... | var express = require('express'),
path = require('path'),
config = require('config'),
setupPassport = require('./setupPassport'),
flash = require('connect-flash'),
appRouter = require('./routers/appRouter.js')(express),
session = require('express-session'),
bodyParser = require('body-parser'... |
Update display of font size and line height | function RGBToHex(RGB) {
const RGBParts = RGB.match(/^rgb\((\d+),\s*(\d+),\s*(\d+)\)$/);
const HexArr = [];
delete RGBParts[0];
RGBParts.forEach((value) => {
let hex = parseInt(value, 10).toString(16);
if (hex.length === 1) {
hex = `0${hex}`;
}
HexArr.push(hex);
});
return `#${Hex... | function RGBToHex(RGB) {
const RGBParts = RGB.match(/^rgb\((\d+),\s*(\d+),\s*(\d+)\)$/);
const HexArr = [];
delete RGBParts[0];
RGBParts.forEach((value) => {
let hex = parseInt(value, 10).toString(16);
if (hex.length === 1) {
hex = `0${hex}`;
}
HexArr.push(hex);
});
return `#${Hex... |
Add docs-live to perform demo-runs | """Development automation."""
import nox
def _install_this_editable(session, *, extras=None):
if extras is None:
extras = []
session.install("flit")
session.run(
"flit",
"install",
"-s",
"--deps=production",
"--extras",
",".join(extras),
si... | """Development automation."""
import nox
def _install_this_editable(session, *, extras=None):
if extras is None:
extras = []
session.install("flit")
session.run(
"flit",
"install",
"-s",
"--deps=production",
"--extras",
",".join(extras),
si... |
Add missing injection for minified MainCtrl | function MainCtrl($scope, $routeParams, $route, $location) {
$scope.checkLocation = function() {
if (!$location.path().startsWith('/login')) {
$scope.hideAdminNav = false;
$scope.dontAskForPassword = false;
} else {
$scope.hideAdminNav = true;
$scope.... | function MainCtrl($scope, $routeParams, $route, $location) {
$scope.checkLocation = function() {
if (!$location.path().startsWith('/login')) {
$scope.hideAdminNav = false;
$scope.dontAskForPassword = false;
} else {
$scope.hideAdminNav = true;
$scope.... |
Test everything with stress test. | #!/usr/bin/env python
# Copyright 2007 Albert Strasheim <fullung@gmail.com>
#
# 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 requ... | #!/usr/bin/env python
# Copyright 2007 Albert Strasheim <fullung@gmail.com>
#
# 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 requ... |
Fix wrong mail server in settings | # -*- coding: utf-8 -*-
"""
talkoohakemisto.settings.production
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
This module contains application settings specific to a production
environment running on Heroku.
"""
import os
from .base import * # flake8: noqa
#
# Generic
# -------
# If a secret key is set, cry... | # -*- coding: utf-8 -*-
"""
talkoohakemisto.settings.production
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
This module contains application settings specific to a production
environment running on Heroku.
"""
import os
from .base import * # flake8: noqa
#
# Generic
# -------
# If a secret key is set, cry... |
[codestyle] Fix bad indentation in the JSONH parser | 'use strict';
var JSONH = require('jsonh');
/**
* Message encoder.
*
* @param {Mixed} data The data that needs to be transformed in to a string.
* @param {Function} fn Completion callback.
* @api public
*/
exports.encoder = function encoder(data, fn) {
var err;
try { data = JSONH.stringify(data); }
catch... | 'use strict';
var JSONH = require('jsonh');
/**
* Message encoder.
*
* @param {Mixed} data The data that needs to be transformed in to a string.
* @param {Function} fn Completion callback.
* @api public
*/
exports.encoder = function encoder(data, fn) {
var err;
try { data = JSONH.stringify(data); }
catch (... |
Add false positive login test | <?php
require_once('Autoload.php');
class SQLAuthTest extends PHPUnit_Framework_TestCase
{
public function testSQLAuthenticator()
{
$GLOBALS['FLIPSIDE_SETTINGS_LOC'] = './tests/travis/helpers';
if(!isset(FlipsideSettings::$dataset['auth']))
{
$params = array('dsn'=>'mysql:hos... | <?php
require_once('Autoload.php');
class SQLAuthTest extends PHPUnit_Framework_TestCase
{
public function testSQLAuthenticator()
{
$GLOBALS['FLIPSIDE_SETTINGS_LOC'] = './tests/travis/helpers';
if(!isset(FlipsideSettings::$dataset['auth']))
{
$params = array('dsn'=>'mysql:hos... |
Fix URL/player.ui.mode sync issues on page load. | angular.module("sim/Simulation.js", [
"sim/model/Player.js",
"sim/ui/ActionBar.js",
"sim/ui/Explore.js",
"sim/ui/Rest.js",
"sim/ui/Status.js"
]).
controller("Simulation", Simulation);
function Simulation($scope, $location, Player) {
// TODO(philharnish): See ngViewDirective for ... | angular.module("sim/Simulation.js", [
"sim/model/Player.js",
"sim/ui/ActionBar.js",
"sim/ui/Explore.js",
"sim/ui/Rest.js",
"sim/ui/Status.js"
]).
controller("Simulation", Simulation);
function Simulation($scope, $location, Player) {
// TODO(philharnish): See ngViewDirective for ... |
Add some fallback code when
looking for our prefs object. | from ..rman_constants import RFB_PREFS_NAME
import bpy
def get_addon_prefs():
try:
addon = bpy.context.preferences.addons[RFB_PREFS_NAME]
return addon.preferences
except:
# try looking for all variants of RFB_PREFS_NAME
for k, v in bpy.context.preferences.addons.items():
... | from ..rman_constants import RFB_PREFS_NAME
import bpy
def get_addon_prefs():
try:
addon = bpy.context.preferences.addons[RFB_PREFS_NAME]
return addon.preferences
except:
return None
def get_pref(pref_name='', default=None):
""" Return the value of a preference
Args:
p... |
:wrench: Add post fixture on reference | <?php
namespace OAuthBundle\DataFixtures\ORM;
use Doctrine\Common\DataFixtures\AbstractFixture;
use Doctrine\Common\DataFixtures\FixtureInterface;
use Doctrine\Common\Persistence\ObjectManager;
use Doctrine\Common\DataFixtures\OrderedFixtureInterface;
use WordPressBundle\Entity\Post;
class LoadPostData extends Abst... | <?php
namespace OAuthBundle\DataFixtures\ORM;
use Doctrine\Common\DataFixtures\AbstractFixture;
use Doctrine\Common\DataFixtures\FixtureInterface;
use Doctrine\Common\Persistence\ObjectManager;
use Doctrine\Common\DataFixtures\OrderedFixtureInterface;
use WordPressBundle\Entity\Post;
class LoadPostData extends Abst... |
Improve deprecation notices for new template events system | <?php
/*
* This file is part of the Sylius package.
*
* (c) Paweł Jędrzejewski
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
declare(strict_types=1);
namespace Sylius\Bundle\UiBundle\Block;
use Sonata\BlockBundle\Event\BlockE... | <?php
/*
* This file is part of the Sylius package.
*
* (c) Paweł Jędrzejewski
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
declare(strict_types=1);
namespace Sylius\Bundle\UiBundle\Block;
use Sonata\BlockBundle\Event\BlockE... |
Remove email from User API Test | import pytest
from django.test import RequestFactory
from {{ cookiecutter.project_slug }}.users.api.views import UserViewSet
from {{ cookiecutter.project_slug }}.users.models import User
pytestmark = pytest.mark.django_db
class TestUserViewSet:
def test_get_queryset(self, user: User, rf: RequestFactory):
... | import pytest
from django.test import RequestFactory
from {{ cookiecutter.project_slug }}.users.api.views import UserViewSet
from {{ cookiecutter.project_slug }}.users.models import User
pytestmark = pytest.mark.django_db
class TestUserViewSet:
def test_get_queryset(self, user: User, rf: RequestFactory):
... |
Add a way to inflect by count | <?php
namespace PragmaRX\Support\Inflectors;
class Inflector {
protected static $localizedInflectors = [
'en' => 'PragmaRX\Support\Inflectors\En',
'pt' => 'PragmaRX\Support\Inflectors\PtBr',
];
public function inflect($word, $count)
{
if ($count > 1)
{
return $this->plural($word);
}... | <?php
namespace PragmaRX\Support\Inflectors;
class Inflector {
protected static $localizedInflectors = [
'en' => 'PragmaRX\Support\Inflectors\En',
'pt' => 'PragmaRX\Support\Inflectors\PtBr',
];
public static function plural($word)
{
$inflector = static::getInflector();
return $inflector-... |
Remove mfr parameter from init_app | """
Update User.comments_viewed_timestamp field & comments model.
Accompanies https://github.com/CenterForOpenScience/osf.io/pull/1762
"""
from modularodm import Q
from framework.auth.core import User
from website.models import Comment
from website.app import init_app
import logging
from scripts import utils as script_... | """
Update User.comments_viewed_timestamp field & comments model.
Accompanies https://github.com/CenterForOpenScience/osf.io/pull/1762
"""
from modularodm import Q
from framework.auth.core import User
from website.models import Comment
from website.app import init_app
import logging
from scripts import utils as script_... |
Revert "Updated semantic ui dependency."
This reverts commit 32d815b9e0415822d4721eb86cf94d2ff46be786. | // Meteor package definition.
Package.describe({
name: 'aramk:notifications',
version: '0.2.0',
summary: 'A notification widget.',
git: 'https://github.com/aramk/meteor-notifications.git'
});
Package.onUse(function (api) {
api.versionsFrom('METEOR@0.9.0');
api.use([
'coffeescript',
'underscore',
... | // Meteor package definition.
Package.describe({
name: 'aramk:notifications',
version: '0.2.0',
summary: 'A notification widget.',
git: 'https://github.com/aramk/meteor-notifications.git'
});
Package.onUse(function (api) {
api.versionsFrom('METEOR@0.9.0');
api.use([
'coffeescript',
'underscore',
... |
ui: Sort the album list after loading it | define(['jquery'], function($) {
function Sidebar() {
var sidebar = this;
$('#sidebar-toggle-button').click(function() {
sidebar.toggle();
});
sidebar.loadAlbums();
}
Sidebar.prototype = {
toggle: function() {
$(document.body).toggleClass('sidebar-toggled');
},
loadAlbums: function() {
var sidebar = t... | define(['jquery'], function($) {
function Sidebar() {
var sidebar = this;
$('#sidebar-toggle-button').click(function() {
sidebar.toggle();
});
sidebar.loadAlbums();
}
Sidebar.prototype = {
toggle: function() {
$(document.body).toggleClass('sidebar-toggled');
},
loadAlbums: function() {
var albumList =... |
[tests] Remove test for deprecated createmultsig option | #!/usr/bin/env python3
# Copyright (c) 2017 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test deprecation of RPC calls."""
from test_framework.test_framework import BitcoinTestFramework
class Depr... | #!/usr/bin/env python3
# Copyright (c) 2017 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test deprecation of RPC calls."""
from test_framework.test_framework import BitcoinTestFramework
from test_f... |
Allow method URL to be an empty string | var _ = require('lodash');
module.exports = function (methodName, config) {
// Ensure the minimum parameters have been passed
if (!methodName || !_.isString(methodName)) {
throw new Error('The first parameter passed to `addMethod` should be a string.');
}
// If a function is inputted as the `config`, then just ... | var _ = require('lodash');
module.exports = function (methodName, config) {
// Ensure the minimum parameters have been passed
if (!methodName || !_.isString(methodName)) {
throw new Error('The first parameter passed to `addMethod` should be a string.');
}
// If a function is inputted as the `config`, then just ... |
Use try clause for config in optimizer | """Module for optimized functions
Some methods performed in Python may be slowing down solvers. In this optimization
module we place optimized functions that are to be used instead of default
Python methods. Some methods are implemented solely in Cython and only called
from within the regular Python modules.
"""
impo... | """Module for optimized functions
Some methods performed in Python may be slowing down solvers. In this optimization
module we place optimized functions that are to be used instead of default
Python methods. Some methods are implemented solely in Cython and only called
from within the regular Python modules.
"""
impo... |
Allow to run tests against the pecl client | <?php
namespace Tarantool\Tests\Integration;
use Tarantool\Client as TarantoolClient;
use Tarantool\Connection\SocketConnection;
use Tarantool\Tests\Adapter\Tarantool;
trait Client
{
/**
* @var TarantoolClient
*/
private static $client;
/**
* @beforeClass
*/
public static functio... | <?php
namespace Tarantool\Tests\Integration;
use Tarantool\Client as TarantoolClient;
use Tarantool\Connection\SocketConnection;
trait Client
{
/**
* @var TarantoolClient
*/
private static $client;
/**
* @beforeClass
*/
public static function setUpClient()
{
self::$cl... |
Replace `var` with `let` to increase code consistency | "use strict";
import generator from "./generator_function.js";
import asyncGenerator from "./async_generator_function";
it('should correctly import generator function', () => {
expect(typeof generator).toBe("function");
});
it('should correctly build the correct function string', () => {
expect(generator.toString(... | import generator from "./generator_function.js";
import asyncGenerator from "./async_generator_function";
it('should correctly import generator function', () => {
expect(typeof generator).toBe("function");
});
it('should correctly build the correct function string', () => {
expect(generator.toString().indexOf('func... |
Simplify buildLink for Edit History support | <?php
class SV_ConversationImprovements_XenForo_Route_Prefix_Conversations extends XFCP_SV_ConversationImprovements_XenForo_Route_Prefix_Conversations
{
public function buildLink($originalPrefix, $outputPrefix, $action, $extension, $data, array &$extraParams)
{
if (isset($data['message_id']) &&
... | <?php
class SV_ConversationImprovements_XenForo_Route_Prefix_Conversations extends XFCP_SV_ConversationImprovements_XenForo_Route_Prefix_Conversations
{
public function buildLink($originalPrefix, $outputPrefix, $action, $extension, $data, array &$extraParams)
{
if (isset($data['message_id']) &&
... |
Add Searchable Mixin for API | # -*- coding: utf-8 -*-
# This file is part of Shuup.
#
# Copyright (c) 2012-2017, Shoop Commerce Ltd. All rights reserved.
#
# This source code is licensed under the OSL-3.0 license found in the
# LICENSE file in the root directory of this source tree.
from django.db.models.deletion import ProtectedError
from rest_fra... | # -*- coding: utf-8 -*-
# This file is part of Shuup.
#
# Copyright (c) 2012-2017, Shoop Commerce Ltd. All rights reserved.
#
# This source code is licensed under the OSL-3.0 license found in the
# LICENSE file in the root directory of this source tree.
from django.db.models.deletion import ProtectedError
from rest_fra... |
Address review comment: Document return type. | # Copyright Hybrid Logic Ltd. See LICENSE file for details.
"""
Combine and retrieve current cluster state.
"""
from twisted.application.service import Service
from ._model import Deployment, Node
class ClusterStateService(Service):
"""
Store known current cluster state, and combine partial updates with
... | # Copyright Hybrid Logic Ltd. See LICENSE file for details.
"""
Combine and retrieve current cluster state.
"""
from twisted.application.service import Service
from ._model import Deployment, Node
class ClusterStateService(Service):
"""
Store known current cluster state, and combine partial updates with
... |
Fix spec in which order of loading was different in travis server | <?php
namespace Spec\PHPSpec\Loader;
use \PHPSpec\Loader\DirectoryLoader,
\PHPSpec\Util\SpecIterator;
class DescribeDirectoryLoader extends \PHPSpec\Context
{
function itLoadsAllExampleGroupsUnderADirectory()
{
$loader = new DirectoryLoader;
$examples = $loader->load(__DIR__ . '/_files/Ba... | <?php
namespace Spec\PHPSpec\Loader;
use \PHPSpec\Loader\DirectoryLoader,
\PHPSpec\Util\SpecIterator;
class DescribeDirectoryLoader extends \PHPSpec\Context
{
function itLoadsAllExampleGroupsUnderADirectory()
{
$loader = new DirectoryLoader;
$examples = $loader->load(__DIR__ . '/_files/Ba... |
Check for oninput support instead of browser type | /*
* Every time the form field is changed, sanitize its contents with the given
* function to only allow input of a certain form.
*/
(function ($) {
var inputEvents = "input";
if (!("oninput" in document || "oninput" in $("<input>")[0])) {
inputEvents += " keyup";
}
jQuery.fn.restrict = func... | /*
* Every time the form field is changed, sanitize its contents with the given
* function to only allow input of a certain form.
*/
(function ($) {
jQuery.fn.restrict = function(sanitizationFunc) {
$(this).bind($.browser.msie ? "keyup" : "input", function(e) {
$(this).val(sanitizationFunc($(... |
Remove superfluous license headers (OKAPI-109) | package org.folio.okapi.bean;
import com.fasterxml.jackson.annotation.JsonInclude;
@JsonInclude(JsonInclude.Include.NON_NULL)
public class Permission {
private String permissionName;
private String displayName;
private String description;
private String[] subPermissions;
public Permission() {
}
public... | /*
* Copyright (c) 2015-2017, Index Data
* All rights reserved.
* See the file LICENSE for details.
*/
package org.folio.okapi.bean;
import com.fasterxml.jackson.annotation.JsonInclude;
@JsonInclude(JsonInclude.Include.NON_NULL)
public class Permission {
private String permissionName;
private String displayNa... |
Change Flask interface to 0.0.0.0 | from flask import Flask
class Driver:
'''
Holds the driver state so the flasked script can change behaviour based
on what the user injects via HTTP
'''
name = 'nobody'
def start(self, name):
self.name = name
return self.name
def stop(self):
self.name = 'nob... | from flask import Flask
class Driver:
'''
Holds the driver state so the flasked script can change behaviour based
on what the user injects via HTTP
'''
name = 'nobody'
def start(self, name):
self.name = name
return self.name
def stop(self):
self.name = 'nob... |
Add crm_security.xml file entry in update_xml section
bzr revid: mga@tinyerp.com-80638551c5a66adf0a49181f6ff6ae283ced3709 | {
"name" : "Customer & Supplier Relationship Management",
"version" : "1.0",
"author" : "Tiny",
"website" : "http://tinyerp.com/module_crm.html",
"category" : "Generic Modules/CRM & SRM",
"description": """The Tiny ERP case and request tracker enables a group of
people to intelligently and efficiently manage task... | {
"name" : "Customer & Supplier Relationship Management",
"version" : "1.0",
"author" : "Tiny",
"website" : "http://tinyerp.com/module_crm.html",
"category" : "Generic Modules/CRM & SRM",
"description": """The Tiny ERP case and request tracker enables a group of
people to intelligently and efficiently manage task... |
Set default load speed to 250 ms | $(function(){
$('.cd-slideshow').each(function(){
var $this = this;
var pageSpeed = ifDataExists($this, 'page-speed', 5000);
var fadeSpeed = ifDataExists($this, 'fade-speed', 1000);
$('> :gt(0)', $this).hide();
if (!$('> :eq(0)', $this).hasClass('cd-loader')) {
$('> :eq(0)', $this).css('disp... | $(function(){
$('.cd-slideshow').each(function(){
var $this = this;
var pageSpeed = ifDataExists($this, 'page-speed', 5000);
var fadeSpeed = ifDataExists($this, 'fade-speed', 1000);
$('> :gt(0)', $this).hide();
if (!$('> :eq(0)', $this).hasClass('cd-loader')) {
$('> :eq(0)', $this).css('disp... |
Improve error message for type mismatch. | package flow
import (
"fmt"
"go/types"
"github.com/dustin/go-humanize"
)
func cardinalityMismatchError(source, dest ComponentID, sourceSig, destSig *types.Tuple) error {
return fmt.Errorf(`
As I infer the types of values flowing through your program, I see a mismatch in this connection.
%[1]s -> %[2]s
There ... | package flow
import (
"fmt"
"go/types"
"github.com/dustin/go-humanize"
)
func cardinalityMismatchError(source, dest ComponentID, sourceSig, destSig *types.Tuple) error {
return fmt.Errorf(`
As I infer the types of values flowing through your program, I see a mismatch in this connection.
%[1]s -> %[2]s
There ... |
Support Grappelli in inline ckeditor initialisation. | $(function() {
initialiseCKEditor();
initialiseCKEditorInInlinedForms();
function initialiseCKEditorInInlinedForms() {
$(".add-row a, .grp-add-handler").click(function () {
initialiseCKEditor();
return true;
});
}
});
function initialiseCKEditor() {
$('texta... | $(function() {
initialiseCKEditor();
initialiseCKEditorInInlinedForms();
function initialiseCKEditorInInlinedForms() {
$(".add-row a").click(function () {
initialiseCKEditor();
return true;
});
}
});
function initialiseCKEditor() {
$('textarea[data-type=cked... |
Remove assert_ functions from nose. | """Tests directories set in the permamodel package definition file."""
import os
from .. import data_directory, examples_directory, permamodel_directory, tests_directory
def test_permamodel_directory_is_set():
assert permamodel_directory is not None
def test_data_directory_is_set():
assert data_directory ... | """Tests directories set in the permamodel package definition file."""
import os
from nose.tools import assert_true
from .. import (permamodel_directory, data_directory,
examples_directory, tests_directory)
def test_permamodel_directory_is_set():
assert(permamodel_directory is not None)
def tes... |
Use consistent capitalization in comments | /**
* App Dependencies.
*/
var loopback = require('loopback')
, app = module.exports = loopback()
, fs = require('fs')
, path = require('path')
, request = require('request')
, TaskEmitter = require('strong-task-emitter');
// Expose a rest api
app.use(loopback.rest());
// Add static files
app.use(loopbac... | /**
* App Dependencies.
*/
var loopback = require('loopback')
, app = module.exports = loopback()
, fs = require('fs')
, path = require('path')
, request = require('request')
, TaskEmitter = require('strong-task-emitter');
// expose a rest api
app.use(loopback.rest());
// Add static files
app.use(loopbac... |
Add alerts for web sockets | var hostname = window.location.hostname;
var wsaddr = "wss://".concat(hostname, ":1234/api");
/*
* Useful functions
*/
function map_alert(message) {
$('body').prepend('<div style="padding: 5px; z-index: 10; position: absolute; right: 0; left: 0;"> <div id="inner-message" class="alert alert-info alert-dismissible... | var hostname = window.location.hostname;
var wsaddr = "wss://".concat(hostname, ":1234/api");
console.log("Connecting to " + wsaddr);
var paladinws = new PaladinWebSocket(wsaddr);
var width = $(document).width();
var height = $(document).height();
// Disable the scroll bar
document.documentElement.style.overflow = '... |
Add require to test example. | import test from 'ava';
import examplesLoader from '../loaders/examples.loader';
test('should return valid, parsable JS', t => {
let exampleMarkdown = `
# header
const _ = require('lodash');
<div/>
text
\`\`\`
<span/>
\`\`\`
`;
let result = examplesLoader.call({}, exampleMarkdown);
t.truthy(result);
t.notThro... | import test from 'ava';
import examplesLoader from '../loaders/examples.loader';
test('should return valid, parsable JS', t => {
let exampleMarkdown = `
# header
<div/>
text
\`\`\`
<span/>
\`\`\`
`;
let result = examplesLoader.call({}, exampleMarkdown);
t.truthy(result);
t.notThrows(() => new Function(result),... |
Support Python 3.6 event loops in this example | import sys
from pythonosc.osc_server import AsyncIOOSCUDPServer
from pythonosc.dispatcher import Dispatcher
import asyncio
def filter_handler(address, *args):
print(f"{address}: {args}")
dispatcher = Dispatcher()
dispatcher.map("/filter", filter_handler)
ip = "127.0.0.1"
port = 1337
async def loop():
"""... | from pythonosc.osc_server import AsyncIOOSCUDPServer
from pythonosc.dispatcher import Dispatcher
import asyncio
def filter_handler(address, *args):
print(f"{address}: {args}")
dispatcher = Dispatcher()
dispatcher.map("/filter", filter_handler)
ip = "127.0.0.1"
port = 1337
async def loop():
"""Example mai... |
Set to 1.1 for new release | from setuptools import find_packages, setup
import sys
if 'install' in sys.argv:
import webbrowser
webbrowser.open('https://www.youtube.com/watch?v=NMZcwXh7HDA', new=2, autoraise=True)
setup(
name='rdalal',
version='1.1',
description='Install some sweet Rehan',
author='Will Kahn-Greene',
... | from setuptools import find_packages, setup
import sys
if 'install' in sys.argv:
import webbrowser
webbrowser.open('https://www.youtube.com/watch?v=NMZcwXh7HDA', new=2, autoraise=True)
setup(
name='rdalal',
version='1.0',
description='Install some sweet Rehan',
author='Will Kahn-Greene',
... |
Fix wrong link in JS sources | /*!
* JS-Tricks main script
*/
(function (w, d) {
// Touch detection ( ͡ᵔ ͜ʖ ͡ᵔ)
// @see http://js-tricks.com/detect-touch-devices-using-javascript
if('ontouchstart' in window) {
var htmlEl = d.getElementsByTagName('html')[0];
var htmlElClasses = htmlEl.className;
htmlEl.className += (htmlElClasses... | /*!
* JS-Tricks main script
*/
(function (w, d) {
// Touch detection ( ͡ᵔ ͜ʖ ͡ᵔ)
// @see http://localhost:8080/detect-touch-devices-using-javascript
if('ontouchstart' in window) {
var htmlEl = d.getElementsByTagName('html')[0];
var htmlElClasses = htmlEl.className;
htmlEl.className += (htmlElClasse... |
Make mock Model class extend object for Python 2 compat | from django.test import TestCase as BaseTestCase
from django.test import RequestFactory
from permissions import PermissionsRegistry as BasePermissionsRegistry
class PermissionsRegistry(BasePermissionsRegistry):
def _get_user_model(self):
return User
def _get_model_instance(self, model, **kwargs):
... | from django.test import TestCase as BaseTestCase
from django.test import RequestFactory
from permissions import PermissionsRegistry as BasePermissionsRegistry
class PermissionsRegistry(BasePermissionsRegistry):
def _get_user_model(self):
return User
def _get_model_instance(self, model, **kwargs):
... |
Fix a check for an empty mediaType
We need it for the old attachments. | define(["app/app"], function(App) {
"use strict";
App.Attachment = DS.Model.extend({
file: DS.attr('file'), // FormData File object
url: DS.attr('string'),
thumbnailUrl: DS.attr('string'),
fileName: DS.attr('string'),
fileSize: DS.attr('number'),
mediaType: DS.attr('string'),
createdAt... | define(["app/app"], function(App) {
"use strict";
App.Attachment = DS.Model.extend({
file: DS.attr('file'), // FormData File object
url: DS.attr('string'),
thumbnailUrl: DS.attr('string'),
fileName: DS.attr('string'),
fileSize: DS.attr('number'),
mediaType: DS.attr('string'),
createdAt... |
po: Append string into .pot file
When more than one item was returned, then `potData` would be appended
as array and not as string. | // Extract the title from cockpit's manifest.json and append it to a .pot file
// This assumes the .pot file already exists.
const fs = require("fs");
const jsel = require("jsel");
if (process.argv.length != 4) {
console.error("Usage: add-title <manifest.json> <POT-file>");
process.exit(1);
}
var manifestJsonNam... | // Extract the title from cockpit's manifest.json and append it to a .pot file
// This assumes the .pot file already exists.
const fs = require("fs");
const jsel = require("jsel");
if (process.argv.length != 4) {
console.error("Usage: add-title <manifest.json> <POT-file>");
process.exit(1);
}
var manifestJsonNam... |
Resolve upmerge conflict in composer | <?php
/*
* This file is part of the Sylius package.
*
* (c) Paweł Jędrzejewski
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
declare(strict_types=1);
namespace Sylius\Component\Shipping\Resolver;
use Sylius\Component\Registry... | <?php
/*
* This file is part of the Sylius package.
*
* (c) Paweł Jędrzejewski
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
declare(strict_types=1);
namespace Sylius\Component\Shipping\Resolver;
use Sylius\Component\Registry... |
Use resources for harvest reports | <?php
namespace OGetIt\HarvestReport;
use OGetIt\Common\OGetIt_Resources;
class OGetIt_HarvestReport {
/**
* @var string
*/
private $_coordinates;
/**
* @var OGetIt_Resources
*/
private $_resources;
/**
* @param unknown $coordinates Format; 1:100:10
* @param integer $metal
* @... | <?php
namespace OGetIt\HarvestReport;
class OGetIt_HarvestReport {
/**
* @var string
*/
private $_coordinates;
/**
* @var integer
*/
private $_metal;
/**
* @var integer
*/
private $_crystal;
/**
* @param unknown $coordinates Format; 1:100:10
* @param integer $metal
... |
Change the appium package name. | from os import path
from setuptools import setup
here = path.abspath(path.dirname(__file__))
# Get the long description from the relevant file
with open(path.join(here, "README.rst")) as f:
long_description = f.read()
classifiers = ["License :: OSI Approved :: Apache Software License",
"Topic :: ... | from os import path
from setuptools import setup
here = path.abspath(path.dirname(__file__))
# Get the long description from the relevant file
with open(path.join(here, "README.rst")) as f:
long_description = f.read()
classifiers = ["License :: OSI Approved :: Apache Software License",
"Topic :: ... |
Handle xpress deprecate warning regarding req.param() | var express = require('express')
var router = express.Router()
router.get('/', function (req, res, next) {
console.log('Cookies: ', req.cookies)
if (Object.keys(req.cookies).indexOf('username') !== -1) {
return res.redirect('/studies')
} else {
res.render('index', { title: 'Choose a new username / Enter ... | var express = require('express')
var router = express.Router()
router.get('/', function (req, res, next) {
console.log('Cookies: ', req.cookies)
if (Object.keys(req.cookies).indexOf('username') !== -1) {
return res.redirect('/studies')
} else {
res.render('index', { title: 'Choose a new username / Enter ... |
Fix current tab styling on workspace summary page | ;(function($, ns) {
ns.WorkspaceSummaryPage = chorus.pages.Base.extend({
crumbs : function() {
return [
{ label: t("breadcrumbs.home"), url: "#/" },
{ label: this.model.get("name") }
]
},
setup : function(workspaceId) {
// ... | ;(function($, ns) {
ns.WorkspaceSummaryPage = chorus.pages.Base.extend({
crumbs : function() {
return [
{ label: t("breadcrumbs.home"), url: "#/" },
{ label: this.model.get("name") }
]
},
setup : function(workspaceId) {
// ... |
Fix deprecated warning for ts-jest | var semver = require('semver');
function getSupportedTypescriptTarget() {
var nodeVersion = process.versions.node;
if (semver.gt(nodeVersion, '7.6.0')) {
return 'es2017'
} else if (semver.gt(nodeVersion, '7.0.0')) {
return 'es2016';
} else if (semver.gt(nodeVersion, '6.0.0')) {
return 'es2015';
... | var semver = require('semver');
function getSupportedTypescriptTarget() {
var nodeVersion = process.versions.node;
if (semver.gt(nodeVersion, '7.6.0')) {
return 'es2017'
} else if (semver.gt(nodeVersion, '7.0.0')) {
return 'es2016';
} else if (semver.gt(nodeVersion, '6.0.0')) {
return 'es2015';
... |
Fix infinite loop at root dir if nothing is found | package main
import (
"fmt"
"os"
"os/exec"
"path/filepath"
)
const FILE string = "Makefile"
const PROG string = "make"
/* TODO:
add stopping at homedir
configurable filename for aliases?
*/
func main() {
checkDir, err := os.Getwd()
if err != nil {
fmt.Println("Error getting working directory:", err)
os.Exi... | package main
import (
"fmt"
"log"
"os"
"os/exec"
"path/filepath"
)
const FILE string = "Makefile"
const PROG string = "make"
/* TODO:
add stopping at homedir
configurable filename for aliases?
*/
func main() {
checkDir, err := os.Getwd()
if err != nil {
log.Fatal(err)
}
for {
//fmt.Println("Checking:", ... |
Fix babel-runtime/regenerator import in tools runtime setup.
Fixes #7181. | // Install ES2015-complaint polyfills for Object, Array, String, Function,
// Symbol, Map, and Set, patching the native implementations if available.
require("meteor-ecmascript-runtime");
// Install a global ES2015-compliant Promise constructor that knows how to
// run all its callbacks in Fibers.
var Promise = global... | // Install ES2015-complaint polyfills for Object, Array, String, Function,
// Symbol, Map, and Set, patching the native implementations if available.
require("meteor-ecmascript-runtime");
// Install a global ES2015-compliant Promise constructor that knows how to
// run all its callbacks in Fibers.
var Promise = global... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.