text stringlengths 16 4.96k | positive stringlengths 321 2.24k | negative stringlengths 310 2.21k |
|---|---|---|
Hide feedback notification after 5 seconds (rather than 10) | Atmo.Views.NotificationHolder = Backbone.View.extend({
initialize: function() {
Atmo.notifications.bind('add', this.add_notification, this);
},
add_notification: function(model) {
var x_close = $('<button/>', {
type: 'button',
'class': 'close',
'data-dismi... | Atmo.Views.NotificationHolder = Backbone.View.extend({
initialize: function() {
Atmo.notifications.bind('add', this.add_notification, this);
},
add_notification: function(model) {
var x_close = $('<button/>', {
type: 'button',
'class': 'close',
'data-dismi... |
Progressbar: Use new has/lacksClasses assertions for all class checks | (function( $ ) {
module( "progressbar: methods" );
test( "destroy", function() {
expect( 1 );
domEqual( "#progressbar", function() {
$( "#progressbar" ).progressbar().progressbar( "destroy" );
});
});
test( "disable", function( assert ) {
expect( 3 );
var element = $( "#progressbar" ).progressbar().progressb... | (function( $ ) {
module( "progressbar: methods" );
test( "destroy", function() {
expect( 1 );
domEqual( "#progressbar", function() {
$( "#progressbar" ).progressbar().progressbar( "destroy" );
});
});
test( "disable", function() {
expect( 3 );
var element = $( "#progressbar" ).progressbar().progressbar( "dis... |
Use absolute imports to avoid module naming issues | from __future__ import absolute_import
import os
from settings import *
db = os.environ.get('DB')
SECRET_KEY = "This is a test, you don't need secrets"
if db == "sqlite":
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': ':memory:',
},
}
elif d... | import os
from settings import *
db = os.environ.get('DB')
SECRET_KEY = "This is a test, you don't need secrets"
if db == "sqlite":
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': ':memory:',
},
}
elif db == "postgres":
DATABASES = {
... |
Add data: response to be manipulated in front end | var base = require('./base.js');
exports.assemble = {
addSchedule:
function (parameters) {
var userEventEntry = {
availability: JSON.stringify(parameters.availability),
Users_id: parameters.usersid,
Events_id: parameters.eventsid
};
... | var base = require('./base.js');
exports.assemble = {
addSchedule:
function (parameters) {
var userEventEntry = {
availability: JSON.stringify(parameters.availability),
Users_id: parameters.usersid,
Events_id: parameters.eventsid
};
... |
Add back the webpack inline sourcemaps | var path = require('path');
var webpack = require('webpack');
module.exports = {
plugins: [
new webpack.DefinePlugin({
"process.env": Object.keys(process.env).reduce(function(o, k) {
o[k] = JSON.stringify(process.env[k]);
return o;
}, {})
}),
],
devtool: '#inline-source-map',... | var path = require('path');
var webpack = require('webpack');
module.exports = {
plugins: [
new webpack.DefinePlugin({
"process.env": Object.keys(process.env).reduce(function(o, k) {
o[k] = JSON.stringify(process.env[k]);
return o;
}, {})
}),
],
module: {
loaders: [
... |
Add route for line map editor | // -*- tab-width: 2 -*-
var express = require('express')
var router = express.Router()
/* GET home page. */
router.get('/', function (req, res) {
res.render('admin_home')
})
router.get('/:competitionid', function (req, res) {
res.render('competition_admin', {id : req.params.competitionid})
})
router.get('/:compe... | // -*- tab-width: 2 -*-
var express = require('express')
var router = express.Router()
/* GET home page. */
router.get('/', function (req, res) {
res.render('admin_home')
})
router.get('/:competitionid', function (req, res) {
res.render('competition_admin', {id : req.params.competitionid})
})
router.get('/:compe... |
Improve the code coverage of /plugin/pkg/admission/deny | /*
Copyright 2014 The Kubernetes 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 law or agreed to in writing, ... | /*
Copyright 2014 The Kubernetes 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 law or agreed to in writing, ... |
Remove hard code prj root. | const app = require('./core/app');
const element = require('./core/element');
const plugin = require('./core/plugin');
const paths = require('./core/paths');
const vio = require('./core/vio');
const template = require('./core/template');
const config = require('./core/config');
const ast = require('./core/ast');
const ... | const app = require('./core/app');
const element = require('./core/element');
const plugin = require('./core/plugin');
const paths = require('./core/paths');
const vio = require('./core/vio');
const template = require('./core/template');
const config = require('./core/config');
const ast = require('./core/ast');
const ... |
Change 'language' to 'syntax', that is more precise terminology. | #
# linter.py
# Linter for SublimeLinter3, a code checking framework for Sublime Text 3
#
# Written by Aparajita Fishman
# Copyright (c) 2013 Aparajita Fishman
#
# Project: https://github.com/SublimeLinter/SublimeLinter-contrib-jsl
# License: MIT
#
"""This module exports the JSL plugin linter class."""
from SublimeLi... | #
# linter.py
# Linter for SublimeLinter3, a code checking framework for Sublime Text 3
#
# Written by Aparajita Fishman
# Copyright (c) 2013 Aparajita Fishman
#
# Project: https://github.com/SublimeLinter/SublimeLinter-contrib-jsl
# License: MIT
#
"""This module exports the JSL plugin linter class."""
from SublimeLi... |
Fix flake8 errors: W391 blank line at end of file | import subprocess
from thefuck.utils import for_app, replace_command, eager
@for_app('ifconfig')
def match(command):
return 'error fetching interface information: Device not found' \
in command.stderr
@eager
def _get_possible_interfaces():
proc = subprocess.Popen(['ifconfig', '-a'], stdout=subpro... | import subprocess
from thefuck.utils import for_app, replace_command, eager
@for_app('ifconfig')
def match(command):
return 'error fetching interface information: Device not found' \
in command.stderr
@eager
def _get_possible_interfaces():
proc = subprocess.Popen(['ifconfig', '-a'], stdout=subpro... |
OAK-3898: Add filter capabilities to the segment graph run mode
Bump export version
git-svn-id: 67138be12999c61558c3dd34328380c8e4523e73@1725678 13f79535-47bb-0310-9956-ffa450edef68 | /*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may ... | /*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may ... |
Reset color to default when color been has changed | import {
FETCH_ASSETS,
FETCH_ASSETS_FULFILLED,
SET_CURRENT_ASSET,
SET_CURRENT_COLOR
} from '../constants/assets';
import keyBy from 'lodash/keyBy';
const initialState = {
isLoading: false,
data: {},
current: 'Hairstyles',
currentColor: 'default'
};
const reducer = (state = initialState, action) => {
... | import {
FETCH_ASSETS,
FETCH_ASSETS_FULFILLED,
SET_CURRENT_ASSET,
SET_CURRENT_COLOR
} from '../constants/assets';
import keyBy from 'lodash/keyBy';
const initialState = {
isLoading: false,
data: {},
current: 'Hairstyles',
currentColor: 'default'
};
const reducer = (state = initialState, action) => {
... |
Make it possible to manually override version numbers | #!/usr/bin/python
import time
from datetime import date
from setuptools import setup
from pagekite.common import APPVER
import os
try:
# This borks sdist.
os.remove('.SELF')
except:
pass
setup(
name="pagekite",
version=os.getenv(
'PAGEKITE_VERSION',
APPVER.replace('github', 'dev%d' % (12... | #!/usr/bin/python
import time
from datetime import date
from setuptools import setup
from pagekite.common import APPVER
import os
try:
# This borks sdist.
os.remove('.SELF')
except:
pass
setup(
name="pagekite",
version=APPVER.replace('github', 'dev%d' % (120*int(time.time()/120))),
license="AGPLv3+"... |
Move calls within Sitemap Xml controller | <?php
class SitemapXML_Controller extends Page_Controller {
private static $url_handlers = array(
'' => 'GetSitemapXML'
);
private static $allowed_actions = array(
'GetSitemapXML'
);
public function init()
{
parent::init();
}
public function GetSitemapXML()
... | <?php
class SitemapXML_Controller extends Page_Controller {
private static $url_handlers = array(
'' => 'GetSitemapXML'
);
private static $allowed_actions = array(
'GetSitemapXML'
);
public function init()
{
$this->response->addHeader("Content-Type", "application/xml"... |
Add allowed and exposed headers to response headers for CORS | /*
* SystemConfig.java
*
* Copyright (C) 2018 [ A Legge Up ]
*
* This software may be modified and distributed under the terms
* of the MIT license. See the LICENSE file for details.
*/
package com.aleggeup.confagrid.config;
import org.springframework.context.annotation.Bean;
import org.springframework.contex... | /*
* SystemConfig.java
*
* Copyright (C) 2018 [ A Legge Up ]
*
* This software may be modified and distributed under the terms
* of the MIT license. See the LICENSE file for details.
*/
package com.aleggeup.confagrid.config;
import org.springframework.context.annotation.Bean;
import org.springframework.contex... |
Add reverse to data migration | # -*- coding: utf-8 -*-
# Generated by Django 1.9.13 on 2018-03-04 23:14
from __future__ import unicode_literals
import json
from django.db import migrations
def populate_default(apps, schema_editor):
ScriptParameter = apps.get_model('wooey', 'ScriptParameter')
for obj in ScriptParameter.objects.all():
... | # -*- coding: utf-8 -*-
# Generated by Django 1.9.13 on 2018-03-04 23:14
from __future__ import unicode_literals
import json
from django.db import migrations
def populate_default(apps, schema_editor):
ScriptParameter = apps.get_model('wooey', 'ScriptParameter')
for obj in ScriptParameter.objects.all():
... |
Define PropertyReader interface and use it a couple of places. | package boardgame
type State struct {
//The version number of the state. Increments by one each time a Move is
//applied.
Version int
//The schema version that this state object uses. This number will not
//change often, but is useful to detect if the state was saved back when a
//diferent schema was in use and ... | package boardgame
type State struct {
//The version number of the state. Increments by one each time a Move is
//applied.
Version int
//The schema version that this state object uses. This number will not
//change often, but is useful to detect if the state was saved back when a
//diferent schema was in use and ... |
Fix 'file not found' when loading translation files. | const i18next = require('i18next');
const i18nextXHRBackend = require('i18next-xhr-backend');
const jqueryI18next = require('jquery-i18next');
i18next
.use(i18nextXHRBackend)
.init({
whitelist: ['en-US', 'pt-BR'],
fallbackLng: 'en-US',
debug: false,
ns: ['deimos-issuer'],
defaultNS: 'deimos-issuer'... | const i18next = require('i18next');
const i18nextXHRBackend = require('i18next-xhr-backend');
const jqueryI18next = require('jquery-i18next');
i18next
.use(i18nextXHRBackend)
.init({
fallbackLng: 'en-US',
debug: false,
ns: ['deimos-issuer'],
defaultNS: 'deimos-issuer',
backend: {
loadPath: 'l... |
Fix optimistic state for Player | import PlayerController from './PlayerController'
import { connect } from 'react-redux'
import { ensureState } from 'redux-optimistic-ui'
import { requestPlayNext } from 'store/modules/status'
import {
emitStatus,
emitError,
emitLeave,
cancelStatus,
mediaRequest,
mediaRequestSuccess,
mediaRequestError,
} ... | import PlayerController from './PlayerController'
import { connect } from 'react-redux'
import { requestPlayNext } from 'store/modules/status'
import {
emitStatus,
emitError,
emitLeave,
cancelStatus,
mediaRequest,
mediaRequestSuccess,
mediaRequestError,
} from '../../modules/player'
const mapActionCreato... |
[refactor] Fix test path in Validation test | /*
* eXist Open Source Native XML Database
* Copyright (C) 2001-2018 The eXist Project
* http://exist-db.org
*
* This program 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 2
* o... | /*
* eXist Open Source Native XML Database
* Copyright (C) 2001-2018 The eXist Project
* http://exist-db.org
*
* This program 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 2
* o... |
Refactor the initialization a bit to make configuration easier. | import json
import requests
class TemperatureWatch(object):
thermostat_url = None
alert_high = 80
alert_low = 60
_last_response = None
def get_info(self):
r = requests.get(self.thermostat_url + '/tstat')
self._last_response = json.loads(r.text)
return r.text
def check... | import json
import requests
class TemperatureWatch(object):
thermostat_url = None
alert_high = 80
alert_low = 60
_last_response = None
def get_info(self):
r = requests.get(self.thermostat_url + '/tstat')
self._last_response = json.loads(r.text)
return r.text
def check... |
Change default data path to be a relative path
although a relative path could be ambiguous, in most cases this a
reasonable and convenient setting because you'll likely invoke the
binary from the root directory of the app, and if you don't you can
easily pass in a different setting. | package main
import (
"flag"
"fmt"
"os"
)
type Config struct {
extractAddress string
entitiesPath string
logPath string
}
func NewConfig() *Config {
cfg := new(Config)
cfg.extractAddress = getenvDefault("EXTRACTOR_EXTRACT_ADDR", ":3096")
cfg.entitiesPath = getenvDefault("EXTRACTOR_ENTITIES_PATH", ... | package main
import (
"flag"
"fmt"
"os"
)
type Config struct {
extractAddress string
entitiesPath string
logPath string
}
func NewConfig() *Config {
cfg := new(Config)
cfg.extractAddress = getenvDefault("EXTRACTOR_EXTRACT_ADDR", ":3096")
cfg.entitiesPath = getenvDefault("EXTRACTOR_ENTITIES_PATH", ... |
Fix include path and ascii / utf8 errors. | #!/usr/bin/python
import sys
import os
import glob
#sys.path.append(os.path.join(os.path.dirname(__file__), "gen-py"))
sys.path.append(os.path.join(os.path.dirname(__file__),"gen-py/thrift_solr/"))
sys.path.append(os.path.dirname(__file__) )
from thrift.transport import TSocket
from thrift.server import TServer
#im... | #!/usr/bin/python
import sys
import glob
sys.path.append("python_scripts/gen-py")
sys.path.append("gen-py/thrift_solr/")
from thrift.transport import TSocket
from thrift.server import TServer
#import thrift_solr
import ExtractorService
import sys
import readability
import readability
def extract_with_python_rea... |
Add Guest for Mail Receiver. | "use strict";
const debug = require("debug")("OSMBC:util:initialize");
const async = require("async");
const logger = require("../config.js").logger;
const configModule = require("../model/config.js");
const userModule = require("../model/user.js");
const messageCenter = require("../notification/messageCenter.js")... | "use strict";
const debug = require("debug")("OSMBC:util:initialize");
const async = require("async");
const logger = require("../config.js").logger;
const configModule = require("../model/config.js");
const userModule = require("../model/user.js");
const messageCenter = require("../notification/messageCenter.js")... |
Add place to store a user's token | <?php
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateUsersTable extends Migration {
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('users', function(Blueprint $table)
{
$table->increments('id');
$table->str... | <?php
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateUsersTable extends Migration {
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('users', function(Blueprint $table)
{
$table->increments('id');
$table->str... |
Fix "Trying to get property of non-object" | @component('mail::message')
# Dear {{ '@' . $user->username }}, moderator of [#{{ $category->name }}](https://voten.co/c/{{ $category->name }}?ref=email)
During the beta phase, to keep the community clean and active, we are deleting all the inactive channels that haven't had any activities in the last 60 days. Your *... | @component('mail::message')
# Dear {{ '@' . $user->username }}, moderator of [#{{ $category->name }}](https://voten.co/c/{{ $category->name }}?ref=email)
During the beta phase, to keep the community clean and active, we are deleting all the inactive channels that haven't had any activities in the last 60 days. Your *... |
Use `call()` to correctly assign `this` in handler
The handler function's `this` should refer to the element to which the
listener is bound, rather than the `window` object. This also ensures
that `this` is equal to `e.currentTarget`. |
/**
* Module dependencies.
*/
var matches = require('matches-selector')
, event = require('event');
/**
* Delegate event `type` to `selector`
* and invoke `fn(e)`. A callback function
* is returned which may be passed to `.unbind()`.
*
* @param {Element} el
* @param {String} selector
* @param {String} typ... |
/**
* Module dependencies.
*/
var matches = require('matches-selector')
, event = require('event');
/**
* Delegate event `type` to `selector`
* and invoke `fn(e)`. A callback function
* is returned which may be passed to `.unbind()`.
*
* @param {Element} el
* @param {String} selector
* @param {String} typ... |
Remove unused imports in interpeter. | # -*- coding: utf-8 -*-
from .evaluator import evaluate
from .parser import parse, unparse, parse_multiple
from .types import Environment
def interpret(source, env=None):
"""
Interpret a DIY Lang program statement
Accepts a program statement as a string, interprets it, and then
returns the resulting... | # -*- coding: utf-8 -*-
from os.path import dirname, join
from .evaluator import evaluate
from .parser import parse, unparse, parse_multiple
from .types import Environment
def interpret(source, env=None):
"""
Interpret a DIY Lang program statement
Accepts a program statement as a string, interprets it,... |
Update `create_user` method manager to require person | # Django
from django.contrib.auth.models import BaseUserManager
class UserManager(BaseUserManager):
def create_user(self, email, person, password='', **kwargs):
user = self.model(
email=email,
person=person,
password='',
is_active=True,
**kwargs... | # Django
from django.contrib.auth.models import BaseUserManager
class UserManager(BaseUserManager):
def create_user(self, email, password='', **kwargs):
user = self.model(
email=email,
password='',
is_active=True,
**kwargs
)
user.save(using=... |
Disable flatfile tests until atom tests complete. | #!/usr/bin/python
import unittest
from firmant.utils import get_module
# Import this now to avoid it throwing errors.
import pytz
from firmant.configuration import settings
from test.configuration import suite as configuration_tests
from test.datasource.atom import suite as atom_tests
from test.plugins.datasource.flat... | #!/usr/bin/python
import unittest
from firmant.utils import get_module
# Import this now to avoid it throwing errors.
import pytz
from firmant.configuration import settings
from test.configuration import suite as configuration_tests
from test.datasource.atom import suite as atom_tests
from test.plugins.datasource.flat... |
[1.9] Put Components.utils to a constant
http://code.google.com/p/fbug/source/detail?r=11472 | /* See license.txt for terms of usage */
define([], function() {
//********************************************************************************************* //
//Constants
const Cu = Components.utils;
// ********************************************************************************************* //
// Firebug ... | /* See license.txt for terms of usage */
define([], function() {
// ********************************************************************************************* //
// Firebug Trace - FBTrace
var scope = {};
try
{
Components.utils["import"]("resource://fbtrace/firebug-trace-service.js", scope);
}
catch (err)
{
... |
Stop passing middlewares array to stack | /**
* Builder.js
*
* @author: Harish Anchu <harishanchu@gmail.com>
* @copyright Copyright (c) 2015-2016, QuorraJS.
* @license See LICENSE.txt
*/
var StackedHttpKernel = require('./StackedHttpKernel');
function Builder() {
/**
* Stores middleware classes
*
* @type {Array}
* @protected
... | /**
* Builder.js
*
* @author: Harish Anchu <harishanchu@gmail.com>
* @copyright Copyright (c) 2015-2016, QuorraJS.
* @license See LICENSE.txt
*/
var StackedHttpKernel = require('./StackedHttpKernel');
function Builder() {
/**
* Stores middleware classes
*
* @type {Array}
* @protected
... |
Add @AwaitRule to integration test
Done to ensure that Arquillian waits for the application to standup
properly before executing the test method | /*
* Copyright 2016-2017 Red Hat, Inc, and individual contributors.
*
* 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... | /*
* Copyright 2016-2017 Red Hat, Inc, and individual contributors.
*
* 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... |
Tag version v1.0.0 -- first extracted version | from distutils.core import setup
import os
package_data = []
BASE_DIR = os.path.dirname(__file__)
walk_generator = os.walk(os.path.join(BASE_DIR, "project_template"))
paths_and_files = [(paths, files) for paths, dirs, files in walk_generator]
for path, files in paths_and_files:
prefix = path[path.find("project_tem... | from distutils.core import setup
import os
package_data = []
BASE_DIR = os.path.dirname(__file__)
walk_generator = os.walk(os.path.join(BASE_DIR, "project_template"))
paths_and_files = [(paths, files) for paths, dirs, files in walk_generator]
for path, files in paths_and_files:
prefix = path[path.find("project_tem... |
Remove workaround for issue with older python versions. | # Copyright (C) 2011, 2012 Nippon Telegraph and Telephone Corporation.
# Copyright (C) 2011 Isaku Yamahata <yamahata at valinux co jp>
#
# 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
#
# h... | # Copyright (C) 2011, 2012 Nippon Telegraph and Telephone Corporation.
# Copyright (C) 2011 Isaku Yamahata <yamahata at valinux co jp>
#
# 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
#
# h... |
Read what you're getting up front | import Rx from 'rx';
import {h} from '@cycle/dom';
export function labeledSlider(responses) {
const events = intent(responses.DOM),
DOM = view(model(responses, events));
return {DOM, events};
function intent(DOM) {
return {
newValue: DOM.select('.slider').events('input')
.map(ev => ev... | import Rx from 'rx';
import {h} from '@cycle/dom';
export function labeledSlider(responses) {
function intent(DOM) {
return {
newValue: DOM.select('.slider').events('input')
.map(ev => ev.target.value)
};
}
function model({props}, {newValue}) {
const initialValue$ = props.get('initial'... |
Check that circle ci catches failures. | package com.realkinetic.app.gabby.repository.downstream.memory;
import com.realkinetic.app.gabby.config.BaseConfig;
import com.realkinetic.app.gabby.config.DefaultConfig;
import com.realkinetic.app.gabby.config.MemoryConfig;
import com.realkinetic.app.gabby.repository.BaseDownstream;
import com.realkinetic.app.gabby.r... | package com.realkinetic.app.gabby.repository.downstream.memory;
import com.realkinetic.app.gabby.config.BaseConfig;
import com.realkinetic.app.gabby.config.DefaultConfig;
import com.realkinetic.app.gabby.config.MemoryConfig;
import com.realkinetic.app.gabby.repository.BaseDownstream;
import com.realkinetic.app.gabby.r... |
Make filter_by_district more strict - don't show anything to unconfigured users | from __future__ import unicode_literals
from django.db import models
from django.utils.translation import ugettext_lazy as _
from django.contrib.auth.models import User
from locations.models import District
class Coordinator(models.Model):
user = models.OneToOneField(User, on_delete=models.CASCADE)
is_manage... | from __future__ import unicode_literals
from django.db import models
from django.utils.translation import ugettext_lazy as _
from django.contrib.auth.models import User
from locations.models import District
class Coordinator(models.Model):
user = models.OneToOneField(User, on_delete=models.CASCADE)
is_manage... |
Make server listen on port 80 | require('app-module-path').addPath(__dirname);
var express = require('express');
var passport = require('passport');
var session = require('express-session');
var app = express();
var inventory_router = require('api/inventory.js');
var reservations_router = require('api/reservations.js');
var auth = require('api/aut... | require('app-module-path').addPath(__dirname);
var express = require('express');
var passport = require('passport');
var session = require('express-session');
var app = express();
var inventory_router = require('api/inventory.js');
var reservations_router = require('api/reservations.js');
var auth = require('api/aut... |
[Readability] Rename method name (avoid abbreviation)
AND:
* Remove redundant comment + update doc block comment.
* Change "isAlreadyExecuted" method visibility to private (don't need to be public!). | <?php
/**
* @author Pierre-Henry Soria <hello@ph7cms.com>
* @copyright (c) 2012-2018, Pierre-Henry Soria. All Rights Reserved.
* @license GNU General Public License; See PH7.LICENSE.txt and PH7.COPYRIGHT.txt in the root directory.
* @package PH7 / App / Include / Class
*/
namesp... | <?php
/**
* @author Pierre-Henry Soria <hello@ph7cms.com>
* @copyright (c) 2012-2018, Pierre-Henry Soria. All Rights Reserved.
* @license GNU General Public License; See PH7.LICENSE.txt and PH7.COPYRIGHT.txt in the root directory.
* @package PH7 / App / Include / Class
*/
namesp... |
Remove unused array of model | var MaapError = require("./utils/MaapError");
const EventEmitter = require("events");
const util = require("util");
/**
* Set dsl's store and point to access at the any engine defined in MaaS.
* Token inherits from EventEmitter. Any engine create own events to
* comunicate with the other engines. The only once own ... | var MaapError = require("./utils/MaapError.js");
const EventEmitter = require('events');
const util = require('util');
/**
* Set dsl's store and point to access at the any engine defined in MaaS.
* Token inherits from EventEmitter. Any engine create own events to
* comunicate with the other engines. The only once o... |
Add optional parameters for symfony2/cache-clear
Add optional parameters for symfony2/cache-clear task like --no-warmup. | <?php
/*
* This file is part of the Magallanes package.
*
* (c) Andrés Montañez <andres@andresmontanez.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Mage\Task\BuiltIn\Symfony2;
use Mage\Task\BuiltIn\Symfony2\SymfonyAbs... | <?php
/*
* This file is part of the Magallanes package.
*
* (c) Andrés Montañez <andres@andresmontanez.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Mage\Task\BuiltIn\Symfony2;
use Mage\Task\BuiltIn\Symfony2\SymfonyAbs... |
Use pathlib to read ext.conf | import pathlib
from mopidy import config, exceptions, ext
__version__ = "1.2.2"
class Extension(ext.Extension):
dist_name = "Mopidy-dLeyna"
ext_name = "dleyna"
version = __version__
def get_default_config(self):
return config.read(pathlib.Path(__file__).parent / "ext.conf")
def get_co... | import os
from mopidy import config, exceptions, ext
__version__ = "1.2.2"
class Extension(ext.Extension):
dist_name = "Mopidy-dLeyna"
ext_name = "dleyna"
version = __version__
def get_default_config(self):
return config.read(os.path.join(os.path.dirname(__file__), "ext.conf"))
def ge... |
Add missing import of insecurity lib | const utils = require('../lib/utils')
const insecurity = require('../lib/insecurity')
const challenges = require('../data/datacache').challenges
const db = require('../data/mongodb')
module.exports = function trackOrder () {
return (req, res) => {
const id = insecurity.sanitizeProcessExit(utils.trunc(decodeURICo... | const utils = require('../lib/utils')
const challenges = require('../data/datacache').challenges
const db = require('../data/mongodb')
module.exports = function trackOrder () {
return (req, res) => {
const id = insecurity.sanitizeProcessExit(utils.trunc(decodeURIComponent(req.params.id), 40))
if (utils.notSo... |
Change 'share' method in service provider to 'singleton' to support L5.4 | <?php namespace Rossedman\Teamwork;
use GuzzleHttp\Client as Guzzle;
use Illuminate\Support\ServiceProvider;
class TeamworkServiceProvider extends ServiceProvider {
/**
* Register the service provider.
*
* @return void
*/
public function register()
{
$this->app->singleton('ros... | <?php namespace Rossedman\Teamwork;
use GuzzleHttp\Client as Guzzle;
use Illuminate\Support\ServiceProvider;
class TeamworkServiceProvider extends ServiceProvider {
/**
* Register the service provider.
*
* @return void
*/
public function register()
{
$this->app['rossedman.team... |
Revert "Prevent link processing for dropdowns"
This reverts commit 2cb937a4405627c94c05c391dd610b85ba7e1cad. | 'use strict';
/**
* client
**/
/**
* client.common
**/
/*global $, _, nodeca, window, document*/
/**
* client.common.init()
*
* Assigns all necessary event listeners and handlers.
*
*
* ##### Example
*
* nodeca.client.common.init();
**/
module.exports = function () {
nodeca.io.init();
... | 'use strict';
/**
* client
**/
/**
* client.common
**/
/*global $, _, nodeca, window, document*/
/**
* client.common.init()
*
* Assigns all necessary event listeners and handlers.
*
*
* ##### Example
*
* nodeca.client.common.init();
**/
module.exports = function () {
nodeca.io.init();
... |
Fix lambda invoke with no payload | 'use strict'
const { config, Lambda } = require('aws-sdk')
const { stringify } = JSON
config.update({
accessKeyId: 'ABC',
secretAccessKey: 'SECRET',
})
const lambda = new Lambda({
apiVersion: '2015-03-31',
endpoint: 'http://localhost:3000',
})
exports.noPayload = async function noPayload() {
const params... | 'use strict'
const { config, Lambda } = require('aws-sdk')
const { stringify } = JSON
config.update({
accessKeyId: 'ABC',
secretAccessKey: 'SECRET',
})
const lambda = new Lambda({
apiVersion: '2015-03-31',
endpoint: 'http://localhost:3000',
})
exports.noPayload = async function noPayload() {
const params... |
Use .code instead of .name for type references in code bodies | package de.japkit.roo.japkit.web;
import org.springframework.format.FormatterRegistrar;
import org.springframework.format.FormatterRegistry;
import de.japkit.annotations.ParamNames;
import de.japkit.metaannotations.Method;
import de.japkit.metaannotations.Template;
import de.japkit.roo.base.web.EntityConverterUtil;
i... | package de.japkit.roo.japkit.web;
import org.springframework.format.FormatterRegistrar;
import org.springframework.format.FormatterRegistry;
import de.japkit.annotations.ParamNames;
import de.japkit.metaannotations.Method;
import de.japkit.metaannotations.Template;
import de.japkit.roo.base.web.EntityConverterUtil;
i... |
Hide decryption success dialog from screen recorders
* MOPPAND-610 | package ee.ria.DigiDoc.android.utils.widget;
import android.app.Dialog;
import android.view.WindowManager;
import android.widget.Button;
import android.widget.CheckBox;
import androidx.annotation.NonNull;
import ee.ria.DigiDoc.R;
import ee.ria.DigiDoc.android.Activity;
import ee.ria.DigiDoc.android.utils.SecureUtil;... | package ee.ria.DigiDoc.android.utils.widget;
import android.app.Dialog;
import android.view.WindowManager;
import android.widget.Button;
import android.widget.CheckBox;
import androidx.annotation.NonNull;
import ee.ria.DigiDoc.R;
import ee.ria.DigiDoc.android.Activity;
public class NotificationDialog extends Dialog... |
Print error if it exists | package cli
import (
"bytes"
"testing"
)
func TestFlagC(t *testing.T) {
var in, out, err bytes.Buffer
c := CLI{
In: &in,
Out: &out,
Err: &err,
}
args := []string{"-c", "echo aaa"}
code := c.Run(args)
if code != 0 {
t.Errorf("Run: got %v, want %v", code, 0)
}
if got, want := out.String(), "aaa\n"; g... | package cli
import (
"bytes"
"testing"
)
func TestFlagC(t *testing.T) {
var in, out, err bytes.Buffer
c := CLI{
In: &in,
Out: &out,
Err: &err,
}
args := []string{"-c", "echo aaa"}
code := c.Run(args)
if code != 0 {
t.Errorf("Run: got %v, want %v", code, 0)
}
if got, want := out.String(), "aaa\n"; g... |
Use long instead of Long when appropriate | package cgeo.geocaching;
import java.util.ArrayList;
import java.util.List;
public class cgSearch {
private long id;
private List<String> geocodes = new ArrayList<String>();
public String error = null;
public String url = "";
public String[] viewstates = null;
public int totalCnt = 0;
public cgSearch() {
i... | package cgeo.geocaching;
import java.util.ArrayList;
import java.util.List;
public class cgSearch {
private Long id = null;
private List<String> geocodes = new ArrayList<String>();
public String error = null;
public String url = "";
public String[] viewstates = null;
public int totalCnt = 0;
public cgSearch(... |
Move Journal to it's own repo. | /*
* Copyright (C) 2015 higherfrequencytrading.com
*
* This program 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.
*
* This program is distr... | /*
* Copyright (C) 2015 higherfrequencytrading.com
*
* This program 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.
*
* This program is distr... |
Add to download links ng-csv | var path = require('path');
var rootPath = path.normalize(__dirname + '/../../');
module.exports = {
local: {
baseUrl: 'http://localhost:3030',
db: 'mongodb://localhost/rp_local',
rootPath: rootPath,
port: process.env.PORT || 3030
},
staging : {
baseUrl: 'http://... | var path = require('path');
var rootPath = path.normalize(__dirname + '/../../');
module.exports = {
local: {
baseUrl: 'http://localhost:3051',
db: 'mongodb://localhost/rp_local',
rootPath: rootPath,
port: process.env.PORT || 3051
},
staging : {
baseUrl: 'http://... |
Read datadict file as-is, without type-guessing | import pandas as pd
def load_datadict(filepath, trim_index=True, trim_all=False):
df = pd.read_csv(filepath, index_col=0, dtype=object)
if trim_index:
df.index = df.index.to_series().str.strip()
if trim_all:
df = df.applymap(lambda x: x.strip() if type(x) is str else x)
return df
def i... | import pandas as pd
def load_datadict(filepath, trim_index=True, trim_all=False):
df = pd.read_csv(filepath, index_col=0)
if trim_index:
df.index = df.index.to_series().str.strip()
if trim_all:
df = df.applymap(lambda x: x.strip() if type(x) is str else x)
return df
def insert_rows_at(... |
Add factory to avoid referring to impl classes from other modules | /********************************************************************************
* Copyright (c) 2019 Stephane Bastian
*
* This program and the accompanying materials are made available under the 2
* terms of the Eclipse Public License 2.0 which is available at
* http://www.eclipse.org/legal/epl-2.0.
*
* SPDX-L... | /********************************************************************************
* Copyright (c) 2019 Stephane Bastian
*
* This program and the accompanying materials are made available under the 2
* terms of the Eclipse Public License 2.0 which is available at
* http://www.eclipse.org/legal/epl-2.0.
*
* SPDX-L... |
[Taxon][Image] Add validation for taxon image code uniqueness | <?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.
*/
namespace Sylius\Component\Core\Model;
use Sylius\Component\Resource\Model\CodeAwareInterface;
use Sy... | <?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.
*/
namespace Sylius\Component\Core\Model;
use Sylius\Component\Resource\Model\ResourceInterface;
use Syl... |
Remove code that was causing a problem running syncdb. Code seems to be redundant anyway. | from django.db import models
from django.db.models.signals import post_save
import mimetypes
import wellknown
#
# create default host-meta handler
#
from wellknown.resources import HostMeta
wellknown.register('host-meta', handler=HostMeta(), content_type='application/xrd+xml')
#
# resource model
#
class Resource(mo... | from django.db import models
from django.db.models.signals import post_save
import mimetypes
import wellknown
#
# create default host-meta handler
#
from wellknown.resources import HostMeta
wellknown.register('host-meta', handler=HostMeta(), content_type='application/xrd+xml')
#
# resource model
#
class Resource(mo... |
Test DatadogMetricsBackend against datadog's get_hostname
This fixes tests in Travis since the hostname returned is different | from __future__ import absolute_import
from mock import patch
from datadog.util.hostname import get_hostname
from sentry.metrics.datadog import DatadogMetricsBackend
from sentry.testutils import TestCase
class DatadogMetricsBackendTest(TestCase):
def setUp(self):
self.backend = DatadogMetricsBackend(pr... | from __future__ import absolute_import
import socket
from mock import patch
from sentry.metrics.datadog import DatadogMetricsBackend
from sentry.testutils import TestCase
class DatadogMetricsBackendTest(TestCase):
def setUp(self):
self.backend = DatadogMetricsBackend(prefix='sentrytest.')
@patch('... |
Use enum instead of boolean to hold state. | package dk.kleistsvendsen;
import com.google.inject.Inject;
public class GameTimer implements IGameTimer {
private ITicSource ticSource_;
private long startTic_;
private long pauseTic_;
private enum State {
IDLE,
PAUSED,
RUNNING
}
private State running_;
@Inject
... | package dk.kleistsvendsen;
import com.google.inject.Inject;
public class GameTimer implements IGameTimer {
private ITicSource ticSource_;
private long startTic_;
private long pauseTic_;
private boolean running_;
@Inject
public GameTimer(ITicSource ticSource) {
running_ = false;
... |
Install url from the right place. | import os
from setuptools import setup, find_packages
# Utility function to read the README file.
# Used for the long_description. It's nice, because now 1) we have a top level
# README file and 2) it's easier to type in the README file than to put a raw
# string in below ...
def read(fname):
return open(os.path.... | import os
from setuptools import setup, find_packages
# Utility function to read the README file.
# Used for the long_description. It's nice, because now 1) we have a top level
# README file and 2) it's easier to type in the README file than to put a raw
# string in below ...
def read(fname):
return open(os.path.... |
Split command line tests into individuals | import sys
from px import px
from unittest.mock import patch
@patch('px.px.install')
def test_cmdline_install(mock):
args = ['px', '--install']
px._main(args)
mock.assert_called_once_with(args)
@patch("px.px_top.top")
def test_cmdline_top(mock):
px._main(['px', '--top'])
mock.assert_called_once()... | import sys
from px import px
from unittest.mock import patch
def test_main():
args = ['px', '--install']
with patch("px.px.install") as install_mock:
px._main(args)
install_mock.assert_called_once_with(args)
with patch("px.px_top.top") as top_mock:
px._main(['px', '--top'])
... |
Test using tmp media root | """
Test some of the basic model use cases
"""
from django.test import TestCase
from django.core.files.storage import DefaultStorage
from candidates.tests.helpers import TmpMediaRootMixin
from .factories import PartyFactory, PartyEmblemFactory
class TestPartyModels(TmpMediaRootMixin, TestCase):
def setUp(self):... | """
Test some of the basic model use cases
"""
from django.test import TestCase
from .factories import PartyFactory, PartyEmblemFactory
class TestPartyModels(TestCase):
def setUp(self):
PartyFactory.reset_sequence()
def test_party_str(self):
party = PartyFactory()
self.assertEqual(s... |
Use SHA-256 for the encryption. | package org.sagebionetworks.bridge.crypto;
import org.bouncycastle.jce.provider.BouncyCastleProvider;
import org.jasypt.encryption.StringEncryptor;
import org.jasypt.encryption.pbe.StandardPBEStringEncryptor;
import org.jasypt.salt.RandomSaltGenerator;
public class BridgeEncryptor implements StringEncryptor {
pr... | package org.sagebionetworks.bridge.crypto;
import org.bouncycastle.jce.provider.BouncyCastleProvider;
import org.jasypt.encryption.StringEncryptor;
import org.jasypt.encryption.pbe.StandardPBEStringEncryptor;
import org.jasypt.salt.RandomSaltGenerator;
public class BridgeEncryptor implements StringEncryptor {
pr... |
Move to generated tracker name
Change-Id: I1ac24a9278fcfc3a0cc81add5fede9f2435c17ef | /*
* Copyright Google Inc. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable l... | /*
* Copyright Google Inc. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable l... |
Rename test for Publish operator. | package Publish
import (
"runtime"
"testing"
"time"
"github.com/stretchr/testify/assert"
)
func TestPublishRefCount(t *testing.T) {
scheduler := NewGoroutine()
ch := make(chan int, 30)
s := FromChanInt(ch).Publish().RefCount().SubscribeOn(scheduler)
a := []int{}
b := []int{}
asub := s.SubscribeNext(func(n ... | package Publish
import (
"runtime"
"testing"
"time"
"github.com/stretchr/testify/assert"
)
func TestShare(t *testing.T) {
scheduler := NewGoroutine()
ch := make(chan int, 30)
s := FromChanInt(ch).Publish().RefCount().SubscribeOn(scheduler)
a := []int{}
b := []int{}
asub := s.SubscribeNext(func(n int) { a =... |
Refactor a lightweight Mock class. | import unittest
from event import Event
class Mock:
def __init__(self):
self.called = False
self.params = ()
def __call__(self, *args, **kwargs):
self.called = True
self.params = (args, kwargs)
class EventTest(unittest.TestCase):
def test_a_listener_is_notified_when_even... | import unittest
from event import Event
class EventTest(unittest.TestCase):
def test_a_listener_is_notified_when_event_is_raised(self):
called = False
def listener():
nonlocal called
called = True
event = Event()
event.connect(listener)
event.fire(... |
Move drawing manager call to be in front of the background | var p5 = require('p5');
var sketch = function (p) {
var Receiver = require('./Receiver.js');
var receiver = new Receiver();
var Processor = require('./Processor.js');
var processor = new Processor();
var DrawingManager = require('./DrawingManager.js');
var dM = new DrawingManager(p);
p.setup = functi... | var p5 = require('p5');
var sketch = function (p) {
var Receiver = require('./Receiver.js');
var receiver = new Receiver();
var Processor = require('./Processor.js');
var processor = new Processor();
var DrawingManager = require('./DrawingManager.js');
var dM = new DrawingManager(p);
p.setup = functi... |
Fix the config table seeder
It should include the "extensions_enabled" key which is read
when initializing all extensions. | <?php namespace Flarum\Core\Seeders;
use Illuminate\Database\Seeder;
use DB;
class ConfigTableSeeder extends Seeder
{
/**
* Run the database seeds.
*
* @return void
*/
public function run()
{
$config = [
'api_url' => 'http://flarum.dev/api',
... | <?php namespace Flarum\Core\Seeders;
use Illuminate\Database\Seeder;
use DB;
class ConfigTableSeeder extends Seeder
{
/**
* Run the database seeds.
*
* @return void
*/
public function run()
{
$config = [
'api_url' => 'http://flarum.dev/api',
'b... |
Handle invalid client credentials properly. | <?php
namespace Northstar\Auth\Repositories;
use League\OAuth2\Server\Repositories\ClientRepositoryInterface;
use Northstar\Auth\Entities\ClientEntity;
use Northstar\Models\Client;
class ClientRepository implements ClientRepositoryInterface
{
/**
* Get a client.
*
* @param string $clientIdentifier... | <?php
namespace Northstar\Auth\Repositories;
use League\OAuth2\Server\Repositories\ClientRepositoryInterface;
use Northstar\Auth\Entities\ClientEntity;
use Northstar\Models\Client;
class ClientRepository implements ClientRepositoryInterface
{
/**
* Get a client.
*
* @param string $clientIdentifier... |
Tidy up the PHP version message | <?php
/*
Plugin Name: Comment Timeout
Plugin URI: http://bitbucket.org/jammycakes/comment-timeout/
Description: Automatically closes comments on blog entries after a user-configurable period of time. It has options which allow you to keep the discussion open for longer on older posts which have had recent comments ... | <?php
/*
Plugin Name: Comment Timeout
Plugin URI: http://bitbucket.org/jammycakes/comment-timeout/
Description: Automatically closes comments on blog entries after a user-configurable period of time. It has options which allow you to keep the discussion open for longer on older posts which have had recent comments ... |
Remove unused dining API method | package com.pennapps.labs.pennmobile.api;
import com.squareup.okhttp.OkHttpClient;
import com.squareup.okhttp.Request;
import com.squareup.okhttp.Response;
import org.json.JSONException;
import org.json.JSONObject;
import java.io.IOException;
public class DiningAPI {
protected OkHttpClient client;
protecte... | package com.pennapps.labs.pennmobile.api;
import com.squareup.okhttp.OkHttpClient;
import com.squareup.okhttp.Request;
import com.squareup.okhttp.Response;
import org.json.JSONException;
import org.json.JSONObject;
import java.io.IOException;
public class DiningAPI {
protected OkHttpClient client;
protecte... |
Test fixes and style adjustments | var test = require('tape')
var es2015 = require('babel-preset-es2015')
var es2015Loose = require('../index')
var LOOSE = {loose: true}
var PREFIX = 'transform-es2015-'
var SHOULD_BE_LOOSE = [
PREFIX + 'template-literals',
PREFIX + 'classes',
PREFIX + 'computed-properties',
PREFIX + 'for-of',
PREFIX + 'spread',
... | var test = require('tape'),
es2015 = require('babel-preset-es2015'),
es2015Loose = require('..');
var LOOSE = { loose: true };
var PREFIX = 'transform-es2015-';
var SHOULD_BE_LOOSE = [
PREFIX+'template-literals',
PREFIX+'classes',
PREFIX+'computed-properties',
PREFIX+'for-of',
PREFIX+'spread',
PREFIX+'destru... |
Fix default template of order received notification
Order lines were rendered on a single line. Fix that by adding a line
break after each order line. | # -*- coding: utf-8 -*-
# This file is part of Shoop.
#
# Copyright (c) 2012-2015, Shoop Ltd. All rights reserved.
#
# This source code is licensed under the AGPLv3 license found in the
# LICENSE file in the root directory of this source tree.
MESSAGE_SUBJECT_TEMPLATE = "{{ order.shop }} - Order {{ order.identifier }}... | # -*- coding: utf-8 -*-
# This file is part of Shoop.
#
# Copyright (c) 2012-2015, Shoop Ltd. All rights reserved.
#
# This source code is licensed under the AGPLv3 license found in the
# LICENSE file in the root directory of this source tree.
MESSAGE_SUBJECT_TEMPLATE = "{{ order.shop }} - Order {{ order.identifier }}... |
Remove name since it's redundant, show just asset name and download count | document.getElementById("ayuda").setAttribute("aria-current", "page");
var aside = document.getElementById("complementario");
var form = document.createElement("FORM");
var p = document.createElement("P");
var label = document.createElement("LABEL");
label.setAttribute("for", "repo");
t = document.createTextNode("cue... | document.getElementById("ayuda").setAttribute("aria-current", "page");
var aside = document.getElementById("complementario");
var form = document.createElement("FORM");
var p = document.createElement("P");
var label = document.createElement("LABEL");
label.setAttribute("for", "repo");
t = document.createTextNode("cue... |
Add license and Source Code url | from distutils.core import setup
setup(name="zutil",
version='0.1.5',
description="Utilities used for generating zCFD control dictionaries",
author="Zenotech",
author_email="support@zenotech.com",
license="MIT",
url="https://zcfd.zenotech.com/",
project_urls={
"Sourc... | from distutils.core import setup
setup(name="zutil",
version='0.1.5',
description="Utilities used for generating zCFD control dictionaries",
author="Zenotech",
author_email="support@zenotech.com",
url="https://zcfd.zenotech.com/",
packages=["zutil", "zutil.post", "zutil.analysis", "... |
Change the name in the javascript plugin to the correct name from the native code | /*global cordova, module*/
var exec = require("cordova/exec")
var JWTAuth = {
/*
* Returns the stored user email.
* Can return null if the user is not signed in.
*/
getUserEmail: function (successCallback, errorCallback) {
exec(successCallback, errorCallback, "JWTAuth", "getUserEmail", ... | /*global cordova, module*/
var exec = require("cordova/exec")
var JWTAuth = {
/*
* Returns the stored user email.
* Can return null if the user is not signed in.
*/
getUserEmail: function (successCallback, errorCallback) {
exec(successCallback, errorCallback, "JWTAuth", "getSignedInEmai... |
[ADD] Add /login as a valid route during the race | import React from 'react';
import { BrowserRouter, Switch, Route, Redirect } from 'react-router-dom';
import NotFoundPage from '../../../pages/NotFound';
import AppContainer from '../../../../../../lib/react/components/AppContainer';
import Login from '../../components/Login';
import Dashboard from './Dashboard';
cla... | import React from 'react';
import { BrowserRouter, Switch, Route, Redirect } from 'react-router-dom';
import NotFoundPage from '../../../pages/NotFound';
import AppContainer from '../../../../../../lib/react/components/AppContainer';
import Login from '../../components/Login';
import Dashboard from './Dashboard';
cla... |
Remove pointless converting of arguments object to an array since alert.js doesn't seem to care that it's not really an array. | var EXPORTED_SYMBOLS = ["GM_notification"];
var Cc = Components.classes;
var Ci = Components.interfaces;
// The first time this runs, we check if nsIAlertsService is installed and
// works. If it fails, we re-define notify to use a chrome window.
// We check to see if nsIAlertsService works because of the case where ... | var EXPORTED_SYMBOLS = ["GM_notification"];
var Cc = Components.classes;
var Ci = Components.interfaces;
// The first time this runs, we check if nsIAlertsService is installed and
// works. If it fails, we re-define notify to use a chrome window.
// We check to see if nsIAlertsService works because of the case where ... |
Allow to override the controller used for excetion handling | <?php
namespace Flint\Provider;
use Symfony\Component\HttpKernel\EventListener\ExceptionListener;
use Flint\Controller\ControllerResolver;
use Silex\Application;
/**
* @package Flint
*/
class FlintServiceProvider implements \Silex\ServiceProviderInterface
{
/**
* {@inheritDoc}
*/
public function ... | <?php
namespace Flint\Provider;
use Symfony\Component\HttpKernel\EventListener\ExceptionListener;
use Flint\Controller\ControllerResolver;
use Silex\Application;
/**
* @package Flint
*/
class FlintServiceProvider implements \Silex\ServiceProviderInterface
{
/**
* {@inheritDoc}
*/
public function ... |
Implement backport of logging package for 2.6
debugging 3 | import logging
from logging import *
class Logger(logging.Logger):
def getChild(self, suffix):
"""
(copied from module "logging" for Python 3.4)
Get a logger which is a descendant to this one.
This is a convenience method, such that
logging.getLogger('abc').getChild('de... | import logging
from logging import *
class Logger26(logging.getLoggerClass()):
def getChild(self, suffix):
"""
(copied from module "logging" for Python 3.4)
Get a logger which is a descendant to this one.
This is a convenience method, such that
logging.getLogger('abc').... |
Remove unused numpy input (codacy) | #!/usr/bin/env python3
"""
Utilities to compute the power of a device
"""
from UliEngineering.EngineerIO import normalize_numeric
from UliEngineering.Units import Unit
__all__ = ["current_by_power", "power_by_current_and_voltage"]
def current_by_power(power="25 W", voltage="230 V") -> Unit("A"):
"""
Given a d... | #!/usr/bin/env python3
"""
Utilities to compute the power of a device
"""
from UliEngineering.EngineerIO import normalize_numeric
from UliEngineering.Units import Unit
import numpy as np
__all__ = ["current_by_power", "power_by_current_and_voltage"]
def current_by_power(power="25 W", voltage="230 V") -> Unit("A"):
... |
Set DEBUG = False in production | from local_settings import *
DEBUG = False
ALLOWED_HOSTS = ['uchicagohvz.org']
# Database
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.postgresql_psycopg2', # Add 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'.
'NAME': 'uchicagohvz', # Or path... | from local_settings import *
settings.DEBUG = False
ALLOWED_HOSTS = ['uchicagohvz.org']
# Database
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.postgresql_psycopg2', # Add 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'.
'NAME': 'uchicagohvz', ... |
Convert into a class to match the other handlers. | # This is a software index handler that gives a score based on the
# number of mentions in open access articles. It uses the CORE
# aggregator (http://core.ac.uk/) to search the full text of indexed
# articles.
#
# Inputs:
# - identifier (String)
#
# Outputs:
# - score (Number)
# - description (String)
import reque... | import requests, json, urllib
SEARCH_URL = 'http://core.kmi.open.ac.uk/api/search/'
API_KEY = 'FILL THIS IN'
def getCOREMentions(identifier, **kwargs):
"""Return the number of mentions in CORE and a descriptor, as a tuple.
Needs an API key, which can be obtained here: http://core.ac.uk/api-keys/register"... |
Increment version to 1.0.5. Resync code base after machine crash. | import sys
import os
from setuptools import setup
long_description = open('README.rst').read()
classifiers = [
'Development Status :: 4 - Beta',
'License :: OSI Approved :: BSD License',
'Programming Language :: Python :: 2',
'Programming Language :: Python :: 2.7',
'Programming Language :: Pytho... | import sys
import os
from setuptools import setup
long_description = open('README.rst').read()
classifiers = [
'Development Status :: 4 - Beta',
'License :: OSI Approved :: BSD License',
'Programming Language :: Python :: 2',
'Programming Language :: Python :: 2.7',
'Programming Language :: Pytho... |
Increase time between channel topic updates | package net.dirtydeeds.discordsoundboard.async;
import net.dirtydeeds.discordsoundboard.service.SoundboardBot;
import net.dirtydeeds.discordsoundboard.utils.*;
public class PeriodicLambdas {
public static PeriodicLambdaJob askForDonation() {
return new PeriodicLambdaJob(Reusables::sendDonationMessage, Periodic... | package net.dirtydeeds.discordsoundboard.async;
import net.dirtydeeds.discordsoundboard.service.SoundboardBot;
import net.dirtydeeds.discordsoundboard.utils.*;
public class PeriodicLambdas {
public static PeriodicLambdaJob askForDonation() {
return new PeriodicLambdaJob(Reusables::sendDonationMessage, Periodic... |
Enable security for OPTIONS to anyone | package vaccination.security;
import org.springframework.stereotype.Component;
import javax.servlet.*;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
@Component
public class SimpleCORSFilter implements Filter {
public void doFilter(ServletRequest req, ServletResponse res, FilterChain... | package vaccination.security;
import org.springframework.stereotype.Component;
import javax.servlet.*;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
@Component
public class SimpleCORSFilter implements Filter {
public void doFilter(ServletRequest req, ServletResponse res, FilterChain... |
Extend from image instead of sprite | import Phaser from 'phaser';
import { tile, nextTile, alignToGrid, pixelToTile } from '../../tiles';
import { clone } from '../../utils';
import tween from './tween';
export default class extends Phaser.Image {
constructor(game, x, y, sprite, frame, id, objectType) {
const alignedCoords = alignToGrid({ x, y })... | import Phaser from 'phaser';
import { tile, nextTile, alignToGrid, pixelToTile } from '../../tiles';
import { clone } from '../../utils';
import tween from './tween';
export default class extends Phaser.Sprite {
constructor(game, x, y, sprite, frame, id, objectType) {
const alignedCoords = alignToGrid({ x, y }... |
Add a long type backfill for PY3 compat
PY3 combined the long and int types which makes some compiler
operations difficult. Adding a backfill to help with PY2/PY3
compat.
Signed-off-by: Kevin Conway <3473c1f185ca03eadc40ad288d84425b54fd7d57@gmail.com> | """Compatibility helpers for Py2 and Py3."""
from __future__ import division
from __future__ import absolute_import
from __future__ import print_function
from __future__ import unicode_literals
import sys
class VERSION(object):
"""Stand in for sys.version_info.
The values from sys only have named parameter... | """Compatibility helpers for Py2 and Py3."""
from __future__ import division
from __future__ import absolute_import
from __future__ import print_function
from __future__ import unicode_literals
import sys
class VERSION(object):
"""Stand in for sys.version_info.
The values from sys only have named parameter... |
Move config HTML generation to separate helper function. | <?php
/**
* @file
* Contains linclark\MicrodataPhpTest
*/
namespace linclark\MicrodataPHP;
/**
* Tests the MicrodataPHP functionality.
*/
class MicrodataPhpTest extends \PHPUnit_Framework_TestCase {
/**
* Tests parsing a sample html document.
*/
public function testParseMicroData() {
$config = $t... | <?php
/**
* @file
* Contains linclark\MicrodataPhpTest
*/
namespace linclark\MicrodataPHP;
/**
* Tests the MicrodataPHP functionality.
*/
class MicrodataPhpTest extends \PHPUnit_Framework_TestCase {
/**
* Tests parsing a sample html document.
*/
public function testParseMicroData() {
$config = ar... |
Add default tabbar as null | /* eslint-disable react/forbid-prop-types */
import React, { useEffect, useRef } from 'react';
import PropTypes from 'prop-types';
import { useNavigation } from '@react-navigation/native';
import { createBottomTabNavigator } from '@react-navigation/bottom-tabs';
const DEFAULT_TAB_CONFIG = { options: { tabBarVisible: f... | /* eslint-disable react/forbid-prop-types */
import React, { useEffect, useRef } from 'react';
import PropTypes from 'prop-types';
import { useNavigation } from '@react-navigation/native';
import { createBottomTabNavigator } from '@react-navigation/bottom-tabs';
const DEFAULT_TAB_CONFIG = { options: { tabBarVisible: f... |
Use from_date to construct from year, month, day. | from datetime import date, timedelta
class DateWithCalendar(object):
def __init__(self, calendar_class, date):
self.calendar = calendar_class
self.date = date
def convert_to(self, calendar):
return calendar.from_date(self.date)
def __eq__(self, other):
return self.calendar... | from datetime import date, timedelta
class DateWithCalendar(object):
def __init__(self, calendar_class, date):
self.calendar = calendar_class
self.date = date
def convert_to(self, calendar):
return calendar.from_date(self.date)
def __eq__(self, other):
return self.calendar... |
Update code style of doc generator | const fs = require('fs');
const markdox = require('markdox');
const sources = [
'../src/index.js',
'../src/apis/users.js',
'../src/apis/organizations.js',
'../src/apis/memberships.js',
'../src/apis/sourceimages.js',
'../src/apis/operations.js',
'../src/apis/stacks.js',
'../src/apis/render.js'
];
const ... | var fs = require('fs')
, markdox = require('markdox');
var sources = [
'../src/index.js',
'../src/apis/users.js',
'../src/apis/organizations.js',
'../src/apis/memberships.js',
'../src/apis/sourceimages.js',
'../src/apis/operations.js',
'../src/apis/stacks.js',
'../src/apis/render.js'
... |
Make request executor not follow redirects | import { Map } from 'immutable';
const httpClient = {request: require('request')};
class Response {
body:?string;
headers:Map;
status:number;
statusText:string;
responseTimeMs:number;
constructor(body, headers, status, statusText, responseTimeMs) {
this.body = body;
this.headers = new Map(headers)... | import { Map } from 'immutable';
const httpClient = {request: require('request')};
class Response {
body:?string;
headers:Map;
status:number;
statusText:string;
responseTimeMs:number;
constructor(body, headers, status, statusText, responseTimeMs) {
this.body = body;
this.headers = new Map(headers)... |
Refactor code based on PR comments. | import React, { Component } from 'react'
import ResponseFields from './ResponseFields.js'
export default class ResponseList extends Component {
render () {
return (
<div className="response-list">
{ this.props.responses.map(response => (<ResponseFields
response={response}
... | import React, { Component } from 'react'
import ResponseFields from './ResponseFields.js'
export default class ResponseList extends Component {
render () {
return (
<div className="response-list">
{ this.props.responses.map(response => {
return (<ResponseFields
response={... |
Replace version with a placeholder for develop | package main
import (
"github.com/albrow/scribble/util"
"gopkg.in/alecthomas/kingpin.v1"
"os"
)
var (
app = kingpin.New("scribble", "A tiny static blog generator written in go.")
serveCmd = app.Command("serve", "Compile and serve the site.")
servePort = serveCmd.Flag("port", "The port on which to serve the si... | package main
import (
"github.com/albrow/scribble/util"
"gopkg.in/alecthomas/kingpin.v1"
"os"
)
var (
app = kingpin.New("scribble", "A tiny static blog generator written in go.")
serveCmd = app.Command("serve", "Compile and serve the site.")
servePort = serveCmd.Flag("port", "The port on which to serve the si... |
Add extra inner wrapper which has a 'flex: 1' | import React, { PureComponent } from 'react';
import cx from 'classnames';
import PropTypes from 'prop-types';
import { Box } from '../box';
import theme from './theme.css';
class ScrollContainer extends PureComponent {
render() {
const { className, header, body, footer, ...others } = this.props;
const clas... | import React, { PureComponent } from 'react';
import cx from 'classnames';
import PropTypes from 'prop-types';
import { Box } from '../box';
import theme from './theme.css';
class ScrollContainer extends PureComponent {
render() {
const { className, header, body, footer, ...others } = this.props;
const clas... |
Change don't device orientation lock at the time of run | (function() {
'use strict';
angular.module('sensors.components')
.controller('MenuController', MenuController);
function MenuController($scope, $window, menuItems, openLinkTobrowser) {
$scope.items = [];
$scope.isLock = false;
$scope.screen = $window.screen;
$scope.openLink = openLinkTobrow... | (function() {
'use strict';
angular.module('sensors.components')
.controller('MenuController', MenuController);
function MenuController($scope, $window, menuItems, openLinkTobrowser) {
$scope.items = [];
$scope.isLock = true;
$scope.screen = $window.screen;
$scope.openLink = openLinkTobrows... |
Build constraints for cairo packages should be based on cairo-naming, not use pango-naming. | // +build !cairo_1_10,!cairo_1_12,!cairo_1_14
package cairo
// #include <stdlib.h>
// #include <cairo.h>
// #include <cairo-gobject.h>
import "C"
import (
"unsafe"
)
// GetVariations is a wrapper around cairo_font_options_get_variations().
func (o *FontOptions) GetVariations() string {
return C.GoString(C.cairo_fo... | // +build !pango_1_10,!pango_1_12,!pango_1_14
package cairo
// #include <stdlib.h>
// #include <cairo.h>
// #include <cairo-gobject.h>
import "C"
import (
"unsafe"
)
// GetVariations is a wrapper around cairo_font_options_get_variations().
func (o *FontOptions) GetVariations() string {
return C.GoString(C.cairo_fo... |
Add alert for posted comment | <?php
use Laracasts\Commander\CommanderTrait;
use Nook\Statuses\LeaveCommentOnStatusCommand;
use Nook\Forms\LeaveCommentForm;
/**
* Class CommentsController
*/
class CommentsController extends BaseController
{
use CommanderTrait;
/**
* @var LeaveCommentForm
*/
protected $leaveCommentFormForm;... | <?php
use Laracasts\Commander\CommanderTrait;
use Nook\Statuses\LeaveCommentOnStatusCommand;
use Nook\Forms\LeaveCommentForm;
/**
* Class CommentsController
*/
class CommentsController extends BaseController
{
use CommanderTrait;
/**
* @var LeaveCommentForm
*/
protected $leaveCommentFormForm;... |
Add FIXME note in recursive reduction rule node. | package org.metaborg.meta.lang.dynsem.interpreter.nodes.rules;
import org.metaborg.meta.lang.dynsem.interpreter.nodes.rules.premises.Premise;
import com.oracle.truffle.api.frame.FrameDescriptor;
import com.oracle.truffle.api.frame.VirtualFrame;
import com.oracle.truffle.api.profiles.BranchProfile;
import com.oracle.t... | package org.metaborg.meta.lang.dynsem.interpreter.nodes.rules;
import org.metaborg.meta.lang.dynsem.interpreter.nodes.rules.premises.Premise;
import com.oracle.truffle.api.frame.FrameDescriptor;
import com.oracle.truffle.api.frame.VirtualFrame;
import com.oracle.truffle.api.profiles.BranchProfile;
import com.oracle.t... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.