text stringlengths 16 4.96k | positive stringlengths 321 2.24k | negative stringlengths 310 2.21k |
|---|---|---|
Disable most Nova functions for DuesTransactions | <?php
namespace App\Policies;
use App\User;
use App\DuesTransaction;
use Illuminate\Auth\Access\HandlesAuthorization;
class DuesTransactionPolicy
{
use HandlesAuthorization;
public function view(User $user, DuesTransaction $resource)
{
return $user->can('read-dues-transactions');
}
publ... | <?php
namespace App\Policies;
use App\User;
use App\DuesTransaction;
use Illuminate\Auth\Access\HandlesAuthorization;
class DuesTransactionPolicy
{
use HandlesAuthorization;
public function view(User $user, DuesTransaction $resource)
{
return $user->can('read-dues-transactions');
}
publ... |
Flyway: Fix Scanner constructor substitution for Flyway 7.9.0 | package io.quarkus.flyway.runtime.graal;
import java.nio.charset.Charset;
import java.util.Collection;
import org.flywaydb.core.api.Location;
import org.flywaydb.core.internal.scanner.LocationScannerCache;
import org.flywaydb.core.internal.scanner.ResourceNameCache;
import com.oracle.svm.core.annotate.Substitute;
im... | package io.quarkus.flyway.runtime.graal;
import java.nio.charset.Charset;
import java.util.Collection;
import org.flywaydb.core.api.Location;
import org.flywaydb.core.internal.scanner.LocationScannerCache;
import org.flywaydb.core.internal.scanner.ResourceNameCache;
import com.oracle.svm.core.annotate.Substitute;
im... |
Add a link in doc. | /*
* Copyright 2018, TeamDev. All rights reserved.
*
* Redistribution and use in source and/or binary forms, with or without
* modification, must retain the above copyright notice and the following
* disclaimer.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR... | /*
* Copyright 2018, TeamDev. All rights reserved.
*
* Redistribution and use in source and/or binary forms, with or without
* modification, must retain the above copyright notice and the following
* disclaimer.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR... |
Call the new findByDates method | package <%=packageName%>.service;
import <%=packageName%>.config.audit.AuditEventConverter;
import <%=packageName%>.domain.PersistentAuditEvent;
import <%=packageName%>.repository.PersistenceAuditEventRepository;
import org.joda.time.LocalDateTime;
import org.springframework.boot.actuate.audit.AuditEvent;
import org.s... | package <%=packageName%>.service;
import <%=packageName%>.config.audit.AuditEventConverter;
import <%=packageName%>.domain.PersistentAuditEvent;
import <%=packageName%>.repository.PersistenceAuditEventRepository;
import org.joda.time.LocalDateTime;
import org.springframework.boot.actuate.audit.AuditEvent;
import org.s... |
Allow quitting the application with SIGINT (Ctrl-C) | # -*- coding: utf-8 -*-
import util.colored_exceptions
from gui import main_window
from core import volumes, control
from PySide import QtGui
from PySide import QtCore
import signal
import sys
import os
import core.calculation
if __name__ == '__main__':
app = QtGui.QApplication(sys.argv)
control = control.Con... | # -*- coding: utf-8 -*-
import util.colored_exceptions
from gui import main_window
from core import volumes, control
from PySide import QtGui
import sys
import os
import core.calculation
if __name__ == '__main__':
app = QtGui.QApplication(sys.argv)
control = control.Control()
window = main_window.MainWind... |
Change input box to <form> to enable search with Enter key. | /**
* Poster v0.1.0
* A React webapp to list upcoming movies and maintain a watchlist, powered by TMDb
*
* Author: Kushal Pandya <kushalspandya@gmail.com> (https://doublslash.com)
* Date: 13 June, 2016
* License: MIT
*
* Section > Home -> [ SearchBox ]
*/
import React from "react";
export default
class Searc... | /**
* Poster v0.1.0
* A React webapp to list upcoming movies and maintain a watchlist, powered by TMDb
*
* Author: Kushal Pandya <kushalspandya@gmail.com> (https://doublslash.com)
* Date: 13 June, 2016
* License: MIT
*
* Section > Home -> [ SearchBox ]
*/
import React from "react";
export default
class Searc... |
Set default value for lasteditor | <?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class AddLasteditorGeodataLiterature extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('geod... | <?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class AddLasteditorGeodataLiterature extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('geod... |
Update the default value for the header cta link to be an empty string instead of a hash. | /**
* WidgetHeaderCTA component.
*
* Site Kit by Google, Copyright 2021 Google LLC
*
* 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
*
* https://www.apache.org/licenses/LICENSE-2.0... | /**
* WidgetHeaderCTA component.
*
* Site Kit by Google, Copyright 2021 Google LLC
*
* 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
*
* https://www.apache.org/licenses/LICENSE-2.0... |
Add Python 2.6 to classifiers | from setuptools import setup, find_packages
setup(
name='pymediainfo',
version='2.1.5',
author='Louis Sautier',
author_email='sautier.louis@gmail.com',
url='https://github.com/sbraz/pymediainfo',
description="""A Python wrapper for the mediainfo library.""",
packages=find_packages(),
na... | from setuptools import setup, find_packages
setup(
name='pymediainfo',
version='2.1.5',
author='Louis Sautier',
author_email='sautier.louis@gmail.com',
url='https://github.com/sbraz/pymediainfo',
description="""A Python wrapper for the mediainfo library.""",
packages=find_packages(),
na... |
Fix iPhone/iPad not triggering click event | const userAgent = navigator.userAgent.toLowerCase()
const event = userAgent.match(/(iphone|ipod|ipad)/) ? "touchstart" : "click"
const directive = {
instances: []
}
directive.onEvent = function (event) {
directive.instances.forEach(({ el, fn }) => {
if (event.target !== el && !el.contains(event.target)) {
... | const directive = {
instances: []
}
directive.onEvent = function (event) {
directive.instances.forEach(({ el, fn }) => {
if (event.target !== el && !el.contains(event.target)) {
fn && fn(event)
}
})
}
directive.bind = function (el) {
directive.instances.push({ el, fn: null })
if (directive.ins... |
Use stream while reading file | 'use strict';
/**
* @file Hydrate the file from scratch.
* Download it from Cluestr, save it to local storage, run tika and returns the result.
*
* This helper is used in the server queue.
*/
var async = require('async');
var request = require('request');
var crypto = require('crypto');
var fs = require('fs');
... | 'use strict';
/**
* @file Hydrate the file from scratch.
* Download it from Cluestr, save it to local storage, run tika and returns the result.
*
* This helper is used in the server queue.
*/
var async = require('async');
var request = require('request');
var crypto = require('crypto');
var fs = require('fs');
... |
Use bodyParser.json() instead of bodyParser itself.
See: http://stackoverflow.com/questions/24330014/bodyparser-is-deprecated-express-4 | var express = require('express');
var bodyParser = require('body-parser');
var methodOverride = require('method-override');
var serveStatic = require('serve-static');
var errorhandler = require('errorhandler');
var less = require('less-middleware');
var path = require('path');
exports.register = function(application, ... | var express = require('express');
var bodyParser = require('body-parser');
var methodOverride = require('method-override');
var serveStatic = require('serve-static');
var errorhandler = require('errorhandler');
var less = require('less-middleware');
var path = require('path');
exports.register = function(application, ... |
Update email task test for members | from app.na_celery.email_tasks import send_emails
class WhenProcessingSendEmailsTask:
def it_calls_send_email_to_task(self, mocker, db, db_session, sample_email, sample_member):
mock_send_email = mocker.patch('app.na_celery.email_tasks.send_email', return_value=200)
send_emails(sample_email.id)
... | from app.na_celery.email_tasks import send_emails
class WhenProcessingSendEmailsTask:
def it_calls_send_email_to_task(self, mocker, db, db_session, sample_admin_user, sample_email):
mock_send_email = mocker.patch('app.na_celery.email_tasks.send_email')
send_emails(sample_email.id)
assert... |
Fix array out of bounds bug | package core.commands;
import core.Constants;
import core.entities.QueueManager;
import core.entities.Server;
import core.exceptions.BadArgumentsException;
import core.exceptions.DoesNotExistException;
import core.util.Utils;
import net.dv8tion.jda.core.entities.Member;
public class CmdDeleteNotification extends Comm... | package core.commands;
import core.Constants;
import core.entities.QueueManager;
import core.entities.Server;
import core.exceptions.BadArgumentsException;
import core.exceptions.DoesNotExistException;
import core.util.Utils;
import net.dv8tion.jda.core.entities.Member;
public class CmdDeleteNotification extends Comm... |
Add missing method for empty panel | /**
* Empty panel which is shown when no data object is selected.
* @class
*/
export default class EmptyDetailPanel {
constructor(rootElement, rb) {
this.rootElement = rootElement;
this.rb = rb;
}
render() {
let panel = $('#rbro_detail_panel');
$('#rbro_detail_panel').app... | /**
* Empty panel which is shown when no data object is selected.
* @class
*/
export default class EmptyDetailPanel {
constructor(rootElement, rb) {
this.rootElement = rootElement;
this.rb = rb;
}
render() {
let panel = $('#rbro_detail_panel');
$('#rbro_detail_panel').app... |
Implement ucFirst() to pass test | /**
* 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);
};
/... |
Move the package as well as the group | package net.stickycode.resource.stereotype;
import net.stickycode.stereotype.ConfiguredComponent;
/**
* Interface used to mark of point where an external resource should be injected.
*
* <pre>
* @Configured
* private Resource<String> helpText;
*
* @Configured
* private Resource<Properties> decodeM... | package net.stickycode.stereotype.resource;
import net.stickycode.stereotype.ConfiguredComponent;
/**
* Interface used to mark of point where an external resource should be injected.
*
* <pre>
* @Configured
* private Resource<String> helpText;
*
* @Configured
* private Resource<Properties> decodeM... |
Use Set.removeAll instead my own loop. | package mccoyst;
import java.io.*;
import java.util.*;
import org.objectweb.asm.*;
public class App{
public static void main(String[] args) throws Exception{
if(args.length < 2){
System.err.println("I need the names of two class files.");
System.exit(1);
}
InputStream a = new FileInputStream(args[0]... | package mccoyst;
import java.io.*;
import java.util.*;
import org.objectweb.asm.*;
public class App{
public static void main(String[] args) throws Exception{
if(args.length < 2){
System.err.println("I need the names of two class files.");
System.exit(1);
}
InputStream a = new FileInputStream(args[0]... |
Remove github link from 'install_requires' | from setuptools import setup
setup(
name='firetv',
version='1.0.5.dev',
description='Communicate with an Amazon Fire TV device via ADB over a network.',
url='https://github.com/happyleavesaoc/python-firetv/',
license='MIT',
author='happyleaves',
author_email='happyleaves.tfr@gmail.com',
... | from setuptools import setup
setup(
name='firetv',
version='1.0.5.dev',
description='Communicate with an Amazon Fire TV device via ADB over a network.',
url='https://github.com/happyleavesaoc/python-firetv/',
license='MIT',
author='happyleaves',
author_email='happyleaves.tfr@gmail.com',
... |
Fix class name, got it totally wrong. | <?php
/**
* An exception for ZendExt_Db_Dao_Select.
*
* @category ZendExt
* @package ZendExt_Db_Dao
* @copyright 2010 Juan Sotuyo
* @license Copyright (C) 2010. All rights reserved.
* @version Release: 1.0.0
* @link http://www.zendext.com/
* @since 1.0.0
*/
/**
* An exception for ZendExt_Db_... | <?php
/**
* An exception for Zend_Db_Dao_Select.
*
* @category ZendExt
* @package ZendExt_Db_Dao
* @copyright 2010 Juan Sotuyo
* @license Copyright (C) 2010. All rights reserved.
* @version Release: 1.0.0
* @link http://www.zendext.com/
* @since 1.0.0
*/
/**
* An exception for Zend_Db_Dao_Se... |
Disable django debug toolbar until wagtail 1.12 is released
see https://github.com/jazzband/django-debug-toolbar/issues/950 for
reference | from .base import *
# SECURITY WARNING: don't run with debug turned on in production!
DEBUG = True
for template_engine in TEMPLATES:
template_engine['OPTIONS']['debug'] = True
# SECURITY WARNING: keep the secret key used in production secret!
SECRET_KEY = 'qid$h1o8&wh#p(j)lifis*5-rf@lbiy8%^3l4x%@b$z(tli@ab'
# F... | from .base import *
# SECURITY WARNING: don't run with debug turned on in production!
DEBUG = True
for template_engine in TEMPLATES:
template_engine['OPTIONS']['debug'] = True
# SECURITY WARNING: keep the secret key used in production secret!
SECRET_KEY = 'qid$h1o8&wh#p(j)lifis*5-rf@lbiy8%^3l4x%@b$z(tli@ab'
tr... |
Add support for the patching connection and the prefix through config dict | from boto.dynamodb2.layer1 import DynamoDBConnection
from .model import Model
def patch_from_config(config):
if 'DYNAMODB_CONNECTION' in config:
patch_dynamodb_connection(**config['DYNAMODB_CONNECTION'])
if 'DYNAMODB_PREFIX' in config:
patch_table_name_prefix(config['DYNAMODB_PREFIX'])
def ... | from boto.dynamodb2.layer1 import DynamoDBConnection
from .model import Model
def patch_dynamodb_connection(**kwargs):
""":class:`boto.dynamodb2.layer1.DynamoDBConnection` patcher.
It partially applies the keyword arguments to the
:class:`boto.dynamodb2.layer1.DynamoDBConnection` initializer method.
... |
Add Extra Cache Headers To Build Badge Response
Add extra cache prevention headers to the build badge response. This should help
reduce caching on GitHub README's. | import path from 'path';
import logging from '../logging';
const logger = logging.getLogger('express');
import {
internalFindSnap,
internalGetSnapBuilds
} from './launchpad';
import { getGitHubRepoUrl } from '../../common/helpers/github-url';
import { snapBuildFromAPI } from '../../common/helpers/snap-builds';
c... | import path from 'path';
import logging from '../logging';
const logger = logging.getLogger('express');
import {
internalFindSnap,
internalGetSnapBuilds
} from './launchpad';
import { getGitHubRepoUrl } from '../../common/helpers/github-url';
import { snapBuildFromAPI } from '../../common/helpers/snap-builds';
c... |
Include slugs in ghost response | // @flow
import GhostContentAPI from "@tryghost/content-api";
const ghostContentAPI =
window.GHOST_URL &&
window.GHOST_CONTENT_API_KEY &&
new GhostContentAPI({
url: window.GHOST_URL,
key: window.GHOST_CONTENT_API_KEY,
version: "v3",
});
export type GhostPost = {|
title: string,
url: string,
... | // @flow
import GhostContentAPI from "@tryghost/content-api";
const ghostContentAPI =
window.GHOST_URL &&
window.GHOST_CONTENT_API_KEY &&
new GhostContentAPI({
url: window.GHOST_URL,
key: window.GHOST_CONTENT_API_KEY,
version: "v3",
});
export type GhostPost = {|
title: string,
url: string,
... |
Change formula validation error to consistent form | from rest_framework.views import APIView
from rest_framework.reverse import reverse
from rest_framework.response import Response
from rest_framework import generics, status
from django.core.exceptions import ValidationError
from .models import *
from .serializers import *
from .formula import validate_formula
class Me... | from rest_framework.views import APIView
from rest_framework.reverse import reverse
from rest_framework.response import Response
from rest_framework import generics
from rest_framework import generics, status
from django.core.exceptions import ValidationError
from .models import *
from .serializers import *
from .formu... |
Add option to render based on version | import Ember from 'ember';
import layout from './template';
import config from 'ember-get-config';
/**
* @module ember-osf
* @submodule components
*/
/**
* Render the provided url in an iframe via MFR
*
* Sample usage:
* ```handlebars
* {{file-renderer
* download=model.links.download
* width="800" hei... | import Ember from 'ember';
import layout from './template';
import config from 'ember-get-config';
/**
* @module ember-osf
* @submodule components
*/
/**
* Render the provided url in an iframe via MFR
*
* Sample usage:
* ```handlebars
* {{file-renderer
* download=model.links.download
* width="800" hei... |
Implement search listener on search button | // # Place all the behaviors and hooks related to the matching controller here.
// # All this logic will automatically be available in application.js.
// # You can use CoffeeScript in this file: http://coffeescript.org/
$(document).ready(function(){
bindSearchBySubmit();
bindSearchByButton();
})
var bindSearchByS... | // # Place all the behaviors and hooks related to the matching controller here.
// # All this logic will automatically be available in application.js.
// # You can use CoffeeScript in this file: http://coffeescript.org/
$(document).ready(function(){
bindSearchBySubmit();
bindSearchByButton();
})
var bindSearchByS... |
Comment out invalid propset examples. | /**
* Created by zsolt on 3/23/14.
*/
var person = {
firstName: 'Jimmy',
lastName: 'Smith',
get fullName() {
return this.firstName + ' ' + this.lastName;
}
// set fullName (name) {
// var words = name.toString().split(' ');
// this.firstName = words[0] || '';
// this.l... | /**
* Created by zsolt on 3/23/14.
*/
var person = {
firstName: 'Jimmy',
lastName: 'Smith',
get fullName() {
return this.firstName + ' ' + this.lastName;
}
// set fullName (name) {
// var words = name.toString().split(' ');
// this.firstName = words[0] || '';
// this.l... |
Set environmental vars for rancher-compose to work | #!/usr/bin/env python
"""
Deploy builds to a Rancher orchestrated stack using rancher-compose
"""
import os
import drone
import subprocess
def main():
"""The main entrypoint for the plugin."""
payload = drone.plugin.get_input()
vargs = payload["vargs"]
# Required fields should raise an error
os.... | #!/usr/bin/env python
"""
Deploy builds to a Rancher orchestrated stack using rancher-compose
"""
import os
import drone
import subprocess
def main():
"""The main entrypoint for the plugin."""
payload = drone.plugin.get_input()
vargs = payload["vargs"]
# Required fields should raise an error
url... |
Make the pretoucher touch further ahead for long delays on new chunks. | package net.openhft.chronicle.queue;
import net.openhft.chronicle.core.threads.EventHandler;
import net.openhft.chronicle.core.threads.HandlerPriority;
import net.openhft.chronicle.core.threads.InvalidEventHandlerException;
import net.openhft.chronicle.queue.impl.single.Pretoucher;
import net.openhft.chronicle.queue.i... | package net.openhft.chronicle.queue;
import net.openhft.chronicle.core.threads.EventHandler;
import net.openhft.chronicle.core.threads.HandlerPriority;
import net.openhft.chronicle.core.threads.InvalidEventHandlerException;
import net.openhft.chronicle.queue.impl.single.Pretoucher;
import net.openhft.chronicle.queue.i... |
Fix comment for extensions flag | // Copyright © 2017 shoarai
// The renfls renames files in a directory.
package main
import (
"flag"
"fmt"
"os"
"os/exec"
"strings"
"github.com/shoarai/renfls"
)
const toDir = "toSubDirsName"
// Flag
var ext string
var ignore bool
func main() {
// DEBUG:
// createTestDir()
flag.BoolVar(&ignore, "ignore"... | // Copyright © 2017 shoarai
// The renfls renames files in a directory.
package main
import (
"flag"
"fmt"
"os"
"os/exec"
"strings"
"github.com/shoarai/renfls"
)
const toDir = "toSubDirsName"
// Flag
var ext string
var ignore bool
func main() {
// DEBUG:
// createTestDir()
flag.BoolVar(&ignore, "ignore"... |
Set delay to zero for local development. | /*
* In order to prevent errors caused by e2e tests running too fast you can slow them down by calling the following
* function. Use higher values for slower tests.
*
* utils.delayPromises(30);
*
*/
var promisesDelay = 0;
function delayPromises(milliseconds) {
var executeFunction = browser.driver.controlFlo... | /*
* In order to prevent errors caused by e2e tests running too fast you can slow them down by calling the following
* function. Use higher values for slower tests.
*
* utils.delayPromises(30);
*
*/
var promisesDelay = 50;
function delayPromises(milliseconds) {
var executeFunction = browser.driver.controlFl... |
Remove usage of prototype extensions
Addons should not assume existence of prototype extensions and are now disabled by default. | import Ember from 'ember';
const { computed, observer } = Ember;
export default Ember.Component.extend({
tagName: 'div',
attributeBindings: ['contenteditable'],
editable: true,
isUserTyping: false,
plaintext: false,
classNames: ['editable'],
contenteditable: computed('editable', function() {
var edi... | import Ember from 'ember';
export default Ember.Component.extend({
tagName: 'div',
attributeBindings: ['contenteditable'],
editable: true,
isUserTyping: false,
plaintext: false,
classNames: ['editable'],
contenteditable: (function() {
var editable = this.get('editable');
return editable ? 'true' : ... |
Use "plugins_dir" config option for added plugins directories | <?php
namespace Smarty\Service;
use Zend\ServiceManager\Factory\FactoryInterface;
use Interop\Container\ContainerInterface;
use Smarty\View\Renderer;
class RendererFactory implements FactoryInterface
{
public function __invoke(ContainerInterface $container, $requestedName, array $options = null)
{
$config =... | <?php
namespace Smarty\Service;
use Zend\ServiceManager\Factory\FactoryInterface;
use Interop\Container\ContainerInterface;
use Smarty\View\Renderer;
class RendererFactory implements FactoryInterface
{
public function __invoke(ContainerInterface $container, $requestedName, array $options = null)
{
$config =... |
Put JokeService in the right place alphabetically | from pal.services.bonapp_service import BonAppService
from pal.services.dictionary_service import DictionaryService
from pal.services.directory_service import DirectoryService
from pal.services.joke_service import JokeService
from pal.services.movie_service import MovieService
from pal.services.service import wrap_resp... | from pal.services.bonapp_service import BonAppService
from pal.services.dictionary_service import DictionaryService
from pal.services.directory_service import DirectoryService
from pal.services.joke_service import JokeService
from pal.services.movie_service import MovieService
from pal.services.service import wrap_resp... |
Change port for testing purposes | var gpio = require('onoff').Gpio;
var red = new gpio(16, 'out');
var green = new gpio(12, 'out');
var blue = new gpio(21, 'out');
var button = new gpio(25, 'in', 'both');
var express = require('express');
var app = express();
app.get('/', function(req, res){
res.send('Hi I changed this again!');
});
app.listen(3001... | var gpio = require('onoff').Gpio;
var red = new gpio(16, 'out');
var green = new gpio(12, 'out');
var blue = new gpio(21, 'out');
var button = new gpio(25, 'in', 'both');
var express = require('express');
var app = express();
app.get('/', function(req, res){
res.send('Hi I changed this again!');
});
app.listen(3000... |
Use new API correctly, v2... | #!/usr/bin/python3
'''
Run simulations with parameter samples.
'''
import model
countries = model.datasheet.get_country_list()
# Move these to the front.
countries_to_plot = ['United States of America',
'South Africa',
'Uganda',
'Nigeria',
... | #!/usr/bin/python3
'''
Run simulations with parameter samples.
'''
import model
countries = model.datasheet.get_country_list()
# Move these to the front.
countries_to_plot = ['United States of America',
'South Africa',
'Uganda',
'Nigeria',
... |
Add back daily NoAttendanceJediPush job | <?php
declare(strict_types=1);
namespace App\Console;
use App\Jobs\DailyDuesSummary;
use App\Jobs\WeeklyAttendance;
use App\Jobs\NoAttendanceJediPush;
use Illuminate\Console\Scheduling\Schedule;
use Illuminate\Foundation\Console\Kernel as ConsoleKernel;
class Kernel extends ConsoleKernel
{
/**
* The Artisa... | <?php
declare(strict_types=1);
namespace App\Console;
use App\Jobs\DailyDuesSummary;
use App\Jobs\WeeklyAttendance;
use Illuminate\Console\Scheduling\Schedule;
use Illuminate\Foundation\Console\Kernel as ConsoleKernel;
class Kernel extends ConsoleKernel
{
/**
* The Artisan commands provided by your applica... |
Allow loadenv to only run if env variables are not set | <?php
namespace Dara\Origins;
use PDO;
use Dotenv\Dotenv;
class Connection extends PDO
{
protected static $driver;
protected static $host;
protected static $dbname;
protected static $user;
protected static $pass;
/**
* Get environment values from .env file
*
*... | <?php
namespace Dara\Origins;
use PDO;
use Dotenv\Dotenv;
class Connection extends PDO
{
protected static $driver;
protected static $host;
protected static $dbname;
protected static $user;
protected static $pass;
/**
* Get environment values from .env file
*
*... |
Move conditional to chached data | var express = require('express');
var router = express.Router();
var nodemailer = require('nodemailer');
// create reusable transporter object using the default SMTP transport
var smtp = process.env.SMTPCREDENTIALS || '';
var transporter = nodemailer.createTransport(smtp);
var SECRET = process.env.SPASECRET || '';
r... | var express = require('express');
var router = express.Router();
var nodemailer = require('nodemailer');
// create reusable transporter object using the default SMTP transport
var smtp = process.env.SMTPCREDENTIALS || '';
var transporter = nodemailer.createTransport(smtp);
var SECRET = process.env.SPASECRET || '';
r... |
Add some session details for persistent state stuff | <?php
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
define('MAX_COMIC_STEPS', 10);
session_start();
require_once('libs/Smarty.class.php');
if (empty($_SESSION['comic_seed'])) $... | <?php
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
require_once('libs/Smarty.class.php');
if (empty($_GET['type'])) $_GET['type'] = 'problem';
if (empty($_GET['randomseed'])) $_... |
Add connect flash middleware setup | var express = require('express');
var logger = require('morgan');
var bodyParser = require('body-parser');
var session = require('express-session'); // compatible stores at https://github.com/expressjs/session#compatible-session-stores
var exphbs = require('express-handlebars');
var cookieParser = require('cookie-pars... | var express = require('express');
var logger = require('morgan');
var bodyParser = require('body-parser');
var session = require('express-session'); // compatible stores at https://github.com/expressjs/session#compatible-session-stores
var exphbs = require('express-handlebars');
var cookieParser = require('cookie-pars... |
Use imageUuid instead of installPath
Signed-off-by: David Lee <15c338f3b79a63a0d5423e9c6562cd312918fe74@gmail.com> | package org.zstack.header.storage.backup;
import org.zstack.header.identity.Action;
import org.zstack.header.image.ImageConstant;
import org.zstack.header.message.APIMessage;
import org.zstack.header.message.APIParam;
@Action(category = ImageConstant.ACTION_CATEGORY)
public class APIExportImageFromBackupStorageMsg ex... | package org.zstack.header.storage.backup;
import org.zstack.header.identity.Action;
import org.zstack.header.image.ImageConstant;
import org.zstack.header.message.APIMessage;
import org.zstack.header.message.APIParam;
@Action(category = ImageConstant.ACTION_CATEGORY)
public class APIExportImageFromBackupStorageMsg ex... |
Add abstract method from interface | <?php
namespace Larium\Pay\Transaction;
use Larium\Pay\TransactionException;
trait Commit
{
/**
* @var bool
*/
private $committed = false;
abstract public function canCommit();
/**
* {@inheritdoc}
*/
public function commit()
{
if (!$this->canCommit()) {
... | <?php
namespace Larium\Pay\Transaction;
use Larium\Pay\TransactionException;
trait Commit
{
/**
* @var bool
*/
private $committed = false;
/**
* {@inheritdoc}
*/
public function commit()
{
if (!$this->canCommit()) {
throw TransactionExeption::unableToCommi... |
Add support for protocol redirects | #!/usr/bin/env node
'use strict'
var url = require('url')
var normalizeUrl = require('normalize-url')
var chalk = require('chalk')
var arg = normalizeUrl(process.argv[2])
var http = require('http')
var https = require('https')
var start = Date.now()
var hops = 0
follow(arg, start)
function follow (u, ms) {
var op... | #!/usr/bin/env node
'use strict'
var url = require('url')
var normalizeUrl = require('normalize-url')
var chalk = require('chalk')
var arg = normalizeUrl(process.argv[2])
var http = require(arg.indexOf('https://') === 0 ? 'https' : 'http')
var start = Date.now()
var hops = 0
follow(arg, start)
function follow (u, m... |
Return empty JSON array if IncidentRepository is not yet initialized | package org.stagemonitor.alerting.alerter;
import java.io.IOException;
import java.util.Collections;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
im... | package org.stagemonitor.alerting.alerter;
import java.io.IOException;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.stagemonitor.alerting... |
Remove trailing whitespace in line 27 | package seedu.ezdo.commons.util;
import seedu.ezdo.model.todo.ReadOnlyTask;
//@@author A0139177W
/**
* Utility method for Recur
*/
public class RecurUtil {
/**
* Checks if a recurring status is valid with at least a start date and/or
* due date present in a task. Floating tasks should not have a recu... | package seedu.ezdo.commons.util;
import seedu.ezdo.model.todo.ReadOnlyTask;
//@@author A0139177W
/**
* Utility method for Recur
*/
public class RecurUtil {
/**
* Checks if a recurring status is valid with at least a start date and/or
* due date present in a task. Floating tasks should not have a recu... |
Use command-line argument to bind server address | import argparse
import zmq
from .databases import Databases
from .worker import Worker
parser = argparse.ArgumentParser("escalator")
parser.add_argument(
'--bind', default='tcp://*:4224',
help="Address to bind escalator server"
)
args = parser.parse_args()
context = zmq.Context()
back_uri = 'inproc://work... | import zmq
from .databases import Databases
from .worker import Worker
context = zmq.Context()
back_uri = 'inproc://workers'
proxy = zmq.devices.ThreadDevice(
device_type=zmq.QUEUE, in_type=zmq.DEALER, out_type=zmq.ROUTER
)
proxy.bind_out('tcp://*:4224')
proxy.bind_in(back_uri)
proxy.start()
databases = Databa... |
Use Request and ResponseWriter creators in Server | // Copyright 2016 Marcel Gotsch. All rights reserved.
// Use of this source code is governed by a MIT-style
// license that can be found in the LICENSE file.
package goserv
import (
"net/http"
)
type TLS struct {
CertFile, KeyFile string
}
type Server struct {
*Router
Addr string
TLS *TLS
}
func (s *Server) ... | // Copyright 2016 Marcel Gotsch. All rights reserved.
// Use of this source code is governed by a MIT-style
// license that can be found in the LICENSE file.
package goserv
import (
"net/http"
)
type TLS struct {
CertFile, KeyFile string
}
type Server struct {
*Router
Addr string
TLS *TLS
}
func (s *Server) ... |
Use 2578 as port on example | const LocalDatabaseConnector = require('../shared/local-database-connector')
const os = require('os')
global.instanceId = os.hostname();
const SyncProcessManager = require('./sync-process-manager')
const manager = new SyncProcessManager();
LocalDatabaseConnector.forShared().then((db) => {
const {Account} = db;
Ac... | const LocalDatabaseConnector = require('../shared/local-database-connector')
const os = require('os')
global.instanceId = os.hostname();
const SyncProcessManager = require('./sync-process-manager')
const manager = new SyncProcessManager();
LocalDatabaseConnector.forShared().then((db) => {
const {Account} = db;
Ac... |
Add code for saving preferences correctly, but only for integers now | import ConfigParser
from gi.repository import Gtk
from pref_mapping import *
from var import *
def read_config_if_exists(filename):
if os.path.isfile(filename):
# Init config parser and read config
Config = ConfigParser.SafeConfigParser()
Config.read(filename)
section = "TorGTKprefs"
# Loop through options... | import ConfigParser
from gi.repository import Gtk
from pref_mapping import *
from var import *
def read_config_if_exists(filename):
if os.path.isfile(filename):
# Init config parser and read config
Config = ConfigParser.SafeConfigParser()
Config.read(filename)
section = "TorGTKprefs"
# Loop through options... |
Add new relationship to Investment resource | import six
from .node import Node
@six.python_2_unicode_compatible
class Investment(Node):
"""Represents a Investment (investor-investment) on CrunchBase"""
KNOWN_PROPERTIES = [
'type',
'uuid',
'money_invested',
'money_invested_currency_code',
'money_invested_usd',
... | import six
from .node import Node
@six.python_2_unicode_compatible
class Investment(Node):
"""Represents a Investment (investor-investment) on CrunchBase"""
KNOWN_PROPERTIES = [
'type',
'uuid',
'money_invested',
'money_invested_currency_code',
'money_invested_usd',
... |
Return all poet attributes except password from create method | var _ = require('underscore');
module.exports = function(dbConfig) {
var db = require('./poemlab_database')(dbConfig);
return {
create: function(user_data, callback) {
var params = _.values(_.pick(user_data, ["name", "email", "password"]));
db.query("insert into poets (name, email, password) values ($1, $... | var _ = require('underscore');
module.exports = function(dbConfig) {
var db = require('./poemlab_database')(dbConfig);
return {
create: function(user_data, callback) {
var params = _.values(_.pick(user_data, ["name", "email", "password"]));
db.query("insert into poets (name, email, password) values ($1, $... |
Change set options to a different class to ensure that it cannot be accidentally used in place of the real internal property. | /*
* Copyright 2015 The OpenDCT Authors. 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... | /*
* Copyright 2015 The OpenDCT Authors. 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... |
Allow names with more than one word | package com.enjin.averian_roleplay.core;
import org.bukkit.ChatColor;
import org.bukkit.command.Command;
import org.bukkit.command.CommandExecutor;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
public class SetNameCommand implements CommandExecutor {
private AverianCore plugin;
public ... | package com.enjin.averian_roleplay.core;
import org.bukkit.ChatColor;
import org.bukkit.command.Command;
import org.bukkit.command.CommandExecutor;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
public class SetNameCommand implements CommandExecutor {
private AverianCore plugin;
public ... |
Make TOC footer more like Cover footer | @extends('layouts.master')
@section('title')
Claw & Quill: No. {{ $issue->number }}
@endsection
@section('content')
<header id="header">
<div><a class="image" href="/"><img src="/img/cnq-logo.png" alt="Claw & Quill"></a></div>
<h1>No. {{ $issue->number }} · {{ $issue->pub_date->toFormattedDateStrin... | @extends('layouts.master')
@section('title')
Claw & Quill: No. {{ $issue->number }}
@endsection
@section('content')
<header id="header">
<div><a class="image" href="/"><img src="/img/cnq-logo.png" alt="Claw & Quill"></a></div>
<h1>No. {{ $issue->number }} · {{ $issue->pub_date->toFormattedDateStrin... |
Update data chart controller to use route params | define(function() {
var DataChartController = function($rootScope, $routeParams, HubResource, HubSelectionService) {
var self = this
this.isLoaded = false
// Fake promise to get around ig data source
this.dataChart = HubResource.listDataPoints()
// Load data on selection ch... | define(function() {
var DataChartController = function($rootScope, $q, HubResource, HubSelectionService) {
var self = this
this.isLoaded = false
// Fake promise to get around ig data source
this.dataChart = HubResource.listDataPoints()
// Load data on selection change
... |
Remove use of deprecated getTagsWithPrefix method | <?php
RequestHandler::$responseMode = 'csv';
RequestHandler::respond('projects', array(
'data' => array_map(function($Project) {
preg_match('/^\s*[^*#]\s*\w.*/m', $Project->README, $matches);
return array(
'name' => $Project->Title
,'description' => trim($matches[0])
... | <?php
RequestHandler::$responseMode = 'csv';
RequestHandler::respond('projects', array(
'data' => array_map(function($Project) {
preg_match('/^\s*[^*#]\s*\w.*/m', $Project->README, $matches);
return array(
'name' => $Project->Title
,'description' => trim($matches[0])
... |
Add long description for PyPI upload | #!/usr/bin/env python
#
# Author: Logan Gunthorpe <logang@deltatee.com>
# Copyright (c) Deltatee Enterprises Ltd. 2015, All rights reserved.
#
# This library 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 Foundati... | #!/usr/bin/env python
#
# Author: Logan Gunthorpe <logang@deltatee.com>
# Copyright (c) Deltatee Enterprises Ltd. 2015, All rights reserved.
#
# This library 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 Foundati... |
Use sys.executable when invoking python interpreter from tests
When we only have python3 installed, the test for missing argument is
failing because there is no "python" executable. Use `sys.executable`
instead. Also set environment correctly, like done in 7024d3b36176. | # -*- coding: utf-8 -*-
"""
test_cookiecutter_invocation
----------------------------
Tests to make sure that cookiecutter can be called from the cli without
using the entry point set up for the package.
"""
import os
import pytest
import subprocess
import sys
from cookiecutter import utils
def test_should_raise_... | # -*- coding: utf-8 -*-
"""
test_cookiecutter_invocation
----------------------------
Tests to make sure that cookiecutter can be called from the cli without
using the entry point set up for the package.
"""
import os
import pytest
import subprocess
import sys
from cookiecutter import utils
def test_should_raise_... |
Include README in package cf. PyPA recommendation
http://python-packaging.readthedocs.io/en/latest/metadata.html#a-readme-long-description | import os
from setuptools import setup, find_packages
__version__ = '0.1'
HERE = os.path.dirname(__file__)
def readme():
with open('README.rst') as f:
return f.read()
setup(
name='rubberjack-cli',
version=__version__,
packages=find_packages(exclude=['test*']),
include_package_data=True... | import os
from setuptools import setup, find_packages
__version__ = '0.1'
HERE = os.path.dirname(__file__)
try:
long_description = open(os.path.join(HERE, 'README.rst')).read()
except:
long_description = None
setup(
name='rubberjack-cli',
version=__version__,
packages=find_packages(exclude=['tes... |
Make mailer test a bit more inclusive. | package authboss
import (
"bytes"
"strings"
"testing"
)
func TestMailer(t *testing.T) {
mailServer := &bytes.Buffer{}
config := NewConfig()
config.Mailer = LogMailer(mailServer)
config.Storer = mockStorer{}
Init(config)
err := SendMail(Email{
To: []string{"some@email.com", "a@a.com"},
ToNames: [... | package authboss
import (
"bytes"
"strings"
"testing"
)
func TestMailer(t *testing.T) {
mailServer := &bytes.Buffer{}
config := NewConfig()
config.Mailer = LogMailer(mailServer)
config.Storer = mockStorer{}
Init(config)
err := SendMail(Email{
To: []string{"some@email.com", "a@a.com"},
ToNames: [... |
Add 'active' class bindings for component that is added when Aviary Editor is launched and removed with Aviary's 'onClose' callback | import Ember from 'ember';
export default Ember.Component.extend({
aviaryApiClient: null, // injected
classNames: ['edit-icon'],
classNameBindings: ['featherActive:active'],
image: null,
url: null,
imageSelector: null,
closeOnSave: false,
featherActive: false,
imageToEdit: function() {
var image... | import Ember from 'ember';
export default Ember.Component.extend({
aviaryApiClient: null, // injected
classNames: ['edit-icon'],
image: null,
url: null,
imageSelector: null,
closeOnSave: false,
imageToEdit: function() {
var imageNotSet = Ember.isEmpty(this.get('image'));
var selector = this.get(... |
Add reporting unit URL to region serializer. | import json
from rest_framework import serializers
from django.core.urlresolvers import reverse
from landscapesim.models import Region
class ReportingUnitSerializer(serializers.Serializer):
type = serializers.SerializerMethodField()
properties = serializers.SerializerMethodField()
geometry = serializers... | import json
from rest_framework import serializers
from landscapesim.models import Region
class ReportingUnitSerializer(serializers.Serializer):
type = serializers.SerializerMethodField()
properties = serializers.SerializerMethodField()
geometry = serializers.SerializerMethodField()
class Meta:
... |
Set campaign and region to null by default
Campaign and region are getting passed down by the dashboard view
from the dropdowns, so there is no need to provide defaults in the
NCO dashboard component. | 'use strict';
module.exports = {
template: require('./nco.html'),
data: function () {
return {
region : null,
campaign: null,
overview: [{
title : 'Influencer',
indicators: [164,165,166,167],
chart : 'chart-bar'
}, {
title : 'Information Source',
indicators: [164,165,... | 'use strict';
module.exports = {
template: require('./nco.html'),
data: function () {
return {
region : 12907,
campaign: true, // Trick with-indicator into loading without a campaign
overview: [{
title : 'Influencer',
indicators: [164,165,166,167],
chart : 'chart-bar'
}, {
t... |
Add missing import of `Path` | """
byceps.config_defaults
~~~~~~~~~~~~~~~~~~~~~~
Default configuration values
:Copyright: 2006-2020 Jochen Kupperschmidt
:License: Modified BSD, see LICENSE for details.
"""
from datetime import timedelta
from pathlib import Path
# database connection
SQLALCHEMY_ECHO = False
# Disable Flask-SQLAlchemy's tracking... | """
byceps.config_defaults
~~~~~~~~~~~~~~~~~~~~~~
Default configuration values
:Copyright: 2006-2020 Jochen Kupperschmidt
:License: Modified BSD, see LICENSE for details.
"""
from datetime import timedelta
# database connection
SQLALCHEMY_ECHO = False
# Disable Flask-SQLAlchemy's tracking of object modifications.... |
Fix crashing error caused when network_console isn't accessible. | <?php
namespace Dan\Core;
use Dan\Events\Event;
use Illuminate\Support\ServiceProvider;
class ExceptionServiceProvider extends ServiceProvider
{
/**
* Register the service provider.
*
* @return void
*/
public function register()
{
events()->subscribe('console.exception')
... | <?php
namespace Dan\Core;
use Dan\Events\Event;
use Illuminate\Support\ServiceProvider;
class ExceptionServiceProvider extends ServiceProvider
{
/**
* Register the service provider.
*
* @return void
*/
public function register()
{
events()->subscribe('console.exception')
... |
Convert percentage to a value between 0 and 1 | #!/usr/bin/env python3
import psutil
import os
import time
def create_bar(filled):
low = '.'
high = '|'
if filled > 1:
low = str(int(filled))
high = str(int(filled + 1))
filled = filled - int(filled)
filled = int(filled * 10)
if filled < 5:
color = "green"
elif f... | #!/usr/bin/env python
import psutil
import os
import time
def create_bar(filled):
low = '.'
high = '|'
if filled > 1:
low = str(int(filled))
high = str(int(filled + 1))
filled = filled - int(filled)
filled = int(filled * 10)
if filled < 5:
color = "green"
elif fi... |
Fix insert() method for related models. | <?php namespace Laravel\Database\Eloquent\Relationships;
use Laravel\Database\Eloquent\Model;
class Has_One_Or_Many extends Relationship {
/**
* Insert a new record for the association.
*
* @param Model|array $attributes
* @return bool
*/
public function insert($attributes)
{
if ($attributes instanc... | <?php namespace Laravel\Database\Eloquent\Relationships;
use Laravel\Database\Eloquent\Model;
class Has_One_Or_Many extends Relationship {
/**
* Insert a new record for the association.
*
* @param Model|array $attributes
* @return bool
*/
public function insert($attributes)
{
$attributes = ($attribu... |
Add a fallback redirect in case an error occurs
In case something goes wrong while adding new minutes,
the user is now redirected to something that most
likely exists. Should be extended to redirect the
user to an error page that explains what happened.
Or the meetingseries/:_id page with a flash message/
modal box, t... | import { MeetingSeries } from '/imports/meetingseries'
Router.configure({
// set default application template for all routes
layoutTemplate: 'appLayout'
});
Router.route('/', {name: 'home'});
Router.route('/meetingseries/:_id', function () {
var meetingSeriesID = this.params._id;
this.render('meetin... | import { MeetingSeries } from '/imports/meetingseries'
Router.configure({
// set default application template for all routes
layoutTemplate: 'appLayout'
});
Router.route('/', {name: 'home'});
Router.route('/meetingseries/:_id', function () {
var meetingSeriesID = this.params._id;
this.render('meetin... |
Adjust limited mouse based camera movement |
var GNOVEL = GNOVEL || {};
(function() {
"use strict";
/**
* @class MouseMovedCamera
* If created, will enable effect of mouse moved camera (small shift in the camera's direction vector according to mouse movement)
* @param {[GNOVEL.Gnovel]} gnovel
* @constructor
*/
var MouseMovedCamera = function(gno... |
var GNOVEL = GNOVEL || {};
(function() {
"use strict";
/**
* @class MouseMovedCamera
* If created, will enable effect of mouse moved camera (small shift in the camera's direction vector according to mouse movement)
* @param {[GNOVEL.Gnovel]} gnovel
* @constructor
*/
var MouseMovedCamera = function(gno... |
Remove OperationalError and ProgrammingError imports | # -*- coding: utf-8 -*-
# Generated by Django 1.11.22 on 2019-10-31 16:33
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('ratechecker', '0001_initial'),
]
operations = [
migrations.AlterUniqueTogether(
... | # -*- coding: utf-8 -*-
# Generated by Django 1.11.22 on 2019-10-31 16:33
from __future__ import unicode_literals
from django.db import migrations, OperationalError, ProgrammingError
class Migration(migrations.Migration):
dependencies = [
('ratechecker', '0001_initial'),
]
operations = [
... |
Remove vet check for desktop notifications in AppTokenUtil. | const AppTokenUtil = {
getAppTokensBasedOnQuery: getAppTokensBasedOnQuery
};
function getAppTokensBasedOnQuery(query, desktopAppId) {
let userDisabledMap = new Map();
let userIdsSet = new Set();
let appTokens = Push.appTokens.find(query).fetch();
if (!appTokens.length) {
return [];
}
if (desktopAp... | const AppTokenUtil = {
getAppTokensBasedOnQuery: getAppTokensBasedOnQuery
};
function getAppTokensBasedOnQuery(query, desktopAppId) {
let userDisabledMap = new Map();
let userIdsSet = new Set();
let appTokens = Push.appTokens.find(query).fetch();
if (!appTokens.length) {
return [];
}
appTokens.for... |
Remove default param on slm locale for redirect error | <?php
/**
* SlmLocale Configuration
*
* If you have a ./config/autoload/ directory set up for your project, you can
* drop this config file in it and change the values as you wish.
*/
$settings = array(
/**
* Default locale
*
* Some good description here. Default is something
*
* Accep... | <?php
/**
* SlmLocale Configuration
*
* If you have a ./config/autoload/ directory set up for your project, you can
* drop this config file in it and change the values as you wish.
*/
$settings = array(
/**
* Default locale
*
* Some good description here. Default is something
*
* Accep... |
Update provider test to ensure default credentials were found. | package softlayer
import (
"testing"
"github.com/hashicorp/terraform/helper/schema"
"github.com/hashicorp/terraform/terraform"
)
var testAccProviders map[string]terraform.ResourceProvider
var testAccProvider *schema.Provider
func init() {
testAccProvider = Provider().(*schema.Provider)
testAccProviders = map[s... | package softlayer
import (
"os"
"testing"
"github.com/hashicorp/terraform/helper/schema"
"github.com/hashicorp/terraform/terraform"
)
var testAccProviders map[string]terraform.ResourceProvider
var testAccProvider *schema.Provider
func init() {
testAccProvider = Provider().(*schema.Provider)
testAccProviders =... |
Add twig global var Facebook app id info | <?php
/*
* 이 컨트롤러를 상속받아 구현하는 컨트롤러는 Twig 템플릿 엔진을 기본으로 로드함
*/
class MY_Controller extends CI_Controller {
public function __construct() {
parent::__construct();
$this->load->library('twig');
$this->load->helper('url');
$this->config->load('facebook');
// Twig 관련 글로벌 설정은 이곳 ... | <?php
/*
* 이 컨트롤러를 상속받아 구현하는 컨트롤러는 Twig 템플릿 엔진을 기본으로 로드함
*/
class MY_Controller extends CI_Controller {
public function __construct() {
parent::__construct();
$this->load->library('twig');
$this->load->helper('url');
// Twig 관련 글로벌 설정은 이곳 또는 application/libraries/Twig.php 에 작성
... |
Add license meta for pypi
Add license meta for pypi. | from setuptools import setup
setup(
name='guzzle_sphinx_theme',
version='0.7.11',
description='Sphinx theme used by Guzzle.',
long_description=open('README.rst').read(),
author='Michael Dowling',
author_email='mtdowling@gmail.com',
url='https://github.com/guzzle/guzzle_sphinx_theme',
pa... | from setuptools import setup
setup(
name='guzzle_sphinx_theme',
version='0.7.11',
description='Sphinx theme used by Guzzle.',
long_description=open('README.rst').read(),
author='Michael Dowling',
author_email='mtdowling@gmail.com',
url='https://github.com/guzzle/guzzle_sphinx_theme',
pa... |
Add uniform API for public body widgets | from django import forms
from django.utils.translation import ugettext_lazy as _
from froide.helper.form_utils import JSONMixin
from .models import PublicBody
from .widgets import PublicBodySelect
class PublicBodyForm(JSONMixin, forms.Form):
publicbody = forms.ModelChoiceField(
queryset=PublicBody.o... | from django import forms
from django.utils.translation import ugettext_lazy as _
from froide.helper.form_utils import JSONMixin
from .models import PublicBody
from .widgets import PublicBodySelect
class PublicBodyForm(JSONMixin, forms.Form):
publicbody = forms.ModelChoiceField(
queryset=PublicBody.o... |
Use static properties for the sub-items | "use strict"
import Context from "./context"
import ShadowTree from "./shadowtree"
import PHPStrictError from "./phpstricterror"
class Lint {
static get PHPStrictError() {
return PHPStrictError
}
static get ShadowTree() {
return ShadowTree
}
constructor(tree, filename = null, names... | "use strict"
import Context from "./context"
import ShadowTree from "./shadowtree"
class Lint {
constructor(tree, filename = null, namespace = []) {
Object.assign(
this,
{
filename: filename,
namespace: namespace,
tree: tree,
... |
Remove hack by only importing when configured | import logging
from airflow import configuration
from airflow.executors.base_executor import BaseExecutor
from airflow.executors.local_executor import LocalExecutor
from airflow.executors.sequential_executor import SequentialExecutor
from airflow.utils import AirflowException
_EXECUTOR = configuration.get('core', 'E... | import logging
from airflow import configuration
from airflow.executors.base_executor import BaseExecutor
from airflow.executors.local_executor import LocalExecutor
from airflow.executors.sequential_executor import SequentialExecutor
# TODO Fix this emergency fix
try:
from airflow.executors.celery_executor import... |
Remove duplicate case from switch | // created to start cleaning up "window" interaction
//
window.show = function(id) {
window.hideall();
runHooks("paneChanged", id);
switch(id) {
case 'all':
case 'faction':
case 'alerts':
window.chat.show(id);
break;
case 'debug':
window.debug.console.show();
break;
c... | // created to start cleaning up "window" interaction
//
window.show = function(id) {
window.hideall();
runHooks("paneChanged", id);
switch(id) {
case 'all':
case 'faction':
case 'alerts':
window.chat.show(id);
break;
case 'alerts':
window.chat.show('alerts');
break;
c... |
Fix asset `asyncErrorHandling`, use valid global instance of `wTools` |
require( 'wTesting' );
// const _ = require( 'wTools' );
const _ = _globals_.testing.wTools;
_.include( 'wConsequence' );
//
function asyncErrorHandling( test )
{
_.Consequence.UncaughtTimeOut = 1;
let con = new _.Consequence().take( null )
// /*
// In first case error is handled right after creation and... |
require( 'wTesting' );
const _ = require( 'wTools' );
_.include( 'wConsequence' );
//
function asyncErrorHandling( test )
{
_.Consequence.UncaughtTimeOut = 1;
let con = new _.Consequence().take( null )
// /*
// In first case error is handled right after creation and tester has time to perform the check.
... |
Return the json from the parser method | from bs4 import BeautifulSoup
from requests.auth import HTTPBasicAuth
import requests
import json
def parse_content():
rs = requests.get('http://soundspectra.com/admin/', auth=HTTPBasicAuth('admin', 'h@ckm3'))
html_data = rs.text
soup = BeautifulSoup(html_data)
details = {'stream_details' : []}
... | from bs4 import BeautifulSoup
from requests.auth import HTTPBasicAuth
import requests
import json
def parse_content():
rs = requests.get('http://soundspectra.com/admin/', auth=HTTPBasicAuth('admin', 'h@ckm3'))
html_data = rs.text
soup = BeautifulSoup(html_data)
details = {'stream_details' : []}
... |
Use the src directory instead of the src/levels directory as the cwd. | # Copyright 2013 Daniel Stokes, Mitchell Stokes
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable ... | # Copyright 2013 Daniel Stokes, Mitchell Stokes
#
# 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 ... |
Set default isPremium=true on Account/Plan to happify sqlite | <?php
namespace Application\Migrations;
use SimplyTestable\BaseMigrationsBundle\Migration\BaseMigration,
Doctrine\DBAL\Schema\Schema;
/**
* Auto-generated Migration: Please modify to your need!
*/
class Version20130607130241_add_AccountPlan_isPremium extends BaseMigration
{
public function up(Schema $s... | <?php
namespace Application\Migrations;
use SimplyTestable\BaseMigrationsBundle\Migration\BaseMigration,
Doctrine\DBAL\Schema\Schema;
/**
* Auto-generated Migration: Please modify to your need!
*/
class Version20130607130241_add_AccountPlan_isPremium extends BaseMigration
{
public function up(Schema $s... |
Remove the dependecy of QtGui from a test located in QtNetwork. | import unittest
from PySide.QtCore import *
from PySide.QtNetwork import *
from helper import UsesQCoreApplication
from httpd import TestServer
class testAuthenticationSignal(UsesQCoreApplication):
def setUp(self):
super(testAuthenticationSignal, self).setUp()
self.httpd = TestServer(secure=Tru... | import unittest
from PySide.QtCore import *
from PySide.QtNetwork import *
from helper import UsesQApplication
from httpd import TestServer
class testAuthenticationSignal(UsesQApplication):
def setUp(self):
super(testAuthenticationSignal, self).setUp()
self.httpd = TestServer(secure=True)
... |
Include queued date in MQ messages | from tapiriik.database import db
from tapiriik.messagequeue import mq
from tapiriik.sync import Sync
from datetime import datetime
from pymongo.read_preferences import ReadPreference
import kombu
import time
Sync.InitializeWorkerBindings()
producer = kombu.Producer(Sync._channel, Sync._exchange)
while True:
queuein... | from tapiriik.database import db
from tapiriik.messagequeue import mq
from tapiriik.sync import Sync
from datetime import datetime
from pymongo.read_preferences import ReadPreference
import kombu
import time
Sync.InitializeWorkerBindings()
producer = kombu.Producer(Sync._channel, Sync._exchange)
while True:
queuein... |
Use tests from spec (extended for nested example) | 'use strict'
const jsonPointer = require('../lib')
const expect = require('chai').expect
const testDoc = {
foo: ['bar', 'baz'],
person: { name: { firstName: 'bob' } },
'': 0,
'a/b': 1,
'c%d': 2,
'e^f': 3,
'g|h': 4,
'i\\j': 5,
'k\"l': 6,
' ': 7,
'm~n': 8
}
it('dereferences root document', functi... | 'use strict'
const jsonPointer = require('../lib')
const expect = require('chai').expect
it('dereferences root document', function () {
const doc = {
name: {
firstName: 'Joe',
secondName: 'Smith'
}
}
const pointer = ''
const result = jsonPointer.get(doc, pointer)
expect(result).to.deep... |
Update WIND to new loader format | define(['mac/roman'], function(macintoshRoman) {
'use strict';
return function(item) {
return item.getBytes().then(function(bytes) {
var dataDV = new DataView(bytes.buffer, bytes.byteOffset, bytes.byteLength);
var dataObject = {
initialRectangle: {
top: dataDV.getInt16(0, false... | define(['mac/roman'], function(macintoshRoman) {
'use strict';
return function(resource) {
var dataDV = new DataView(resource.data.buffer, resource.data.byteOffset, resource.data.byteLength);
resource.dataObject = {
initialRectangle: {
top: dataDV.getInt16(0, false),
left: dataDV.g... |
Use dictionary lookup only once | from __future__ import absolute_import
import six
from sentry.api.serializers import Serializer, register
from sentry.models import Commit, CommitFileChange
from sentry.api.serializers.models.release import get_users_for_commits
@register(CommitFileChange)
class CommitFileChangeSerializer(Serializer):
def get_a... | from __future__ import absolute_import
import six
from sentry.api.serializers import Serializer, register
from sentry.models import Commit, CommitFileChange
from sentry.api.serializers.models.release import get_users_for_commits
@register(CommitFileChange)
class CommitFileChangeSerializer(Serializer):
def get_a... |
Comment out dotenv for heroku deployment | 'use strict';
var express = require('express');
var routes = require('./app/routes/index.js');
var mongoose = require('mongoose');
var passport = require('passport');
var session = require('express-session');
var bodyParser = require('body-parser')
var app = express();
// require('dotenv').load();
require('./app/conf... | 'use strict';
var express = require('express');
var routes = require('./app/routes/index.js');
var mongoose = require('mongoose');
var passport = require('passport');
var session = require('express-session');
var bodyParser = require('body-parser')
var app = express();
require('dotenv').load();
require('./app/config/... |
CRM-4573: Add ability to save multiple values for patch API | <?php
namespace Oro\Bundle\EntityBundle\Tests\Functional\DataFixtures;
use Doctrine\Common\DataFixtures\AbstractFixture;
use Doctrine\Common\Persistence\ObjectManager;
use Symfony\Component\DependencyInjection\ContainerAwareInterface;
use Symfony\Component\DependencyInjection\ContainerInterface;
use Oro\Bundle\Orga... |
<?php
namespace Oro\Bundle\EntityBundle\Tests\Functional\DataFixtures;
use Doctrine\Common\DataFixtures\AbstractFixture;
use Doctrine\Common\Persistence\ObjectManager;
use Symfony\Component\DependencyInjection\ContainerAwareInterface;
use Symfony\Component\DependencyInjection\ContainerInterface;
use Oro\Bundle\Org... |
Fix bug of adding the id to the resulting data | import json
from lettuce import step, world
@step(u'post "([^"]*)" records?')
def post_record(step, model_name):
world.path = '/data/%s' % str(model_name.lower())
for record in step.hashes:
data = json.dumps(record)
world.response = world.browser.post(world.path, params=data, status='*')
@st... | import json
from lettuce import step, world
@step(u'post "([^"]*)" records?')
def post_record(step, model_name):
world.path = '/data/%s' % str(model_name.lower())
for record in step.hashes:
data = json.dumps(record)
world.response = world.browser.post(world.path, params=data, status='*')
@st... |
Add one more empty line to end of import to adjust to H306 | #!/usr/bin/env python
import argparse
import sys
import cv2
import numpy
import six.moves.cPickle as pickle
parser = argparse.ArgumentParser(description='Compute images mean array')
parser.add_argument('dataset', help='Path to training image-label list file')
parser.add_argument('--output', '-o', default='mean.npy',... | #!/usr/bin/env python
import argparse
import sys
import cv2
import numpy
import six.moves.cPickle as pickle
parser = argparse.ArgumentParser(description='Compute images mean array')
parser.add_argument('dataset', help='Path to training image-label list file')
parser.add_argument('--output', '-o', default='mean.npy',
... |
Disable DB vacuum cleanup step and it was not the root cause of the
problem. | package com.vaguehope.onosendai.update;
import android.content.Intent;
import com.vaguehope.onosendai.images.HybridBitmapCache;
import com.vaguehope.onosendai.storage.AttachmentStorage;
import com.vaguehope.onosendai.storage.DbBindingService;
import com.vaguehope.onosendai.util.LogWrapper;
/*
* TODO move this class... | package com.vaguehope.onosendai.update;
import android.content.Intent;
import com.vaguehope.onosendai.images.HybridBitmapCache;
import com.vaguehope.onosendai.storage.AttachmentStorage;
import com.vaguehope.onosendai.storage.DbBindingService;
import com.vaguehope.onosendai.util.LogWrapper;
/*
* TODO move this class... |
Add cDatePublic to indexed page list | <?
/**
*
* A wrapper class for results from the search engine, allowing for abstraction in case search engines are changed in the future.
* @package Utilities
* @subpackage Search
*/
defined('C5_EXECUTE') or die("Access Denied.");
class Concrete5_Library_IndexedPageList extends PageList {
protected $indexModeSimple =... | <?
/**
*
* A wrapper class for results from the search engine, allowing for abstraction in case search engines are changed in the future.
* @package Utilities
* @subpackage Search
*/
defined('C5_EXECUTE') or die("Access Denied.");
class Concrete5_Library_IndexedPageList extends PageList {
protected $indexModeSimple =... |
Add a conditional to check whther 'arg' is a byte | # IdeaScaly
# Copyright 2015 Jorge Saldivar
# See LICENSE for details.
import six
import dateutil.parser
def parse_datetime(str_date):
try:
date_is = dateutil.parser.parse(str_date)
return date_is
except:
return None
def parse_html_value(html):
return html[html.find('>')+1:html.r... | # IdeaScaly
# Copyright 2015 Jorge Saldivar
# See LICENSE for details.
import six
import dateutil.parser
def parse_datetime(str_date):
try:
date_is = dateutil.parser.parse(str_date)
return date_is
except:
return None
def parse_html_value(html):
return html[html.find('>')+1:html.r... |
Update the importer to use the places service | from datetime import timedelta
import httplib
from tempfile import TemporaryFile
from zipfile import ZipFile
from celery.schedules import schedule
from molly.apps.places.parsers.naptan import NaptanParser
class NaptanImporter(object):
IMPORTER_NAME = 'naptan'
IMPORT_SCHEDULE = schedule(run_every=timedelta(w... | from datetime import timedelta
import httplib
from tempfile import TemporaryFile
from zipfile import ZipFile
from celery.schedules import schedule
from molly.apps.places.parsers.naptan import NaptanParser
class NaptanImporter(object):
IMPORTER_NAME = 'naptan'
IMPORT_SCHEDULE = schedule(run_every=timedelta(w... |
Use node-style callbacks in through2 | 'use strict';
var defaults = require('defaults'),
through = require('through2'),
getLicenseTemplate = require('./lib/licenseTemplateStore').get,
prefixStream = require('./lib/prefixStream');
module.exports = function(type, options) {
var opts = defaults(options, {
year: new Date().getFullYear(),
license: t... | 'use strict';
var defaults = require('defaults'),
through = require('through2'),
getLicenseTemplate = require('./lib/licenseTemplateStore').get,
prefixStream = require('./lib/prefixStream');
module.exports = function(type, options) {
var opts = defaults(options, {
year: new Date().getFullYear(),
license: t... |
Fix requirejs for other locations than apps/ | /* global requirejs */
/**
* Mail
*
* This file is licensed under the Affero General Public License version 3 or
* later. See the COPYING file.
*
* @author Christoph Wurst <christoph@winzerhof-wurst.at>
* @copyright Christoph Wurst 2015, 2016
*/
(function() {
'use strict';
requirejs.config({
baseUrl: './... | /* global requirejs */
/**
* Mail
*
* This file is licensed under the Affero General Public License version 3 or
* later. See the COPYING file.
*
* @author Christoph Wurst <christoph@winzerhof-wurst.at>
* @copyright Christoph Wurst 2015, 2016
*/
(function() {
'use strict';
requirejs.config({
baseUrl: './... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.