text stringlengths 16 4.96k | positive stringlengths 321 2.24k | negative stringlengths 310 2.21k |
|---|---|---|
SGenJavaValidatorTest: Use Linker instead of LazyLinker | /**
* Copyright (c) 2012 committers of YAKINDU and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
* Contr... | /**
* Copyright (c) 2012 committers of YAKINDU and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
* Contr... |
Update sniffer tests with new argument passing | from mock import patch
from django.test import TestCase
from breach.sniffer import Sniffer
class SnifferTest(TestCase):
def setUp(self):
self.endpoint = 'http://localhost'
sniffer_params = {
'snifferendpoint': self.endpoint,
'sourceip': '147.102.239.229',
'host... | from mock import patch
from django.test import TestCase
from breach.sniffer import Sniffer
class SnifferTest(TestCase):
def setUp(self):
self.endpoint = 'http://localhost'
self.sniffer = Sniffer(self.endpoint, '147.102.239.229', 'dionyziz.com', 'wlan0', '8080')
@patch('breach.sniffer.request... |
Refactor code using es6 syntax | import passport from 'passport';
import passportLocal from 'passport-local';
import user from '../models';
const LocalStrategy = passportLocal.Strategy;
passport.serializeUser((sessionUser, done) => {
done(null, sessionUser.id);
});
passport.deserializeUser((id, done) => {
User.findById(id, (err, sessionUser) =>... | import passport from 'passport';
import passportLocal from 'passport-local';
import user from '../models';
const LocalStrategy = passportLocal.Strategy;
passport.serializeUser((user, done) => {
done(null, user.id);
});
passport.deserializeUser(function(id, done) {
User.findById(id, (err, user) => {
done(err,... |
Implement ability to submit the reply form | import React from 'react';
import { Modal, Form, Button, Header } from 'semantic-ui-react';
const ReplyFormModal = ({ onChange, onSubmit, listingId, userId }) =>
<Modal trigger={<Button>Contact Them!</Button>}>
<Modal.Header>Contact Form</Modal.Header>
<Modal.Content>
<Modal.Description>
<Heade... | import React from 'react';
import { Modal, Form, Button, Header } from 'semantic-ui-react';
const ReplyFormModal = () => {
return (
<Modal trigger={<Button>Contact Them!</Button>}>
<Modal.Header>Contact Form</Modal.Header>
<Modal.Content>
<Modal.Description>
<Header>Send Them A Mess... |
Fix issue where interfaces pass in _out | '''
Used to manage the outputter system. This package is the modular system used
for managing outputters.
'''
# Import salt utils
import salt.loader
def display_output(data, out, opts=None):
'''
Print the passed data using the desired output
'''
get_printout(out, opts)(data)
def get_printout(out, o... | '''
Used to manage the outputter system. This package is the modular system used
for managing outputters.
'''
# Import salt utils
import salt.loader
def display_output(data, out, opts=None):
'''
Print the passed data using the desired output
'''
if opts is None:
opts = {}
if not 'color' i... |
Disable less tests on php 7.4+ | <?php
namespace Minify\Test;
use Minify_HTML_Helper;
/**
* @requires php < 7.3
* @see https://github.com/mrclay/minify/pull/685
*/
class LessSourceTest extends TestCase
{
public function setUp()
{
$this->realDocRoot = $_SERVER['DOCUMENT_ROOT'];
$_SERVER['DOCUMENT_ROOT'] = self::$document_r... | <?php
namespace Minify\Test;
use Minify_HTML_Helper;
/**
* @requires php < 7.3
*/
class LessSourceTest extends TestCase
{
public function setUp()
{
$this->realDocRoot = $_SERVER['DOCUMENT_ROOT'];
$_SERVER['DOCUMENT_ROOT'] = self::$document_root;
}
/**
* @link https://github.co... |
Add real diff reporter to list of defaults | package reporters
import (
"os/exec"
"github.com/approvals/go-approval-tests/utils"
)
// NewFrontLoadedReporter creates the default front loaded reporter.
func NewFrontLoadedReporter() Reporter {
return NewFirstWorkingReporter(
NewContinuousIntegrationReporter(),
)
}
// NewDiffReporter creates the default dif... | package reporters
import (
"os/exec"
"github.com/approvals/go-approval-tests/utils"
)
// NewFrontLoadedReporter creates the default front loaded reporter.
func NewFrontLoadedReporter() Reporter {
return NewFirstWorkingReporter(
NewContinuousIntegrationReporter(),
)
}
// NewDiffReporter creates the default dif... |
Delete isn't a post method
This should fix the issue described in this stack overflow question https://stackoverflow.com/questions/49714538/unable-to-delete-an-object-parse-server | /*
* Copyright 2015 Chidiebere Okwudire.
*
* 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 ... | /*
* Copyright 2015 Chidiebere Okwudire.
*
* 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 ... |
Fix a bug with application stdout print | from .baselauncher import BaseLauncher
class BaseTestCases(BaseLauncher):
def handle_problem_set(self, name, problems):
for i, prob in enumerate(problems):
answer_got = self.get_answer(prob, name, i, len(problems))
if not answer_got:
return False
if not p... | from .baselauncher import BaseLauncher
class BaseTestCases(BaseLauncher):
def handle_problem_set(self, name, problems):
for i, prob in enumerate(problems):
answer_got = self.get_answer(prob, name, i, len(problems))
if not answer_got:
return False
if not p... |
Fix leftover reference to v4.0.0-alpha.6
Running `./build/change-version.js v4.0.0-alpha.6 v4.0.0` fixed this,
so the version change script works fine. I'm presuming instead this
change was just omitted from 35f80bb12e4e, and then wouldn't have
been caught by subsequent runs of `change-version`, since it only
ever rep... | import $ from 'jquery'
import Alert from './alert'
import Button from './button'
import Carousel from './carousel'
import Collapse from './collapse'
import Dropdown from './dropdown'
import Modal from './modal'
import Popover from './popover'
import Scrollspy from './scrollspy'
import Tab from './tab'
import Tooltip fr... | import $ from 'jquery'
import Alert from './alert'
import Button from './button'
import Carousel from './carousel'
import Collapse from './collapse'
import Dropdown from './dropdown'
import Modal from './modal'
import Popover from './popover'
import Scrollspy from './scrollspy'
import Tab from './tab'
import Tooltip fr... |
Improve `arc lint --output summary`
Summary:
This currently output like this:
file_a:
file_b:
file_c:
Warning on line 29: blah blah
This isn't especially useful and can't be piped to other tools. Instead, emit output like:
file_c:29:Warning: blah blah
This is greppable / pipeable.
Test Plan: Ran `arc ... | <?php
/**
* Shows lint messages to the user.
*
* @group lint
*/
final class ArcanistLintSummaryRenderer extends ArcanistLintRenderer {
public function renderLintResult(ArcanistLintResult $result) {
$messages = $result->getMessages();
$path = $result->getPath();
$text = array();
foreach ($message... | <?php
/**
* Shows lint messages to the user.
*
* @group lint
*/
final class ArcanistLintSummaryRenderer extends ArcanistLintRenderer {
public function renderLintResult(ArcanistLintResult $result) {
$messages = $result->getMessages();
$path = $result->getPath();
$text = array();
$text[] = $path."... |
Update js interface to allow more params | /*
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 not use ... | /*
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 not use ... |
Put Tejas email in contact form | <?php
// Check for empty fields
if(empty($_POST['name']) ||
empty($_POST['email']) ||
empty($_POST['phone']) ||
empty($_POST['message']) ||
!filter_var($_POST['email'],FILTER_VALIDATE_EMAIL))
{
echo "No arguments Provided!";
return false;
}
$name = strip_tags(htmlspecialchars($_P... | <?php
// Check for empty fields
if(empty($_POST['name']) ||
empty($_POST['email']) ||
empty($_POST['phone']) ||
empty($_POST['message']) ||
!filter_var($_POST['email'],FILTER_VALIDATE_EMAIL))
{
echo "No arguments Provided!";
return false;
}
$name = strip_tags(htmlspecialchars(... |
Add a "FIXME" comment for the disabled test so it shows up as a note in Eclipse (this idea was suggested awhile ago by brozow). | package org.opennms.netmgt.vulnscand;
import junit.framework.TestCase;
import org.opennms.core.queue.FifoQueue;
import org.opennms.core.queue.FifoQueueImpl;
import org.opennms.netmgt.config.VulnscandConfigFactory;
public class SchedulerTest extends TestCase {
protected void setUp() throws Exception {
System.... | package org.opennms.netmgt.vulnscand;
import junit.framework.TestCase;
import org.opennms.core.queue.FifoQueue;
import org.opennms.core.queue.FifoQueueImpl;
import org.opennms.netmgt.config.VulnscandConfigFactory;
public class SchedulerTest extends TestCase {
protected void setUp() throws Exception {
System.... |
Remove starred expression for 3.4 compatibility | import enum
import functools
import operator
import struct
class Packet(enum.IntEnum):
connect = 0
disconnect = 1
data = 2
ack = 3
end = 4
def build_data_packet(window, blockseed, block):
payload = struct.pack('!II', window, blockseed) + block
return build_packet(Packet.data, payload)
... | import enum
import functools
import operator
import struct
class Packet(enum.IntEnum):
connect = 0
disconnect = 1
data = 2
ack = 3
end = 4
def build_data_packet(window, blockseed, block):
payload = struct.pack('!II', window, blockseed) + block
return build_packet(Packet.data, payload)
... |
Change admin sort for slots | """Admin for schedule-related models."""
from pygotham.admin.utils import model_view
from pygotham.schedule import models
# This line is really long because pep257 needs it to be on one line.
__all__ = ('DayModelView', 'RoomModelView', 'SlotModelView', 'PresentationModelView')
CATEGORY = 'Schedule'
DayModelView = ... | """Admin for schedule-related models."""
from pygotham.admin.utils import model_view
from pygotham.schedule import models
# This line is really long because pep257 needs it to be on one line.
__all__ = ('DayModelView', 'RoomModelView', 'SlotModelView', 'PresentationModelView')
CATEGORY = 'Schedule'
DayModelView = ... |
Fix check for empty min/max years. |
from django import template
from django.db.models import Min, Max
from gnotty.models import IRCMessage
from gnotty.conf import settings
register = template.Library()
@register.inclusion_tag("gnotty/includes/nav.html", takes_context=True)
def gnotty_nav(context):
min_max = IRCMessage.objects.aggregate(Min("mes... |
from django import template
from django.db.models import Min, Max
from gnotty.models import IRCMessage
from gnotty.conf import settings
register = template.Library()
@register.inclusion_tag("gnotty/includes/nav.html", takes_context=True)
def gnotty_nav(context):
min_max = IRCMessage.objects.aggregate(Min("mes... |
Use .name to lookup tag name under fruitloops | /*global viewTemplateOverrides, createErrorMessage */
Handlebars.registerViewHelper('view', {
factory: function(args, options) {
var View = args.length >= 1 ? args[0] : Thorax.View;
return Thorax.Util.getViewInstance(View, options.options);
},
// ensure generated placeholder tag in template
// will matc... | /*global viewTemplateOverrides, createErrorMessage */
Handlebars.registerViewHelper('view', {
factory: function(args, options) {
var View = args.length >= 1 ? args[0] : Thorax.View;
return Thorax.Util.getViewInstance(View, options.options);
},
// ensure generated placeholder tag in template
// will matc... |
Add plugin state to logging | /* eslint-disable no-console */
import { CONFIG } from '../constants';
import { Socket } from 'phoenix';
import { startPlugin } from '..';
import listenAuth from './listenAuth';
import handleNotifications from './handleNotifications';
import handleWork from './handleWork';
import renderIcon from './renderIcon';
export... | /* eslint-disable no-console */
import { CONFIG } from '../constants';
import { Socket } from 'phoenix';
import { startPlugin } from '..';
import listenAuth from './listenAuth';
import handleNotifications from './handleNotifications';
import handleWork from './handleWork';
import renderIcon from './renderIcon';
export... |
Update ember-addon file to be compatible with latest master | 'use strict';
var path = require('path');
var commands = require('./lib/commands');
var postBuild = require('./lib/tasks/post-build');
module.exports = {
name: 'ember-cli-cordova',
treePaths: {
app: 'app',
styles: 'app/styles',
templates: 'app/templates',
ad... | 'use strict';
var path = require('path');
var commands = require('./lib/commands');
var postBuild = require('./lib/tasks/post-build');
module.exports = {
name: 'ember-cli-cordova',
init: function() {
this.setConfig();
},
blueprintsPath: function() {
return path.join(__dirname, 'blueprints');
... |
Stop rollup bundling for example | import { terser } from 'rollup-plugin-terser'
import pkg from './package.json'
import { nodeResolve } from '@rollup/plugin-node-resolve'
import commonjs from '@rollup/plugin-commonjs'
const umd = { format: 'umd', name: 'A11yDialog', exports: 'default' }
const es = { format: 'es' }
const minify = {
plugins: [terser()... | import { terser } from 'rollup-plugin-terser'
import pkg from './package.json'
import { nodeResolve } from '@rollup/plugin-node-resolve'
import commonjs from '@rollup/plugin-commonjs'
const umd = { format: 'umd', name: 'A11yDialog', exports: 'default' }
const es = { format: 'es' }
const minify = {
plugins: [terser()... |
Rename internal properties of SmoothHelper to avoid collisions with
classes that use the mixin. | Dashboard.SmoothHelper = Ember.Mixin.create({
_smoothHelperInterval: 10,
_smoothHelperProperties: function() {
return {};
}.property(),
setSmooth: function(property, value, duration) {
var p = this.get('_smoothHelperProperties');
var d = typeof duration !== 'undefined' ? duration : 1000;
if (p... | Dashboard.SmoothHelper = Ember.Mixin.create({
interval: 10,
properties: function() {
return {};
}.property(),
setSmooth: function(property, value, duration) {
var p = this.get('properties');
var d = typeof duration !== 'undefined' ? duration : 1000;
if (p[property] && p[property].intervalCall)... |
Accordion: Update test helper to use QUnit.push instead of deepEqual to get useful stacktrace | function accordion_state( accordion ) {
var expected = $.makeArray( arguments ).slice( 1 );
var actual = accordion.find( ".ui-accordion-content" ).map(function() {
return $( this ).css( "display" ) === "none" ? 0 : 1;
}).get();
QUnit.push( QUnit.equiv(actual, expected), actual, expected );
}
function accordion_e... | function accordion_state( accordion ) {
var expected = $.makeArray( arguments ).slice( 1 );
var actual = accordion.find( ".ui-accordion-content" ).map(function() {
return $( this ).css( "display" ) === "none" ? 0 : 1;
}).get();
deepEqual( actual, expected );
}
function accordion_equalHeights( accordion, min, max... |
Fix incomplete update to botocross 1.1.1 | #!/usr/bin/env python
from distutils.core import setup
from setuptools import find_packages
import stackformation
import sys
if sys.version_info <= (2, 5):
error = "ERROR: stackformation requires Python Version 2.6 or above...exiting."
print >> sys.stderr, error
sys.exit(1)
setup(name="stackformation",
... | #!/usr/bin/env python
from distutils.core import setup
from setuptools import find_packages
import stackformation
import sys
if sys.version_info <= (2, 5):
error = "ERROR: stackformation requires Python Version 2.6 or above...exiting."
print >> sys.stderr, error
sys.exit(1)
setup(name="stackformation",
... |
Add handle method in order to delegate to fire method for Laravel 5.5 | <?php
namespace Torann\Currency\Console;
use Illuminate\Console\Command;
class Cleanup extends Command
{
/**
* The name and signature of the console command.
*
* @var string
*/
protected $signature = 'currency:cleanup';
/**
* The console command description.
*
* @var s... | <?php
namespace Torann\Currency\Console;
use Illuminate\Console\Command;
class Cleanup extends Command
{
/**
* The name and signature of the console command.
*
* @var string
*/
protected $signature = 'currency:cleanup';
/**
* The console command description.
*
* @var s... |
Fix error when part of profile data is unset | <?php
namespace BNETDocs\Models\User;
use \CarlBennett\MVC\Libraries\Model;
class View extends Model {
public $biography;
public $contributions;
public $discord;
public $documents;
public $facebook;
public $facebook_uri;
public $github;
public $github_uri;
public $instagram;
public $instagram_ur... | <?php
namespace BNETDocs\Models\User;
use \CarlBennett\MVC\Libraries\Model;
class View extends Model {
public $biography;
public $contributions;
public $discord;
public $documents;
public $facebook;
public $facebook_uri;
public $github;
public $github_uri;
public $instagram;
public $instagram_ur... |
Remove whitespace from en dash
https://stackoverflow.com/questions/5078239 | <!-- Sticky Header -->
<div id="header-placeholder" role="presentation">
<header role="banner">
<div class="container">
<div class="header-left">
<a href="http://www.artic.edu/">
<img src="images/logo.svg" alt="Art Institute of Chicago">
</a>
<span class="exhibit">
<span class="title">Gauguin</s... | <!-- Sticky Header -->
<div id="header-placeholder" role="presentation">
<header role="banner">
<div class="container">
<div class="header-left">
<a href="http://www.artic.edu/">
<img src="images/logo.svg" alt="Art Institute of Chicago">
</a>
<span class="exhibit">
<span class="title">Gauguin</s... |
Fix Client Send Empty message | package controller;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.JButton;
import model.Message;
import view.MessageBoard;
public class MessageBoardController implements ActionListener{
private Controller controller;
public MessageBoardController(Controller controll... | package controller;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.JButton;
import model.Message;
import view.MessageBoard;
public class MessageBoardController implements ActionListener{
private Controller controller;
public MessageBoardController(Controller controll... |
Fix iteration was over whole element instead of only over subelements. | #!/usr/bin/env python
"""
================================================================================
:mod:`header` -- XML handler for header
================================================================================
.. module:: header
:synopsis: XML handler for header
.. inheritance-diagram:: header
"... | #!/usr/bin/env python
"""
================================================================================
:mod:`header` -- XML handler for header
================================================================================
.. module:: header
:synopsis: XML handler for header
.. inheritance-diagram:: header
"... |
Remove forgotten if in customer.py | from .Base import Base
class Customer(Base):
@property
def id(self):
return self.getProperty('id')
@property
def name(self):
return self.getProperty('name')
@property
def email(self):
return self.getProperty('email')
@property
def locale(self):
return... | from .Base import Base
class Customer(Base):
@property
def id(self):
return self.getProperty('id')
@property
def name(self):
return self.getProperty('name')
@property
def email(self):
return self.getProperty('email')
@property
def locale(self):
return... |
Rename the related name for User one-to-one relationship | from django.db import models
from django.utils.translation import ugettext as _
from Django.contrib.auth.models import User
FEMALE = 'F'
MALE = 'M'
class Teacher(models.Model):
"""
Halaqat teachers information
"""
GENDER_CHOICES = (
(MALE, _('Male')),
(FEMALE, _('Female')),
)
... | from django.db import models
from django.utils.translation import ugettext as _
from Django.contrib.auth.models import User
FEMALE = 'F'
MALE = 'M'
class Teacher(models.Model):
"""
Halaqat teachers information
"""
GENDER_CHOICES = (
(MALE, _('Male')),
(FEMALE, _('Female')),
)
... |
Remove loading user meta data.
Signed-off-by: Mior Muhammad Zaki <e1a543840a942eb68427510a8a483282a7bfeddf@gmail.com> | <?php
namespace Orchestra\Foundation\Http;
use Illuminate\Foundation\Http\Kernel as HttpKernel;
class Kernel extends HttpKernel
{
/**
* The bootstrap classes for the application.
*
* @return void
*/
protected $bootstrappers = [
\Illuminate\Foundation\Bootstrap\LoadEnvironmentVaria... | <?php
namespace Orchestra\Foundation\Http;
use Illuminate\Foundation\Http\Kernel as HttpKernel;
class Kernel extends HttpKernel
{
/**
* The bootstrap classes for the application.
*
* @return void
*/
protected $bootstrappers = [
\Illuminate\Foundation\Bootstrap\LoadEnvironmentVaria... |
Change var to const in webpack file | const path = require('path');
const webpack = require('webpack');
const APP_DIR = path.resolve(__dirname, 'client');
const SERVER_DIR = path.resolve(__dirname, 'server');
module.exports = {
devtool: 'eval',
entry: [
'webpack-hot-middleware/client', 'webpack/hot/dev-server',
APP_DIR + '/index.jsx'
],
ou... | var path = require('path');
var webpack = require('webpack');
var APP_DIR = path.resolve(__dirname, 'client');
var SERVER_DIR = path.resolve(__dirname, 'server');
console.log('=============', path.join(__dirname, 'dist'))
module.exports = {
devtool: 'eval',
entry: [
'webpack-hot-middleware/client', 'webpack/ho... |
Use the right way to limit queries | from django import template
from fullcalendar.models import Occurrence
register = template.Library()
@register.inclusion_tag('events/agenda_tag.html')
def show_agenda(*args, **kwargs):
qs = Occurrence.objects.upcoming()
if 'limit' in kwargs:
qs = qs[:int(kwargs['limit'])]
return {
'occu... | from django import template
from fullcalendar.models import Occurrence
register = template.Library()
@register.inclusion_tag('events/agenda_tag.html')
def show_agenda(*args, **kwargs):
qs = Occurrence.objects.upcoming()
if 'limit' in kwargs:
qs.limit(int(kwargs['limit']))
return {
'occu... |
Switch to obj long for nullable field | /*
* The MIT License (MIT)
*
* Copyright (c) 2016 Vincent Zhang/PhoenixLAB
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to u... | /*
* The MIT License (MIT)
*
* Copyright (c) 2016 Vincent Zhang/PhoenixLAB
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to u... |
Update comparator to select based on smallest by CPU, then Memory | define(function (require) {
"use strict";
var Backbone = require('backbone'),
_ = require('underscore'),
Size = require('models/Size'),
globals = require('globals');
return Backbone.Collection.extend({
model: Size,
url: globals.API_V2_ROOT + "/sizes",
parse: function (response) {
... | define(function (require) {
"use strict";
var Backbone = require('backbone'),
_ = require('underscore'),
Size = require('models/Size'),
globals = require('globals');
return Backbone.Collection.extend({
model: Size,
url: globals.API_V2_ROOT + "/sizes",
parse: function (response) {
... |
Use custom error message if email is invalid | const Sequelize = require('sequelize')
const bcrypt = require('bcrypt')
module.exports = {
model: {
name: Sequelize.STRING,
email: {
type: Sequelize.STRING,
allowNull: false,
unique: {
msg: 'username taken'
},
validate: {
isEmail: {
msg: 'username is not a valid email address'
}
... | const Sequelize = require('sequelize')
const bcrypt = require('bcrypt')
module.exports = {
model: {
name: Sequelize.STRING,
email: {
type: Sequelize.STRING,
allowNull: false,
unique: {
msg: 'username taken'
},
validate: {
isEmail: true
}
},
password: Sequelize.STRING,
photo: Sequel... |
Fix typo when displaying individual category details | <?php
namespace App\Http\Controllers;
use App\Http\Controllers\Controller;
use App\Models\Category;
use Cache;
class CategoriesController extends Controller
{
/**
* Display a listing of the resource.
*
* @return Response
*/
public function index()
{
$output = Cache::rememberFo... | <?php
namespace App\Http\Controllers;
use App\Http\Controllers\Controller;
use App\Models\Category;
use Cache;
class CategoriesController extends Controller
{
/**
* Display a listing of the resource.
*
* @return Response
*/
public function index()
{
$output = Cache::rememberFo... |
Fix wrong input component order | import React from 'react';
import LoadingContainer from '../containers/LoadingContainer';
import PathResultsContainer from '../containers/PathResultsContainer';
import ErrorMessageContainer from '../containers/ErrorMessageContainer';
import SearchButtonContainer from '../containers/SearchButtonContainer';
import ToArt... | import React from 'react';
import LoadingContainer from '../containers/LoadingContainer';
import PathResultsContainer from '../containers/PathResultsContainer';
import ErrorMessageContainer from '../containers/ErrorMessageContainer';
import SearchButtonContainer from '../containers/SearchButtonContainer';
import ToArt... |
Fix exception to use the filename instead of a blank string.
The exception was not reporting the problem file due to using the wrong
variable. | <?php
namespace Sprockets\Filter;
use Sprockets\File;
class Scss extends Base
{
private $parser;
public function __construct()
{
$previous_error_reporting = error_reporting();
error_reporting(E_ERROR);
$this->parser = new \SassParser(array('syntax' => \SassFile::SCSS));
error_reporting($previous_error_r... | <?php
namespace Sprockets\Filter;
use Sprockets\File;
class Scss extends Base
{
private $parser;
public function __construct()
{
$previous_error_reporting = error_reporting();
error_reporting(E_ERROR);
$this->parser = new \SassParser(array('syntax' => \SassFile::SCSS));
error_reporting($previous_error_r... |
Make study id types compatible | package com.movisens.xs.api.models;
import javax.annotation.Generated;
import com.google.gson.annotations.Expose;
@Generated("org.jsonschema2pojo")
public class Study {
@Expose
private Integer id;
@Expose
private String name;
/**
*
* @return The id
*/
public Integer getId() {
return id;
}
/**
*... | package com.movisens.xs.api.models;
import javax.annotation.Generated;
import com.google.gson.annotations.Expose;
@Generated("org.jsonschema2pojo")
public class Study {
@Expose
private long id;
@Expose
private String name;
/**
*
* @return The id
*/
public long getId() {
return id;
}
/**
*
* ... |
Change single quotes to double | #!/usr/bin/env python
import setuptools
from distutils.core import setup
execfile("sodapy/version.py")
with open("requirements.txt") as requirements:
required = requirements.read().splitlines()
try:
import pypandoc
long_description = pypandoc.convert('README.md', 'rst')
except(IOError, ImportError):
... | #!/usr/bin/env python
import setuptools
from distutils.core import setup
execfile('sodapy/version.py')
with open('requirements.txt') as requirements:
required = requirements.read().splitlines()
try:
import pypandoc
long_description = pypandoc.convert('README.md', 'rst')
except(IOError, ImportError):
... |
Remove removeOperation from grouped operation
This function is never used and actually should never be used. The operation may not be modified after it is used, so removing an operation from the list makes no sense. | # Copyright (c) 2015 Ultimaker B.V.
# Uranium is released under the terms of the AGPLv3 or higher.
from . import Operation
## An operation that groups several other operations together.
#
# The intent of this operation is to hide an underlying chain of operations
# from the user if they correspond to only one in... | # Copyright (c) 2015 Ultimaker B.V.
# Uranium is released under the terms of the AGPLv3 or higher.
from . import Operation
## An operation that groups several other operations together.
#
# The intent of this operation is to hide an underlying chain of operations
# from the user if they correspond to only one in... |
Format arrivalDate when creating reservation in db | var db = require('./db.js');
var moment = require('moment');
var _ = require('lodash');
var get = function() {
return db.get('reservations').value();
};
var make = function(id, arrivalDate, nights, guests) {
if (guests > 5 || !arrivalDate || !nights || !guests) {
return false;
}
let reservationDetails = {... | var db = require('./db.js');
var moment = require('moment');
var _ = require('lodash');
var get = function() {
return db.get('reservations').value();
};
var make = function(id, arrivalDate, nights, guests) {
if (guests > 5 || !arrivalDate || !nights || !guests) {
return false;
}
let reservationDetails = {... |
Use mapDispatchToProps and bindActionCreators to streamline the dispatch process. | import React, { Component, PropTypes } from 'react'
import { connect } from 'react-redux'
import { bindActionCreators } from 'redux'
import Heading from '../components/heading'
import Counter from '../components/counter'
import * as Actions from '../actions'
class App extends Component {
render() {
const {... | import React, { Component, PropTypes } from 'react';
import { connect } from 'react-redux';
import Heading from '../components/heading'
import Counter from '../components/counter'
import { increment, decrement } from '../actions'
class App extends Component {
render() {
const { dispatch, counter, children... |
Use only the python module index, but not the one from the (broken) pyqt4 extension | # -*- coding: utf-8 -*-
import sys, os
import pyudev
needs_sphinx = '1.0'
extensions = ['sphinx.ext.autodoc', 'sphinx.ext.intersphinx',
'sphinxcontrib.pyqt4', 'sphinxcontrib.issuetracker']
master_doc = 'index'
exclude_patterns = ['_build/*']
source_suffix = '.rst'
project = u'pyudev'
copyright = u'2... | # -*- coding: utf-8 -*-
import sys, os
import pyudev
needs_sphinx = '1.0'
extensions = ['sphinx.ext.autodoc', 'sphinx.ext.intersphinx',
'sphinxcontrib.pyqt4', 'sphinxcontrib.issuetracker']
master_doc = 'index'
exclude_patterns = ['_build/*']
source_suffix = '.rst'
project = u'pyudev'
copyright = u'2... |
Allow select type to link to item in column | import React from 'react';
import ItemsTableCell from '../../components/ItemsTableCell';
import ItemsTableValue from '../../components/ItemsTableValue';
var SelectColumn = React.createClass({
displayName: 'SelectColumn',
propTypes: {
col: React.PropTypes.object,
data: React.PropTypes.object,
linkTo: React.Prop... | import React from 'react';
import ItemsTableCell from '../../components/ItemsTableCell';
import ItemsTableValue from '../../components/ItemsTableValue';
var SelectColumn = React.createClass({
displayName: 'SelectColumn',
propTypes: {
col: React.PropTypes.object,
data: React.PropTypes.object,
},
renderValue () ... |
Fix build path for browser benchmark entry | "use strict";
const target = require( "@pegjs/bundler/target" );
module.exports = [
/* https://unpkg.com/pegjs@latest/dist/peg.js */
target( {
entry: require.resolve( "pegjs" ),
library: "peg",
output: "packages/pegjs/dist/peg.js",
} ),
/* https://unpkg.com/pegjs@latest/dis... | "use strict";
const target = require( "@pegjs/bundler/target" );
module.exports = [
/* https://unpkg.com/pegjs@latest/dist/peg.js */
target( {
entry: require.resolve( "pegjs" ),
library: "peg",
output: "packages/pegjs/dist/peg.js",
} ),
/* https://unpkg.com/pegjs@latest/dis... |
Fix stopping on a breakpoint for PyCharm 2017.3 | # -*- coding: utf-8 -*-
import threading
def pytest_exception_interact(node, call, report):
"""
Drop into PyCharm debugger, if available, on uncaught exceptions.
"""
try:
import pydevd
from pydevd import pydevd_tracing
except ImportError:
pass
else:
exctype, val... | # -*- coding: utf-8 -*-
import threading
def pytest_exception_interact(node, call, report):
"""
Drop into PyCharm debugger, if available, on uncaught exceptions.
"""
try:
import pydevd
from pydevd import pydevd_tracing
except ImportError:
pass
else:
exctype, val... |
Add missing comma in classifiers. | from setuptools import setup
setup(
name='jobcli',
version='0.1.a1',
py_modules=['jobcli'],
install_requires=['click', 'requests',],
entry_points={'console_scripts':['jobcli=jobcli:cli',]},
url='https://www.jobcli.com',
author='Stephan Goergen',
author_email='stephan.goergen@gmail.com',... | from setuptools import setup
setup(
name='jobcli',
version='0.1.a1',
py_modules=['jobcli'],
install_requires=['click', 'requests',],
entry_points={'console_scripts':['jobcli=jobcli:cli',]},
url='https://www.jobcli.com',
author='Stephan Goergen',
author_email='stephan.goergen@gmail.com',... |
Remove callback when the job is done | package io.github.izzyleung.zhihudailypurify.task;
import io.github.izzyleung.zhihudailypurify.ZhihuDailyPurifyApplication;
import io.github.izzyleung.zhihudailypurify.bean.DailyNews;
import java.util.List;
public abstract class BaseGetNewsTask extends BaseDownloadTask<Void, Void, List<DailyNews>> {
protected bo... | package io.github.izzyleung.zhihudailypurify.task;
import io.github.izzyleung.zhihudailypurify.ZhihuDailyPurifyApplication;
import io.github.izzyleung.zhihudailypurify.bean.DailyNews;
import java.util.List;
public abstract class BaseGetNewsTask extends BaseDownloadTask<Void, Void, List<DailyNews>> {
protected bo... |
Simplify comments list behavior so API requests are consistent with other types of records. | import Ember from 'ember';
const {
Route,
inject: { service }
} = Ember;
export default Route.extend({
currentUser: service(),
model(params) {
let projectId = this.modelFor('project').id;
let { number } = params;
return this.store.queryRecord('task', { projectId, number });
},
setupControll... | import Ember from 'ember';
const {
Route,
inject: { service }
} = Ember;
export default Route.extend({
currentUser: service(),
model(params) {
let projectId = this.modelFor('project').id;
let { number } = params;
return this.store.queryRecord('task', { projectId, number });
},
setupControll... |
Remove .only() call for tests. Sorry | 'use strict';
var validation = require('../lib/index')
, app = require('./app')
, should = require('should')
, request = require('supertest');
describe('set default values', function() {
describe('when the values are missing', function() {
// Expect default values to be set
it('should return the request wi... | 'use strict';
var validation = require('../lib/index')
, app = require('./app')
, should = require('should')
, request = require('supertest');
describe.only('set default values', function() {
describe('when the values are missing', function() {
// Expect default values to be set
it('should return the reque... |
Extend default idle timeout to account for the long and somewhat rare ListActiveBreakpoint calls.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=126710902 | /**
* Copyright 2015 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 appli... | /**
* Copyright 2015 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 appli... |
Add reset color to default mention templates. | package com.nguyenquyhy.discordbridge.models;
import ninja.leaping.configurate.objectmapping.Setting;
import ninja.leaping.configurate.objectmapping.serialize.ConfigSerializable;
/**
* Created by Hy on 12/11/2016.
*/
@ConfigSerializable
public class ChannelMinecraftMentionConfig implements IConfigInheritable<Channe... | package com.nguyenquyhy.discordbridge.models;
import ninja.leaping.configurate.objectmapping.Setting;
import ninja.leaping.configurate.objectmapping.serialize.ConfigSerializable;
/**
* Created by Hy on 12/11/2016.
*/
@ConfigSerializable
public class ChannelMinecraftMentionConfig implements IConfigInheritable<Channe... |
Fix Memcachestat. Using wrong classname | <?php
require_once('../_include.php');
try {
$config = SimpleSAML_Configuration::getInstance();
$session = SimpleSAML_Session::getInstance();
/* Make sure that the user has admin access rights. */
if (!isset($session) || !$session->isValid('login-admin') ) {
SimpleSAML_Utilities::redirect('/' . $config->getBa... | <?php
require_once('../_include.php');
try {
$config = SimpleSAML_Configuration::getInstance();
$session = SimpleSAML_Session::getInstance();
/* Make sure that the user has admin access rights. */
if (!isset($session) || !$session->isValid('login-admin') ) {
SimpleSAML_Utilities::redirect('/' . $config->getBa... |
Fix syntax and merge differences | #!/usr/bin/env node
var oust = require('../index');
var pkg = require('../package.json');
var fs = require('fs');
var argv = require('minimist')(process.argv.slice(2));
var printHelp = function() {
console.log('oust');
console.log(pkg.description);
console.log('');
console.log('Usage:');
console.... | #!/usr/bin/env node
var oust = require('../index');
var pkg = require('../package.json');
var fs = require('fs');
var argv = require('minimist')((process.argv.slice(2)))
var printHelp = function() {
console.log('oust');
console.log(pkg.description);
console.log('');
console.log('Usage:');
console... |
Refactor config class in dataservice module | 'use strict';
var EventEmitter = require('events').EventEmitter
class Config {
constructor() {
this.requiredKeys = ['url','type']
this.messages = {
missingConfig: 'DataService missing config object',
missingKey: 'DataService config missing required key: '
}
}
error(msg) {
throw new ... | 'use strict';
var EventEmitter = require('events').EventEmitter
class Config {
constructor() {
this.requiredKeys = ['url','type']
this.messages = {
missingConfig: 'DataService missing config object',
missingKey: 'DataService config missing required key: '
}
}
error(msg) {
throw new ... |
Update to new Cervus API | import { Game } from 'cervus/core';
import { Plane, Box } from 'cervus/shapes';
import { basic } from 'cervus/materials';
const game = new Game({
width: window.innerWidth,
height: window.innerHeight,
clear_color: "#eeeeee",
far: 1000
});
document.querySelector("#ui").addEventListener(
'click', () => game.ca... | import { Game } from 'cervus/modules/core';
import { Plane, Box } from 'cervus/modules/shapes';
import { basic } from 'cervus/modules/materials';
const game = new Game({
width: window.innerWidth,
height: window.innerHeight,
clear_color: "#eeeeee",
far: 1000
});
document.querySelector("#ui").addEventListener(... |
Clarify implications of introducing new migrations | const { last } = require('lodash');
const db = require('../database');
const settings = require('../settings');
const { runMigrations } = require('./run_migrations');
// IMPORTANT: Add new migrations that need to traverse entire database, e.g.
// messages store, below. Whenever we need this, we need to force attachm... | const { last } = require('lodash');
const db = require('../database');
const settings = require('../settings');
const { runMigrations } = require('./run_migrations');
// NOTE: Add new migrations that need to traverse entire database, e.g. messages
// store, here. These will only run after attachment migration has co... |
Switch to automated git clone and pull | #!/usr/bin/env python
import os
dependencies = (
('resources/vim/bundle/neobundle.vim',
'https://github.com/Shougo/neobundle.vim'),
('resources/zsh/zsh-syntax-highlighting',
'git://github.com/zsh-users/zsh-syntax-highlighting.git'),
('bins/el-rando', 'https://github.com/EvanHahn/el-rando.... | #!/usr/bin/env python
import os
dependencies = (
('bins/el-rando', 'https://github.com/EvanHahn/el-rando.git'),
('bins/is_github_up', 'https://github.com/EvanHahn/is-GitHub-up.git'),
('bins/iscp', 'https://github.com/EvanHahn/iscp.git'),
('bins/journ', 'https://github.com/EvanHahn/journ.git'),
('b... |
Support for Redux DevTools Extension | import {
applyMiddleware,
combineReducers,
compose,
createStore as createReduxStore
} from 'redux'
const makeRootReducer = (reducers, asyncReducers) => {
// Redux + combineReducers always expect at least one reducer, if reducers
// and asyncReducers are empty, we define an useless reducer funct... | import {
applyMiddleware,
combineReducers,
compose,
createStore as createReduxStore
} from 'redux'
const makeRootReducer = (reducers, asyncReducers) => {
// Redux + combineReducers always expect at least one reducer, if reducers
// and asyncReducers are empty, we define an useless reducer funct... |
Update galaxy params w/ new model choices |
'''
Use parameters from Diskfit in the Galaxy class
'''
from galaxies import Galaxy
from astropy.table import Table
from cube_analysis.rotation_curves import update_galaxy_params
from paths import fourteenB_HI_data_path, fourteenB_HI_data_wGBT_path
# The models from the peak velocity aren't as biased, based on com... |
'''
Use parameters from Diskfit in the Galaxy class
'''
from astropy import units as u
from galaxies import Galaxy
from astropy.table import Table
from paths import fourteenB_HI_data_path
def update_galaxy_params(gal, param_table):
'''
Use the fit values from fit rather than the hard-coded values in galaxi... |
Add db name for unit tests | <?php
/**
* Application configuration shared by all test types
*/
return [
'language' => 'en-US',
'controllerMap' => [
'fixture' => [
'class' => 'yii\faker\FixtureController',
'fixtureDataPath' => '@tests/codeception/fixtures',
'templatePath' => '@tests/codeception/... | <?php
/**
* Application configuration shared by all test types
*/
return [
'language' => 'en-US',
'controllerMap' => [
'fixture' => [
'class' => 'yii\faker\FixtureController',
'fixtureDataPath' => '@tests/codeception/fixtures',
'templatePath' => '@tests/codeception/... |
Add reference from article to catalog. | /*jslint eqeq: true, indent: 2, node: true, plusplus: true, regexp: true, unparam: true, vars: true, nomen: true */
'use strict';
var Schema = require('mongoose').Schema;
/**
* The article schema.
*/
var PostSchema = new Schema({
type: {type: Number, 'default': 0},
authorId: String,
catalogId: {type: String, ... | /*jslint eqeq: true, indent: 2, node: true, plusplus: true, regexp: true, unparam: true, vars: true, nomen: true */
'use strict';
var Schema = require('mongoose').Schema;
/**
* The article schema.
*/
var PostSchema = new Schema({
type: { type: Number, 'default': 0},
authorId: String,
catalogId: String,
tags... |
Fix spec issue with Transfer::Server ProtocolDetails | patches = [
{
"op": "move",
"from": "/ResourceTypes/AWS::Transfer::Server/Properties/Protocols/ItemType",
"path": "/ResourceTypes/AWS::Transfer::Server/Properties/Protocols/PrimitiveItemType",
},
{
"op": "replace",
"path": "/ResourceTypes/AWS::Transfer::Server/Propert... | patches = [
{
"op": "move",
"from": "/ResourceTypes/AWS::Transfer::Server/Properties/Protocols/ItemType",
"path": "/ResourceTypes/AWS::Transfer::Server/Properties/Protocols/PrimitiveItemType",
},
{
"op": "replace",
"path": "/ResourceTypes/AWS::Transfer::Server/Propert... |
[reference] Add a reference name in the list. | var loadManyReferenceList = require('./builder').loadMany;
var dispatcher = require('../dispatcher');
/**
* Focus reference action.
* @param {array} referenceNames - An array which contains the name of all the references to load.
* @returns {Promise} - The promise of loading all the references.
*/
function builtIn... | var loadManyReferenceList = require('./builder').loadMany;
var dispatcher = require('../dispatcher');
/**
* Focus reference action.
* @param {array} referenceNames - An array which contains the name of all the references to load.
* @returns {Promise} - The promise of loading all the references.
*/
function builtIn... |
Add slugify to the jinja2's globals scope | from flask import Flask
from flask.ext.bootstrap import Bootstrap
from flask.ext.sqlalchemy import SQLAlchemy
from flask.ext.login import LoginManager
from flask.ext.uploads import UploadSet, configure_uploads, IMAGES
from helpers.text import slugify
from config import config
bootstrap = Bootstrap()
db = SQLAlchemy(... | from flask import Flask
from flask.ext.bootstrap import Bootstrap
from flask.ext.sqlalchemy import SQLAlchemy
from flask.ext.login import LoginManager
from flask.ext.uploads import UploadSet, configure_uploads, IMAGES
from config import config
bootstrap = Bootstrap()
db = SQLAlchemy()
login_manager = LoginManager()
l... |
Replace deprecated "getName()" method from Twig extensions. | <?php
/**
* @author Igor Nikolaev <igor.sv.n@gmail.com>
* @copyright Copyright (c) 2015, Darvin Studio
* @link https://www.darvin-studio.ru
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Darvin\Utils\Twig\Extens... | <?php
/**
* @author Igor Nikolaev <igor.sv.n@gmail.com>
* @copyright Copyright (c) 2015, Darvin Studio
* @link https://www.darvin-studio.ru
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Darvin\Utils\Twig\Extens... |
Fix UTF-8 encoding for json exports | from lib.harvester import Harvester
from lib.cli_helper import is_writable_directory
import argparse
import logging
import json
logger = logging.getLogger(__name__)
logger.setLevel(logging.INFO)
formatter = logging.Formatter("%(asctime)s - %(name)s - %(levelname)s - %(message)s")
logging.basicConfig(format="%(asctime... | from lib.harvester import Harvester
from lib.cli_helper import is_writable_directory
import argparse
import logging
import json
logger = logging.getLogger(__name__)
logger.setLevel(logging.INFO)
formatter = logging.Formatter("%(asctime)s - %(name)s - %(levelname)s - %(message)s")
logging.basicConfig(format="%(asctime... |
XWIKI-10405: Implement a new Platform Mail Sender API
* Add missing @Unstable annotation | /*
* See the NOTICE file distributed with this work for additional
* information regarding copyright ownership.
*
* This 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.1 of
* th... | /*
* See the NOTICE file distributed with this work for additional
* information regarding copyright ownership.
*
* This 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.1 of
* th... |
Add getKeys and count to Patricia Tree | package com.cc4102.stringDict;
import java.util.ArrayList;
/**
* @author Lucas Puebla Silva
*
*/
public class PatriciaTree implements StringDictionary {
private PatriciaNode root;
public PatriciaTree() {
this.root = new PatriciaNode("", true, null, new ArrayList<>());
}
public int getLen... | package com.cc4102.stringDict;
import java.util.ArrayList;
/**
* @author Lucas Puebla Silva
*
*/
public class PatriciaTree implements StringDictionary {
private PatriciaNode root;
public PatriciaTree() {
this.root = new PatriciaNode("", true, null, new ArrayList<>());
}
@Override
pub... |
Change version number for release | import os
from setuptools import setup
with open(os.path.join(os.path.dirname(__file__), 'README.rst')) as readme:
README = readme.read()
# allow setup.py to be run from any path
os.chdir(os.path.normpath(os.path.join(os.path.abspath(__file__), os.pardir)))
setup(
name='mezzanine-sermons',
version='0.1.1... | import os
from setuptools import setup
with open(os.path.join(os.path.dirname(__file__), 'README.rst')) as readme:
README = readme.read()
# allow setup.py to be run from any path
os.chdir(os.path.normpath(os.path.join(os.path.abspath(__file__), os.pardir)))
setup(
name='mezzanine-sermons',
version='0.1.0... |
Add a language string for logging the actions
Signed-off-by: Suki <52329a27ea5670aeec0efeeb0773bf1b4f1affa1@missallsunday.com> | <?php
/**
*
* @package moderateAdmin mod
* @version 1.0
* @author Jessica Gonzlez <suki@missallsunday.com>
* @copyright Copyright (c) 2013, Jessica Gonzlez
* @license http://www.mozilla.org/MPL/ MPL 2.0
*/
global $txt;
$txt['mA_main'] = 'moderate admin';
// Permissions
$txt['cannot_moderateAdmin'] = 'I\'m sor... | <?php
/**
*
* @package moderateAdmin mod
* @version 1.0
* @author Jessica Gonzlez <suki@missallsunday.com>
* @copyright Copyright (c) 2013, Jessica Gonzlez
* @license http://www.mozilla.org/MPL/ MPL 2.0
*/
global $txt;
$txt['mA_main'] = 'moderate admin';
// Permissions
$txt['cannot_moderateAdmin'] = 'I\'m sor... |
Update service provider to use bindShared.
Signed-off-by: Mior Muhammad Zaki <e1a543840a942eb68427510a8a483282a7bfeddf@gmail.com> | <?php namespace Orchestra\Widget;
use Illuminate\Support\ServiceProvider;
use Illuminate\Foundation\AliasLoader;
class WidgetServiceProvider extends ServiceProvider
{
/**
* Indicates if loading of the provider is deferred.
*
* @var boolean
*/
protected $defer = true;
/**
* Regist... | <?php namespace Orchestra\Widget;
use Illuminate\Support\ServiceProvider;
use Illuminate\Foundation\AliasLoader;
class WidgetServiceProvider extends ServiceProvider
{
/**
* Indicates if loading of the provider is deferred.
*
* @var boolean
*/
protected $defer = true;
/**
* Regist... |
Fix @package annotation from Jam to Atlas | <?php namespace CL\Atlas\Test;
use Openbuildings\EnvironmentBackup as EB;
use CL\Atlas\DB;
/**
* @package Atlas
* @author Ivan Kerin
*/
abstract class AbstractTestCase extends \PHPUnit_Framework_TestCase {
public $env;
public function setUp()
{
parent::setUp();
$this->env = new EB\Environment(array(
'... | <?php namespace CL\Atlas\Test;
use Openbuildings\EnvironmentBackup as EB;
use CL\Atlas\DB;
/**
* @package Jam
* @author Ivan Kerin
*/
abstract class AbstractTestCase extends \PHPUnit_Framework_TestCase {
public $env;
public function setUp()
{
parent::setUp();
$this->env = new EB\Environment(array(
'st... |
Rename variable torpedos to torpedoCount | package hu.bme.mit.spaceship;
import java.util.Random;
/**
* Class storing and managing the torpedoes of a ship
*/
public class TorpedoStore {
private int torpedoCount = 0;
private Random generator = new Random();
public TorpedoStore(int numberOfTorpedos){
this.torpedoCount = numberOfTorpedos;
}
publ... | package hu.bme.mit.spaceship;
import java.util.Random;
/**
* Class storing and managing the torpedoes of a ship
*/
public class TorpedoStore {
private int torpedos = 0;
private Random generator = new Random();
public TorpedoStore(int numberOfTorpedos){
this.torpedos = numberOfTorpedos;
}
public boole... |
Add ``get_domain`` test fixture factory.
Helpful to test the ``Domain``. | from us_ignite.apps.models import (Application, ApplicationMembership,
Domain, Page)
from us_ignite.profiles.tests.fixtures import get_user
def get_application(**kwargs):
data = {
'name': 'Gigabit app',
}
if not 'owner' in kwargs:
data['owner'] = get_user... | from us_ignite.apps.models import Application, ApplicationMembership, Page
from us_ignite.profiles.tests.fixtures import get_user
def get_application(**kwargs):
defaults = {
'name': 'Gigabit app',
}
if not 'owner' in kwargs:
defaults['owner'] = get_user('us-ignite')
defaults.update(kwa... |
Fix moment.js not found in production | //= require jquery
//= require jquery_ujs
//= require twitter/bootstrap
//= require lodash
//= require handlebars.runtime
// To use placeholders in inputs in browsers that do not support it
// natively yet.
//= require jquery/jquery.placeholder
// Notifications (flash messages).
//= require jquery/jquery.noty
// To ... | //= require jquery
//= require jquery_ujs
//= require twitter/bootstrap
//= require lodash
//= require handlebars.runtime
// To use placeholders in inputs in browsers that do not support it
// natively yet.
//= require jquery/jquery.placeholder
// Notifications (flash messages).
//= require jquery/jquery.noty
// To ... |
Add import and export buttons | //Source:
//https://plus.google.com/+AddyOsmani/posts/jBS8CiNTESM
//http://bgrins.github.io/devtools-snippets/#console-save
//A simple way to save objects as .json files from the console
(function(console){
console.save = function(data, filename){
if(!data) {
console.error('Console.save: No da... | //Source:
//https://plus.google.com/+AddyOsmani/posts/jBS8CiNTESM
//http://bgrins.github.io/devtools-snippets/#console-save
(function(console){
console.save = function(data, filename){
if(!data) {
console.error('Console.save: No data');
return;
}
if(!filename) file... |
Add capture method to charge | <?php
class Stripe_Charge extends Stripe_ApiResource
{
public static function constructFrom($values, $apiKey=null)
{
$class = get_class();
return self::_scopedConstructFrom($class, $values, $apiKey);
}
public static function retrieve($id, $apiKey=null)
{
$class = get_class();
return self::_s... | <?php
class Stripe_Charge extends Stripe_ApiResource
{
public static function constructFrom($values, $apiKey=null)
{
$class = get_class();
return self::_scopedConstructFrom($class, $values, $apiKey);
}
public static function retrieve($id, $apiKey=null)
{
$class = get_class();
return self::_s... |
Rename variable for more consitency | const chai = require('chai');
const chaiAsPromised = require('chai-as-promised');
const nock = require('nock');
chai.use(chaiAsPromised);
chai.should();
const expect = chai.expect;
const pnut = require('../lib/pnut');
describe('The pnut API wrapper', function () {
before(function() {
let base = 'https://api.p... | const chai = require('chai');
const chaiAsPromised = require('chai-as-promised');
const nock = require('nock');
chai.use(chaiAsPromised);
chai.should();
const expect = chai.expect;
const pnut = require('../lib/pnut');
describe('The pnut API wrapper', function () {
before(function() {
let root = 'https://api.p... |
Set REALTIME_UI default to true. | <?php
use PHPCensor\Configuration;
use PHPCensor\DatabaseManager;
use PHPCensor\Helper\Lang;
use PHPCensor\StoreRegistry;
const ROOT_DIR = __DIR__ . '/';
const SRC_DIR = ROOT_DIR . 'src/';
const PUBLIC_DIR = ROOT_DIR . 'public/';
const APP_DIR = ROOT_DIR . 'app/';
const RUNTIME_DIR = ROOT_DIR . 'runtime/'... | <?php
use PHPCensor\Configuration;
use PHPCensor\DatabaseManager;
use PHPCensor\Helper\Lang;
use PHPCensor\StoreRegistry;
const ROOT_DIR = __DIR__ . '/';
const SRC_DIR = ROOT_DIR . 'src/';
const PUBLIC_DIR = ROOT_DIR . 'public/';
const APP_DIR = ROOT_DIR . 'app/';
const RUNTIME_DIR = ROOT_DIR . 'runtime/'... |
Change sequelize to use new logger | // Sequelize Initialization
var log = require('npmlog');
var fs = require('fs');
var path = require('path');
var Sequelize = require('sequelize');
var lodash = require('lodash');
var config = require('../config');
var db = {};
var sequelize = new Sequelize(
config.db[config.mode].name,
... | // Sequelize Initialization
var fs = require('fs');
var path = require('path');
var Sequelize = require('sequelize');
var lodash = require('lodash');
var config = require('../config');
var sequelize = new Sequelize(config.db[config.mode].name, config.db[config.mode].user, config.db[config.mode].passwo... |
Remove db password from source control | <?php
include("/secure/data_db_settings.php");
# Read GET variables
$stime = $_POST['stime'];
$etime = $_POST['etime'];
$moves = $_POST['moves'];
$conn = mysql_connect('localhost:3036', $dbuser, $dbpass);
if(! $conn )
{
die('Could not connect: ' . mysql_error());
}
uns... | <?php
# Database variables
$dbhost = 'localhost:3036';
$dbuser = 'c0smic_tyro';
$dbpass = '2$M*k^4!?oDm';
# Read GET variables
$stime = $_POST['stime'];
$etime = $_POST['etime'];
$moves = $_POST['moves'];
# Create output string
$str = "$stime, $etime, \"$moves\"";
$conn = ... |
Hide the sidebar by default. | import {Experiment, ExperimentStep} from './experiment.model';
angular.module('materialscommons').component('mcExperiment', {
templateUrl: 'app/project/experiments/experiment/mc-experiment.html',
controller: MCExperimentComponentController
});
/*@ngInject*/
function MCExperimentComponentController($scope, mov... | import {Experiment, ExperimentStep} from './experiment.model';
angular.module('materialscommons').component('mcExperiment', {
templateUrl: 'app/project/experiments/experiment/mc-experiment.html',
controller: MCExperimentComponentController
});
/*@ngInject*/
function MCExperimentComponentController($scope, mov... |
Add interval for checking flow meter | var twilio = require('twilio'),
express = require('express'),
orderPizza = require('orderpizza'),
kegapi = require('kegapi'),
sendText = require('sendText');
var app = express();
var textResponse = function(request, response) {
console.log('got here');
if (twilio.validateExpressRequest(request... | var twilio = require('twilio'),
express = require('express'),
orderPizza = require('orderpizza'),
sendText = require('sendText');
var app = express();
var textResponse = function(request, response) {
console.log('got here');
if (twilio.validateExpressRequest(request, '08b1eaf92fd66749470c93088253c... |
Fix expected case on mysql5 foreignKey extraction | <?php
/**
* DBSteward unit test for mysql5 foreign key extraction
*
* @package DBSteward
* @license http://www.opensource.org/licenses/bsd-license.php Simplified BSD License
*/
require_once __DIR__ . '/Mysql5ExtractionTest.php';
/**
* @group mysql5
*/
class Mysql5ExtractCompoundForeignKeyTest extends Mysql5Ext... | <?php
/**
* DBSteward unit test for mysql5 foreign key extraction
*
* @package DBSteward
* @license http://www.opensource.org/licenses/bsd-license.php Simplified BSD License
*/
require_once __DIR__ . '/Mysql5ExtractionTest.php';
/**
* @group mysql5
*/
class Mysql5ExtractCompoundForeignKeyTest extends Mysql5Ext... |
Print the error in the regression test. | """
A regression test for computing three kinds of spectrogram.
Just to ensure we didn't break anything.
"""
import numpy as np
import os
from tfr.files import load_wav
from tfr.spectrogram_features import spectrogram_features
DATA_DIR = os.path.join(os.path.dirname(os.path.abspath(__file__)), 'data')
def test_spec... | """
A regression test for computing three kinds of spectrogram.
Just to ensure we didn't break anything.
"""
import numpy as np
import os
from tfr.files import load_wav
from tfr.spectrogram_features import spectrogram_features
DATA_DIR = os.path.join(os.path.dirname(os.path.abspath(__file__)), 'data')
def test_spec... |
Fix array structure in @var annotation | <?php
declare(strict_types=1);
namespace Codeception\Subscriber;
use Codeception\Event\TestEvent;
use Codeception\Events;
use Codeception\ResultAggregator;
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
class FailFast implements EventSubscriberInterface
{
use Shared\StaticEventsTrait;
/**
... | <?php
declare(strict_types=1);
namespace Codeception\Subscriber;
use Codeception\Event\TestEvent;
use Codeception\Events;
use Codeception\ResultAggregator;
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
class FailFast implements EventSubscriberInterface
{
use Shared\StaticEventsTrait;
/**
... |
Add blank line to fix linting error | """A module to prove a way of locating and loading test resource files.
This is akin to the `iati.resources` module, but deals with test data.
"""
import iati.resources
def load_as_dataset(file_path):
"""Load a specified test data file as a Dataset.
Args:
file_path (str): The path of the file, rela... | """A module to prove a way of locating and loading test resource files.
This is akin to the `iati.resources` module, but deals with test data.
"""
import iati.resources
def load_as_dataset(file_path):
"""Load a specified test data file as a Dataset.
Args:
file_path (str): The path of the file, relat... |
Add option to print only last step of iteration. | #!/usr/bin/env python3
from argparse import ArgumentParser
from itertools import groupby
def iterate(n):
result = 0
digits = [int(i) for i in str(n)]
for k, g in groupby(digits):
result = result * 100 + len(tuple(g)) * 10 + k
return result
def compute(n, i=20):
yield n
x = n
for... | #!/usr/bin/env python3
from argparse import ArgumentParser
from itertools import groupby
def iterate(n):
result = 0
digits = [int(i) for i in str(n)]
for k, g in groupby(digits):
result = result * 100 + len(tuple(g)) * 10 + k
return result
def compute(n, i=20):
yield n
x = n
for... |
Plugins: Read logger config from Preferences
required due to 9b30d85d1b60fef4f4d7c35868dd406f0c5d94f3 | import logging
import sublime
PACKAGE_NAME = __package__.split(".", 1)[0]
logging.basicConfig(
level=logging.ERROR,
format="%(name)s [%(levelname)s]: %(message)s"
)
logger = logging.getLogger(PACKAGE_NAME)
def load_logger():
"""
Subscribe to Preferences changes in to get log level from user settings... | import logging
import sublime
PACKAGE_NAME = __package__.split(".", 1)[0]
logging.basicConfig(
level=logging.ERROR,
format="%(name)s [%(levelname)s]: %(message)s"
)
logger = logging.getLogger(PACKAGE_NAME)
def load_logger():
"""
Subscribe to Markdown changes in to get log level from user settings.
... |
Expatistan: Move to group "base" and enable "More at ..." | (function(env){
env.ddg_spice_expatistan = function(api_result) {
"use strict";
if(!api_result || api_result.status !== 'OK') {
return Spice.failed('expatistan');
}
Spice.add({
id: "expatistan",
name: "Expatistan",
data: api_result,
... | (function(env){
env.ddg_spice_expatistan = function(api_result) {
"use strict";
if(!api_result || api_result.status !== 'OK') {
return Spice.failed('expatistan');
}
Spice.add({
id: "expatistan",
name: "Expatistan",
data: api_result,
... |
Add retry_after to meta of too many requests exception | <?php
namespace Notimatica\ApiExceptions;
use Exception;
class TooManyRequestsApiException extends ApiException
{
/**
* @var int|null
*/
protected $retryAfter = null;
/**
* @param int|null $retryAfter
* @param array $headers
* @param string $message
* @param Exception $prev... | <?php
namespace Notimatica\ApiExceptions;
use Exception;
class TooManyRequestsApiException extends ApiException
{
/**
* @param int|null $retryAfter
* @param array $headers
* @param string $message
* @param Exception $previous
*/
public function __construct($retryAfter = null, $header... |
Set log level to WARNING when testing | import logging
import luigi
import sciluigi as sl
import os
TESTFILE_PATH = '/tmp/test.out'
log = logging.getLogger('sciluigi-interface')
log.setLevel(logging.WARNING)
class TestTask(sl.Task):
def out_data(self):
return sl.TargetInfo(self, TESTFILE_PATH)
def run(self):
with self.out_data().... | import luigi
import sciluigi as sl
import os
TESTFILE_PATH = '/tmp/test.out'
class TestTask(sl.Task):
def out_data(self):
return sl.TargetInfo(self, TESTFILE_PATH)
def run(self):
with self.out_data().open('w') as outfile:
outfile.write('File written by luigi\n')
class TestRunTas... |
Allow specifying entry to run
When making an entries object, it's not predictable which entry will be first. This patch allows specifying the entry by name. | import cluster from "cluster";
export default class StartServerPlugin {
constructor(entry) {
this.entry = entry;
this.afterEmit = this.afterEmit.bind(this);
this.apply = this.apply.bind(this);
this.startServer = this.startServer.bind(this);
this.worker = null;
}
afterEmit(compilation, callb... | import cluster from "cluster";
export default class StartServerPlugin {
constructor() {
this.afterEmit = this.afterEmit.bind(this);
this.apply = this.apply.bind(this);
this.startServer = this.startServer.bind(this);
this.worker = null;
}
afterEmit(compilation, callback) {
if (this.worker &&... |
Update to depend on separate powershift-cli package. | 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 :: 3',
'Programming Language :: Python :: 3.5',
'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 :: 3',
'Programming Language :: Python :: 3.5',
]
setup_kwargs = dict(
name='... |
Add README content to long description | import codecs
import setuptools
setuptools.setup(
name='bashlint',
version='0.0.1',
description='Bash linting tool',
long_description=codecs.open('README.rst', 'r', 'utf-8').read(),
keywords='bash',
author='Stanislav Kudriashev',
author_email='stas.kudriashev@gmail.com',
url='https://... | import setuptools
setuptools.setup(
name='bashlint',
version='0.0.1',
description="Bash linting tool",
long_description="Simple Bash linting tool written in Python.",
keywords='bash',
author='Stanislav Kudriashev',
author_email='stas.kudriashev@gmail.com',
url='https://github.com/skudr... |
Make fields in example app non required | from django.db import models
import i18n
from i18n.models import TranslatableModel
class Document(TranslatableModel):
untranslated_charfield = models.CharField(max_length=50, blank=True)
charfield = i18n.LocalizedCharField(max_length=50)
textfield = i18n.LocalizedTextField(max_length=500, blank=True)
... | import i18n
from i18n.models import TranslatableModel
class Document(TranslatableModel):
charfield = i18n.LocalizedCharField(max_length=50)
textfield = i18n.LocalizedTextField(max_length=512)
filefield = i18n.LocalizedFileField(null=True, upload_to='files')
imagefield = i18n.LocalizedImageField(null=... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.