text stringlengths 17 1.47k | positive stringlengths 673 4.43k | negative stringlengths 677 2.81k |
|---|---|---|
Use path for group directly | <?php
namespace App\Providers;
use Illuminate\Support\Facades\Route;
use Illuminate\Foundation\Support\Providers\RouteServiceProvider as ServiceProvider;
class RouteServiceProvider extends ServiceProvider
{
/**
* This namespace is applied to your controller routes.
*
* In addition, it is set as th... | <?php
namespace App\Providers;
use Illuminate\Support\Facades\Route;
use Illuminate\Foundation\Support\Providers\RouteServiceProvider as ServiceProvider;
class RouteServiceProvider extends ServiceProvider
{
/**
* This namespace is applied to your controller routes.
*
* In addition, it is set as th... |
Fix the missing key-s warning | (function () {
'use strict';
var React = require('react'),
clearingItem = function () {
return React.DOM.div(
{className: 'star-rating-clear-container', key: 0},
React.DOM.a({
className: 'star-rating-clear',
title: 'R... | (function () {
'use strict';
var React = require('react'),
clearingItem = function () {
return React.DOM.div(
{className: 'star-rating-clear-container', key: 's0'},
React.DOM.a({
className: 'star-rating-clear',
title:... |
Update command to use new handle method | <?php
namespace SebastiaanLuca\Migrations\Commands;
use Illuminate\Database\Console\Migrations\MigrateMakeCommand;
use Illuminate\Support\Composer;
use SebastiaanLuca\Migrations\ExtendedMigrationCreator;
class GenerateMigration extends MigrateMakeCommand
{
/**
* The name and signature of the console command... | <?php
namespace SebastiaanLuca\Migrations\Commands;
use Illuminate\Database\Console\Migrations\MigrateMakeCommand;
use Illuminate\Support\Composer;
use SebastiaanLuca\Migrations\ExtendedMigrationCreator;
class GenerateMigration extends MigrateMakeCommand
{
/**
* The name and signature of the console command... |
Change the while loop to a for loop to make the code more concise | package com.example.android.miwok;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.Toolbar;
import android.widget.LinearLayout;
import android.widget.TextView;
import java.util.ArrayList;
public class NumbersActivity extends AppCompatActivity {
@Overri... | package com.example.android.miwok;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.Toolbar;
import android.widget.LinearLayout;
import android.widget.TextView;
import java.util.ArrayList;
public class NumbersActivity extends AppCompatActivity {
@Overri... |
Fix pytables -> tables for pip. | from ez_setup import use_setuptools
use_setuptools()
from setuptools import setup
setup(
name='urbansim',
version='0.2dev',
description='Tool for modeling metropolitan real estate markets',
author='Synthicity',
author_email='ffoti@berkeley.edu',
license='AGPL',
url='https://git... | from ez_setup import use_setuptools
use_setuptools()
from setuptools import setup
setup(
name='urbansim',
version='0.2dev',
description='Tool for modeling metropolitan real estate markets',
author='Synthicity',
author_email='ffoti@berkeley.edu',
license='AGPL',
url='https://git... |
Make a test of multiple header values insensitve to their order
This test sometimes failed on Python 3 because the values in the header
were ordered differently - splitting them and comparing as a set should
fix that. | from __future__ import unicode_literals
from django_webtest import WebTest
from .auth import TestUserMixin
from .uk_examples import UK2015ExamplesMixin
class TestCaching(TestUserMixin, UK2015ExamplesMixin, WebTest):
def setUp(self):
super(TestCaching, self).setUp()
def test_unauth_user_cache_heade... | from __future__ import unicode_literals
from django_webtest import WebTest
from .auth import TestUserMixin
from .uk_examples import UK2015ExamplesMixin
class TestCaching(TestUserMixin, UK2015ExamplesMixin, WebTest):
def setUp(self):
super(TestCaching, self).setUp()
def test_unauth_user_cache_heade... |
Stop pinning tomli version for tests-require
This was to work around a temporary issue with black. Pinning
prevented using the latest black version, which is the first
stable version. | import sys
import setuptools
with open("twarc/version.py") as f:
exec(f.read())
with open("docs/README.md") as f:
long_description = f.read()
with open("requirements.txt") as f:
dependencies = f.read().split()
if __name__ == "__main__":
setuptools.setup(
name="twarc",
version=version... | import sys
import setuptools
with open("twarc/version.py") as f:
exec(f.read())
with open("docs/README.md") as f:
long_description = f.read()
with open("requirements.txt") as f:
dependencies = f.read().split()
if __name__ == "__main__":
setuptools.setup(
name="twarc",
version=version... |
Use Request::isMethodSafe() according to standard
https://tools.ietf.org/html/rfc7231#section-4.2.1 | <?php
namespace Bolt\EventListener;
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
use Symfony\Component\HttpKernel\Event\FilterResponseEvent;
use Symfony\Component\HttpKernel\KernelEvents;
/**
* Disable browser's XSS detection for given routes.
*
* These routes should still verify the request da... | <?php
namespace Bolt\EventListener;
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
use Symfony\Component\HttpKernel\Event\FilterResponseEvent;
use Symfony\Component\HttpKernel\KernelEvents;
/**
* Disable browser's XSS detection for given routes.
*
* These routes should still verify the request da... |
Add more tests for Route53Client::cleanId | <?php
namespace Aws\Test\Route53;
use Aws\Route53\Route53Client;
/**
* @covers Aws\Route53\Route53Client
*/
class Route53ClientTest extends \PHPUnit_Framework_TestCase
{
public function testCleansIds()
{
$client = new Route53Client([
'service' => 'route53',
'region' => 'us-w... | <?php
namespace Aws\Test\Route53;
use Aws\Route53\Route53Client;
/**
* @covers Aws\Route53\Route53Client
*/
class Route53ClientTest extends \PHPUnit_Framework_TestCase
{
public function testCleansIds()
{
$client = new Route53Client([
'service' => 'route53',
'region' => 'us-w... |
Check result of symlink function | <?php
namespace Gitonomy\Git;
/**
* Hooks handler.
*
* @author Alexandre Salomé <alexandre.salome@gmail.com>
*/
class Hooks
{
/**
* @var Gitonomy\Git\Repository
*/
protected $repository;
function __construct(Repository $repository)
{
$this->repository = $repository;
}
f... | <?php
namespace Gitonomy\Git;
/**
* Hooks handler.
*
* @author Alexandre Salomé <alexandre.salome@gmail.com>
*/
class Hooks
{
/**
* @var Gitonomy\Git\Repository
*/
protected $repository;
function __construct(Repository $repository)
{
$this->repository = $repository;
}
f... |
Handle case with empty block | # -*- coding: utf-8 -*-
"""antimarkdown.handlers -- Element handlers for converting HTML Elements/subtrees to Markdown text.
"""
from collections import deque
from antimarkdown import nodes
def render(*domtrees):
if not domtrees:
return u''
root = nodes.Root()
for dom in domtrees:
build_... | # -*- coding: utf-8 -*-
"""antimarkdown.handlers -- Element handlers for converting HTML Elements/subtrees to Markdown text.
"""
from collections import deque
from antimarkdown import nodes
def render(*domtrees):
if not domtrees:
return u''
root = nodes.Root()
for dom in domtrees:
build_... |
Make EntryMarkleLeafStore cater for empty db | package uk.gov.register.db;
import com.fasterxml.jackson.core.JsonGenerator;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.SerializationFeature;
import uk.gov.register.core.Entry;
import uk.gov.verifiablelog.store.Me... | package uk.gov.register.db;
import com.fasterxml.jackson.core.JsonGenerator;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.SerializationFeature;
import uk.gov.register.core.Entry;
import uk.gov.verifiablelog.store.Me... |
BAP-775: Create datagrid and pager for all results from indexer
- updated datagrid interface | <?php
namespace Oro\Bundle\GridBundle\Datagrid;
use Sonata\AdminBundle\Datagrid\DatagridInterface as BaseDatagridInterface;
use Oro\Bundle\GridBundle\Property\PropertyInterface;
use Oro\Bundle\GridBundle\Sorter\SorterInterface;
use Oro\Bundle\GridBundle\Route\RouteGeneratorInterface;
use Oro\Bundle\GridBundle\Action... | <?php
namespace Oro\Bundle\GridBundle\Datagrid;
use Sonata\AdminBundle\Datagrid\DatagridInterface as BaseDatagridInterface;
use Oro\Bundle\GridBundle\Property\PropertyInterface;
use Oro\Bundle\GridBundle\Sorter\SorterInterface;
use Oro\Bundle\GridBundle\Route\RouteGeneratorInterface;
use Oro\Bundle\GridBundle\Action... |
chore(test): Fix styleguide specs now that tabs changed | require('./spec_helper');
import StyleguideNav from '../../src/styleguide-nav';
describe('StyleguideNav', () => {
beforeEach(() => {
const navTree = {
CSS: {
eggplants: "purple.html",
apples: "red.html"
},
React: {
carrots: "orange.html",
apples: "red.html"
... | require('./spec_helper');
import StyleguideNav from '../../src/styleguide-nav';
describe('StyleguideNav', () => {
beforeEach(() => {
const navTree = {
CSS: {
eggplants: "purple.html",
apples: "red.html"
},
React: {
carrots: "orange.html",
apples: "red.html"
... |
Throw AccessDeniedHttpException instead of a NotFoundHttpException. | <?php
namespace Oneup\Bundle\ContaoSecurityCheckerBundle\Controller;
use Oneup\Bundle\ContaoSecurityCheckerBundle\DependencyInjection\Configuration;
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Symfony\Component\HttpFoundation\JsonResponse;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Co... | <?php
namespace Oneup\Bundle\ContaoSecurityCheckerBundle\Controller;
use Oneup\Bundle\ContaoSecurityCheckerBundle\DependencyInjection\Configuration;
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Symfony\Component\HttpFoundation\JsonResponse;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Co... |
Set term category when fetching definition | function fetchDefinition() {
var term = document.getElementById('id_term-text').value;
var language = document.getElementById('id_term-language').value;
var url = '/api/define.json?term=' + term + '&language=' + language;
fetch(url)
.then(function(response) {
return response.json();
})
... | function fetchDefinition() {
var term = document.getElementById('id_term-text').value;
var language = document.getElementById('id_term-language').value;
var url = '/api/define.json?term=' + term + '&language=' + language;
fetch(url)
.then(function(response) {
return response.json();
})
... |
Set Guzzle 6 as Http Client And Http Message Factory. | <?php
/**
* Linkedin API for Laravel Framework
*
* @author Mauri de Souza Nunes <mauri870@gmail.com>
* @license https://opensource.org/licenses/MIT MIT License
*/
namespace Artesaos\LinkedIn;
use Illuminate\Support\ServiceProvider;
use Http\Adapter\Guzzle6\Client as HttpClient;
use Http\Message\MessageFacto... | <?php
/**
* Linkedin API for Laravel Framework
*
* @author Mauri de Souza Nunes <mauri870@gmail.com>
* @license https://opensource.org/licenses/MIT MIT License
*/
namespace Artesaos\LinkedIn;
use Illuminate\Support\ServiceProvider;
class LinkedinServiceProvider extends ServiceProvider
{
/**
* Perf... |
Fix bug in getPrefFast (first time use) | /* global sauce */
/* Just add some client side caching to the proxy calls. */
sauce.ns('storage', ns => {
'use strict';
let _prefs;
let _prefsCache = new Map();
let _fastPrefsReadyInvoked; // catch API misuse with this.
const _fastPrefInit = (async () => {
if (!sauce.proxy.isConnected) ... | /* global sauce */
/* Just add some client side caching to the proxy calls. */
sauce.ns('storage', ns => {
'use strict';
let _prefs;
let _prefsCache = new Map();
let _fastPrefsReadyInvoked; // catch API misuse with this.
const _fastPrefInit = (async () => {
if (!sauce.proxy.isConnected) ... |
Set publish and trashed state | (function () {
'use strict';
function RelatedLinksAppController($scope) {
var vm = this;
vm.relations = $scope.model.viewModel;
var currentVariant = _.find($scope.content.variants, function (v) { return v.active });
if (currentVariant.language) {
vm.culture =... | (function () {
'use strict';
function RelatedLinksAppController($scope) {
var vm = this;
vm.relations = $scope.model.viewModel;
var currentVariant = _.find($scope.content.variants, function (v) { return v.active });
if (currentVariant.language) {
vm.culture =... |
[QUEUE] Add tags list on queues | <?php
namespace WorkerBundle\DependencyInjection;
use Symfony\Component\Config\Definition\Builder\TreeBuilder;
use Symfony\Component\Config\Definition\ConfigurationInterface;
/**
* This is the class that validates and merges configuration from your app/config files
*
* To learn more see {@link http://symfony.com/... | <?php
namespace WorkerBundle\DependencyInjection;
use Symfony\Component\Config\Definition\Builder\TreeBuilder;
use Symfony\Component\Config\Definition\ConfigurationInterface;
/**
* This is the class that validates and merges configuration from your app/config files
*
* To learn more see {@link http://symfony.com/... |
Use new services for retreiving the Project and Entry | var trexControllers = angular.module('trexControllers', []);
trexControllers.controller('ProjectListCtrl', ['$scope', 'Project',
function($scope, Project) {
$scope.projects = Project.query();
$scope.order = "name";
$scope.orderreverse = false;
$scope.setOrder = function(name) {
... | var trexControllers = angular.module('trexControllers', []);
trexControllers.controller('ProjectListCtrl', ['$scope', '$http',
function($scope, $http) {
$http.get('/api/1/projects/').success(function(data) {
$scope.projects = data;
});
$scope.order = "name";
$scope.orde... |
Make sure LOG is defined before using it. | """A virtual serial port data source."""
from __future__ import absolute_import
import logging
from .base import BytestreamDataSource, DataSourceError
LOG = logging.getLogger(__name__)
try:
import serial
except ImportError:
LOG.debug("serial library not installed, can't use serial interface")
class Serial... | """A virtual serial port data source."""
from __future__ import absolute_import
import logging
try:
import serial
except ImportError:
LOG.debug("serial library not installed, can't use serial interface")
from .base import BytestreamDataSource, DataSourceError
LOG = logging.getLogger(__name__)
class Serial... |
Add snippet fetching to HEAD | /* jshint node: true */
'use strict';
var fs = require('fs');
var path = require('path');
function readSnippet() {
try {
// NOTE: expecting addon as a node_module on parent addon or in an Ember CLI application.
return fs.readFileSync(path.join(process.cwd(), 'node_modules/ember-segmentio/vendor/snippet-core... | /* jshint node: true */
'use strict';
var fs = require('fs');
var path = require('path');
function readSnippet() {
try {
// NOTE: expecting addon as a node_module on parent addon or in an Ember CLI application.
return fs.readFileSync(path.join(process.cwd(), 'node_modules/ember-segmentio/vendor/snippet-core... |
Split into own method for clariy and "return" support | from __future__ import absolute_import
import traceback
from celery import shared_task
from celery.utils.log import get_task_logger
from django.contrib.staticfiles.storage import staticfiles_storage
from takeyourmeds.utils.dt import local_time
from takeyourmeds.telephony.utils import send_sms, make_call
from .mode... | from __future__ import absolute_import
import traceback
from celery import shared_task
from celery.utils.log import get_task_logger
from django.contrib.staticfiles.storage import staticfiles_storage
from takeyourmeds.utils.dt import local_time
from takeyourmeds.telephony.utils import send_sms, make_call
from .mode... |
Rename the date field related to the project status | # -*- encoding:utf-8 -*-
from django.db import models
class Project(models.Model):
STATUS = (
('unrevised', u'Неразгледан'),
('returned', u'Върнат за корекция'),
('pending', u'Предстои да бъде разгледан на СИС'),
('approved', u'Разгледан и одобрен на СИС'),
('rejected', u'Р... | # -*- encoding:utf-8 -*-
from django.db import models
class Project(models.Model):
STATUS = (
('unrevised', u'Неразгледан'),
('returned', u'Върнат за корекция'),
('pending', u'Предстои да бъде разгледан на СИС'),
('approved', u'Разгледан и одобрен на СИС'),
('rejected', u'Р... |
[page] Add mixin for the cartridge | var isFunction = require('lodash/lang/isFunction');
var dispatcher = require('focus').dispatcher;
module.exports = {
/**
* Register the cartridge.
*/
_registerCartridge: function registerCartridge(){
this.cartridgeConfiguration = this.cartridgeConfiguration || this.props.cartridgeConfiguration;
... | var isFunction = require('lodash/lang/isFunction');
var dispatcher = require('focus').dispatcher;
module.exports = {
/**
* Register the cartridge.
*/
_registerCartridge: function registerCartridge(){
if(!isFunction(this.cartridgeConfiguration)){
this.cartridgeConfiguration = function car... |
Use identity operator when comparing with None | from __future__ import absolute_import
from __future__ import division
from __future__ import unicode_literals
from libthumbor import CryptoURL
class ThumborService(object):
def __init__(self, baseurl='http://localhost:8888/', secretkey='MY_SECURE_KEY'):
self.baseurl = baseurl.rstrip('/')
self._u... | from __future__ import absolute_import
from __future__ import division
from __future__ import unicode_literals
from libthumbor import CryptoURL
class ThumborService(object):
def __init__(self, baseurl='http://localhost:8888/', secretkey='MY_SECURE_KEY'):
self.baseurl = baseurl.rstrip('/')
self._u... |
Fix in how the contents is determined. | define(function (require, exports, module) {
'use strict';
var Mode = require("../../mode").Mode;
var util = require("../../util");
var oop = require("../../oop");
var GenericDecorator = require("./generic_decorator").GenericDecorator;
var tr = require("./generic_tr").tr;
function GenericMode () {
Mode.call(this)... | define(function (require, exports, module) {
'use strict';
var Mode = require("../../mode").Mode;
var util = require("../../util");
var oop = require("../../oop");
var GenericDecorator = require("./generic_decorator").GenericDecorator;
var tr = require("./generic_tr").tr;
function GenericMode () {
Mode.call(this)... |
Use the naive datetime format for MySQL as well
See the SQLAlchemy docs for more information:
http://docs.sqlalchemy.org/en/latest/dialects/mysql.html#sqlalchemy.dial
ects.mysql.DATETIME | # -*- coding: utf-8 -*-
"""
flaskbb.utils.database
~~~~~~~~~~~~~~~~~~~~~~
Some database helpers such as a CRUD mixin.
:copyright: (c) 2015 by the FlaskBB Team.
:license: BSD, see LICENSE for more details.
"""
import pytz
from flaskbb.extensions import db
class CRUDMixin(object):
def __repr_... | # -*- coding: utf-8 -*-
"""
flaskbb.utils.database
~~~~~~~~~~~~~~~~~~~~~~
Some database helpers such as a CRUD mixin.
:copyright: (c) 2015 by the FlaskBB Team.
:license: BSD, see LICENSE for more details.
"""
import pytz
from flaskbb.extensions import db
class CRUDMixin(object):
def __repr_... |
Fix issue with not using upgraded history object | import React from 'react'
import { merge } from 'lodash'
import {
Router as ReactRouter,
RouterContext,
browserHistory,
createMemoryHistory,
match
} from 'react-router'
import {
syncHistoryWithStore,
routerReducer
} from 'react-router-redux'
export {
Route,
IndexRoute,
Redirect,
IndexR... | import React from 'react'
import { merge } from 'lodash'
import {
Router as ReactRouter,
RouterContext,
browserHistory,
createMemoryHistory,
match
} from 'react-router'
import {
syncHistoryWithStore,
routerReducer
} from 'react-router-redux'
export {
Route,
IndexRoute,
Redirect,
IndexR... |
Use require for views instead of require_once | <?php
class DbconfigController extends ControllerBase {
protected function dbInit() {}
public function create( $user, $pass, $dbname ) {
$entries = compact( 'user', 'pass', 'dbname' );
$entries = [ 'db' => $entries ];
try {
updateConfig( $... | <?php
class DbconfigController extends ControllerBase {
protected function dbInit() {}
public function create( $user, $pass, $dbname ) {
$entries = compact( 'user', 'pass', 'dbname' );
$entries = [ 'db' => $entries ];
try {
updateConfig( $... |
Select the only suggestion when hit enter key | var Tutu = Tutu || (function() {
function removeSuggestionMenu() {
var cmdSegs = $('#mesage-input').val().split();
var suggestions = $('div.tt-menu div.tt-suggestion>strong');
if(suggestions.length == 1) {
var lastCmdSeg = cmdSegs[cmdSegs.length - 1];
var suggestion =... | var Tutu = Tutu || (function() {
function initHotkeyBindings() {
var msg_box = $('#message-input')[0];
Mousetrap(msg_box).bind('enter', function(e) {
var suggestion_menu_visible = $('div.tt-menu').is(":visible");
if (suggestion_menu_visible) {
console.log("me... |
Remove reference to butter since butter is deprecated | '''
Return data to a mongodb server
Required python modules: pymongo
'''
import logging
try:
import pymongo
has_pymongo = True
except ImportError:
has_pymongo = False
log = logging.getLogger(__name__)
__opts__ = {'mongo.db': 'salt',
'mongo.host': 'salt',
'mongo.password': '',
... | '''
Return data to a mongodb server
This is the default interface for returning data for the butter statd subsytem
Required python modules: pymongo
'''
import logging
try:
import pymongo
has_pymongo = True
except ImportError:
has_pymongo = False
log = logging.getLogger(__name__)
__opts__ = {'mongo.db... |
Add the "Production" trove classifier. | import sys
from setuptools import setup, find_packages
extra_setup = {}
if sys.version_info >= (3,):
extra_setup['use_2to3'] = True
setup(
name='blessings',
version='1.2',
description='A thin, practical wrapper around terminal formatting, positioning, and more',
long_description=open('README.rst... | import sys
from setuptools import setup, find_packages
extra_setup = {}
if sys.version_info >= (3,):
extra_setup['use_2to3'] = True
setup(
name='blessings',
version='1.2',
description='A thin, practical wrapper around terminal formatting, positioning, and more',
long_description=open('README.rst... |
Add year to miner table to make it sort properly. | @extends('layouts.master')
@section('title', 'Miners')
@section('content')
<div class="row">
<div class="col-12">
<table id="miners">
<thead>
<th>Miner</th>
<th>Corporation</th>
<th class="numeric">Amount owed</th>
... | @extends('layouts.master')
@section('title', 'Miners')
@section('content')
<div class="row">
<div class="col-12">
<table id="miners">
<thead>
<th>Miner</th>
<th>Corporation</th>
<th class="numeric">Amount owed</th>
... |
Add changes requested in PR. | /*
* Copyright 2016, TeamDev Ltd. 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 EXPRES... | /*
* Copyright 2016, TeamDev Ltd. 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 EXPRES... |
Use the DObjectFactory to move DObjects over the wire.
git-svn-id: a1a4b28b82a3276cc491891159dd9963a0a72fae@7 542714f4-19e9-0310-aa3c-eee0fc999fb1 | //
// $Id: ObjectResponse.java,v 1.3 2001/05/29 03:28:50 mdb Exp $
package com.samskivert.cocktail.cher.net;
import java.io.IOException;
import java.io.DataInputStream;
import java.io.DataOutputStream;
import com.samskivert.cocktail.cher.dobj.DObject;
import com.samskivert.cocktail.cher.dobj.DObjectFactory;
public ... | //
// $Id: ObjectResponse.java,v 1.2 2001/05/23 04:03:40 mdb Exp $
package com.samskivert.cocktail.cher.net;
import java.io.IOException;
import java.io.DataInputStream;
import java.io.DataOutputStream;
import com.samskivert.cocktail.cher.dobj.DObject;
import com.samskivert.cocktail.cher.io.TypedObjectFactory;
publi... |
Fix CORS when running the api server with Docker | """This module contains basic functions to instantiate the BigchainDB API.
The application is implemented in Flask and runs using Gunicorn.
"""
import os
from flask import Flask
from flask.ext.cors import CORS
from server.lib.api.views import api_views
def create_app(debug):
"""Return an instance of the Flask ... | """This module contains basic functions to instantiate the BigchainDB API.
The application is implemented in Flask and runs using Gunicorn.
"""
import os
from flask import Flask
from flask.ext.cors import CORS
from server.lib.api.views import api_views
def create_app(debug):
"""Return an instance of the Flask ... |
Hide documentation commands in non-python scope | # -*- coding: utf-8 -*-
import sublime
import sublime_plugin
from .utils import ask_daemon, PythonCommandMixin
class HelpMessageCommand(sublime_plugin.TextCommand):
def run(self, edit, docstring):
self.view.close()
self.view.insert(edit, self.view.size(), docstring)
class SublimeJediDocstring(... | # -*- coding: utf-8 -*-
import sublime
import sublime_plugin
from .utils import ask_daemon
class HelpMessageCommand(sublime_plugin.TextCommand):
def run(self, edit, docstring):
self.view.close()
self.view.insert(edit, self.view.size(), docstring)
class SublimeJediDocstring(sublime_plugin.TextC... |
Fix compat for python 2.6 | try:
from collections import OrderedDict
except ImportError:
from django.utils.datastructures import SortedDict as OrderedDict
from sequere.query import QuerySetTransformer
from sequere import utils
class RedisQuerySetTransformer(QuerySetTransformer):
def __init__(self, client, count, key, prefix, manage... | from collections import OrderedDict
from sequere.query import QuerySetTransformer
from sequere import utils
class RedisQuerySetTransformer(QuerySetTransformer):
def __init__(self, client, count, key, prefix, manager):
super(RedisQuerySetTransformer, self).__init__(client, count)
self.keys = [key... |
Add comments to example module | /**
* Example WebSocket module.
*/
class EchoChat {
constructor( ws ) {
this.ws = ws;
}
/**
* Default message routing function for this object.
* The routing server assumes all modules will have a
* doAction() function.
*/
doAction( messageObj ) {
console.log( "do... | /**
* Example WebSocket module.
*/
class EchoChat {
constructor( ws ) {
this.ws = ws;
}
doAction( messageObj ) {
console.log( "do action", messageObj );
switch( messageObj.data.action ) {
case 'echo_message':
this.echoMessage( messageObj );
... |
Change to gridboard to add column picker | Ext.define('CustomApp', {
extend: 'Rally.app.App',
componentCls: 'app',
launch: function() {
var self = this;
Ext.create('Rally.data.wsapi.Store', {
model: 'TypeDefinition',
autoLoad:true,
filters: [{
property: "TypePath",
operator: "contains... | Ext.define('CustomApp', {
extend: 'Rally.app.App',
componentCls: 'app',
launch: function() {
var self = this;
Ext.create('Rally.data.wsapi.Store', {
model: 'TypeDefinition',
autoLoad:true,
filters: [{
property: "TypePath",
operator: "contains... |
Add get in progress content mehtod
Former-commit-id: 1f63a939185c91b73ba9bdc71ade5bdba59143fe
Former-commit-id: 1e66b188666eb2cfe2167caae5769551fe51cabd
Former-commit-id: 24fe274d42f336154cf8395c622f460da093deb9 | import http from '../http';
export default class collections {
static get(collectionID) {
return http.get(`/zebedee/collectionDetails/${collectionID}`)
.then(response => {
return response;
})
}
static getAll() {
return http.get(`/zebedee/collect... | import http from '../http';
export default class collections {
static get(collectionID) {
return http.get(`/zebedee/collectionDetails/${collectionID}`)
.then(response => {
return response;
})
}
static getAll() {
return http.get(`/zebedee/collect... |
Fix Python 3 issue with long() | from __future__ import unicode_literals
import sys
import json
from django.core.exceptions import ObjectDoesNotExist
from django.http import Http404, HttpResponse
from django.views.generic.detail import BaseDetailView
from .models import Marker
if sys.version_info[0] >= 3:
long = int
class MarkerDetailView(Ba... | from __future__ import unicode_literals
import json
from django.core.exceptions import ObjectDoesNotExist
from django.http import Http404, HttpResponse
from django.views.generic.detail import BaseDetailView
from .models import Marker
class MarkerDetailView(BaseDetailView):
"""
Simple view for fetching mark... |
Update pypi classifier to Alpha status | from setuptools import setup, find_packages
setup(name='pyramid_es',
version='0.3.2.dev',
description='Elasticsearch integration for Pyramid.',
long_description=open('README.rst').read(),
classifiers=[
'Development Status :: 3 - Alpha',
'License :: OSI Approved :: MIT Licen... | from setuptools import setup, find_packages
setup(name='pyramid_es',
version='0.3.2.dev',
description='Elasticsearch integration for Pyramid.',
long_description=open('README.rst').read(),
classifiers=[
'Development Status :: 2 - Pre-Alpha',
'License :: OSI Approved :: MIT L... |
Fix typo selectedSting to selectedString | (function () {
function CreateNotifyController(
$scope,
contentResource,
navigationService,
angularHelper) {
var vm = this;
var currentForm;
vm.notifyOptions = [];
vm.save = save;
vm.cancel = cancel;
vm.message = {
name: $sc... | (function () {
function CreateNotifyController(
$scope,
contentResource,
navigationService,
angularHelper) {
var vm = this;
var currentForm;
vm.notifyOptions = [];
vm.save = save;
vm.cancel = cancel;
vm.message = {
name: $sc... |
Add dbversion parameter to call of webservice via ajax | $(document).ready(function(){
//autocomplete for organism search
$("#search_organism").autocomplete({
position: {
my: "right top", at: "right bottom"
},
source: function (request, response) {
var search = request.term;
$.ajax({
url... | $(document).ready(function(){
//autocomplete for organism search
$("#search_organism").autocomplete({
position: {
my: "right top", at: "right bottom"
},
source: function (request, response) {
var search = request.term;
$.ajax({
url... |
Use "clientInstance" instead of just "forager" | package forager.client;
import java.io.IOException;
import java.util.logging.Logger;
/**
* Monitors currently running tasks and decides when new tasks should be
* requested based on current processing directives.
*
* @author malensek
*/
public class StatusMonitor implements Runnable {
private static final L... | package forager.client;
import java.io.IOException;
import java.util.logging.Logger;
/**
* Monitors currently running tasks and decides when new tasks should be
* requested based on current processing directives.
*
* @author malensek
*/
public class StatusMonitor implements Runnable {
private static final L... |
Update gen-publish script to update 'next' tag for main releases | #!/usr/bin/env node
const path = require("path");
const fs = require("fs-extra");
const should = require("should");
const LATEST = "2";
function generateScript() {
return new Promise((resolve, reject) => {
const packages = [
"@node-red/util",
"@node-red/runtime",
"@nod... | #!/usr/bin/env node
const path = require("path");
const fs = require("fs-extra");
const should = require("should");
const LATEST = "2";
function generateScript() {
return new Promise((resolve, reject) => {
const packages = [
"node-red-util",
"node-red-runtime",
"node-r... |
Extend the status exposing duration | 'use strict';
import { StatsCollector } from './lib/stats';
export default function(RED) {
class DeviceStatsNode {
constructor(n) {
RED.nodes.createNode(this, n);
this.name = n.name;
this.mem = n.mem;
this.nw = n.nw;
this.load = n.load;
this.hostname = n.hostname;
this... | 'use strict';
import { StatsCollector } from './lib/stats';
export default function(RED) {
class DeviceStatsNode {
constructor(n) {
RED.nodes.createNode(this, n);
this.name = n.name;
this.mem = n.mem;
this.nw = n.nw;
this.load = n.load;
this.hostname = n.hostname;
this... |
Handle non-existent files in the database. | #!/usr/bin/env python
import rethinkdb as r
import optparse
if __name__ == "__main__":
parser = optparse.OptionParser()
parser.add_option("-p", "--port", dest="port",
help="rethinkdb port", default=30815)
(options, args) = parser.parse_args()
conn = r.connect('localhost', int(op... | #!/usr/bin/env python
import rethinkdb as r
import optparse
if __name__ == "__main__":
parser = optparse.OptionParser()
parser.add_option("-p", "--port", dest="port",
help="rethinkdb port", default=30815)
(options, args) = parser.parse_args()
conn = r.connect('localhost', int(op... |
Disable the assigned list when changing to the next status | $(function() {
var $nextStatus = $('.next-status-choice');
var $assigned = $('.assigned-choice');
var workflowId = $('.workflow-hidden').val();
var currentStateId = $('.current-state').data('value');
var UpdateAssignedList = function() {
var status = $('input:checked', $nextStatus).val();... | $(function() {
var $nextStatus = $('.next-status-choice');
var $assigned = $('.assigned-choice');
var workflowId = $('.workflow-hidden').val();
var currentStateId = $('.current-state').data('value');
var UpdateAssignedList = function() {
var status = $('input:checked', $nextStatus).val();... |
Use first visible background layer as active background layer | angular.module('anol.layerswitcher', [])
.directive('anolLayerswitcher', ['LayersService', function(LayersService) {
return {
restrict: 'A',
transclude: true,
templateUrl: 'anol/modules/layerswitcher/templates/layerswitcher.html',
scope: {},
link: function(scope, element, at... | angular.module('anol.layerswitcher', [])
.directive('anolLayerswitcher', ['LayersService', function(LayersService) {
return {
restrict: 'A',
transclude: true,
templateUrl: 'anol/modules/layerswitcher/templates/layerswitcher.html',
scope: {},
link: function(scope, element, at... |
Return the proper error message if there is one | import queryString from "query-string";
class Api {
static get(url, data = {}) {
return this.request(url + (Object.keys(data).length > 0 ? ('?' + queryString.stringify(data)) : '' ), undefined, "GET");
}
static post(url, data = {}) {
return this.request(url, data, "POST");
}
stati... | import queryString from "query-string";
class Api {
static get(url, data = {}) {
return this.request(url + (Object.keys(data).length > 0 ? ('?' + queryString.stringify(data)) : '' ), undefined, "GET");
}
static post(url, data = {}) {
return this.request(url, data, "POST");
}
stati... |
Use JSON.stringify instead and fix linter | define([
'/bower_components/jquery/dist/jquery.min.js',
'/common/cryptpad-common.js',
], function (jQuery, Cryptpad) {
var $ = window.jQuery;
var $body = $('body');
var pre = function (text, opt) {
return $('<pre>', opt).text(text);
};
var todo = function (missing) {
var s... | define([
'/bower_components/jquery/dist/jquery.min.js',
'/common/cryptpad-common.js',
], function (jQuery, Cryptpad) {
var $ = window.jQuery;
var $body = $('body');
var pre = function (text, opt) {
return $('<pre>', opt).text(text);
};
var addSlashes = function (text) {
re... |
Add pyzmq. Note: this package doesn't need it but IPython notebook does | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
import sys
try:
from setuptools import setup
except ImportError:
from distutils.core import setup
if sys.argv[-1] == 'publish':
os.system('python setup.py sdist upload')
sys.exit()
requires = ['pyrax==1.4.7',
'ipython==0.13.2',
... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
import sys
try:
from setuptools import setup
except ImportError:
from distutils.core import setup
if sys.argv[-1] == 'publish':
os.system('python setup.py sdist upload')
sys.exit()
requires = ['pyrax==1.4.7',
'ipython==0.13.2',
... |
Fix server error when login with u2f | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
import json
from u2flib_server.u2f import (begin_registration,
begin_authentication,
complete_registration,
complete_authentication)
from components.eternity import config
facet... | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
import json
from u2flib_server.u2f import (begin_registration,
begin_authentication,
complete_registration,
complete_authentication)
from components.eternity import config
facet... |
Add price per layer in order view | <?php
class Magebay_Productbuilderpro_Block_Adminhtml_Additional_Product_Info extends Mage_Core_Block_Abstract
{
protected function _toHtml()
{
$item = $this->getParentBlock()->getItem();
//Zend_Debug::dump($item->getData());
$additionalOptions = serialize($item->getProductOptionByCode("... | <?php
class Magebay_Productbuilderpro_Block_Adminhtml_Additional_Product_Info extends Mage_Core_Block_Abstract
{
protected function _toHtml()
{
$item = $this->getParentBlock()->getItem();
//Zend_Debug::dump($item->getData());
$additionalOptions = serialize($item->getProductOptionByCode("... |
Add logging for state_code error | 'use strict';
const Queries = require('../../helpers/queries');
const Parser = require('../../helpers/paydroid_parser');
const Boom = require('boom');
const D3 = require('d3');
exports.getData = {
auth: {
mode: 'try',
strategy: 'standard'
},
plugins: {
'hapi-auth-cookie': {
... | 'use strict';
const Queries = require('../../helpers/queries');
const Parser = require('../../helpers/paydroid_parser');
const Boom = require('boom');
exports.getData = {
auth: {
mode: 'try',
strategy: 'standard'
},
plugins: {
'hapi-auth-cookie': {
redirectTo: false
... |
Fix "clear completed" button to actually work
As it stands, the "clear completed" button fails to work as intended. This is because the array is mutated during the traversal. An item which immediately follows a completed item will not be checked. The fix is to traverse the array backwards. | var app = app || {};
(function () {
'use strict';
app.controller = function() {
this.list = new app.TodoList(); // Todo collection
this.title = m.prop(''); // Temp title placeholder
this.filter = m.prop(m.route.param('filter') || ''); // TodoList filter
// Add a ... | var app = app || {};
(function () {
'use strict';
app.controller = function() {
this.list = new app.TodoList(); // Todo collection
this.title = m.prop(''); // Temp title placeholder
this.filter = m.prop(m.route.param('filter') || ''); // TodoList filter
// Add a ... |
Increase max listeners to prevent nodes warn. | 'use strict';
var retry = require('retry');
var deepExtend = require('deep-extend');
var errorCodes = [
'EADDRINFO',
'ETIMEDOUT',
'ECONNRESET'
];
function requestReplay(request, options) {
var originalEmit = request.emit;
var operation;
var attempts = 0;
// Default options
options = ... | 'use strict';
var retry = require('retry');
var deepExtend = require('deep-extend');
var errorCodes = [
'EADDRINFO',
'ETIMEDOUT',
'ECONNRESET'
];
function requestReplay(request, options) {
var originalEmit = request.emit;
var operation;
var attempts = 0;
options = deepExtend({
er... |
Add plugins to the domains which handle temp files | # Miscellaneos functions relating the projects app
import os
from datetime import datetime
from django.http import HttpResponseRedirect
from django.utils.http import urlquote
from django.conf import settings
def project_required(func):
"""
Decorator function for other actions that
require a project to be ... | # Miscellaneos functions relating the projects app
import os
from datetime import datetime
from django.http import HttpResponseRedirect
from django.utils.http import urlquote
from django.conf import settings
def project_required(func):
"""
Decorator function for other actions that
require a project to be ... |
Modify the code in the getKey() function so that it gracefully ignores non-integer input. | # Caesar Cipher
MAX_KEY_SIZE = 26
def getMode():
while True:
print('Do you wish to encrypt or decrypt a message?')
mode = input().lower()
if mode in 'encrypt e decrypt d'.split():
return mode
else:
print('Enter either "encrypt" or "e" or "decrypt" or "d".')
... | # Caesar Cipher
MAX_KEY_SIZE = 26
def getMode():
while True:
print('Do you wish to encrypt or decrypt a message?')
mode = input().lower()
if mode in 'encrypt e decrypt d'.split():
return mode
else:
print('Enter either "encrypt" or "e" or "decrypt" or "d".')
... |
Change boolean-based options to real booleans | (function() {
// Creates an iframe with an embedded HipChat conversation window.
//
// Options:
// url - The url to the room to embed; required
// el - The container in which to insert the HipChat panel; required
// timezone - The timezone to use in the embedded room; required
/... | (function() {
// Creates an iframe with an embedded HipChat conversation window.
//
// Options:
// url - The url to the room to embed; required
// el - The container in which to insert the HipChat panel; required
// timezone - The timezone to use in the embedded room; required
/... |
Move choices outside of model class | from django.db import models
from django.utils.translation import pgettext_lazy
from django.utils.encoding import python_2_unicode_compatible
INTEGER = 'i'
STRING = 's'
BOOLEAN = 'b'
@python_2_unicode_compatible
class Setting(models.Model):
VALUE_TYPE_CHOICES = (
(INTEGER, pgettext_lazy('Settings', 'Int... | from django.db import models
from django.utils.translation import pgettext_lazy
from django.utils.encoding import python_2_unicode_compatible
@python_2_unicode_compatible
class Setting(models.Model):
INTEGER = 'i'
STRING = 's'
BOOLEAN = 'b'
VALUE_TYPE_CHOICES = (
(INTEGER, pgettext_lazy('Setti... |
Fix IDE warnings in the agent | package com.github.sulir.runtimesearch.runtime;
import java.io.IOException;
import java.io.ObjectInputStream;
import java.net.InetAddress;
import java.net.ServerSocket;
import java.net.Socket;
public class Check {
public static final int PORT = 4321;
public static String searchValue;
public static void i... | package com.github.sulir.runtimesearch.runtime;
import java.io.IOException;
import java.io.ObjectInputStream;
import java.net.InetAddress;
import java.net.ServerSocket;
import java.net.Socket;
public class Check {
public static final int PORT = 4321;
public static String searchValue;
public static void i... |
Fix portolio tab loading when loaded by pjax | const State = require('../../binary/base/storage').State;
const Client = require('../../binary/base/client').Client;
const PortfolioWS = require('../../binary/websocket_pages/user/account/portfolio/portfolio.init').PortfolioWS;
const JapanPortfolio = (function() {
let $portfolio,
isPortfolioActive = false... | const State = require('../../binary/base/storage').State;
const Client = require('../../binary/base/client').Client;
const PortfolioWS = require('../../binary/websocket_pages/user/account/portfolio/portfolio.init').PortfolioWS;
const JapanPortfolio = (function() {
let $portfolio,
isPortfolioActive = false... |
Allow Handlebars to be a global | define(["handlebars"], function(Handlebars) {
var buildMap = {},
templateExtension = ".hbs";
return {
// http://requirejs.org/docs/plugins.html#apiload
load: function (name, parentRequire, onload, config) {
// Get the template extension.
var ext = (config.hbs && config.hbs.templateExten... | define(["handlebars"], function(Handlebars) {
var buildMap = {},
templateExtension = ".hbs";
return {
// http://requirejs.org/docs/plugins.html#apiload
load: function (name, parentRequire, onload, config) {
// Get the template extension.
var ext = (config.hbs && config.hbs.templateExten... |
Remove outdated imports, oops sorry. | import time
from . import config
# expects Cozify devices type json data
def getMultisensorData(data):
out = []
for device in data:
state=data[device]['state']
devtype = state['type']
if devtype == 'STATE_MULTI_SENSOR':
name=data[device]['name']
if 'lastSeen' i... | import time
from influxdb import InfluxDBClient
from influxdb import SeriesHelper
from . import config
# expects Cozify devices type json data
def getMultisensorData(data):
out = []
for device in data:
state=data[device]['state']
devtype = state['type']
if devtype == 'STATE_MULTI_SEN... |
Rewrite listener to use async/await |
const newtaburlEX = {
async idleCaptive(newtab) {
browser.tabs.onUpdated.addListener(newtaburlEX.forward);
},
async forward(tabId, changeInfo, tab) {
console.log("wewled");
if (changeInfo.title === '@NewTab') {
let ntu = await newtaburlEX.getForwardUrl();
le... |
function nt (newtab) {
function waitForURL(tabId, changeInfo, tab) {
if (changeInfo.title === '@NewTab') {
browser.storage.local.get('newtaburl').then((ntu) => {
browser.tabs.onUpdated.removeListener(waitForURL);
if (ntu.newtaburl == null) {
browser.storage.local.set({
newtaburl: 'about:blank'... |
Fix error if passing a list of args to tenancy_reverse | from django.conf import settings
from django.core.urlresolvers import reverse
from django.db.models import Q
def multitenancy_enabled():
return "decisiontree.multitenancy" in settings.INSTALLED_APPS
def get_tenants_for_user(user):
"""Return all tenants that the user can manage."""
from multitenancy.mode... | from django.conf import settings
from django.core.urlresolvers import reverse
from django.db.models import Q
def multitenancy_enabled():
return "decisiontree.multitenancy" in settings.INSTALLED_APPS
def get_tenants_for_user(user):
"""Return all tenants that the user can manage."""
from multitenancy.mode... |
Use is_readable instead of file_exists | <?php
namespace Ochenta;
/** @throws InvalidArgumentException */
function resource_of($resource) {
if (is_null($resource)) {
return null;
}
if (is_scalar($resource)) {
$stream = fopen('php://temp', 'r+');
if (!empty($resource)) {
fwrite($stream, $resource);
... | <?php
namespace Ochenta;
/** @throws InvalidArgumentException */
function resource_of($resource) {
if (is_null($resource)) {
return null;
}
if (is_scalar($resource)) {
$stream = fopen('php://temp', 'r+');
if (!empty($resource)) {
fwrite($stream, $resource);
... |
Enhance mock of idol user for integration tests (ISO-6)
[rev. matthew.gordon] | package com.hp.autonomy.searchcomponents.idol.test;
import com.hp.autonomy.frontend.configuration.authentication.CommunityPrincipal;
import com.hpe.bigdata.frontend.spring.authentication.AuthenticationInformationRetriever;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.spring... | package com.hp.autonomy.searchcomponents.idol.test;
import com.hp.autonomy.frontend.configuration.authentication.CommunityPrincipal;
import com.hpe.bigdata.frontend.spring.authentication.AuthenticationInformationRetriever;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.spring... |
Add angular-moment dependency to karma | // karma.conf.js
module.exports = function(config) {
config.set({
basePath : '../../',
frameworks: ['jasmine'],
files : [
'bower_components/underscore/underscore.js',
'bower_components/angular/angular.js',
'bower_components/angular-bootstrap/ui-bootstrap-tpls.min.js',
'bower_compon... | // karma.conf.js
module.exports = function(config) {
config.set({
basePath : '../../',
frameworks: ['jasmine'],
files : [
'bower_components/underscore/underscore.js',
'bower_components/angular/angular.js',
'bower_components/angular-cookies/angular-cookies.js',
'bower_components/ang... |
Remove the .only from the generative test | "use strict";
const apiRequest = require( "../../src/token/api-request" );
const storeToken = require( "../../src/token/store-token" );
const Promise = require( "bluebird" );
const expect = require( "expect.js" );
const sinonSandbox = require( "sinon" ).sandbox.create();
describe( "Generative testing", function() {
... | "use strict";
const apiRequest = require( "../../src/token/api-request" );
const storeToken = require( "../../src/token/store-token" );
const Promise = require( "bluebird" );
const expect = require( "expect.js" );
const sinonSandbox = require( "sinon" ).sandbox.create();
describe.only( "Generative testing", function(... |
Fix cleaning for Node 5 | /*
* grunt-google-site-verification
* https://github.com/sbstnmsch/grunt-google-site-verification
*
* Copyright (c) 2016 Sebastian Misch
* Licensed under the MIT license.
*/
module.exports = function(grunt) {
'use strict';
grunt.initConfig({
eslint: {
default: [
'Gruntfile.js',
'ta... | /*
* grunt-google-site-verification
* https://github.com/sbstnmsch/grunt-google-site-verification
*
* Copyright (c) 2016 Sebastian Misch
* Licensed under the MIT license.
*/
module.exports = function(grunt) {
'use strict';
grunt.initConfig({
eslint: {
default: [
'Gruntfile.js',
'ta... |
CRM-2136: Convert Marketing List connection from workflow to controllers | <?php
namespace Oro\Bundle\FormBundle\Form\Handler;
use Doctrine\Common\Persistence\ObjectManager;
use Symfony\Component\Form\FormInterface;
use Symfony\Component\HttpFoundation\Request;
class ApiFormHandler
{
/**
* @var FormInterface
*/
protected $form;
/**
* @var Request
*/
pr... | <?php
namespace Oro\Bundle\FormBundle\Form\Handler;
use Doctrine\Common\Persistence\ObjectManager;
use Symfony\Component\Form\FormInterface;
use Symfony\Component\HttpFoundation\Request;
use OroCRM\Bundle\TaskBundle\Entity\Task;
class ApiFormHandler
{
/**
* @var FormInterface
*/
protected $form;
... |
Fix the name for the installerDb field to match our conventions. | package org.opennms.netmgt.dao.db;
import java.io.ByteArrayOutputStream;
import java.io.PrintStream;
public class PopulatedTemporaryDatabaseTestCase extends
TemporaryDatabaseTestCase {
private InstallerDb m_installerDb;
private ByteArrayOutputStream m_outputStream;
protected void se... | package org.opennms.netmgt.dao.db;
import java.io.ByteArrayOutputStream;
import java.io.PrintStream;
public class PopulatedTemporaryDatabaseTestCase extends
TemporaryDatabaseTestCase {
private InstallerDb installerDb;
private ByteArrayOutputStream m_outputStream;
protected void setU... |
Add current_month_score and last_month_score to EmployeeListSerializer | from .models import Employee
from rest_framework import serializers
class EmployeeSerializer(serializers.ModelSerializer):
class Meta:
model = Employee
depth = 1
fields = ('pk',
'username',
'email',
'first_name',
'last... | from .models import Employee
from rest_framework import serializers
class EmployeeSerializer(serializers.ModelSerializer):
class Meta:
model = Employee
depth = 1
fields = ('pk',
'username',
'email',
'first_name',
'last... |
Change GPG password encryption to AES256 | from glob import glob
import os
import shutil
from .credential import Credential
from .crypt import create_gpg, load_gpg
class Database(object):
def __init__(self, path, gpg):
self.path = path
self.gpg = gpg
@classmethod
def create(cls, path, passphrase, gpg_bin="gpg"):
gpg = cr... | from glob import glob
import os
import shutil
from .credential import Credential
from .crypt import create_gpg, load_gpg
class Database(object):
def __init__(self, path, gpg):
self.path = path
self.gpg = gpg
@classmethod
def create(cls, path, passphrase, gpg_bin="gpg"):
gpg = cr... |
Remove stuff that doesn't work | <?php
namespace MathieuImbert\Slack\Logger;
class SlackRequest
{
private $webhookUrl;
/**
* SlackRequest constructor.
* @param string $webhookUrl
*/
public function __construct($webhookUrl)
{
$this->webhookUrl = $webhookUrl;
}
public function post($text)
{
... | <?php
namespace MathieuImbert\Slack\Logger;
class SlackRequest
{
private $webhookUrl;
/**
* SlackRequest constructor.
* @param string $webhookUrl
*/
public function __construct($webhookUrl)
{
$this->webhookUrl = $webhookUrl;
}
public function post($text)
{
... |
Sort packs newest to oldest. | <?php
namespace AppBundle\Repository;
use AppBundle\Entity\Cycle;
use AppBundle\Entity\Pack;
use Doctrine\ORM\EntityManager;
use Doctrine\ORM\EntityRepository;
use Doctrine\ORM\Query\ResultSetMappingBuilder;
class PackRepository extends EntityRepository
{
public function __construct(EntityManager $entityManager)... | <?php
namespace AppBundle\Repository;
use AppBundle\Entity\Cycle;
use AppBundle\Entity\Pack;
use Doctrine\ORM\EntityManager;
use Doctrine\ORM\EntityRepository;
use Doctrine\ORM\Query\ResultSetMappingBuilder;
class PackRepository extends EntityRepository
{
public function __construct(EntityManager $entityManager)... |
feat: Add abit of visual jazz to the gulp output | var fs = require('fs');
var path = require('path');
var chalk = require('chalk');
var viewsPath = path.join(process.cwd(), 'views')
var partialsPath = path.join(viewsPath, '_partials');
var componentPath;
var hbsFileName;
var scssFileName;
module.exports = function(gulp, argv) {
gulp.task('new-component', funct... | var fs = require('fs');
var path = require('path');
var chalk = require('chalk');
var viewsPath = path.join(process.cwd(), 'views')
var partialsPath = path.join(viewsPath, '_partials');
var componentPath;
var hbsFileName;
var scssFileName;
module.exports = function(gulp, argv) {
gulp.task('new-component', funct... |
Use correct UserDTO parameter when searching | <?php
namespace App\Service;
use App\Classes\ElasticSearchBase;
use App\Entity\DTO\UserDTO;
class Search extends ElasticSearchBase
{
/**
* @param array $params
* @return array
* @throws \Exception when the search service isn't setup
*/
protected function search(array $params) : array
... | <?php
namespace App\Service;
use App\Classes\ElasticSearchBase;
use App\Entity\User;
class Search extends ElasticSearchBase
{
/**
* @param array $params
* @return array
* @throws \Exception when the search service isn't setup
*/
protected function search(array $params) : array
{
... |
Use os.path.join to join paths. Use relative paths. | '''
Created on 03.02.2016.
@author: Lazar
'''
import os
from textx.metamodel import metamodel_from_file
from concepts.layout import Layout
from concepts.object import Object
from concepts.property import Property
from concepts.selector_object import SelectorObject, selector_object_processor
from concepts.selector_vie... | '''
Created on 03.02.2016.
@author: Lazar
'''
from textx.metamodel import metamodel_from_file
from concepts.layout import Layout
from concepts.object import Object
from concepts.property import Property
from concepts.selector_object import SelectorObject, selector_object_processor
from concepts.selector_view import S... |
BUmp patch to include new README fix
The previous README version was incorrect. Bumping the version to
correct the display on PyPi. | """Setuptools configuration for rpmvenv."""
from setuptools import setup
from setuptools import find_packages
with open('README.rst', 'r') as readmefile:
README = readmefile.read()
setup(
name='rpmvenv',
version='0.13.1',
url='https://github.com/kevinconway/rpmvenv',
description='RPM packager f... | """Setuptools configuration for rpmvenv."""
from setuptools import setup
from setuptools import find_packages
with open('README.rst', 'r') as readmefile:
README = readmefile.read()
setup(
name='rpmvenv',
version='0.13.0',
url='https://github.com/kevinconway/rpmvenv',
description='RPM packager f... |
Fix Authenticatable mixing using wrong protocol value | 'use strict';
var request = require('../request')
;
var token = {};
var Authenticatable = {
token: {
get: function () {
return token;
}
},
authenticate: {
value: function (user, password) {
if (!user) {
throw {
name: 'ArgumentError',
message: user + ' is n... | 'use strict';
var request = require('../request')
;
var token = {};
var Authenticatable = {
token: {
get: function () {
return token;
}
},
authenticate: {
value: function (user, password) {
if (!user) {
throw {
name: 'ArgumentError',
message: user + ' is n... |
Use README in long description. | from setuptools import setup, find_packages
version = '1.0a1'
import sys, functools
if sys.version_info[0] >= 3:
open = functools.partial(open, encoding='utf-8')
setup(name='pystunnel',
version=version,
description='Python interface to stunnel',
long_description=open('README.rst').read() + '\n'... | from setuptools import setup, find_packages
version = '1.0a1'
setup(name='pystunnel',
version=version,
description='Python interface to stunnel',
#long_description=open('README.rst').read() + '\n' +
# open('CHANGES.rst').read(),
classifiers=[
'Development Status... |
Update blog model with a more descriptive name | '''
Blog App
This module determines how to display the Blog app in Django's admin
and lists other model functions.
'''
from django.conf import settings
from django.core.urlresolvers import reverse
from django.db import models
from tunobase.core import models as core_models
class Blog(core_models.ContentModel):
... | '''
Blog App
This module determines how to display the Blog app in Django's admin
and lists other model functions.
'''
from django.conf import settings
from django.core.urlresolvers import reverse
from django.db import models
from tunobase.core import models as core_models
class Blog(core_models.ContentModel):
... |
BAP-10985: Update the rules displaying autocomplete result for business unit owner field | <?php
namespace Oro\Bundle\OrganizationBundle\Form\Transformer;
use Doctrine\Common\Collections\Collection;
use Oro\Bundle\OrganizationBundle\Entity\BusinessUnit;
use Oro\Bundle\OrganizationBundle\Entity\Manager\BusinessUnitManager;
use Symfony\Component\Form\DataTransformerInterface;
class BusinessUnitTreeTransform... | <?php
namespace Oro\Bundle\OrganizationBundle\Form\Transformer;
use Doctrine\Common\Collections\Collection;
use Oro\Bundle\OrganizationBundle\Entity\BusinessUnit;
use Oro\Bundle\OrganizationBundle\Entity\Manager\BusinessUnitManager;
use Symfony\Component\Form\DataTransformerInterface;
class BusinessUnitTreeTransform... |
Exclude examples from the package installation
PiperOrigin-RevId: 398741057
Change-Id: I7fd7921b8275b9f8b8994b0f20f0d40e814c3a23
GitOrigin-RevId: 4ca481ae4f7c6cf62e38a970f13a14716f9661fc | # Copyright 2021 DeepMind Technologies Limited
#
# 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 agr... | # Copyright 2021 DeepMind Technologies Limited
#
# 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 agr... |
Make Contact details change when selecting different ones | angular.module("yds").controller("TrafficCountsController", ["$scope", "$timeout", "DashboardService",
function ($scope, $timeout, DashboardService) {
var scope = $scope;
scope.galwayProjectId = "http://linkedeconomy.org/resource/Contract/AwardNotice/2013208591/5795646";
scope.lang = "en";
... | angular.module("yds").controller("TrafficCountsController", ["$scope", "$timeout", "DashboardService",
function ($scope, $timeout, DashboardService) {
var scope = $scope;
scope.galwayProjectId = "http://linkedeconomy.org/resource/Contract/AwardNotice/2013208591/5795646";
scope.lang = "en";
... |
Fix to install extension 'cycgkit.boundingbox'. | from setuptools import Extension, setup
from Cython.Build import cythonize
from sys import platform
from distutils.sysconfig import get_config_vars
import os
(opt,) = get_config_vars('OPT')
if opt:
os.environ['OPT'] = " ".join(flag for flag in opt.split() if flag != '-Wstrict-prototypes')
incl = ['./include']
ex... | from setuptools import Extension, setup
from Cython.Build import cythonize
from sys import platform
from distutils.sysconfig import get_config_vars
import os
(opt,) = get_config_vars('OPT')
if opt:
os.environ['OPT'] = " ".join(flag for flag in opt.split() if flag != '-Wstrict-prototypes')
incl = ['./include']
ex... |
Remove exception messages and add equality test | <?php
/**
* UsernameTest.php
*
* @copyright 2013 George D. Cooksey, III
* @license http://www.opensource.org/licenses/mit-license.html MIT License
*/
namespace VeritasTest\Identity;
use PHPUnit_Framework_TestCase as TestCase;
use Veritas\Identity\Username;
class UsernameTest extends TestCase
{
public fun... | <?php
/**
* UsernameTest.php
*
* @copyright 2013 George D. Cooksey, III
* @license http://www.opensource.org/licenses/mit-license.html MIT License
*/
namespace VeritasTest\Identity;
use PHPUnit_Framework_TestCase as TestCase;
use Veritas\Identity\Username;
class UsernameTest extends TestCase
{
public fun... |
Use the unexpected-dev project on browserstack for Travis "PR" builds
https://github.com/travis-ci/travis-ci/issues/6652 | module.exports = function(config) {
config.set({
frameworks: ['mocha'],
exclude: ['build/test/external.spec.js'],
files: [
'vendor/es5-shim.js',
'vendor/es5-sham.js',
'vendor/rsvp.js',
'vendor/unexpected-magicpen.min.js',
'build/test/promisePolyfill.js',
'unexpected.j... | module.exports = function(config) {
config.set({
frameworks: ['mocha'],
exclude: ['build/test/external.spec.js'],
files: [
'vendor/es5-shim.js',
'vendor/es5-sham.js',
'vendor/rsvp.js',
'vendor/unexpected-magicpen.min.js',
'build/test/promisePolyfill.js',
'unexpected.j... |
Set output target as UMD | 'use strict';
var path = require('path');
var webpack = require('webpack');
var prod = process.env.NODE_ENV === 'production';
var config = {
devtool: prod ? null : 'eval',
entry: [
path.join(__dirname, 'demo', 'src', 'demo.js')
],
output: {
path: path.join(__dirname, 'demo', 'dist', ... | 'use strict';
var path = require('path');
var webpack = require('webpack');
var prod = process.env.NODE_ENV === 'production';
var config = {
devtool: prod ? null : 'eval',
entry: [
path.join(__dirname, 'demo', 'src', 'demo.js')
],
output: {
path: path.join(__dirname, 'demo', 'dist', ... |
Fix in parser test for instances |
var vows = require('vows'),
expect = require('expect.js'),
types = require('../lib/types'),
AST = require('../lib/ast'),
parseAndWalk = require('./helper').parseAndWalk
describe('Parser', function () {
describe('given a var declaration', function () {
it('should par... |
var vows = require('vows'),
expect = require('expect.js'),
types = require('../lib/types'),
AST = require('../lib/ast'),
parseAndWalk = require('./helper').parseAndWalk
describe('Parser', function () {
describe('given a var declaration', function () {
it('should par... |
Use var for compatibility with Android 4.x | var NativeStorageError = require('./NativeStorageError');
// args = [reference, variable]
function LocalStorageHandle(success, error, intent, operation, args) {
var reference = args[0];
var variable = args[1];
if (operation.startsWith('put') || operation.startsWith('set')) {
try {
var ... | var NativeStorageError = require('./NativeStorageError');
// args = [reference, variable]
function LocalStorageHandle(success, error, intent, operation, args) {
var reference = args[0];
var variable = args[1];
if (operation.startsWith('put') || operation.startsWith('set')) {
try {
var ... |
Make the description column searchable
Works, but need to refresh the page to get rid of the "extra" results.
Could be related to https://github.com/rappasoft/laravel-livewire-tables/discussions/374 | <?php
namespace App\Http\Livewire;
use App\Models\SurveyScheduleView;
use Illuminate\Database\Eloquent\Builder;
use Rappasoft\LaravelLivewireTables\DataTableComponent;
use Rappasoft\LaravelLivewireTables\Views\Column;
class SurveyScheduleTable extends DataTableComponent
{
public string $defaultSortColumn = 'prev... | <?php
namespace App\Http\Livewire;
use App\Models\SurveyScheduleView;
use Illuminate\Database\Eloquent\Builder;
use Rappasoft\LaravelLivewireTables\DataTableComponent;
use Rappasoft\LaravelLivewireTables\Views\Column;
class SurveyScheduleTable extends DataTableComponent
{
public string $defaultSortColumn = 'prev... |
Use request path info as fallback | <?php
namespace Kunstmaan\LanguageChooserBundle\LocaleGuesser;
use Lunetics\LocaleBundle\LocaleGuesser\AbstractLocaleGuesser;
use Lunetics\LocaleBundle\Validator\MetaValidator;
use Symfony\Component\HttpFoundation\Request;
/**
* Locale Guesser for detecting the locale in the url
*
* @author Matthias Breddin <mb@l... | <?php
namespace Kunstmaan\LanguageChooserBundle\LocaleGuesser;
use Lunetics\LocaleBundle\LocaleGuesser\AbstractLocaleGuesser;
use Lunetics\LocaleBundle\Validator\MetaValidator;
use Symfony\Component\HttpFoundation\Request;
/**
* Locale Guesser for detecting the locale in the url
*
* @author Matthias Breddin <mb@l... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.