text stringlengths 16 4.96k | positive stringlengths 321 2.24k | negative stringlengths 310 2.21k |
|---|---|---|
Revert "FIX Assert not empty on something that actually is in every composer.json"
This reverts commit f8cf837f6b953713c86747803808e228c648a8a4. | <?php
namespace BringYourOwnIdeas\Maintenance\Tests\Util;
use BringYourOwnIdeas\Maintenance\Util\ComposerLoader;
use PHPUnit_Framework_TestCase;
use SilverStripe\Dev\SapphireTest;
/**
* @mixin PHPUnit_Framework_TestCase
*/
class ComposerLoaderTest extends SapphireTest
{
public function testGetJson()
{
... | <?php
namespace BringYourOwnIdeas\Maintenance\Tests\Util;
use BringYourOwnIdeas\Maintenance\Util\ComposerLoader;
use PHPUnit_Framework_TestCase;
use SilverStripe\Dev\SapphireTest;
/**
* @mixin PHPUnit_Framework_TestCase
*/
class ComposerLoaderTest extends SapphireTest
{
public function testGetJson()
{
... |
Format spacing option check - bug fix | // Woodlot utility library
var DEFAULT_JSON_SPACING = '\t';
// Function to get log format based on Woodlot config setup
function getLogFormat(options) {
if(options.format && options.format.type) {
return options.format.type.toUpperCase();
}
return 'JSON';
};
// Function to get JSON format spacing value
functio... | // Woodlot utility library
var DEFAULT_JSON_SPACING = '\t';
// Function to get log format based on Woodlot config setup
function getLogFormat(options) {
if(options.format && options.format.type) {
return options.format.type.toUpperCase();
}
return 'JSON';
};
// Function to get JSON format spacing value
functio... |
Fix disabling menu without text tracks | import buttonMixin from '../../mixins/videojsButtonMixin';
import CaptionsMenu from './captionsMenu';
import SubtitlesMenuItem from './subtitlesMenuItem';
import TranscriptMenuItem from './transcriptMenuItem';
/**
* The Component for the Button that will open the CaptionsMenu
*/
class CaptionsButton extends buttonMi... | import buttonMixin from '../../mixins/videojsButtonMixin';
import CaptionsMenu from './captionsMenu';
import SubtitlesMenuItem from './subtitlesMenuItem';
import TranscriptMenuItem from './transcriptMenuItem';
/**
* The Component for the Button that will open the CaptionsMenu
*/
class CaptionsButton extends buttonMi... |
Fix - remove Saturday from Week Start dropdown | import React from 'react';
import PropTypes from 'prop-types';
import { Select } from 'react-components';
import { c } from 'ttag';
import { SETTINGS_WEEK_START } from '../../constants';
const { MONDAY, SUNDAY } = SETTINGS_WEEK_START;
const WeekStartSelector = ({ day, onChangeDay, ...rest }) => {
return (
... | import React from 'react';
import PropTypes from 'prop-types';
import { Select } from 'react-components';
import { c } from 'ttag';
import { SETTINGS_WEEK_START } from '../../constants';
const { MONDAY, SATURDAY, SUNDAY } = SETTINGS_WEEK_START;
const WeekStartSelector = ({ day, onChangeDay, ...rest }) => {
retur... |
Add gzipped and non-gzipped file size output | var gulp = require('gulp'),
rename = require('gulp-rename'),
basswork = require('gulp-basswork'),
minifyCss = require('gulp-minify-css'),
transform = require('vinyl-transform'),
size = require('gulp-size'),
webserver = require('gulp-webserver');
gulp.task('css', function() {
gulp.src('./src/t... | var gulp = require('gulp'),
rename = require('gulp-rename'),
basswork = require('gulp-basswork'),
minifyCss = require('gulp-minify-css'),
transform = require('vinyl-transform'),
size = require('gulp-size'),
webserver = require('gulp-webserver');
gulp.task('css', function() {
gulp.src('./src/t... |
Mark disabled users as "closed documents" in search
Test Plan:
$ ./reindex_all_users.php
Search for me in open documents.
Search for @epriestley in open documents.
Reviewers: epriestley
Reviewed By: epriestley
CC: aran, Korvin
Differential Revision: https://secure.phabricator.com/D3216 | <?php
/*
* Copyright 2012 Facebook, Inc.
*
* 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 ag... | <?php
/*
* Copyright 2012 Facebook, Inc.
*
* 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 ag... |
Drop @Requirement RuntimeInformation because we don't need it | package com.lassekoskela.maven;
import org.apache.maven.AbstractMavenLifecycleParticipant;
import org.apache.maven.MavenExecutionException;
import org.apache.maven.execution.ExecutionListener;
import org.apache.maven.execution.MavenSession;
import org.codehaus.plexus.component.annotations.Component;
import org.codehau... | package com.lassekoskela.maven;
import org.apache.maven.AbstractMavenLifecycleParticipant;
import org.apache.maven.MavenExecutionException;
import org.apache.maven.execution.ExecutionListener;
import org.apache.maven.execution.MavenSession;
import org.apache.maven.rtinfo.RuntimeInformation;
import org.codehaus.plexus.... |
Add test for formatting with a currency symbol | <?php namespace Nwidart\MoneyFormatter\Tests;
use Money\Currency;
use Money\Money;
use Nwidart\MoneyFormatter\MoneyFormatter;
class MoneyFormatterTest extends \PHPUnit_Framework_TestCase
{
/** @test */
public function should_format_as_english_pounds()
{
$formatter = new MoneyFormatter('en_GB');
... | <?php namespace Nwidart\MoneyFormatter\Tests;
use Money\Currency;
use Money\Money;
use Nwidart\MoneyFormatter\MoneyFormatter;
class MoneyFormatterTest extends \PHPUnit_Framework_TestCase
{
/** @test */
public function should_format_as_english_pounds()
{
$formatter = new MoneyFormatter('en_GB');
... |
Use list based markup for TOC instead of a table | <?php
/**
* tobiju
*
* @link https://github.com/tobiju/bookdown-bootswatch-templates for the canonical source repository
* @copyright Copyright (c) 2015 Tobias Jüschke
* @license https://github.com/tobiju/bookdown-bootswatch-templates/blob/master/LICENSE.txt New BSD License
*/
if (!$this->page->hasToc... | <?php
/**
* tobiju
*
* @link https://github.com/tobiju/bookdown-bootswatch-templates for the canonical source repository
* @copyright Copyright (c) 2015 Tobias Jüschke
* @license https://github.com/tobiju/bookdown-bootswatch-templates/blob/master/LICENSE.txt New BSD License
*/
if (!$this->page->hasToc... |
Remove mix of spaces and tabs | define(
['backbone', 'views/filenameview', 'collections/files', 'app'],
function(Backbone, FilenameView, Files, app) {
var FilesView = Backbone.View.extend({
tagName: 'ul',
initialize: function(options) {
options = options || {};
this.$parent = options.$parent;
this.$parent.append(this.$el);
this.l... | define(
['backbone', 'views/filenameview', 'collections/files', 'app'],
function(Backbone, FilenameView, Files, app) {
var FilesView = Backbone.View.extend({
tagName: 'ul',
initialize: function(options) {
options = options || {};
this.$parent = options.$parent;
this.$parent.append(this.$el);
this.l... |
consentSimpleAdmin: Use new selftest-function on database backend.
git-svn-id: a243b28a2a52d65555a829a95c8c333076d39ae1@3309 44740490-163a-0410-bde0-09ae8108e29a | <?php
/**
*
* @param array &$hookinfo hookinfo
*/
function consentSimpleAdmin_hook_sanitycheck(&$hookinfo) {
assert('is_array($hookinfo)');
assert('array_key_exists("errors", $hookinfo)');
assert('array_key_exists("info", $hookinfo)');
try {
$consentconfig = SimpleSAML_Configuration::getConfig('module_consen... | <?php
/**
*
* @param array &$hookinfo hookinfo
*/
function consentSimpleAdmin_hook_sanitycheck(&$hookinfo) {
assert('is_array($hookinfo)');
assert('array_key_exists("errors", $hookinfo)');
assert('array_key_exists("info", $hookinfo)');
try {
$consentconfig = SimpleSAML_Configuration::getConfig('module_consen... |
Use template instead of render buffer | import run from "ember-metal/run_loop";
import View from "ember-views/views/view";
import { compile } from "ember-template-compiler";
QUnit.module("Ember.View additions to run queue");
QUnit.test("View hierarchy is done rendering to DOM when functions queued in afterRender execute", function() {
var didInsert = 0;
... | import run from "ember-metal/run_loop";
import View from "ember-views/views/view";
QUnit.module("Ember.View additions to run queue");
QUnit.skip("View hierarchy is done rendering to DOM when functions queued in afterRender execute", function() {
var didInsert = 0;
var childView = View.create({
elementId: 'chi... |
Make the signup error page not look broken.
There was also a type value error happening on error text | /* @flow */
/* eslint-disable react/prop-types */
import React, {Component} from 'react'
import {globalStyles} from '../../../styles/style-guide'
import {Text, Button} from '../../../common-adapters'
import type {Props} from './index.render'
export default class Render extends Component {
props: Props;
render (... | /* @flow */
/* eslint-disable react/prop-types */
import React, {Component} from 'react'
import {globalStyles} from '../../../styles/style-guide'
import {Text, Button} from '../../../common-adapters'
import type {Props} from './index.render'
export default class Render extends Component {
props: Props;
render (... |
Update link to new static front page | <?php
/**
* The template for displaying the header
*
*/
?><!DOCTYPE html>
<html <?php language_attributes(); ?> class="no-js">
<head>
<meta charset="<?php bloginfo( 'charset' ); ?>">
<meta name="viewport" content="width=device-width, initial-scale=1">
<!--[if lt IE 9]>
<script src="<?php echo esc_url( get_templ... | <?php
/**
* The template for displaying the header
*
*/
?><!DOCTYPE html>
<html <?php language_attributes(); ?> class="no-js">
<head>
<meta charset="<?php bloginfo( 'charset' ); ?>">
<meta name="viewport" content="width=device-width, initial-scale=1">
<!--[if lt IE 9]>
<script src="<?php echo esc_url( get_templ... |
Add null guard to mdast-directive-comment util | // @flow
import commentMarker from 'mdast-comment-marker'
import visit from 'unist-util-visit'
import type { Parent } from 'unist'
import type { HTML } from 'mdast'
import type { Marker } from 'mdast-comment-marker'
export interface DirectiveCommentVisitor<Options> {
static directiveName: string,
static reverse: ... | // @flow
import commentMarker from 'mdast-comment-marker'
import visit from 'unist-util-visit'
import type { Parent } from 'unist'
import type { HTML } from 'mdast'
import type { Marker } from 'mdast-comment-marker'
export interface DirectiveCommentVisitor<Options> {
static directiveName: string,
static reverse: ... |
Remove Utils events from advert | define([
'utils/events'
], function (Events) {
/**
* Rockabox JSHook class, it will setup custom hooks set in the Placement js
* for Load, Init, View initial, Engagement and Click.
*
* @param {object} advert The Advert class
* @param {object} customHooks Custom hooks set within Pla... | define([], function () {
/**
* Rockabox JSHook class, it will setup custom hooks set in the Placement js
* for Load, Init, View initial, Engagement and Click.
*
* @param {object} advert The Advert class
* @param {object} customHooks Custom hooks set within Placement js
*/
func... |
Use second subdomain as feature name | // External dependencies
const os = require('os');
const Koa = require('koa');
const send = require('koa-send');
const logger = require('koa-logger');
const assert = require('assert');
const debug = require('debug')('reviewly');
// Internal modules
const config = require('./config')();
assert(!!config, `config needs t... | // External dependencies
const os = require('os');
const Koa = require('koa');
const send = require('koa-send');
const logger = require('koa-logger');
const assert = require('assert');
const debug = require('debug')('reviewly');
// Internal modules
const config = require('./config')();
assert(!!config, `config needs t... |
Use the fqdn when registering with the master.
Not all deployment systems will provide a specific hostname via an env
var so we'll avoid relying on it by asking the machine. | import json
import socket
import requests
from flask import request, jsonify
from dadd.worker import app
from dadd.worker.proc import ChildProcess
@app.route('/run/', methods=['POST'])
def run_process():
proc = ChildProcess(request.json)
proc.run()
return jsonify(proc.info())
@app.route('/register/',... | import json
import requests
from flask import request, jsonify
from dadd.worker import app
from dadd.worker.proc import ChildProcess
@app.route('/run/', methods=['POST'])
def run_process():
proc = ChildProcess(request.json)
proc.run()
return jsonify(proc.info())
@app.route('/register/', methods=['POS... |
Use spaces instead of tabs | var express = require('express');
var app = express();
var bodyParser = require('body-parser');
app.set('port', (process.env.PORT || 5000));
app.use(bodyParser.json());
app.get('/', function(req, res) {
res.send('DC Metro App is up and ready to go!');
});
app.post('/echo_request/parse', function(req, res) {
var ... | var express = require('express');
var app = express();
var bodyParser = require('body-parser');
app.set('port', (process.env.PORT || 5000));
app.use(bodyParser.json());
app.get('/', function(req, res) {
res.send('DC Metro App is up and ready to go!');
});
app.post('/echo_request/parse', function(req, res) {
var re... |
Update the LICENCE on the main file of the plugin | <?php
/**
* Plugin Name: Simple Random Image
* Plugin URI: https://github.com/mitogh/Simple-Random-Image
* Description: Generate a random image from the attachements file.
* Version: 0.1
* Author: Crisoforo.
* Author URI: http://www.crisoforo.com
* License: Apache 2.0
*/
include_once(plugin_dir_path(__FILE__).'... | <?php
/**
* Plugin Name: Simple Random Image
* Plugin URI: https://github.com/mitogh/Simple-Random-Image
* Description: Generate a random image from the attachements file.
* Version: 0.1
* Author: Crisoforo.
* Author URI: http://www.crisoforo.com
* License: MIT
*/
include_once(plugin_dir_path(__FILE__).'/class-... |
Fix syntax issue in PHP 5.6- builds | <?php
/**
* @file filter_input.php
*
* PHP version 5.6+
*
* @author Yancharuk Alexander <alex at itvault dot info>
* @copyright © 2012-2016 Alexander Yancharuk <alex at itvault at info>
* @date 2016-12-07 12:45
* @license The BSD 3-Clause License
* <https://tldrlegal.com/license/bsd-3... | <?php
/**
* @file filter_input.php
*
* PHP version 5.6+
*
* @author Yancharuk Alexander <alex at itvault dot info>
* @copyright © 2012-2016 Alexander Yancharuk <alex at itvault at info>
* @date 2016-12-07 12:45
* @license The BSD 3-Clause License
* <https://tldrlegal.com/license/bsd-3... |
Use env var for env instead of hardcoded env for varsnap js | const process = require('process');
const LogFit = require('logfit');
const Rollbar = require('rollbar');
const varsnap = require('varsnap');
function setupRollbar() {
const rollbarConfig = {
accessToken: process.env.ROLLBAR_CLIENT_TOKEN,
captureUncaught: true,
payload: {
environment: process.env.... | const process = require('process');
const LogFit = require('logfit');
const Rollbar = require('rollbar');
const varsnap = require('varsnap');
function setupRollbar() {
const rollbarConfig = {
accessToken: process.env.ROLLBAR_CLIENT_TOKEN,
captureUncaught: true,
payload: {
environment: process.env.... |
system: Fix style issues for webcontroller class | <?php
/**
* This file contains an abstract WebController class,
* containing methods specifically targeted for the
* Web Usage.
*
* PHP Version 5.3
*
* @category Libraries
* @package Core
* @subpackage Libraries
* @author M2Mobi <info@m2mobi.com>
* @author Heinz Wiesinger <heinz@m2mobi.com>
*/... | <?php
/**
* This file contains an abstract WebController class,
* containing methods specifically targeted for the
* Web Usage.
*
* PHP Version 5.3
*
* @category Libraries
* @package Core
* @subpackage Libraries
* @author M2Mobi <info@m2mobi.com>
* @author Heinz Wiesinger <heinz@m2mobi.com>
*/... |
Reduce dependencies of `checksum` tool | package com.github.sormuras.bach.core;
import com.github.sormuras.bach.internal.ArgumentsParser;
import com.github.sormuras.bach.internal.PathSupport;
import java.io.PrintWriter;
import java.nio.file.Path;
import java.util.Optional;
import java.util.spi.ToolProvider;
public class Checksum implements ToolProvider {
... | package com.github.sormuras.bach.core;
import com.github.sormuras.bach.Bach;
import com.github.sormuras.bach.ToolOperator;
import com.github.sormuras.bach.internal.ArgumentsParser;
import com.github.sormuras.bach.internal.PathSupport;
import java.io.PrintWriter;
import java.nio.file.Path;
import java.util.Optional;
p... |
Store canVote in state when user connects | import { ADMIN_SIGNED_IN, AUTH_SIGNED_IN, AUTH_AUTHENTICATED } from 'common/actionTypes/auth';
const defaultState = {
id: '',
username: '',
fullName: '',
permissions: 0,
reloadPage: false,
loggedIn: false,
registered: false,
authenticated: false,
canVote: false,
};
const auth = (state = defaultState... | import { ADMIN_SIGNED_IN, AUTH_SIGNED_IN, AUTH_AUTHENTICATED } from 'common/actionTypes/auth';
const defaultState = {
id: '',
username: '',
fullName: '',
permissions: 0,
reloadPage: false,
loggedIn: false,
registered: false,
authenticated: false,
};
const auth = (state = defaultState, action) => {
s... |
Fix memebership table creation migration | """Add organizations-users association table
Revision ID: 4fdf1059c4ba
Revises: 393a48ab5fc7
Create Date: 2012-09-02 12:37:11.785052
"""
# revision identifiers, used by Alembic.
revision = '4fdf1059c4ba'
down_revision = '393a48ab5fc7'
from alembic import op
import sqlalchemy as sa
def upgrade():
op.create_tab... | """Add organizations-users association table
Revision ID: 4fdf1059c4ba
Revises: 393a48ab5fc7
Create Date: 2012-09-02 12:37:11.785052
"""
# revision identifiers, used by Alembic.
revision = '4fdf1059c4ba'
down_revision = '393a48ab5fc7'
from alembic import op
import sqlalchemy as sa
def upgrade():
op.create_tab... |
Fix jest tests (jest in different platforms do not result the same log) | 'use strict';
import { runCommand, extendJasmineTimeout } from '../../../utils/helper-tests';
import { join } from 'path';
jest.unmock('../../../utils/helper-fs');
describe('Jest task', () => {
extendJasmineTimeout(jasmine, beforeEach, afterEach);
pit('should be able to generate documentation', () =>
runCom... | 'use strict';
import { runCommand, extendJasmineTimeout } from '../../../utils/helper-tests';
import { join } from 'path';
jest.unmock('../../../utils/helper-fs');
describe('Jest task', () => {
extendJasmineTimeout(jasmine, beforeEach, afterEach);
pit('should be able to generate documentation', () =>
runCom... |
Set templateData.html5Shiv via opt; rename IE CSS opts for consistency | var grunt = require('grunt');
module.exports = {
demo: {
options: {
source: 'demo/static/css/',
destination: 'demo/',
template: 'node_modules/cf-component-demo/' + ( grunt.option('tpl') || 'raw' ) + '/',
templateData: {
ltIE9AltSource: '<%= opt.ltIE9AltSource %>',
ltIE8Sou... | var grunt = require('grunt');
module.exports = {
demo: {
options: {
source: 'demo/static/css/',
destination: 'demo/',
template: 'node_modules/cf-component-demo/' + ( grunt.option('tpl') || 'raw' ) + '/',
templateData: {
ltIE9AltSource: '<%= opt.ltIE9AltCSS %>',
ltIE8Source... |
Create an actual map of TemporalAccessor in wrapper. | package guangyin.internal.types;
import clojure.lang.Keyword;
import clojure.lang.ILookup;
import clojure.lang.IMapEntry;
import clojure.lang.IPersistentMap;
import clojure.lang.PersistentArrayMap;
import java.time.temporal.TemporalField;
import java.time.temporal.TemporalAccessor;
public class TemporalAccessorWrappe... | package guangyin.internal.types;
import clojure.lang.Keyword;
import clojure.lang.ILookup;
import clojure.lang.IPersistentMap;
import java.time.temporal.TemporalField;
import java.time.temporal.TemporalAccessor;
public class TemporalAccessorWrapper extends ObjectWrapper implements ILookup {
protected IPersistentM... |
Remove API User section from example config file | # General Settings
timerestriction = False
debug_mode = True
log_directory = './logs'
# Email Settings
# emailtype = "Gmail"
emailtype = "Console"
# SMS Settings
# outboundsmstype = "WebService"
outboundsmstype = "Console"
# Twilio Auth Keys
account_sid = "twilio sid here"
auth_token = "auth token here"
# SMS Servi... | # General Settings
timerestriction = False
debug_mode = True
log_directory = './logs'
# Email Settings
# emailtype = "Gmail"
emailtype = "Console"
# SMS Settings
# outboundsmstype = "WebService"
outboundsmstype = "Console"
# Twilio Auth Keys
account_sid = "twilio sid here"
auth_token = "auth token here"
# SMS Servi... |
Use destructuring for command and params |
const Discord = require('discord.js');
const client = new Discord.Client();
const config = require('./config.json');
const commands = require('./commands.js')
client.on('ready', () => {
console.log("I am ready!");
client.owner = client.users.get(config.ids.soupmaster);
let spam = client.channels.get... |
const Discord = require('discord.js');
const client = new Discord.Client();
const config = require('./config.json');
const commands = require('./commands.js')
client.on('ready', () => {
console.log("I am ready!");
client.owner = client.users.get(config.ids.soupmaster);
let spam = client.channels.get... |
Store raw data as well as content hash
..for now.
Trying to work out why the content hashes are
changing when I am not expecting them to. | import datetime
import hashlib
import os
# hack to override sqlite database filename
# see: https://help.morph.io/t/using-python-3-with-morph-scraperwiki-fork/148
os.environ['SCRAPERWIKI_DATABASE_NAME'] = 'sqlite:///data.sqlite'
import scraperwiki
def store_history(data, table):
"""
store a hash of the conte... | import datetime
import hashlib
import os
# hack to override sqlite database filename
# see: https://help.morph.io/t/using-python-3-with-morph-scraperwiki-fork/148
os.environ['SCRAPERWIKI_DATABASE_NAME'] = 'sqlite:///data.sqlite'
import scraperwiki
def store_history(data, table):
"""
store a hash of the conte... |
Fix import error (oscar.app.shop doesn't exist anymore) | from django.conf import settings
from django.conf.urls.static import static
from django.conf.urls import include, url
from django.contrib import admin
from django.contrib.staticfiles.urls import staticfiles_urlpatterns
from oscar.app import application
from stores.app import application as stores_app
from stores.dashb... | from django.conf import settings
from django.contrib import admin
from django.conf.urls.static import static
from django.conf.urls import patterns, include, url
from django.contrib.staticfiles.urls import staticfiles_urlpatterns
from oscar.app import shop
from stores.app import application as stores_app
from stores.da... |
Debug Google Cloud Run support | #!/usr/bin/python3
#
# Define containerized environment for running Diosix on Qemu
#
# On Google Cloud Run: Creates HTTP server on port 8080
# or whatever was specified using the PORT system variable.
# Outputs via the HTTP port. This requires K_SERVICE to be set.
#
# On all other environments: Log to stdout
#
# syntax... | #!/usr/bin/python3
#
# Define containerized environment for running Diosix on Qemu
#
# On Google Cloud Run: Creates HTTP server on port 8080
# or whatever was specified using the PORT system variable.
# Outputs via the HTTP port. This requires K_SERVICE to be set.
#
# On all other environments: Log to stdout
#
# syntax... |
Throw error, don't return it | var Bluebird = require('bluebird');
module.exports = issueRequest;
function issueRequest (request) {
return Bluebird.resolve(request)
.catch(normalizeResponseError)
.then(function (res) {
// Api compatibility
res.statusCode = res.status;
return res;
}... | var Bluebird = require('bluebird');
module.exports = issueRequest;
function issueRequest (request) {
return Bluebird.resolve(request)
.catch(normalizeResponseError)
.then(function (res) {
// Api compatibility
res.statusCode = res.status;
return res;
}... |
Fix data relation not working for custom Guids | from superdesk.base_model import BaseModel
def init_app(app):
CoverageModel(app=app)
def rel(resource, embeddable=False):
return {
'type': 'objectid',
'data_relation': {'resource': resource, 'field': '_id', 'embeddable': embeddable}
}
class CoverageModel(BaseModel):
endpoint_name =... | from superdesk.base_model import BaseModel
def init_app(app):
CoverageModel(app=app)
def rel(resource, embeddable=False):
return {
'type': 'objectid',
'data_relation': {'resource': resource, 'field': '_id', 'embeddable': embeddable}
}
class CoverageModel(BaseModel):
endpoint_name =... |
Add Drop.Views object to hold React components | //= require ./core
//= require ./config
//= require_self
//= require_tree ./routers
//= require_tree ./views
//= require_tree ./models
(function () {
var Drop = window.Drop;
_.extend(Drop, Marbles.Events, {
Views: {},
Models: {},
Collections: {},
Routers: {},
Helpers: {
fullPath: function (path) {
... | //= require ./core
//= require ./config
//= require_self
//= require_tree ./routers
//= require_tree ./views
//= require_tree ./models
(function () {
var Drop = window.Drop;
_.extend(Drop, Marbles.Events, {
Models: {},
Collections: {},
Routers: {},
Helpers: {
fullPath: function (path) {
prefix = Dr... |
Clear files and add file row. | // Complete JS code.
console.log('start');
var BASE_URL = "http://localhost:6969/api";
var $ = require("cash-dom");
var nanoajax = require("nanoajax");
var saveAs = require('file-saver').saveAs;
var file_row = $('.file')[0].cloneNode(true);
var log_loaded = false;
var App = {
init: function () {
console.log('in... | // Complete JS code.
console.log('start');
var BASE_URL = "http://localhost:6969/api";
var $ = require("cash-dom");
var nanoajax = require("nanoajax");
var saveAs = require('file-saver').saveAs;
var file_row = $('.file')[0].cloneNode(true);
var log_loaded = false;
var App = {
init: function () {
console.log('in... |
Add formula comment to lin. decay NW class. | package cs437.som.neighborhood;
import cs437.som.NeightborhoodWidthFunction;
/**
* Neighborhood width strategy for self-organizing maps that decays the width
* linearly as the iterations progress.
*
* The exact behavior follows the formula:
* w_i * (1 - (-t / t_max))
* where
* w_i is the initial w... | package cs437.som.neighborhood;
import cs437.som.NeightborhoodWidthFunction;
/**
* Neighborhood width strategy for self-organizing maps that decays the width
* linearly as the iterations progress.
*/
public class LinearDecayNeighborhoodWidthFunction implements NeightborhoodWidthFunction {
private final double ... |
Fix case where command namespace contains Command
Fixes the case where a command has a namespace that contains the string
'Command'. For example: Acme/Commanding/LaunchMissileCommand where
only the last instance of 'Command' should be replaced with 'CommandHandler'
and 'Validator'. | <?php namespace Laracasts\Commander;
class BasicCommandTranslator implements CommandTranslator {
/**
* Translate a command to its handler counterpart
*
* @param $command
* @return mixed
* @throws HandlerNotRegisteredException
*/
public function toCommandHandler($command)
{
... | <?php namespace Laracasts\Commander;
class BasicCommandTranslator implements CommandTranslator {
/**
* Translate a command to its handler counterpart
*
* @param $command
* @return mixed
* @throws HandlerNotRegisteredException
*/
public function toCommandHandler($command)
{
... |
Fix routes for API calls | <?php
require 'vendor/autoload.php';
$router = new AltoRouter();
/*
* Map our routes
*/
$router->map( 'GET', '/', function()
{
require __DIR__ . '/home.php';
});
$router->map( 'GET', '/business/[a:id]', function($id)
{
require __DIR__ . '/business.php';
}, 'business-details' );
$router->map( 'GET', '/se... | <?php
require 'vendor/autoload.php';
$router = new AltoRouter();
/*
* Map our routes
*/
$router->map( 'GET', '/', function()
{
require __DIR__ . '/home.php';
});
$router->map( 'GET', '/business/[a:id]', function($id)
{
require __DIR__ . '/business.php';
}, 'business-details' );
$router->map( 'GET', '/se... |
Change the start up message | package main
import (
"flag"
"time"
"github.com/Sirupsen/logrus"
)
const (
gameTick = time.Millisecond
statsTick = time.Second
)
var addr = flag.String("addr", ":25200", "service address")
var debug = flag.Bool("debug", false, "debug mode")
var log = logrus.New()
func init() {
flag.Parse()
if *debug {
lo... | package main
import (
"flag"
"time"
"github.com/Sirupsen/logrus"
)
const (
gameTick = time.Millisecond
statsTick = time.Second
)
var addr = flag.String("addr", ":25200", "service address")
var debug = flag.Bool("debug", false, "debug mode")
var log = logrus.New()
func init() {
flag.Parse()
if *debug {
lo... |
Add common in import statement | # -*- coding: utf-8 -*-
##############################################################################
#
# Copyright (c) 2010 Camptocamp SA (http://www.camptocamp.com)
# All Right Reserved
#
# Author : Nicolas Bessi (Camptocamp)
#
# WARNING: This program as such is intended to be used by professional
# programmers who ... | # -*- coding: utf-8 -*-
##############################################################################
#
# Copyright (c) 2010 Camptocamp SA (http://www.camptocamp.com)
# All Right Reserved
#
# Author : Nicolas Bessi (Camptocamp)
#
# WARNING: This program as such is intended to be used by professional
# programmers who ... |
Add TODO items in comment | var Clay = require('pebble-clay');
var clayConfig = require('./config');
var clay = new Clay(clayConfig);
Pebble.addEventListener('ready', function(e) {
var timezone_offset = new Date().getTimezoneOffset(); // time-zone offset from UTC, in minutes, for the current locale (Aplite only). Later platforms can lookup ... | var Clay = require('pebble-clay');
var clayConfig = require('./config');
var clay = new Clay(clayConfig);
Pebble.addEventListener('ready', function(e) {
var timezone_offset = new Date().getTimezoneOffset(); // time-zone offset from UTC, in minutes, for the current locale (Aplite only). Later platforms can lookup ... |
Add type text/css to stylesheet | import React from 'react'
export default class Head extends React.Component {
render() {
return (
<head>
<meta charSet="utf-8"/>
<meta httpEquiv="X-UA-compatible" content="IE=edge, chrome=1"/>
<meta name="viewport" content="width=device-width, initial-s... | import React from 'react'
export default class Head extends React.Component {
render() {
return (
<head>
<meta charSet="utf-8"/>
<meta httpEquiv="X-UA-compatible" content="IE=edge, chrome=1"/>
<meta name="viewport" content="width=device-width, initial-s... |
Fix error on php 7.1
Signed-off-by: Fery Wardiyanto <bd7846e81d12676baffd10ffe6daf3939680ab52@gmail.com> | <?php
namespace Projek\Slim\Database;
use Slim\PDO\Database as SlimDatabase;
abstract class Schema
{
/**
* @var string
*/
protected $table = '';
/**
* @var mixed
*/
protected $schema = '';
/**
* @var array
*/
protected $params = [];
/**
* @param... | <?php
namespace Projek\Slim\Database;
use Slim\PDO\Database as SlimDatabase;
abstract class Schema
{
/**
* @var string
*/
protected $table = '';
/**
* @var mixed
*/
protected $schema = '';
/**
* @var array
*/
protected $params = '';
/**
* @param... |
Fix prettyprint.Run line from prev commit | package billing
import (
"io"
"github.com/BytemarkHosting/bytemark-client/lib/output"
"github.com/BytemarkHosting/bytemark-client/lib/output/prettyprint"
)
// Definition is an admin-modifiable parameter for bmbilling
// examples include account-opening credit amount and trial length
type Definition struct {
ID ... | package billing
import (
"io"
"github.com/BytemarkHosting/bytemark-client/lib/output"
"github.com/BytemarkHosting/bytemark-client/lib/output/prettyprint"
)
// Definition is an admin-modifiable parameter for bmbilling
// examples include account-opening credit amount and trial length
type Definition struct {
ID ... |
Migrate to the latest way electron exposes app module | const app = require('electron').app;
const chokidar = require('chokidar');
const extend = require('util')._extend;
const fs = require('fs');
var bootstrap = function(glob, options) {
options = options || {};
var browserWindows = [];
var opts = extend({ignored: /node_modules|[\/\\]\./}, options);
var watcher = ... | var app = require('app');
var chokidar = require('chokidar');
var extend = require('util')._extend;
var fs = require('fs');
var bootstrap = function(glob, options) {
options = options || {};
var browserWindows = [];
var opts = extend({ignored: /node_modules|[\/\\]\./}, options);
var watcher = chokidar.watch(gl... |
Fix install error for [pip install git+git://..] | import os
from setuptools import setup
version = '0.1.0'
name = 'apns-proxy-client'
short_description = 'Client library for APNs Proxy Server.'
def read(fname):
return open(os.path.join(os.path.dirname(__file__), fname)).read()
def read_README():
try:
# pip install from pypy
return read('READ... | import os
from setuptools import setup
version = '0.1.0'
name = 'apns-proxy-client'
short_description = 'Client library for APNs Proxy Server.'
def read(fname):
return open(os.path.join(os.path.dirname(__file__), fname)).read()
requires = [
'pyzmq',
'simplejson'
]
setup(
name=name,
version=v... |
Make return values for Watch/Command clear in interface docs | package metafora
// CoordinatorContext is the context passed to coordinators by the core
// consumer.
type CoordinatorContext interface {
Logger
}
// Coordinator is the core interface Metafora uses to discover, claim, and
// tasks as well as receive commands.
type Coordinator interface {
// Init is called once by t... | package metafora
// CoordinatorContext is the context passed to coordinators by the core
// consumer.
type CoordinatorContext interface {
Logger
}
// Coordinator is the core interface Metafora uses to discover, claim, and
// tasks as well as receive commands.
type Coordinator interface {
// Init is called once by t... |
Fix Doctrine Migrations commands to work with new bundles. | <?php
/*
* This file is part of the Symfony package.
*
* (c) Fabien Potencier <fabien.potencier@symfony-project.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Bundle\DoctrineMigrationsBundle\Command;
use ... | <?php
/*
* This file is part of the Symfony package.
*
* (c) Fabien Potencier <fabien.potencier@symfony-project.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Bundle\DoctrineMigrationsBundle\Command;
use ... |
Fix typo in Javadoc tag for sign() return description.
PiperOrigin-RevId: 287240118 | // Copyright 2017 Google Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in... | // Copyright 2017 Google Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in... |
Swap order of name and description when listing image types
Uses the same order as target types, which puts the most important information,
the name, in front.
Refs APPENG-3419 | #
# Copyright (c) SAS Institute Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in w... | #
# Copyright (c) SAS Institute Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in w... |
Remove VAT number from supplier constants | # Here we define a set of hardcoded keys that we use when denormalizing data from Supplier/ContactInformation tables
# into the SupplierFramework.declaration field. These are used only by the API and by the
# `digitalmarketplace-scripts/scripts/generate-framework-agreement-*-pages`, which generates framework agreement
... | # Here we define a set of hardcoded keys that we use when denormalizing data from Supplier/ContactInformation tables
# into the SupplierFramework.declaration field. These are used only by the API and by the
# `digitalmarketplace-scripts/scripts/generate-framework-agreement-*-pages`, which generates framework agreement
... |
Add task name override functionality | var fs = require('fs')
, request = require('request')
module.exports = function (pliers, name) {
pliers(name || 'npmSecurityCheck', function (done) {
fs.createReadStream('./npm-shrinkwrap.json').pipe(
request.post('https://nodesecurity.io/validate/shrinkwrap', function (error, res) {
if (error) ... | var fs = require('fs')
, request = require('request')
module.exports = function (pliers) {
pliers('npmSecurityCheck', function (done) {
fs.createReadStream('./npm-shrinkwrap.json').pipe(
request.post('https://nodesecurity.io/validate/shrinkwrap', function (error, res) {
if (error) done(new Error... |
Add `sound` to the default settings | import {homedir} from 'os';
import settings from 'electron-settings';
import objectPath from 'object-path';
const DEFAULTS = {
kapturesDir: `${homedir()}/Movies/Kaptures`,
openOnStartup: false,
allowAnalytics: true,
showCursor: true,
highlightClicks: false,
fps: 30,
sound: false
};
const volatiles = {
... | import {homedir} from 'os';
import settings from 'electron-settings';
import objectPath from 'object-path';
const DEFAULTS = {
kapturesDir: `${homedir()}/Movies/Kaptures`,
openOnStartup: false,
allowAnalytics: true,
showCursor: true,
highlightClicks: false,
fps: 30
};
const volatiles = {
cropperWindow:... |
Enable Django secure mode in WSGI module | """
WSGI config for oabutton project.
This module contains the WSGI application used by Django's development server
and any production WSGI deployments. It should expose a module-level variable
named ``application``. Django's ``runserver`` and ``runfcgi`` commands discover
this application via the ``WSGI_APPLICATION``... | """
WSGI config for oabutton project.
This module contains the WSGI application used by Django's development server
and any production WSGI deployments. It should expose a module-level variable
named ``application``. Django's ``runserver`` and ``runfcgi`` commands discover
this application via the ``WSGI_APPLICATION``... |
Revert "revert: use github chart js in meanwhile"
This reverts commit ca6cac9557d4e73f3e3c6a1ca1c6e2857445d366. | <!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Elvenar Stats</title>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" integrity="sha384-1q8mTJOASx8j1Au+a5WDVnPi2lkFfwwEAa8hDDdjZlpLegxhjVME1fgjWPGmkzs7" crossorigin="anonymous">
<link rel="sty... | <!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Elvenar Stats</title>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" integrity="sha384-1q8mTJOASx8j1Au+a5WDVnPi2lkFfwwEAa8hDDdjZlpLegxhjVME1fgjWPGmkzs7" crossorigin="anonymous">
<link rel="sty... |
Add in basic HttpPostHandler docs | #!/usr/bin/env python
# coding=utf-8
"""
Send metrics to a http endpoint via POST
#### Dependencies
* urllib2
#### Configuration
Enable this handler
* handers = diamond.handler.httpHandler.HttpPostHandler
* url = http://www.example.com/endpoint
"""
from Handler import Handler
import urllib2
class HttpPo... | #!/usr/bin/env python
# coding=utf-8
from Handler import Handler
import urllib2
class HttpPostHandler(Handler):
# Inititalize Handler with url and batch size
def __init__(self, config=None):
Handler.__init__(self, config)
self.metrics = []
self.batch_size = int(self.config.get('batch', 1... |
Add Enum backport dependency for python 2
Signed-off-by: Matteo Cafasso <43c758619f0ced9dc5c51a50803f3466c86e4c3d@gmail.com> | from setuptools import find_packages, setup
setup(
name="clipspy",
version="0.0.1",
author="Matteo Cafasso",
author_email="noxdafox@gmail.com",
description=("CLIPS Python bindings."),
packages=find_packages(),
ext_package="clips",
setup_requires=["cffi>=1.0.0"],
install_requires=["c... | from setuptools import find_packages, setup
setup(
name="clipspy",
version="0.0.1",
author="Matteo Cafasso",
author_email="noxdafox@gmail.com",
description=("CLIPS Python bindings."),
packages=find_packages(),
ext_package="clips",
setup_requires=["cffi>=1.0.0"],
install_requires=["c... |
Set field expanded to false on detach | package org.orienteer.core.widget.command;
import org.apache.wicket.ajax.AjaxRequestTarget;
import org.apache.wicket.model.Model;
import org.orienteer.core.component.command.AjaxCommand;
import org.orienteer.core.widget.AbstractWidget;
/**
* Command to make widget fullscreen and back
* @param <T> the type of an en... | package org.orienteer.core.widget.command;
import org.apache.wicket.ajax.AjaxRequestTarget;
import org.apache.wicket.model.Model;
import org.orienteer.core.component.command.AjaxCommand;
import org.orienteer.core.widget.AbstractWidget;
/**
* Command to make widget fullscreen and back
* @param <T> the type of an en... |
Allow using meteor-coverage 2.x.x, needed for code-coverage support from meteor 1.6.0 and onwards | Package.describe({
name: 'meteortesting:mocha',
summary: 'Run Meteor package or app tests with Mocha',
git: 'https://github.com/meteortesting/meteor-mocha.git',
documentation: '../README.md',
version: '0.5.1',
testOnly: true,
});
Package.onUse(function onUse(api) {
api.use([
'practicalmeteor:mocha-co... | Package.describe({
name: 'meteortesting:mocha',
summary: 'Run Meteor package or app tests with Mocha',
git: 'https://github.com/meteortesting/meteor-mocha.git',
documentation: '../README.md',
version: '0.5.1',
testOnly: true,
});
Package.onUse(function onUse(api) {
api.use([
'practicalmeteor:mocha-co... |
[TASK] Add scss to grunt watcher | module.exports = function (grunt) {
grunt.config.merge({
connect: {
server: {
options: {
base: {
path: "build",
options: {
index: "index.html"
}
},
livereload: true
}
}
},
watch: {
sources: {
... | module.exports = function (grunt) {
grunt.config.merge({
connect: {
server: {
options: {
base: {
path: "build",
options: {
index: "index.html"
}
},
livereload: true
}
}
},
watch: {
sources: {
... |
Add kill condition if php does not have GMP extension installed | <?php namespace Brave\Core\Providers;
use Brave\API;
use Illuminate\Support\ServiceProvider;
use Illuminate\Support\Facades\Config;
class CoreApiServiceProvider extends ServiceProvider {
/**
* Bootstrap the application services.
*
* @return void
*/
public function boot()
{
if (extension_loaded ('gmp')) ... | <?php namespace Brave\Core\Providers;
use Brave\API;
use Illuminate\Support\ServiceProvider;
use Illuminate\Support\Facades\Config;
class CoreApiServiceProvider extends ServiceProvider {
/**
* Bootstrap the application services.
*
* @return void
*/
public function boot()
{
// Specify GMP Requirements
... |
Add support for various linux flavors
On many linux distros, 'open' is an alias to 'openvt' so `homestead edit` will not work correctly. This change adds support for Ubuntu, Arch, and many other linux distributions by returning the xdg-open command rather than the open command. | <?php namespace Laravel\Homestead;
use Symfony\Component\Process\Process;
use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
class EditCommand extends Command {
/**
* Configure the command options.
*
* @retur... | <?php namespace Laravel\Homestead;
use Symfony\Component\Process\Process;
use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
class EditCommand extends Command {
/**
* Configure the command options.
*
* @retur... |
Use url instead of home_page | #!/usr/bin/env python2.6
import os
import setuptools
def find_files(path):
return [os.path.join(path, f) for f in os.listdir(path)]
setuptools.setup(
name='workspace-tools',
version='0.7.3',
author='Max Zheng',
author_email='maxzheng.os @t gmail.com',
summary='Tools to simplify working with multiple ... | #!/usr/bin/env python2.6
import os
import setuptools
def find_files(path):
return [os.path.join(path, f) for f in os.listdir(path)]
setuptools.setup(
name='workspace-tools',
version='0.7.3',
author='Max Zheng',
author_email='maxzheng.os @t gmail.com',
home_page='https://github.com/maxzheng/workspace-... |
Update template to use new react-dom
In React 0.14, the DOM manipulation algorithms have been pulled out into
a new package called react-dom. We update our template to use this new
package. | MOUNT_JS = \
"""
if (typeof {var}.React === 'undefined') throw new Error('Cannot find `React` variable. Have you added an object to your JS export which points to React?');
if (typeof {var}.router === 'undefined') throw new Error('Cannot find `router` variable. Have you added an object to your JS export which points to... | MOUNT_JS = \
"""
if (typeof {var}.React === 'undefined') throw new Error('Cannot find `React` variable. Have you added an object to your JS export which points to React?');
if (typeof {var}.router === 'undefined') throw new Error('Cannot find `router` variable. Have you added an object to your JS export which points to... |
Add comment field and some transient helpers | /*
* Copyright 2014 Eric F. Savage, code@efsavage.com
*
* 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 require... | /*
* Copyright 2014 Eric F. Savage, code@efsavage.com
*
* 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 require... |
Allow for .yml files in vendored code | /*
Copyright 2019 The Kubernetes Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, ... | /*
Copyright 2019 The Kubernetes Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, ... |
Fix response format for failed sign-in attempt
The format of response for "Missing credentials" is:
{ "err": { message: "Missing credentials" } }
The format we have everywhere else is:
{ "err": "Error details" }
This change makes the former response consistent with the latter format. | import passport from 'passport'
import jwt from 'jsonwebtoken'
import _ from 'lodash'
import { load as configLoader } from '../../../../config/config'
import { UserSerializer } from '../../../models'
const config = configLoader()
export default class SessionController {
static create(req, res) {
passport.auth... | import passport from 'passport'
import jwt from 'jsonwebtoken'
import _ from 'lodash'
import { load as configLoader } from '../../../../config/config'
import { UserSerializer } from '../../../models'
const config = configLoader()
export default class SessionController {
static create(req, res) {
passport.auth... |
trivial: Fix compile when using python 3.7 or older
Signed-off-by: Richard Hughes <320bca71fc381a4a025636043ca86e734e31cf8b@hughsie.com> | #!/usr/bin/python3
# pylint: disable=invalid-name,missing-docstring
#
# Copyright (C) 2022 Richard Hughes <richard@hughsie.com>
#
# SPDX-License-Identifier: LGPL-2.1+
import sys
import os
import xml.etree.ElementTree as ET
if len(sys.argv) < 2:
print("not enough arguments")
sys.exit(1)
root = ET.Element("gr... | #!/usr/bin/python3
# pylint: disable=invalid-name,missing-docstring
#
# Copyright (C) 2022 Richard Hughes <richard@hughsie.com>
#
# SPDX-License-Identifier: LGPL-2.1+
import sys
import os
import xml.etree.ElementTree as ET
if len(sys.argv) < 2:
print("not enough arguments")
sys.exit(1)
root = ET.Element("gr... |
Update for new express versions | var express = require("express")
var app = express()
var dotenv = require('dotenv');
dotenv.load();
var port = process.env.PORT || 3000
app.configure(function() {
app.use(express.static(__dirname + "/public"))
app.use(express.json())
app.use(express.urlencoded())
app.use(express.cookieParser(process.env.SESS... | var express = require("express")
var app = express()
var dotenv = require('dotenv');
dotenv.load();
var port = process.env.PORT || 3000
app.configure(function() {
app.use(express.static(__dirname + "/public"))
app.use(express.bodyParser())
app.use(express.methodOverride())
app.use(express.cookieParser(proces... |
Fix right click issue (: | import { Menu, MenuItem } from "electron";
export class MainMenu {
constructor(app, tray) {
this.app = app;
this.tray = tray;
}
initialize() {
this.setTrayHandler();
}
setTrayHandler() {
this.tray.on("right-click", () => {
this.tray.popUpContextMenu(this.buildMenu());
});
}
buil... | import { Menu, MenuItem } from "electron";
export class MainMenu {
constructor(app, tray) {
this.app = app;
this.tray = tray;
}
initialize() {
this.setTrayHandler();
}
setTrayHandler(menu) {
menu = menu || this.buildMenu();
this.tray.setContextMenu(menu);
this.tray.on("right-click", (... |
Use proper metadata serializer for spawn player | package protocolsupport.protocol.packet.middleimpl.clientbound.play.v_1_9_r1__1_9_r2;
import java.io.IOException;
import protocolsupport.api.ProtocolVersion;
import protocolsupport.protocol.packet.ClientBoundPacket;
import protocolsupport.protocol.packet.middle.clientbound.play.MiddleSpawnNamed;
import protocolsuppor... | package protocolsupport.protocol.packet.middleimpl.clientbound.play.v_1_9_r1__1_9_r2;
import java.io.IOException;
import protocolsupport.api.ProtocolVersion;
import protocolsupport.protocol.legacyremapper.LegacyDataWatcherSerializer;
import protocolsupport.protocol.packet.ClientBoundPacket;
import protocolsupport.pro... |
Enable CrossOrigin in REST service for films | package io.github.web.rest.service;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind... | package io.github.web.rest.service;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bin... |
Remove the word "download" from the thumbnail alt text. | (function() {
"use strict";
function initPage() {
// The thumbnail images on the show page are links, but the links aren't correct, so remove the links.
// The html looks something like the following, but it varies depending on the type of media it is:
// <a target="_new" title="Download the full-sized PDF" hr... | (function() {
"use strict";
function initPage() {
// The thumbnail images on the show page are links, but the links aren't correct, so remove the links.
// The html looks something like the following, but it varies depending on the type of media it is:
// <a target="_new" title="Download the full-sized PDF" hr... |
Add an exports-type module definition | (function (root, factory) {
'use strict';
if (typeof define === 'function' && define.amd) {
// AMD. Register as an anonymous module.
define([], factory);
} else if (typeof exports === 'object') {
// Node. Does not work with strict CommonJS, but
// only CommonJS-like environme... | (function (root, factory) {
'use strict';
if (typeof define === 'function' && define.amd) {
// AMD. Register as an anonymous module.
define([], factory);
} else {
// Browser globals (root is window)
root.ably = factory();
}
}(this, function () {
'use strict';
var A... |
Add minor fixes to movie lister miniapp | """Movies package.
Top-level package of movies library. This package contains IoC container of
movies module component providers - ``MoviesModule``. It is recommended to use
movies library functionality by fetching required instances from
``MoviesModule`` providers.
``MoviesModule.finder`` is a factory that provides ... | """Movies package.
Top-level package of movies library. This package contains IoC container of
movies module component providers - ``MoviesModule``. It is recommended to use
movies library functionality by fetching required instances from
``MoviesModule`` providers.
``MoviesModule.finder`` is a factory that provides ... |
Change la in pagetitle to at | <?php
$job = new Job($id);
if ($extra != '' && $extra == $job->GetAuth())
{
$later_edit = true;
$_SESSION['later_edit'] = $extra;
}
else
{
$later_edit = false;
$_SESSION['later_edit'] = '';
}
if ($_SESSION['referer'] != BASE_URL . 'post/')
{
if (!$_SESSION['later_edit'])
{
red... | <?php
$job = new Job($id);
if ($extra != '' && $extra == $job->GetAuth())
{
$later_edit = true;
$_SESSION['later_edit'] = $extra;
}
else
{
$later_edit = false;
$_SESSION['later_edit'] = '';
}
if ($_SESSION['referer'] != BASE_URL . 'post/')
{
if (!$_SESSION['later_edit'])
{
red... |
Test pass... at a high performance cost... =,( | package dskvs
import (
"sync"
)
type page struct {
isDirty bool
isDeleted bool
basepath string
coll string
key string
value []byte
sync.RWMutex
}
func newPage(basepath, coll, key string) *page {
return &page{
isDirty: false,
isDeleted: false,
basepath: basepath,
coll: coll,... | package dskvs
import (
"sync"
)
type page struct {
isDirty bool
isDeleted bool
basepath string
coll string
key string
value []byte
sync.RWMutex
}
func newPage(basepath, coll, key string) *page {
return &page{
isDirty: false,
isDeleted: false,
basepath: basepath,
coll: coll,... |
Improve Java seed source code. | package com.google.testing.pogen;
import com.google.common.base.Preconditions;
public class Seed {
public static void main(String[] args) {
int a = 0;
int b, c;
class A {
}
checkArgument(args == null);
checkArgument(args == null, "test");
Preconditions.checkArgument(args != null);
Preconditions.ch... | package com.google.testing.pogen;
import com.google.common.base.Preconditions;
public class Seed {
public static void main(String[] args) {
int a = 0;
int b, c;
class A {
}
checkArgument(args == null);
checkArgument(args == null, "test");
Preconditions.checkArgument(args != null);
Preconditions.ch... |
Set the location bar to an absolute url at startup. | var worker = new Worker('servo-worker.js');
var renderer;
worker.addEventListener("message", function(event) {
var cmd = event.data[0];
var data = event.data[1];
switch(cmd) {
case "log":
console.log("WORKER", data);
break;
case "warn":
console.warn("WORKER", data);
... | var worker = new Worker('servo-worker.js');
var renderer;
worker.addEventListener("message", function(event) {
var cmd = event.data[0];
var data = event.data[1];
switch(cmd) {
case "log":
console.log("WORKER", data);
break;
case "warn":
console.warn("WORKER", data);
... |
Add mapping for Google Translate service | // These URL paths will be transformed to CN mirrors.
var mirrors = {
"//developers.google.com" : "//developers.google.cn",
"//firebase.google.com" : "//firebase.google.cn",
"//developer.android.com" : "//developer.android.google.cn",
"//angular.io" : "//angular.cn",
"//maps.google.com" : "... | // These URL paths will be transformed to CN mirrors.
var mirrors = {
"//developers.google.com" : "//developers.google.cn",
"//firebase.google.com" : "//firebase.google.cn",
"//developer.android.com" : "//developer.android.google.cn",
"//angular.io" : "//angular.cn",
"//maps.google.com" : "... |
Use Lodash `omit` instead of `delete` | const isArrayBuffer = require('lodash/isArrayBuffer');
const isFunction = require('lodash/isFunction');
const isUndefined = require('lodash/isUndefined');
const omit = require('lodash/omit');
// type Context :: {
// writeAttachmentData :: ArrayBuffer -> Promise (IO Path)
// }
//
// migrateDataToFileSystem :: A... | const isArrayBuffer = require('lodash/isArrayBuffer');
const isFunction = require('lodash/isFunction');
const isUndefined = require('lodash/isUndefined');
// type Context :: {
// writeAttachmentData :: ArrayBuffer -> Promise (IO Path)
// }
//
// migrateDataToFileSystem :: Attachment ->
// ... |
Update final catch error message for the owner
Let the owner know that an unhandled exeception bubbled all the way to the top and will shut down Nix | 'use strict';
const fs = require('fs');
const Discord = require('discord.js');
const Nix = require('./lib/nix');
const cfg = require('./config.js');
const discordClient = new Discord.Client();
let nix = new Nix(discordClient, cfg);
// Load every command in the commands folder
fs.readdirSync('./lib/commands')
.for... | 'use strict';
const fs = require('fs');
const Discord = require('discord.js');
const Nix = require('./lib/nix');
const cfg = require('./config.js');
const discordClient = new Discord.Client();
let nix = new Nix(discordClient, cfg);
// Load every command in the commands folder
fs.readdirSync('./lib/commands')
.for... |
Add dependency on different migrations | # -*- coding: utf-8 -*-
# Generated by Django 1.10.2 on 2017-01-18 14:37
from __future__ import unicode_literals
import binascii
import os
from django.db import migrations
def generate_key():
return binascii.hexlify(os.urandom(20)).decode()
def create_auth_token(apps, schema_editor):
Member = apps.get_mode... | # -*- coding: utf-8 -*-
# Generated by Django 1.10.2 on 2017-01-18 14:37
from __future__ import unicode_literals
import binascii
import os
from django.db import migrations
def generate_key():
return binascii.hexlify(os.urandom(20)).decode()
def create_auth_token(apps, schema_editor):
Member = apps.get_mode... |
Fix the home button link. | <script src="js/updater.js"></script>
<?php
include_once 'core.php';
include_once 'db.php';
?>
<a href="../"><img class="logo" style="margin-top:5px;" src="files/logo.png" alt="Hallo"/></a>
<?php
if (isset($_GET['p'])) {
echo '<ul class="navbar-p">';
} else {
echo '<ul class="navbar">';
}
?>
<li><form method... | <script src="js/updater.js"></script>
<?php
include_once 'core.php';
include_once 'db.php';
?>
<a href="../"><img class="logo" style="margin-top:5px;" src="files/logo.png" alt="Hallo"/></a>
<?php
if (isset($_GET['p'])) {
echo '<ul class="navbar-p">';
} else {
echo '<ul class="navbar">';
}
?>
<li><form method... |
Fix header names not getting written back | package water.api;
import water.*;
import com.google.gson.JsonObject;
public class SetColumnNames extends Request {
protected final H2OHexKey _tgtKey = new H2OHexKey("target");
private class HeaderKey extends H2OHexKey {
public HeaderKey(){super("source");}
@Override protected ValueArray parse(String ... | package water.api;
import water.Key;
import water.ValueArray;
import com.google.gson.JsonObject;
public class SetColumnNames extends Request {
protected final H2OHexKey _tgtKey = new H2OHexKey("target");
private class HeaderKey extends H2OHexKey {
public HeaderKey(){super("source");}
@Override protect... |
Use provider() instead of extends() | <?php namespace Analogue\LaravelAuth;
use Illuminate\Support\ServiceProvider;
use Illuminate\Auth\AuthManager;
class AnalogueAuthServiceProvider extends ServiceProvider {
/**
* Indicates if loading of the provider is deferred.
*
* @var bool
*/
protected $defer = true;
public function boot()
{
//
}
... | <?php namespace Analogue\LaravelAuth;
use Illuminate\Support\ServiceProvider;
use Illuminate\Auth\AuthManager;
class AnalogueAuthServiceProvider extends ServiceProvider {
/**
* Indicates if loading of the provider is deferred.
*
* @var bool
*/
protected $defer = false;
public function boot()
{
$this->... |
Fix get_link_title for non-string keys and values.
Include heading and main as possible titles. | """Methods for converting data between systems or formats."""
def make_cm_url(url):
"""Turns a Geokey url into a Community Maps url."""
protocol, address = url.split('//')
address_parts = address.split('/')
new_address_parts = []
for i, part in enumerate(address_parts):
if part == 'api':
... | """Methods for converting data between systems or formats."""
def make_cm_url(url):
"""Turns a Geokey url into a Community Maps url."""
protocol, address = url.split('//')
address_parts = address.split('/')
new_address_parts = []
for i, part in enumerate(address_parts):
if part == 'api':
... |
Make sure stops get unique IDs. | package com.conveyal.geom2gtfs;
import org.onebusaway.gtfs.model.AgencyAndId;
import org.onebusaway.gtfs.model.Stop;
import com.vividsolutions.jts.geom.Coordinate;
import java.util.concurrent.atomic.AtomicInteger;
public class ProtoRouteStop {
// TODO: this is kind of hacky, we should really be using a sepa... | package com.conveyal.geom2gtfs;
import org.onebusaway.gtfs.model.AgencyAndId;
import org.onebusaway.gtfs.model.Stop;
import com.vividsolutions.jts.geom.Coordinate;
import java.util.concurrent.atomic.AtomicInteger;
public class ProtoRouteStop {
// TODO: this is kind of hacky, we should really be using a sepa... |
Test for empty definitions in tag | package main
import (
"testing"
"onestepback.org/assert"
)
import "strconv"
type StringIo struct {
data string
}
func (self *StringIo) WriteString(s string) (int, error) {
self.data += s
return 0, nil
}
func TestTag(t *testing.T) {
tag := NewTag("file.go")
tag.Add("fun", "def fun", Location { 10, 123 })
tag... | package main
import (
"testing"
"onestepback.org/assert"
)
import "strconv"
type StringIo struct {
data string
}
func (self *StringIo) WriteString(s string) (int, error) {
self.data += s
return 0, nil
}
func TestTag(t *testing.T) {
tag := NewTag("file.go")
tag.Add("fun", "def fun", Location { 10, 123 })
tag... |
Define proxy function for course specific tracking logs | """
In this module we define the interface between the cli input provided
by the user and the analytics required by the user
"""
from edx_data_research import parsing
from edx_data_research import reporting
def cmd_report_basic(args):
"""
Run basic analytics
"""
edx_obj = reporting.Basic(args)
geta... | """
In this module we define the interface between the cli input provided
by the user and the analytics required by the user
"""
from edx_data_research import parsing
from edx_data_research import reporting
def cmd_report_basic(args):
"""
Run basic analytics
"""
edx_obj = reporting.Basic(args)
geta... |
Add *args/**kwargs to save() as per the Django docs | from django.db import models
import datetime
class TimestampModel(models.Model):
"""
Extend the default Django model to add timestamps to all objects.
"""
class Meta:
abstract = True
# Timestamps!
created_at = models.DateTimeField()
updated_at = models.DateTimeField()
... | from django.db import models
import datetime
class TimestampModel(models.Model):
"""
Extend the default Django model to add timestamps to all objects.
"""
class Meta:
abstract = True
# Timestamps!
created_at = models.DateTimeField()
updated_at = models.DateTimeField()
... |
Fix bug where volume changes not emitted to client through event stream | var eventSource = require('express-eventsource'),
logger = require('radiodan-client').utils.logger('event-routes');
module.exports = function (app, eventBus, services) {
var eventStream = eventSource();
// Shared eventsource
// To send data call: eventStream.send(dataObj, 'eventName');
app.use('/', e... | var eventSource = require('express-eventsource'),
logger = require('radiodan-client').utils.logger('event-routes');
module.exports = function (app, eventBus, services) {
var eventStream = eventSource();
// Shared eventsource
// To send data call: eventStream.send(dataObj, 'eventName');
app.use('/', e... |
Update to 2.9.0.0 and use equivalent version of redis-py | #!/usr/bin/env python
from setuptools import setup, find_packages
# Match releases to redis-py versions
__version__ = '2.9.0.0'
# Jenkins will replace __build__ with a unique value.
__build__ = ''
setup(name='mockredispy',
version=__version__ + __build__,
description='Mock for redis-py',
url='http... | #!/usr/bin/env python
from setuptools import setup, find_packages
# Match releases to redis-py versions
__version__ = '2.8.0.4'
# Jenkins will replace __build__ with a unique value.
__build__ = ''
setup(name='mockredispy',
version=__version__ + __build__,
description='Mock for redis-py',
url='http... |
Exclude jobExecution on client side
- To overcome future errors in `JobCommandTests` exclude `jobExecution` if
client side `StepExecutionJacksonMixIn` is used as what happens with those
tests when hateoas 1.0.2 is brought in.
- Issue will happen with real server/shell but we can't do more clever
things until she... | /*
* Copyright 2016-2020 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by a... | /*
* Copyright 2016-2018 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by a... |
Update development status to "beta"
It's live on the website so it can't really be called "pre-alpha" anymore! | """voting setuptools information."""
import setuptools
setuptools.setup(
name="voting",
version="0.0.1",
description="UKVoting web systems",
author="Jon Ribbens",
author_email="jon-voting@unequivocal.eu",
url="https://github.com/jribbens/voting",
license="MIT",
py_modules=["voting"],
... | """voting setuptools information."""
import setuptools
setuptools.setup(
name="voting",
version="0.0.1",
description="UKVoting web systems",
author="Jon Ribbens",
author_email="jon-voting@unequivocal.eu",
url="https://github.com/jribbens/voting",
license="MIT",
py_modules=["voting"],
... |
Make the decorator actually work again. | from functools import wraps
from django.http import Http404
from django.utils.decorators import available_attrs
from waffle import is_active
def waffle(flag_name):
def decorator(view):
@wraps(view, assigned=available_attrs(view))
def _wrapped_view(request, *args, **kwargs):
if flag_n... | from functools import wraps
from django.http import Http404
from django.utils.decorators import available_attrs
from waffle import is_active
def waffle(flag_name):
def decorator(view):
if flag_name.startswith('!'):
active = is_active(request, flag_name[1:])
else:
active =... |
Fix issue with toon alle resultaten by implementing new action | import { call, put, takeLatest } from 'redux-saga/effects';
import fetchNearestDetail from '../../services/nearest-detail/nearest-detail';
import { MAP_HIGHLIGHT } from '../../ducks/map/map';
import ACTIONS from '../../../shared/actions';
export function* fetchNearestDetails(action) {
const {
location,
la... | import { call, put, takeLatest } from 'redux-saga/effects';
import fetchNearestDetail from '../../services/nearest-detail/nearest-detail';
import ACTIONS from '../../../shared/actions';
export function* fetchNearestDetails(action) {
const {
location,
layers,
zoom
} = action.payload;
try {
const... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.