text stringlengths 17 1.47k | positive stringlengths 673 4.43k | negative stringlengths 677 2.81k |
|---|---|---|
Fix version autodetection from git tags | """
iniconfig: brain-dead simple config-ini parsing.
compatible CPython 2.3 through to CPython 3.2, Jython, PyPy
(c) 2010 Ronny Pfannschmidt, Holger Krekel
"""
from setuptools import setup
def main():
with open('README.txt') as fp:
readme = fp.read()
setup(
name='iniconfig',
package... | """
iniconfig: brain-dead simple config-ini parsing.
compatible CPython 2.3 through to CPython 3.2, Jython, PyPy
(c) 2010 Ronny Pfannschmidt, Holger Krekel
"""
from setuptools import setup
def main():
with open('README.txt') as fp:
readme = fp.read()
setup(
name='iniconfig',
package... |
Add a git reset to trigger a possible 'error: unable to read sha1 file...' error and cause a fresh checkout to resolve | from mono_master import MonoMasterPackage
from bockbuild.util.util import *
class MonoMasterEncryptedPackage (MonoMasterPackage):
def __init__(self):
MonoMasterPackage.__init__ (self)
self.configure_flags.extend(['--enable-extension-module=crypto --enable-native-types'])
def prep(self):
... | from mono_master import MonoMasterPackage
from bockbuild.util.util import *
class MonoMasterEncryptedPackage (MonoMasterPackage):
def __init__(self):
MonoMasterPackage.__init__ (self)
self.configure_flags.extend(['--enable-extension-module=crypto --enable-native-types'])
def prep(self):
... |
Add author badge to comments | <ul>
@foreach($comments as $comment)
<li>
<div>
{{-- Comment owner --}}
<label class="text-info">{{ $comment->user->name }} </label>
@if($comment->user->ownsArticle($comment->article))
<span class="badge badge-info">author</span... | <ul>
@foreach($comments as $comment)
<li>
<div>
{{-- Comment owner --}}
<label class="text-info">{{ $comment->user->name }} </label>
<span> - {{ $comment->created_at->diffForHumans() }}</span>
</div>
<div class="comment-body... |
Fix python 2 testing issue | __all__ = [
'test',
]
import unittest
import fnmatch
import os
try:
from colour_runner.runner import ColourTextTestRunner as TextTestRunner
except ImportError:
from unittest import TextTestRunner
def test(close=False):
"""
@desc: This is a convienance method to run all of the tests in `PVGeo`.
... | __all__ = [
'test',
]
import unittest
import fnmatch
import os
try:
from colour_runner.runner import ColourTextTestRunner as TextTestRunner
except ImportError:
from unittest import TextTestRunner
def test(close=False):
"""
@desc: This is a convienance method to run all of the tests in `PVGeo`.
... |
Fix crash in FAB background tint
am: 9d42ab847a
* commit '9d42ab847a9187fe54c53553a0593fad0aea9263':
Fix crash in FAB background tint | /*
* Copyright (C) 2015 The Android Open Source Project
*
* 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 app... | /*
* Copyright (C) 2014 The Android Open Source Project
*
* 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 app... |
Add missing INTEGRATION_INSTALLATION_REPOSITORIES github event | package org.kohsuke.github;
import java.util.Locale;
/**
* Hook event type.
*
* @author Kohsuke Kawaguchi
* @see GHEventInfo
* @see <a href="https://developer.github.com/v3/activity/events/types/">Event type reference</a>
*/
public enum GHEvent {
COMMIT_COMMENT,
CREATE,
DELETE,
DEPLOYMENT,
D... | package org.kohsuke.github;
import java.util.Locale;
/**
* Hook event type.
*
* @author Kohsuke Kawaguchi
* @see GHEventInfo
* @see <a href="https://developer.github.com/v3/activity/events/types/">Event type reference</a>
*/
public enum GHEvent {
COMMIT_COMMENT,
CREATE,
DELETE,
DEPLOYMENT,
D... |
Hide log chart when empty | /* global google Gabra $ */
// $(document).ready(function () {
google.load('visualization', '1.0', {'packages': ['corechart']})
google.setOnLoadCallback(function () {
$.ajax({
method: 'GET',
url: Gabra.api_url + 'logs/chart',
success: function (data) {
var table = new google.visualizat... | /* global google Gabra $ */
// $(document).ready(function () {
google.load('visualization', '1.0', {'packages': ['corechart']})
google.setOnLoadCallback(function () {
$.ajax({
method: 'GET',
url: Gabra.api_url + 'logs/chart',
success: function (data) {
var table = new google.visualizat... |
Add modal class to body when a modal view is shown | define(["backbone", "jquery", "utils"], function(B, $, $u) {
return B.View.extend({
initialize: function(options) {
if (options.url)
this.template = $u.templateWithUrl(options.url);
else if (options.template)
this.template = function(_, cb) {
... | define(["backbone", "utils"], function(B, $u) {
return B.View.extend({
initialize: function(options) {
if (options.url)
this.template = $u.templateWithUrl(options.url);
else if (options.template)
this.template = function(_, cb) {
cb... |
Add url to the description field.
Signed-off-by: François de Metz <5187da0b934cc25eb2201a3ec9206c24b13cb23b@stormz.me> | var icalendar = require('icalendar');
var _ = require('underscore');
exports.generateIcal = function(currentUser, boards, params) {
var ical = new icalendar.iCalendar();
boards.each(function(board) {
board.cards().each(function(card) {
// no arm, no chocolate
if (!card.get('badg... | var icalendar = require('icalendar');
var _ = require('underscore');
exports.generateIcal = function(currentUser, boards, params) {
var ical = new icalendar.iCalendar();
boards.each(function(board) {
board.cards().each(function(card) {
// no arm, no chocolate
if (!card.get('badg... |
Format reporter output with Chalk | 'use strict';
const chalk = require('chalk');
/* eslint max-statements: 'off' */
class Reporter {
/**
* Writes to console
*
* @static
* @param {Array} statsObjArray An array of stats objects
* @param {String} statsType The type of stat being processed
* @return {Undefined} No return
* @member... | 'use strict';
const chalk = require('chalk');
/* eslint max-statements: 'off' */
class Reporter {
/**
* Writes to console
*
* @static
* @param {Array} statsObjArray An array of stats objects
* @param {String} statsType The type of stat being processed
* @return {Undefined} No return
* @member... |
Clean up using servers listening and error events | 'use strict';
const { EventEmitter } = require('events');
const logger = require('./logger')('server-impl.js');
const migrator = require('../migrator');
const getApp = require('./app');
const { startMonitoring } = require('./metrics');
const { createStores } = require('./db');
const { createOptions } = require('./op... | 'use strict';
const { EventEmitter } = require('events');
const logger = require('./logger')('server-impl.js');
const migrator = require('../migrator');
const getApp = require('./app');
const { startMonitoring } = require('./metrics');
const { createStores } = require('./db');
const { createOptions } = require('./op... |
Set message attribute on InvalidValidationResponse error class. | __all___ = [
'YubicoError',
'StatusCodeError',
'InvalidClientIdError',
'InvalidValidationResponse',
'SignatureVerificationError'
]
class YubicoError(Exception):
""" Base class for Yubico related exceptions. """
pass
class StatusCodeError(YubicoError):
def __init__(self, status_code):... | __all___ = [
'YubicoError',
'StatusCodeError',
'InvalidClientIdError',
'InvalidValidationResponse',
'SignatureVerificationError'
]
class YubicoError(Exception):
""" Base class for Yubico related exceptions. """
pass
class StatusCodeError(YubicoError):
def __init__(self, status_code):... |
Add done flag to experiment. | export class ExperimentStep {
constructor(title, _type) {
this.id = '';
this.title = title;
this._type = _type;
this.steps = [];
this.description = '';
this.flags = {
important: false,
review: false,
error: false,
done: ... | export class ExperimentStep {
constructor(title, _type) {
this.id = '';
this.title = title;
this._type = _type;
this.steps = [];
this.description = '';
this.flags = {
important: false,
review: false,
error: false,
done: ... |
Fix replace bug in equality formula. |
package model.formulas;
public class Equality extends Formula {
public final Term lhs;
public final Term rhs;
public Equality(Term lhs, Term rhs){
this.lhs = lhs;
this.rhs = rhs;
super.precedence = 3;
}
@Override
public Formula replace(String newId,String oldId){
... |
package model.formulas;
public class Equality extends Formula {
public final Term lhs;
public final Term rhs;
public Equality(Term lhs, Term rhs){
this.lhs = lhs;
this.rhs = rhs;
super.precedence = 3;
}
@Override
public Formula replace(String newId,String oldId){
... |
Sort the exocomp system list by name. | import React, { Component } from "react";
import {
ButtonDropdown,
DropdownToggle,
DropdownMenu,
DropdownItem
} from "reactstrap";
class DestinationSelect extends Component {
state = { dropdownOpen: false };
toggle = () => {
this.setState({ dropdownOpen: !this.state.dropdownOpen });
};
render() {
... | import React, { Component } from "react";
import {
ButtonDropdown,
DropdownToggle,
DropdownMenu,
DropdownItem
} from "reactstrap";
class DestinationSelect extends Component {
state = { dropdownOpen: false };
toggle = () => {
this.setState({ dropdownOpen: !this.state.dropdownOpen });
};
render() {
... |
Fix region and removing version in file | <?php
/**
* @copyright Federico Nicolás Motta
* @author Federico Nicolás Motta <fedemotta@gmail.com>
* @license http://opensource.org/licenses/mit-license.php The MIT License (MIT)
* @package yii2-aws-sdk
*/
namespace fedemotta\awssdk;
use yii\base\Component;
use Aws\Common\Aws;
/**
* Yii2 component wrapping of ... | <?php
/**
* @copyright Federico Nicolás Motta
* @author Federico Nicolás Motta <fedemotta@gmail.com>
* @license http://opensource.org/licenses/mit-license.php The MIT License (MIT)
* @package yii2-aws-sdk
* @version 0.1
*/
namespace fedemotta\awssdk;
use yii\base\Component;
use Aws\Common\Aws;
/**
* Yii2 compon... |
Move checkNumber function to the buttom of class implementation. | /**
* Copyright (c) 2016, Christopher Ramírez
* All rights reserved.
*
* This source code is licensed under the MIT license.
*/
'use strict'
const validIdNumberRegExp = /^(\d{3})[ -]?(\d{6})[ -]?(\d{4}\S{1})$/
class NicaraguanId {
constructor(number) {
this.fullName = undefined
this.birthPla... | /**
* Copyright (c) 2016, Christopher Ramírez
* All rights reserved.
*
* This source code is licensed under the MIT license.
*/
'use strict'
const validIdNumberRegExp = /^(\d{3})[ -]?(\d{6})[ -]?(\d{4}\S{1})$/
class NicaraguanId {
constructor(number) {
this.fullName = undefined
this.birthPla... |
Improve login page when wrong password is entered | //
// Copyright 2014 Ilkka Oksanen <iao@iki.fi>
//
// 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 app... | //
// Copyright 2014 Ilkka Oksanen <iao@iki.fi>
//
// 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 app... |
Use github's `clone_url` instead of mandating ssh. | from collections import namedtuple
Remote = namedtuple('Remote', ('name', 'url'))
CommitInfo = namedtuple("CommitInfo",
('commit', 'origin', 'remote_repo', 'ref'))
class PRInfo(object):
def __init__(self, json):
self.json = json
@property
def base_sha(self):
retur... | from collections import namedtuple
Remote = namedtuple('Remote', ('name', 'url'))
CommitInfo = namedtuple("CommitInfo",
('commit', 'origin', 'remote_repo', 'ref'))
class PRInfo(object):
def __init__(self, json):
self.json = json
@property
def base_sha(self):
retur... |
Add group/job info to job dashboard
Signed-off-by: Salim Alam <18ae4dd1e3db1d49a738226169e3b099325c79a0@chef.io> | import time
from datetime import datetime
def my_log_parser(logger, line):
if line.count(',') >= 6:
date, report_type, group_id, job_id, event, package, rest = line.split(',',6)
if report_type == 'J' and event != 'Pending':
date = datetime.strptime(date, "%Y-%m-%d %H:%M:%S")
... | import time
from datetime import datetime
def my_log_parser(logger, line):
if line.count(',') >= 6:
date, report_type, group_id, job_id, event, package, rest = line.split(',',6)
if report_type == 'J' and event != 'Pending':
date = datetime.strptime(date, "%Y-%m-%d %H:%M:%S")
... |
Change comment color to increase contrast | module.exports = {
plain: {
color: '#f8f8f2',
backgroundColor: '#272822'
},
styles: [
{
types: ['comment', 'prolog', 'doctype', 'cdata'],
style: {
color: '#c6cad2'
}
},
{
types: ['punctuation'],
style: {
color: '#F8F8F2'
}
},
{
... | module.exports = {
plain: {
color: '#f8f8f2',
backgroundColor: '#272822'
},
styles: [
{
types: ['comment', 'prolog', 'doctype', 'cdata'],
style: {
color: '#778090'
}
},
{
types: ['punctuation'],
style: {
color: '#F8F8F2'
}
},
{
... |
Fix assertion into info e2e-test | 'use strict';
describe('my angular musicbrainz app', function () {
beforeEach(function () {
browser().navigateTo('app/index.html');
});
describe('search', function () {
beforeEach(function () {
browser().navigateTo('#/search');
});
it('should render search wh... | 'use strict';
describe('my angular musicbrainz app', function () {
beforeEach(function () {
browser().navigateTo('app/index.html');
});
it('should automatically redirect to /search when location hash/fragment is empty', function () {
expect(browser().location().url()).toBe('/search');
... |
Update forms to bootstrap 3
form-horizontal needs additional helper classes in BS3 | from django import forms
from django.template.defaultfilters import slugify
from crispy_forms.helper import FormHelper
from crispy_forms.layout import Layout, Fieldset, Submit
from crispy_forms.bootstrap import FormActions
from competition.models.team_model import Team
class TeamForm(forms.ModelForm):
class Met... | from django import forms
from django.template.defaultfilters import slugify
from crispy_forms.helper import FormHelper
from crispy_forms.layout import Layout, Fieldset, Submit
from crispy_forms.bootstrap import FormActions
from competition.models.team_model import Team
class TeamForm(forms.ModelForm):
class Met... |
Make our PollingDataStreamers start up right away | import logging
from datetime import timedelta
from twisted.internet.task import LoopingCall
from moksha.hub.hub import MokshaHub
log = logging.getLogger('moksha.hub')
class DataStream(object):
""" The parent DataStream class. """
def __init__(self):
self.hub = MokshaHub()
def send_message(self... | import logging
from datetime import timedelta
from twisted.internet.task import LoopingCall
from moksha.hub.hub import MokshaHub
log = logging.getLogger('moksha.hub')
class DataStream(object):
""" The parent DataStream class. """
def __init__(self):
self.hub = MokshaHub()
def send_message(self... |
Add missing like count from my projects list query
fbshipit-source-id: fede441 | import gql from 'graphql-tag';
import { graphql } from 'react-apollo';
import ProjectList from '../components/ProjectList';
const MyAppsQuery = gql`
query MyApps($limit: Int!, $offset: Int!){
viewer {
me {
id
appCount
apps(limit: $limit, offset: $offset) {
id
fu... | import gql from 'graphql-tag';
import { graphql } from 'react-apollo';
import ProjectList from '../components/ProjectList';
const MyAppsQuery = gql`
query MyApps($limit: Int!, $offset: Int!){
viewer {
me {
id
appCount
apps(limit: $limit, offset: $offset) {
id
fu... |
Stop the centerOn animation if the user scrolls | /**
* Pixel - jQuery plugins
*/
(function($){
/**
* Center scroll on the selected element
*
* @param {number} [speed=1025]
* @returns {*}
*/
$.fn.centerOn = function(speed) {
// Scroll speed
speed = speed || 1025;
// Center the users viewport on the selected ... | /**
* Pixel - jQuery plugins
*/
(function($){
/**
* Center scroll on the selected element
*
* @param {number} [speed=1025]
* @returns {*}
*/
$.fn.centerOn = function(speed) {
// Scroll speed
speed = speed || 1025;
// Center the users viewport on the selected ... |
Update php version for magento connect | <?php
return array(
'extension_name' => 'Allopass_Hipay',
'summary' => 'Official HiPay Fullservice payment extension.',
'description' => 'HiPay Fullservice is the first payment platform oriented towards merchants that responds to all matters related to online payment: transactio... | <?php
return array(
'extension_name' => 'Allopass_Hipay',
'summary' => 'Official HiPay Fullservice payment extension.',
'description' => 'HiPay Fullservice is the first payment platform oriented towards merchants that responds to all matters related to online payment: transactio... |
Change $urlRouterProvider.otherwise back to /home | (function () {
'use strict';
angular
.module('app.core')
.run(function($rootScope, $state) {
return $rootScope.$on('$stateChangeStart', function() {
return $rootScope.$state = $state;
});
})
.config(function ($stateProvider, $urlRouterProv... | (function () {
'use strict';
angular
.module('app.core')
.run(function($rootScope, $state) {
return $rootScope.$on('$stateChangeStart', function() {
return $rootScope.$state = $state;
});
})
.config(function ($stateProvider, $urlRouterProv... |
Fix bug with manga names being cut. | <?php
namespace App;
use Illuminate\Database\Eloquent\Model;
use \App\Manga;
class Library extends Model
{
//
protected $fillable = ['name', 'path'];
public function getId()
{
return $this->id;
}
public function getName()
{
return $this->name;
}
public function... | <?php
namespace App;
use Illuminate\Database\Eloquent\Model;
use \App\Manga;
class Library extends Model
{
//
protected $fillable = ['name', 'path'];
public function getId()
{
return $this->id;
}
public function getName()
{
return $this->name;
}
public function... |
Fix Skype postDeploy hook name | 'use strict';
const skReply = require('./reply');
const skParse = require('./parse');
module.exports = function skSetup(api, bot, logError) {
api.post('/skype', request => {
let arr = [].concat.apply([], request.body),
skContextId = request.headers.contextid;
let skHandle = parsedMessage => {
... | 'use strict';
const skReply = require('./reply');
const skParse = require('./parse');
module.exports = function skSetup(api, bot, logError) {
api.post('/skype', request => {
let arr = [].concat.apply([], request.body),
skContextId = request.headers.contextid;
let skHandle = parsedMessage => {
... |
Replace double quotes with single quotes | <?php
namespace RpsCompetition\Db;
if (!class_exists('AVH_RPS_Client')) {
header('Status: 403 Forbidden');
header('HTTP/1.1 403 Forbidden');
exit();
}
/**
* Class QueryBanquet
*
* @author Peter van der Does
* @copyright Copyright (c) 2015, AVH Software
* @package RpsCompetition\Db
*/
class Quer... | <?php
namespace RpsCompetition\Db;
if (!class_exists('AVH_RPS_Client')) {
header('Status: 403 Forbidden');
header('HTTP/1.1 403 Forbidden');
exit();
}
/**
* Class QueryBanquet
*
* @author Peter van der Does
* @copyright Copyright (c) 2015, AVH Software
* @package RpsCompetition\Db
*/
class Quer... |
Add grunt-release and rename NPM module to grypher. | // Generated on 2014-07-07 using generator-nodejs 2.0.0
module.exports = function (grunt) {
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
jshint: {
all: [
'Gruntfile.js',
'test/**/*.js'
],
options: {
j... | // Generated on 2014-07-07 using generator-nodejs 2.0.0
module.exports = function (grunt) {
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
jshint: {
all: [
'Gruntfile.js',
'test/**/*.js'
],
options: {
j... |
Fix issue with Flatpickr re-initializing itself | (function (window, document) {
let fields = Array.prototype.slice.call(
document.querySelectorAll('input[data-provides="anomaly.field_type.datetime"]:not(.flatpickr-input)')
);
// Initialize inputs
fields.forEach(function (field) {
if (!field.getAttribute('readonly')) {
l... | (function (window, document) {
let fields = Array.prototype.slice.call(
document.querySelectorAll('input[data-provides="anomaly.field_type.datetime"]')
);
// Initialize inputs
fields.forEach(function (field) {
if (!field.getAttribute('readonly')) {
let inputMode = field.g... |
Make basestring work in Python 3 | #! /usr/bin/env python
# encoding: utf-8
from __future__ import absolute_import
import urllib
from .base import AuthenticationMixinBase
from . import GrantFailed
try:
basestring
except NameError:
basestring = str
class AuthorizationCodeMixin(AuthenticationMixinBase):
"""Implement helpers for the Authori... | #! /usr/bin/env python
# encoding: utf-8
from __future__ import absolute_import
import urllib
from .base import AuthenticationMixinBase
from . import GrantFailed
class AuthorizationCodeMixin(AuthenticationMixinBase):
"""Implement helpers for the Authorization Code grant for OAuth2."""
def auth_url(self, sco... |
Use requirements.txt for all requirements, at least for now. | import os
from setuptools import setup, find_packages
here = os.path.abspath(os.path.dirname(__file__))
README = open(os.path.join(here, 'README.txt')).read()
version = '0.1'
# Use requirements.txt for all requirements, at least for now.
requires = []
if __name__ == '__main__':
setup(name='pings',
ve... | import os
from setuptools import setup, find_packages
here = os.path.abspath(os.path.dirname(__file__))
README = open(os.path.join(here, 'README.txt')).read()
version = '0.1'
requires = ['pyramid', 'pyramid_debugtoolbar']
if __name__ == '__main__':
setup(name='pings',
version=version,
descr... |
Modify migration file to include meta data changes
The OIDCBackChannelLogoutEvent model's meta data was changed in commit
f62a72b29f. Although this has no effect on the database, Django still
wants to include the meta data in migrations. Since this migration file
isn't yet included in any release, it can be modified, ... | from django.db import migrations, models
import django.utils.timezone
class Migration(migrations.Migration):
dependencies = [
("helusers", "0001_add_ad_groups"),
]
operations = [
migrations.CreateModel(
name="OIDCBackChannelLogoutEvent",
fields=[
(... | # Generated by Django 3.2.4 on 2021-06-21 05:46
from django.db import migrations, models
import django.utils.timezone
class Migration(migrations.Migration):
dependencies = [
("helusers", "0001_add_ad_groups"),
]
operations = [
migrations.CreateModel(
name="OIDCBackChannelLog... |
Disable district search + use contains filter for representatives. | var HDO = HDO || {};
(function (H, $) {
H.representativeSelector = {
init: function (opts) {
var districtSelect, representativeSelect, representatives, selectedRepresentatives;
districtSelect = opts.districtSelect;
representativeSelect = opts.representativeSelect;
representatives ... | var HDO = HDO || {};
(function (H, $) {
H.representativeSelector = {
init: function (opts) {
var districtSelect, representativeSelect, representatives, selectedRepresentatives;
districtSelect = opts.districtSelect;
representativeSelect = opts.representativeSelect;
representatives ... |
Include worker in karma so coverage reveals that it's not tested | /*global module */
module.exports = function(config) {
'use strict';
config.set({
// base path, that will be used to resolve files and exclude
basePath: '',
// testing framework to use (jasmine/mocha/qunit/...)
frameworks: ['jasmine'],
// list of files / patterns to load in the browser
f... | /*global module */
module.exports = function(config) {
'use strict';
config.set({
// base path, that will be used to resolve files and exclude
basePath: '',
// testing framework to use (jasmine/mocha/qunit/...)
frameworks: ['jasmine'],
// list of files / patterns to load in the browser
f... |
Save event emitter y producer reference in relayer instance | from kafka import KafkaProducer
from .event_emitter import EventEmitter
from .exceptions import ConfigurationError
__version__ = '0.1.3'
class Relayer(object):
def __init__(self, logging_topic, context_handler_class, kafka_hosts=None, topic_prefix='', topic_suffix='', source=''):
self.logging_topic = l... | from kafka import KafkaProducer
from .event_emitter import EventEmitter
from .exceptions import ConfigurationError
__version__ = '0.1.3'
class Relayer(object):
def __init__(self, logging_topic, context_handler_class, kafka_hosts=None, topic_prefix='', topic_suffix='', source=''):
self.logging_topic = l... |
Review: Add comments. Remove space removal. | package org.apache.mesos.elasticsearch.scheduler.state;
import java.io.IOException;
import java.security.InvalidParameterException;
/**
* Path utilities
*/
public class StatePath {
private SerializableState zkState;
public StatePath(SerializableState zkState) {
this.zkState = zkState;
}
/**... | package org.apache.mesos.elasticsearch.scheduler.state;
import org.apache.log4j.Logger;
import java.io.IOException;
import java.security.InvalidParameterException;
/**
* Path utilities
*/
public class StatePath {
private static final Logger LOGGER = Logger.getLogger(StatePath.class);
private SerializableSt... |
Update description and add 'tox' as a testing dependency. | #!/usr/bin/env python
# -*- coding: utf-8 -*-
try:
from setuptools import setup
except ImportError:
from distutils.core import setup
readme = open('README.rst').read()
history = open('HISTORY.rst').read().replace('.. :changelog:', '')
requirements = [
# None
]
test_requirements = [
'tox',
]
setup... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
try:
from setuptools import setup
except ImportError:
from distutils.core import setup
readme = open('README.rst').read()
history = open('HISTORY.rst').read().replace('.. :changelog:', '')
requirements = [
# TODO: put package requirements here
]
test_requi... |
Make index fields public constants
So they are reusable by other classes. | package de.hsmannheim.iws2014.indexing;
import org.apache.lucene.document.*;
import org.apache.lucene.index.IndexWriter;
import java.io.IOException;
import java.util.List;
/**
* This class does all the hard work. Indexing developers.
*/
public class Indexer {
public static final String FIRSTNAME = "firstname"... | package de.hsmannheim.iws2014.indexing;
import org.apache.lucene.document.*;
import org.apache.lucene.index.IndexWriter;
import java.io.IOException;
import java.util.List;
/**
* This class does all the hard work. Indexing developers.
*/
public class Indexer {
private final IndexWriter index;
public Index... |
Raise UnsupportedScheduler if specific scheduler for submit is not
supported (Now just swf is supported). | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""Helper functions.
"""
# built-in modules
import json
# local modules
from mass.exception import UnsupportedScheduler
from mass.input_handler import InputHandler
from mass.scheduler.swf import config
def submit(job, protocol=None, priority=1, scheduler='swf'):
"... | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""Helper functions.
"""
# built-in modules
import json
# local modules
from mass.input_handler import InputHandler
from mass.scheduler.swf import config
def submit(job, protocol=None, priority=1):
"""Submit mass job to SWF with specific priority.
"""
impo... |
Fix issue where users were not saving to the database.
We use .fetchAll() rather than .fetch() to find
all instances of a user. Added auto-timestamp
functionality so all create and update times are
automatically marked with no manual intervention needed. | // SignupController
// ================
// Handles routing for signing up for the pp
'use strict';
let express = require('express'),
SignupController = express.Router(),
bcrypt = require('bcrypt'),
User = require(__dirname + '/../models/user');
SignupController.route('/... | // SignupController
// ================
// Handles routing for signing up for the pp
'use strict';
let express = require('express'),
SignupController = express.Router(),
bcrypt = require('bcrypt'),
User = require(__dirname + '/../models/user');
SignupController.route('/... |
Fix deprecated usage of the config component | <?php
namespace Incenteev\TranslationCheckerBundle\DependencyInjection;
use Symfony\Component\Config\Definition\Builder\TreeBuilder;
use Symfony\Component\Config\Definition\ConfigurationInterface;
class Configuration implements ConfigurationInterface
{
public function getConfigTreeBuilder()
{
$treeBu... | <?php
namespace Incenteev\TranslationCheckerBundle\DependencyInjection;
use Symfony\Component\Config\Definition\Builder\TreeBuilder;
use Symfony\Component\Config\Definition\ConfigurationInterface;
class Configuration implements ConfigurationInterface
{
public function getConfigTreeBuilder()
{
$treeBu... |
Complete parsing system, fully functional | <?php
include("/home/c0smic/secure/data_db_settings.php");
$body = file_get_contents('php://input');
$stime = "";
$etime = "";
$moves = "";
function parseData($body) {
$splitter = substr($body, 0, 1);
global $stime, $etime, $moves;
$mark1 = strpos($body, $splitter, 1... | <?php
include("/home/c0smic/secure/data_db_settings.php");
$body = file_get_contents('php://input');
$stime = "";
$etime = "";
$moves = "";
function parseData($body) {
$splitter = '|';
global $stime, $etime, $moves;
$inc = 1;
while(strcmp(substr($body, $inc, 1... |
Use hgtools 5 or later for use_vcs_version | import sys
import setuptools
def read_long_description():
with open('README.rst') as f:
data = f.read()
with open('CHANGES.rst') as f:
data += '\n\n' + f.read()
return data
importlib_req = ['importlib'] if sys.version_info < (2,7) else []
argparse_req = ['argparse'] if sys.ver... | import sys
import setuptools
def read_long_description():
with open('README.rst') as f:
data = f.read()
with open('CHANGES.rst') as f:
data += '\n\n' + f.read()
return data
importlib_req = ['importlib'] if sys.version_info < (2,7) else []
argparse_req = ['argparse'] if sys.ver... |
Add SITE_ID to test settings since contrib.sites is in INSTALLED_APPS. | #!/usr/bin/env python
from os.path import dirname, abspath
import sys
from django.conf import settings
if not settings.configured:
from django import VERSION
settings_dict = dict(
INSTALLED_APPS=(
'localeurl',
'localeurl.tests',
'django.contrib.sites', # for sitema... | #!/usr/bin/env python
from os.path import dirname, abspath
import sys
from django.conf import settings
if not settings.configured:
from django import VERSION
settings_dict = dict(
INSTALLED_APPS=(
'localeurl',
'localeurl.tests',
'django.contrib.sites', # for sitema... |
Allow error email to still be sent if DB is down
We were seeing errors in the logs where the database was inaccessible,
but the errors were not being emailed out because the handler makes a DB query. | from logging.handlers import SMTPHandler
DEV_TEAM_EMAILS_QUERY = '''SELECT DISTINCT email FROM
members NATURAL JOIN current_position_holders NATURAL JOIN positions NATURAL JOIN groups
WHERE group_name = "Devteam"
'''
DEFAULT_DEV_TEAM_EMAILS = ['devteam@donut.caltech.edu']
class DonutS... | from logging.handlers import SMTPHandler
DEV_TEAM_EMAILS_QUERY = '''SELECT DISTINCT email FROM
members NATURAL JOIN current_position_holders NATURAL JOIN positions NATURAL JOIN groups
WHERE group_name = "Devteam"
'''
class DonutSMTPHandler(SMTPHandler):
def __init__(self,
... |
Add validation to show reactivate button to AdminUser list | window.c.AdminUserDetail = (function(m, _, c){
return {
controller: function(){
return {
actions: {
reset: {
property: 'user_password',
updateKey: 'password',
callToAction: 'Redefinir',
... | window.c.AdminUserDetail = (function(m, _, c){
return {
controller: function(){
return {
actions: {
reset: {
property: 'user_password',
updateKey: 'password',
callToAction: 'Redefinir',
... |
Multiply rss parsed from ps on OSX by 1024 to convert to bytes | var exec = require('child_process').exec;
module.exports = function(sysinfo) {
return new MacProvider(sysinfo);
};
function MacProvider(sysinfo) {
this.lookup = function(pid, options, callback) {
if(typeof options == 'function') {
callback = options;
options = {};
}
... | var exec = require('child_process').exec;
module.exports = function(sysinfo) {
return new MacProvider(sysinfo);
};
function MacProvider(sysinfo) {
this.lookup = function(pid, options, callback) {
if(typeof options == 'function') {
callback = options;
options = {};
}
... |
Hide vote buttons if user is not logged in. | <?php
use yii\helpers\Html;
/* @var $model ShortCirquit\LinkoScopeApi\models\Link */
?>
<div>
<div>
<?= ($index + 1) ?>:
<?php if (!Yii::$app->user->isGuest) : ?>
<?= Html::a('<span class="glyphicon glyphicon-arrow-up"></span>', ['up', 'id' => $model->id,], ['title' => 'Up']) ?>
... | <?php
use yii\helpers\Html;
/* @var $model ShortCirquit\LinkoScopeApi\models\Link */
?>
<div>
<div>
<?= ($index + 1) ?>:
<?= Html::a('<span class="glyphicon glyphicon-arrow-up"></span>', ['up', 'id' => $model->id,], ['title' => 'Up']) ?>
<?= Html::a('<span class="glyphicon glyphi... |
Change encoding of xml to encode all except xml tags | package fr.insee.rmes.utils;
import java.io.IOException;
import java.io.OutputStream;
import java.io.Writer;
import org.codehaus.stax2.io.EscapingWriterFactory;
public class CustomXmlEscapingWriterFactory implements EscapingWriterFactory {
public Writer createEscapingWriterFor(final Writer out, String enc) {
... | package fr.insee.rmes.utils;
import java.io.IOException;
import java.io.OutputStream;
import java.io.Writer;
import org.codehaus.stax2.io.EscapingWriterFactory;
public class CustomXmlEscapingWriterFactory implements EscapingWriterFactory {
public Writer createEscapingWriterFor(final Writer out, String enc) {
ret... |
Add on end stream event |
var es = require('event-stream');
var cred = {
app:require('../../config/app'),
user:require('../../config/user')
};
exports = module.exports = function (p) {
return {
// retrieve all of the lists defined for your user account
0: function () {
p.query()
.selec... |
var es = require('event-stream');
var cred = {
app:require('../../config/app'),
user:require('../../config/user')
};
exports = module.exports = function (p) {
return {
// retrieve all of the lists defined for your user account
0: function () {
p.query()
.selec... |
Add basic validation of ui state. | # :coding: utf-8
# :copyright: Copyright (c) 2013 Martin Pengelly-Phillips
# :license: See LICENSE.txt.
from PySide import QtGui
from .selector import SelectorWidget
from .options import OptionsWidget
class ExporterWidget(QtGui.QWidget):
'''Manage exporting.'''
def __init__(self, host, parent=None):
... | # :coding: utf-8
# :copyright: Copyright (c) 2013 Martin Pengelly-Phillips
# :license: See LICENSE.txt.
from PySide import QtGui
from .selector import SelectorWidget
from .options import OptionsWidget
class ExporterWidget(QtGui.QWidget):
'''Manage exporting.'''
def __init__(self, host, parent=None):
... |
Handle the case of an empty path
This will deal with the root domain request going to default page. | import boto3
import botocore
from flask import (
abort,
current_app,
flash,
make_response,
redirect,
request,
Response,
url_for,
)
from flask_login import current_user
from . import passthrough_bp
@passthrough_bp.route('/<path:path>')
def passthrough(path):
if not current_user.is_a... | import boto3
import botocore
from flask import (
abort,
current_app,
flash,
make_response,
redirect,
request,
Response,
url_for,
)
from flask_login import current_user
from . import passthrough_bp
@passthrough_bp.route('/<path:path>')
def passthrough(path):
if not current_user.is_a... |
Add alert and logout when no login details given | /**
* Generic error handler method for ajax responses.
* Apply your specific requirements for an error response and then call this method to take care of the rest.
* @param response
*/
function handleApiError(response) {
if (!response || response.status === 200)
return;
if (response.status === 403... | /**
* Generic error handler method for ajax responses.
* Apply your specific requirements for an error response and then call this method to take care of the rest.
* @param response
*/
function handleApiError(response) {
if (!response || response.status === 200)
return;
if (response.status === 403... |
Edit tags in edit form input | import React, { Component, PropTypes } from 'react';
import { getDescriptionAndTags, buildDescriptionAndTags } from '../helpers';
class EditActivityForm extends Component {
componentDidMount() {
this.description.focus();
}
updateActivity(e) {
e.preventDefault();
const { description, tags } = getDes... | import React, { Component, PropTypes } from 'react';
class EditActivityForm extends Component {
componentDidMount() {
this.description.focus();
}
updateActivity(e) {
e.preventDefault();
const activity = {
description: this.description.value,
timestamp: this.props.timestamp,
}
... |
Remove semi-colon for sails lift to run correctly | /**
* Default model configuration
* (sails.config.models)
*
* Unless you override them, the following properties will be included
* in each of your models.
*
* For more info on Sails models, see:
* http://sailsjs.org/#/documentation/concepts/ORM
*/
module.exports.models = {
/*******************************... | /**
* Default model configuration
* (sails.config.models)
*
* Unless you override them, the following properties will be included
* in each of your models.
*
* For more info on Sails models, see:
* http://sailsjs.org/#/documentation/concepts/ORM
*/
module.exports.models = {
/*******************************... |
Allow list of flashers as show token value | """Flasher config player."""
from mpf.config_players.device_config_player import DeviceConfigPlayer
from mpf.core.delays import DelayManager
from mpf.core.utility_functions import Util
class FlasherPlayer(DeviceConfigPlayer):
"""Triggers flashers based on config."""
config_file_section = 'flasher_player'
... | """Flasher config player."""
from mpf.config_players.device_config_player import DeviceConfigPlayer
from mpf.core.delays import DelayManager
class FlasherPlayer(DeviceConfigPlayer):
"""Triggers flashers based on config."""
config_file_section = 'flasher_player'
show_section = 'flashers'
__slots__ =... |
Make sure to limit the number of simultaneous requests | <?php
namespace Happyr\LocoBundle\Http;
use GuzzleHttp\Client;
use GuzzleHttp\Exception\ClientException;
use GuzzleHttp\Pool;
use Happyr\LocoBundle\Exception\HttpException;
/**
* @author Tobias Nyholm
*/
class Guzzle5Adapter implements HttpAdapterInterface
{
/**
* {@inheritdoc}
*/
public function... | <?php
namespace Happyr\LocoBundle\Http;
use GuzzleHttp\Client;
use GuzzleHttp\Exception\ClientException;
use GuzzleHttp\Pool;
use Happyr\LocoBundle\Exception\HttpException;
/**
* @author Tobias Nyholm
*/
class Guzzle5Adapter implements HttpAdapterInterface
{
/**
* {@inheritdoc}
*/
public function... |
Make queue_to_send a celery task | import datetime
import logging
from celery.task import task
from django.core.mail.backends.smtp import EmailBackend
from django.contrib.auth.models import User
from pigeonpost.models import ContentQueue, Outbox
logger = logging.getLogger('pigeonpost.tasks')
@task
def queue_to_send(sender, **kwargs):
# Check to... | import datetime
import logging
from celery.task import task
from django.core.mail.backends.smtp import EmailBackend
from django.contrib.auth.models import User
from pigeonpost.models import ContentQueue, Outbox
logger = logging.getLogger('pigeonpost.tasks')
def queue_to_send(sender, **kwargs):
# Check to see i... |
Add more security to the mock system who simulates Eloquent's constructor method. | <?php
use Mockery as m;
class AcTestCase extends Orchestra\Testbench\TestCase
{
protected $app;
protected $router;
public function tearDown()
{
parent::tearDown();
m::close();
}
protected function mock($className)
{
$mock = m::mock($className);
App::bind($... | <?php
use Mockery as m;
class AcTestCase extends Orchestra\Testbench\TestCase
{
protected $app;
protected $router;
public function tearDown()
{
parent::tearDown();
m::close();
}
protected function mock($className)
{
$mock = m::mock($className);
App::bind($... |
Exit instead of die for ending json return | <?php
defined('BASEPATH') OR exit('No direct script access allowed');
class MY_Controller extends CI_Controller
{
public function __construct()
{
parent::__construct();
// save whole request to data property
$request = (array)json_decode(file_get_contents('php://input'));
if (co... | <?php
defined('BASEPATH') OR exit('No direct script access allowed');
class MY_Controller extends CI_Controller
{
public function __construct()
{
parent::__construct();
// save whole request to data property
$request = (array)json_decode(file_get_contents('php://input'));
if (co... |
Add ogv and oga support | <?php
return array(
'properties' => array(
/**
* Define the default array of allowed types/extensions
* This list should be restrictive enough so that malicious users can't do too much damage.
*/
'bucketDefaultAllowedTypes' => array(
// Images
'p... | <?php
return array(
'properties' => array(
/**
* Define the default array of allowed types/extensions
* This list should be restrictive enough so that malicious users can't do too much damage.
*/
'bucketDefaultAllowedTypes' => array(
// Images
'p... |
Remove unneeded condition, update phpdoc, change description. | <?php
namespace Symfony\Upgrade\Fixer;
use Symfony\CS\Tokenizer\Token;
use Symfony\CS\Tokenizer\Tokens;
class FormGetnameToGetblockprefixFixer extends FormTypeFixer
{
/**
* @inheritdoc
*/
public function fix(\SplFileInfo $file, $content)
{
$tokens = Tokens::fromCode($content);
... | <?php
namespace Symfony\Upgrade\Fixer;
use Symfony\CS\Tokenizer\Token;
use Symfony\CS\Tokenizer\Tokens;
class FormGetnameToGetblockprefixFixer extends FormTypeFixer
{
/**
* Fixes a file.
*
* @param \SplFileInfo $file A \SplFileInfo instance
* @param string $content The file content
... |
Fix add security configurations compiler pass. | <?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\AdminBundle\Depen... | <?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\AdminBundle\Depen... |
Make parameters in EndpointManager optional
Change adminurl and internalurl parameters in EndpointManager create()
to optional parameters.
Change-Id: I490e35b89f7ae7c6cdbced6ba8d3b82d5132c19d
Closes-Bug: #1318436 | # Copyright 2012 Canonical Ltd.
# 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 b... | # Copyright 2012 Canonical Ltd.
# 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 b... |
Add optional env vars to prevent additional leakage of personal info | var Pokeio = require('./poke.io')
//Set environment variables or replace placeholder text
var location = process.env.PGO_LOCATION || 'times squere';
var username = process.env.PGO_USERNAME || 'USERNAME';
var password = process.env.PGO_PASSWORD || 'PASSWORD';
Pokeio.SetLocation(location, function(err, loc) {
if (e... | var Pokeio = require('./poke.io')
var location = 'Stockflethsvej 39';
var username = 'Arm4x';
var password = 'OHSHITWADDUP';
Pokeio.SetLocation(location, function(err, loc) {
if (err) throw err;
console.log('[i] Current location: ' + location)
console.log('[i] lat/long/alt: : ' + loc.latitude + ' ' + lo... |
Add support for looking up all subscriptions on a specific release note. | 'use strict';
const BaseRepository = require('@gfcc/mongo-tenant-repository/BaseRepository');
class SubscriptionRepository extends BaseRepository {
getSchemaDefinition() {
return {
subscriberId: {
type: String,
required: true,
index: true,
},
releaseNotesId: {
t... | 'use strict';
const BaseRepository = require('@gfcc/mongo-tenant-repository/BaseRepository');
class SubscriptionRepository extends BaseRepository {
getSchemaDefinition() {
return {
subscriberId: {
type: String,
required: true,
index: true,
},
releaseNotesId: {
t... |
Make comment tests compatible with decaffeinate-parser. | import check from './support/check';
describe('comments', () => {
it('converts line comments to // form', function() {
check(`
# foo
1
`, `
// foo
1;
`);
});
it('converts block comments to /* */', function() {
check(`
###
HEY
###
1
`, `
/... | import check from './support/check';
describe('comments', () => {
it('converts line comments to // form', function() {
check(`
# foo
1
`, `
// foo
1;
`);
});
it('converts block comments to /* */', function() {
check(`
a(
###
HEY
###
1... |
Fix image_obj template tag when sending Nonetype image | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from django import template
from django.conf import settings
from ..generate import image_url as url
register = template.Library()
@register.simple_tag
def image_url(image_url, **kwargs):
return url(image_url=image_url, **kwargs)
@register.simple_tag
def image_obj... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from django import template
from django.conf import settings
from ..generate import image_url as url
register = template.Library()
@register.simple_tag
def image_url(image_url, **kwargs):
return url(image_url=image_url, **kwargs)
@register.simple_tag
def image_obj... |
Make the shortcut an interface to satisfy SonarQube | package org.mybatis.qbe.mybatis3;
import org.mybatis.qbe.Criterion;
import org.mybatis.qbe.WhereClause;
import org.mybatis.qbe.condition.Condition;
import org.mybatis.qbe.field.Field;
import org.mybatis.qbe.mybatis3.render.WhereClauseRenderer;
/**
* This interface combines the operations of building the where clause... | package org.mybatis.qbe.mybatis3;
import org.mybatis.qbe.Criterion;
import org.mybatis.qbe.WhereClause;
import org.mybatis.qbe.condition.Condition;
import org.mybatis.qbe.field.Field;
import org.mybatis.qbe.mybatis3.render.WhereClauseRenderer;
/**
* This class combines the operations of building the where clause
* ... |
:wrench: Remove two more required prop warnings | import React, { Component, PropTypes } from 'react';
import fetchData from '../../actions/fetchData';
import Toast from '../../components/Toast';
import Modals from '../Modals';
import SocketEvents from '../../utils/socketEvents';
import t from '../../utils/types';
import './Main.scss';
import MainNav from '../MainNav... | import React, { Component, PropTypes } from 'react';
import fetchData from '../../actions/fetchData';
import Toast from '../../components/Toast';
import Modals from '../Modals';
import SocketEvents from '../../utils/socketEvents';
import t from '../../utils/types';
import './Main.scss';
import MainNav from '../MainNav... |
Update function to keep defaultValue and Value in sync in config forms | define(['knockout', 'underscore', 'viewmodels/widget'], function (ko, _, WidgetViewModel) {
/**
* registers a text-widget component for use in forms
* @function external:"ko.components".text-widget
* @param {object} params
* @param {string} params.value - the value being managed
* @param {functi... | define(['knockout', 'underscore', 'viewmodels/widget'], function (ko, _, WidgetViewModel) {
/**
* registers a text-widget component for use in forms
* @function external:"ko.components".text-widget
* @param {object} params
* @param {string} params.value - the value being managed
* @param {functi... |
Allow routes to be resolved by name property. | (function () {
'use strict';
angular.module('angular-reverse-url', ['ngRoute'])
.filter('reverseUrl', ['$route', function ($route) {
var regexp = /:([A-Za-z0-9]*)\\*?\\??/g;
return _.memoize(function (name, params) {
var targetRoute;
angular.forE... | (function () {
'use strict';
angular.module('angular-reverse-url', ['ngRoute'])
.filter('reverseUrl', ['$route', function ($route) {
var regexp = /:([A-Za-z0-9]*)\\*?\\??/g;
return _.memoize(function (controller, params) {
var targetRoute;
angula... |
Use https to load openstreetmap data | (function() {
'use strict';
angular.module('kuulemmaApp').directive('locationMap', function($window) {
return {
restrict: 'A',
scope: {
latitude: '@',
longitude: '@',
polygon: '@'
},
link: function(scope, element) {
var L = $window.L;
var map = L.m... | (function() {
'use strict';
angular.module('kuulemmaApp').directive('locationMap', function($window) {
return {
restrict: 'A',
scope: {
latitude: '@',
longitude: '@',
polygon: '@'
},
link: function(scope, element) {
var L = $window.L;
var map = L.m... |
Add examples to the endpoint documentation | 'use strict';
module.exports = defineRoute;
// Define the route
function defineRoute (server, opts) {
server.route({
method: 'GET',
path: '/',
handler: handler,
config: {
jsonp: 'callback',
validate: {
query: {},
payload: fal... | 'use strict';
module.exports = defineRoute;
// Define the route
function defineRoute (server, opts) {
server.route({
method: 'GET',
path: '/',
handler: handler,
config: {
jsonp: 'callback',
validate: {
query: {},
payload: fal... |
Include simple type in bottom descrption | package io.quarkus.annotation.processor.generate_doc;
import java.util.List;
class DescriptiveDocFormatter implements DocFormatter {
private static final String ENTRY_END = "\n\n";
private static final String DETAILS_TITLE = "\n== Details\n";
private static final String DEFAULTS_VALUE_FORMAT = "Defaults t... | package io.quarkus.annotation.processor.generate_doc;
import java.util.List;
class DescriptiveDocFormatter implements DocFormatter {
private static final String ENTRY_END = "\n\n";
private static final String DETAILS_TITLE = "\n== Details\n";
private static final String DEFAULTS_VALUE_FORMAT = "Defaults t... |
Remove if statement before return | import React from 'react';
const CurrentWeather = ({ weather }) => {
const today = weather[0].forecast.simpleforecast.forecastday[0];
const hourly = weather[0].hourly_forecast[0];
return (
<article className='weather-card'>
<h2 className='location'>
{weather[0].current_observation.display_loca... | import React from 'react';
// import CurrentTemp from '../CurrentTemp.js';
const CurrentWeather = ({ weather }) => {
let today;
let hourly;
if (weather.length) {
today = weather[0].forecast.simpleforecast.forecastday[0];
hourly = weather[0].hourly_forecast[0];
} else {
return (
<div>
... |
Update UI preferences model (dict) | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Resource information of host
"""
def get_name():
"""
Get name of this resource
:return: name of this resource
:rtype: str
"""
return 'uipref'
def get_schema():
"""
Schema structure of this resource
:return: schema dictionnary
... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Resource information of host
"""
def get_name():
"""
Get name of this resource
:return: name of this resource
:rtype: str
"""
return 'uipref'
def get_schema():
"""
Schema structure of this resource
:return: schema dictionnary
... |
Return boolean instead of if statement. | <?php
/**
* Zend Framework (http://framework.zend.com/)
*
* @link http://github.com/zendframework/zf2 for the canonical source repository
* @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
... | <?php
/**
* Zend Framework (http://framework.zend.com/)
*
* @link http://github.com/zendframework/zf2 for the canonical source repository
* @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
... |
Fix resource category help text.
Fixes #15 | from django.db import models
class Category(models.Model):
"""A category of resources."""
important = models.BooleanField(
default=False,
help_text=('Categories marked important will be shown at the top of '
'the resource list'),
verbose_name='important')
title =... | from django.db import models
class Category(models.Model):
"""A category of resources."""
important = models.BooleanField(
default=False,
help_text=('categories marked important will be shown at the top of ',
'the resource list'),
verbose_name='important')
title ... |
Reset user data when signed out. | import {
createUser,
updateUser
} from '../../../api/db/user'
import userMutations from './mutations'
import authMutations from '../auth/mutations'
import { getCurrentUserObject } from './getters'
import { ValueChangedObserver } from '../../../services/observers'
import * as paths from '../../../api/db/paths'
... | import {
createUser,
updateUser
} from '../../../api/db/user'
import userMutations from './mutations'
import authMutations from '../auth/mutations'
import { getCurrentUserObject } from './getters'
import { ValueChangedObserver } from '../../../services/observers'
import * as paths from '../../../api/db/paths'
... |
tests: Fix the temp file initialization
Signed-off-by: Kai Blin <94ddc6985b47aef772521e302594241f46a8f665@biotech.uni-tuebingen.de> | # -*- coding: utf-8 -*-
from flask.ext.testing import TestCase
import os
import tempfile
import shutil
import websmash
class ModelTestCase(TestCase):
def create_app(self):
self.app = websmash.app
self.dl = websmash.dl
self.app.config['TESTING'] = True
self.app.config['SQLALCHEMY_DA... | # -*- coding: utf-8 -*-
from flask.ext.testing import TestCase
import os
import tempfile
import shutil
import websmash
class ModelTestCase(TestCase):
def create_app(self):
self.app = websmash.app
self.dl = websmash.dl
self.app.config['TESTING'] = True
self.app.config['SQLALCHEMY_DA... |
Add dropdown menu to navbar | import React, { PureComponent, PropTypes } from 'react'
import { Link } from 'react-router'
import { Menu, Button, Header, Dropdown } from 'semantic-ui-react'
class Navbar extends PureComponent {
static propTypes = {
currentUser: PropTypes.object,
signedIn: PropTypes.bool.isRequired,
signOut: PropTypes.f... | import React, { PureComponent, PropTypes } from 'react'
import { Link } from 'react-router'
import { Menu, Button, Header, Icon } from 'semantic-ui-react'
class Navbar extends PureComponent {
static propTypes = {
currentUser: PropTypes.object,
signedIn: PropTypes.bool.isRequired,
signOut: PropTypes.func.... |
Change xml_encode to permit adding attributes to root node | <?php
function xml_encode($mixed, $attrs = [], $domElement = null, $DOMDocument = null) {
if (is_null($DOMDocument)) {
$DOMDocument = new DOMDocument;
$DOMDocument->formatOutput = true;
xml_encode($mixed, null, $DOMDocument, $DOMDocument);
foreach ($attrs as ... | <?php
function xml_encode($mixed, $domElement = null, $DOMDocument = null) {
if (is_null($DOMDocument)) {
$DOMDocument = new DOMDocument;
$DOMDocument->formatOutput = true;
xml_encode($mixed, $DOMDocument, $DOMDocument);
return $DOMDocument->saveXML();
... |
Update coverage values to match current | 'use strict';
module.exports = function(grunt) {
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
jshint: {
allFiles: ['Gruntfile.js', 'lib/**/*.js', 'test/**/*.js', 'index.js'],
options: {
jshintrc: '.jshintrc',
}
},
... | 'use strict';
module.exports = function(grunt) {
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
jshint: {
allFiles: ['Gruntfile.js', 'lib/**/*.js', 'test/**/*.js', 'index.js'],
options: {
jshintrc: '.jshintrc',
}
},
... |
Fix trl controller fuer directories | <?php
class Vpc_Directories_Item_Directory_Trl_Controller extends Vps_Controller_Action_Auto_Vpc_Grid
{
protected $_buttons = array(
'save',
'reload',
);
protected $_editDialog = array(
'width' => 500,
'height' => 400
);
protected $_hasComponentId = false; //compon... | <?php
class Vpc_Directories_Item_Directory_Trl_Controller extends Vps_Controller_Action_Auto_Vpc_Grid
{
protected $_buttons = array(
'save',
'reload',
);
protected $_editDialog = array(
'width' => 500,
'height' => 400
);
protected $_paging = 25;
public functi... |
Add basic Array.from polyfill for IE11 | (function() {
var isIE11 = !!window.MSInputMethodContext && !!document.documentMode;
if (isIE11) {
// IE11 does not provide classList on SVGElements
if (! ("classList" in SVGElement.prototype)) {
Object.defineProperty(SVGElement.prototype, 'classList', Object.getOwnPropertyDescripto... | (function() {
var isIE11 = !!window.MSInputMethodContext && !!document.documentMode;
if (isIE11) {
// IE11 does not provide classList on SVGElements
if (! ("classList" in SVGElement.prototype)) {
Object.defineProperty(SVGElement.prototype, 'classList', Object.getOwnPropertyDescripto... |
Refactor simple arrow head to use two lines instead of path | package SW9.model_canvas.arrow_heads;
import javafx.scene.paint.Color;
import javafx.scene.shape.*;
public class SimpleArrowHead extends ArrowHead {
private static final double TRIANGLE_LENGTH = 20d;
private static final double TRIANGLE_WIDTH = 15d;
public SimpleArrowHead() {
super();
a... | package SW9.model_canvas.arrow_heads;
import javafx.scene.paint.Color;
import javafx.scene.shape.LineTo;
import javafx.scene.shape.MoveTo;
import javafx.scene.shape.Path;
public class SimpleArrowHead extends ArrowHead {
private static final double TRIANGLE_LENGTH = 20d;
private static final double TRIANGLE_W... |
Change the way we create props for item | 'use strict';
import React, { Component, PropTypes } from 'react';
// TODO: title and body componenets?
// TODO: PropTypes
export default class AccordionItem extends Component {
getItemProps() {
return {
'aria-expanded': this.props.expanded,
'aria-hidden': !this.props.expanded,
className: 're... | 'use strict';
import React, { Component, PropTypes } from 'react';
// TODO: title and body componenets?
// TODO: PropTypes
export default class AccordionItem extends Component {
render() {
let itemProps = {
'aria-expanded': this.props.expanded,
'aria-hidden': !this.props.expanded,
className: ... |
Update dashboard current width when window is resized (eg: when table orientation changes). | /**
* Mycockpit Directive
*/
(function() {
'use strict';
angular
.module('dashboard')
.directive('dashboard', ['dashboardFactory', function(dashboardFactory) {
// Width of the dashboard container
var currentWidth;
// To detet a change of column
... | /**
* Mycockpit Directive
*/
(function() {
'use strict';
angular
.module('dashboard')
.directive('dashboard', ['dashboardFactory', function(dashboardFactory) {
// Width of the dashboard container
var currentWidth;
// To detet a change of column
... |
Add /users/list to authorized URLs | // Requires
var _ = require('underscore');
var express = require('express');
function setup(options, imports, register) {
// Import
var app = imports.server.app;
var workspace = imports.workspace;
// Apply middlewares
app.use(express.cookieParser());
app.use(express.cookieSession({
k... | // Requires
var _ = require('underscore');
var express = require('express');
function setup(options, imports, register) {
// Import
var app = imports.server.app;
var workspace = imports.workspace;
// Apply middlewares
app.use(express.cookieParser());
app.use(express.cookieSession({
k... |
assertIdentifier: Clean up exception message for null identifier | //////////////////////////////////////////////////////////////////////////////
//
// Copyright 2010, Starting Block Technologies
// www.startingblocktech.com
//
//////////////////////////////////////////////////////////////////////////////
package com.startingblocktech.tcases;
im... | //////////////////////////////////////////////////////////////////////////////
//
// Copyright 2010, Starting Block Technologies
// www.startingblocktech.com
//
//////////////////////////////////////////////////////////////////////////////
package com.startingblocktech.tcases;
im... |
Make run loop work within the app class | var gl;
var App = new Class({
Implements: Options,
options: {
name: 'webglet-app',
width: 800,
height: 600,
frameRate: 60
},
initialize: function(element, options) {
this.setOptions(options);
this.element = element;
this.createCanvas();
},
... | var gl;
var App = new Class({
Implements: Options,
options: {
name: 'webglet-app',
width: 800,
height: 600,
frameRate: 60
},
initialize: function(element, options) {
this.setOptions(options);
this.element = element;
this.createCanvas();
},
... |
Create container on remote platform when launching client and no container has yet been created | package pt.up.fe.aiad.gui;
import jade.core.*;
import jade.wrapper.StaleProxyException;
import javafx.fxml.FXML;
import javafx.scene.control.ListView;
import pt.up.fe.aiad.scheduler.SchedulerAgent;
import pt.up.fe.aiad.utils.FXUtils;
public class ClientController {
private String _addressIp;
private int _port... | package pt.up.fe.aiad.gui;
import jade.wrapper.StaleProxyException;
import javafx.fxml.FXML;
import javafx.scene.control.ListView;
import pt.up.fe.aiad.scheduler.SchedulerAgent;
import pt.up.fe.aiad.utils.FXUtils;
public class ClientController {
private String _addressIp;
private int _port;
private String... |
Add 'current-watching' column to overview | <table class="table table-horizontal table-striped">
<thead>
<tr>
<th>Tube</th>
<th>current-jobs-urgent</th>
<th>current-jobs-ready</th>
<th>current-jobs-reserved</th>
<th>current-jobs-delayed</th>
<th>current-jobs-buried</th>
<th>current-using</th>
... | <table class="table table-horizontal table-striped">
<thead>
<tr>
<th>Tube</th>
<th>current-jobs-urgent</th>
<th>current-jobs-ready</th>
<th>current-jobs-reserved</th>
<th>current-jobs-delayed</th>
<th>current-jobs-buried</th>
... |
Convert string to raw string, in order to print "\\" in css. Otherwise the browse cannot reach the file. | import os
import re
from ..assets import build_asset
from ..exceptions import FileNotFound
from .base import BaseProcessor
URL_RE = re.compile(r"""url\((['"]?)\s*(.*?)\s*\1\)""")
def rewrite_paths(source, func):
repl = lambda match: 'url({quote}{path}{quote})'.format(
quote=match.group(1),
path=... | import os
import re
from ..assets import build_asset
from ..exceptions import FileNotFound
from .base import BaseProcessor
URL_RE = re.compile(r"""url\((['"]?)\s*(.*?)\s*\1\)""")
def rewrite_paths(source, func):
repl = lambda match: 'url({quote}{path}{quote})'.format(
quote=match.group(1),
path=... |
Use literal plus character as IE6-8 doesn't like HTML entity | define([
'extensions/views/table/table'
],
function (Table) {
var FailuresTable = Table.extend({
columns: [
{
id: 'description',
title: 'Description',
sortable: true
},
{
id: 'count',
title: 'Occurrences last week',
sortable: true,
d... | define([
'extensions/views/table/table'
],
function (Table) {
var FailuresTable = Table.extend({
columns: [
{
id: 'description',
title: 'Description',
sortable: true
},
{
id: 'count',
title: 'Occurrences last week',
sortable: true,
d... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.