text stringlengths 16 4.96k | positive stringlengths 321 2.24k | negative stringlengths 310 2.21k |
|---|---|---|
Add scrolling to go to the more interesting parts of desk_intelwiki.skp
Bug: skia:11804
Change-Id: I96ce34311b5e5420ee343a0dbc68ef20f399be4f
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/390336
Commit-Queue: Ravi Mistry <9fa2e7438b8cb730f96b74865492597170561628@google.com>
Reviewed-by: Robert Phillips <95... | # Copyright 2014 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
# pylint: disable=W0401,W0614
from telemetry import story
from telemetry.page import page as page_module
from telemetry.page import shared_page_state
clas... | # Copyright 2014 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
# pylint: disable=W0401,W0614
from telemetry import story
from telemetry.page import page as page_module
from telemetry.page import shared_page_state
clas... |
Fix bug that prevents Locale from launching scripts. | /*
* Copyright (C) 2009 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 ... | /*
* Copyright (C) 2009 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 ... |
Updated: Make sure nick has prefix if you're going to cut it off (TagAPI) | package org.royaldev.royalcommands.listeners;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.kitteh.tag.PlayerReceiveNameTagEvent;
import org.royaldev.royalcommands.PConfManager;
import org.royaldev.royalcommands.RoyalCommands;
public class TagAPIListener implements Listener {
... | package org.royaldev.royalcommands.listeners;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.kitteh.tag.PlayerReceiveNameTagEvent;
import org.royaldev.royalcommands.PConfManager;
import org.royaldev.royalcommands.RoyalCommands;
public class TagAPIListener implements Listener {
... |
fix(check): Include more action names in various checks. | /* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
// Actions that, if allowed, would allow an attacker
// to try a candidtate password against an account.
var PASSW... | /* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
var PASSWORD_CHECKING_ACTION = {
accountLogin: true,
accountDestroy: true,
passwordChange: true,
}
var ACCO... |
Make minimum cffi versions consistent | #!/usr/bin/env python3
from setuptools import setup, find_packages
setup(
name='webp',
version='0.1.0a17',
url='https://github.com/anibali/pywebp',
packages=find_packages(include=['webp', 'webp.*', 'webp_build']),
package_data={'webp_build': ['*.h', '*.c']},
author='Aiden Nibali',
descrip... | #!/usr/bin/env python3
from setuptools import setup, find_packages
setup(
name='webp',
version='0.1.0a17',
url='https://github.com/anibali/pywebp',
packages=find_packages(include=['webp', 'webp.*', 'webp_build']),
package_data={'webp_build': ['*.h', '*.c']},
author='Aiden Nibali',
descrip... |
Make dev server accessible on lan | var webpack = require('webpack');
var config = require('./webpack.config.js');
config.entry = [
'webpack-dev-server/client?http://localhost:8888',
'webpack/hot/only-dev-server'
].concat(config.entry);
config.plugins = [
new webpack.NoErrorsPlugin()
];
config.module.loaders = [
{
test: /\.jsx?$/,
excl... | var webpack = require('webpack');
var config = require('./webpack.config.js');
config.entry = [
'webpack-dev-server/client?http://localhost:8888',
'webpack/hot/only-dev-server'
].concat(config.entry);
config.plugins = [
new webpack.NoErrorsPlugin()
];
config.module.loaders = [
{
test: /\.jsx?$/,
excl... |
Add extra space for convention. | var rest = require('restler');
module.exports = {
'gif': function(input, cb) {
var self = this;
var query = encodeURIComponent(input.parsed);
var options = { rejectUnauthorized: false };
var baseUrl = 'https://ticketap.com/rightgif';
var url = baseUrl + '?text='+query;
rest.get(url, options).... | var rest = require('restler');
module.exports = {
'gif': function(input, cb) {
var self = this;
var query = encodeURIComponent(input.parsed);
var options = { rejectUnauthorized: false };
var baseUrl = 'https://ticketap.com/rightgif';
var url = baseUrl + '?text='+query;
rest.get(url, options).... |
Add the 'hljs' class to the pre tag | 'use strict';
var cheerio = require('cheerio');
var he = require('he');
var hl = require('highlight.js');
var highlightAuto = hl.highlightAuto;
var highlight = hl.highlight;
module.exports = function(input) {
this.cacheable();
var $ = cheerio.load(input);
$('code').replaceWith(function(i, e) {
v... | 'use strict';
var cheerio = require('cheerio');
var he = require('he');
var hl = require('highlight.js');
var highlightAuto = hl.highlightAuto;
var highlight = hl.highlight;
module.exports = function(input) {
this.cacheable();
var $ = cheerio.load(input);
$('code').replaceWith(function(i, e) {
v... |
Modify harvestibility for butter blocks. | package net.darkmorford.btweagles.block;
import net.darkmorford.btweagles.BetterThanWeagles;
import net.minecraft.block.Block;
import net.minecraft.block.SoundType;
import net.minecraft.block.material.Material;
import net.minecraft.client.renderer.block.model.ModelResourceLocation;
import net.minecraft.creativetab.Cre... | package net.darkmorford.btweagles.block;
import net.darkmorford.btweagles.BetterThanWeagles;
import net.minecraft.block.Block;
import net.minecraft.block.SoundType;
import net.minecraft.block.material.Material;
import net.minecraft.client.renderer.block.model.ModelResourceLocation;
import net.minecraft.creativetab.Cre... |
Make So loading inside generated TMM delegates less confusing
Summary:
## Rationale
Inlining the maybeLoadSoLibrary private static method makes following the So load chain from TurboModuleManagerDelegate through ReactPackageTurboModuleManagerDelegate to each app's TurboModuleManagerDelegate much easier to understand.
... | /*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
package com.facebook.react.uiapp;
import androidx.annotation.VisibleForTesting;
import com.facebook.jni.HybridData;
import com.fac... | /*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
package com.facebook.react.uiapp;
import androidx.annotation.VisibleForTesting;
import com.facebook.jni.HybridData;
import com.fac... |
Add handy main() method for hashing a given value | /*
* Copyright Myrrix Ltd
*
* 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 wr... | /*
* Copyright Myrrix Ltd
*
* 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 wr... |
Change votes route to / | Router.configure({
layoutTemplate: 'layout'
});
Router.route('/', {name: 'votesList'});
Router.route('/iframe', {name: 'iFrame'});
Router.route('/submitvote', {name: 'submitVote'});
Router.route('/signup', {name: 'signup'});
Router.route('/scores', {name: 'scoreCard'});
Router.route('/login', {name: 'loginpage'});
... | Router.configure({
layoutTemplate: 'layout'
});
Router.route('/votes', {name: 'votesList'});
Router.route('/iframe', {name: 'iFrame'});
Router.route('/submitvote', {name: 'submitVote'});
Router.route('/signup', {name: 'signup'});
Router.route('/scores', {name: 'scoreCard'});
Router.route('/login', {name: 'loginpage'}... |
Add build step into Conan recipe. | from conans import ConanFile, CMake
class ArgsConan(ConanFile):
name = "cfgfile"
version = "0.2.8.2"
url = "https://github.com/igormironchik/cfgfile.git"
license = "MIT"
description = "Header-only library for reading/saving configuration files with schema defined in sources."
exports = "cfgfil... | from conans import ConanFile
class ArgsConan(ConanFile):
name = "cfgfile"
version = "0.2.8.2"
url = "https://github.com/igormironchik/cfgfile.git"
license = "MIT"
description = "Header-only library for reading/saving configuration files with schema defined in sources."
exports = "cfgfile/*", "... |
Add documentation for stooge types | package creational
import (
"fmt"
"io"
"os"
)
var outputWriter io.Writer = os.Stdout // modified during testing
// StoogeType is used as a enum for stooge types.
type StoogeType int
const (
Larry StoogeType = iota // Larry stooge
Moe // Moe stooge
Curly // Cutly stooge
)
... | package creational
import (
"fmt"
"io"
"os"
)
var outputWriter io.Writer = os.Stdout // modified during testing
// StoogeType is used as a enum for stooge types.
type StoogeType int
const (
Larry StoogeType = iota
Moe
Curly
)
// Stooge provides an interface for interacting with stooges.
type Stooge interface... |
Improve batching of ids for querying | import {pluck} from 'lodash/collection'
import Promise from 'bluebird'
const BATCH_CHAR_LIMIT = 1990
/**
* Gets the content already existent on the destination space that needs
* updating, based on the response retrieved from the source space
*/
export default function getDestinationContentForUpdate (managementCli... | import {pluck} from 'lodash/collection'
import Promise from 'bluebird'
const BATCH_CHAR_LIMIT = 1990
/**
* Gets the content already existent on the destination space that needs
* updating, based on the response retrieved from the source space
*/
export default function getDestinationContentForUpdate (managementCli... |
Update tests to reflect title change | from flask import url_for
import pytest
from selenium.webdriver.common.by import By
from selenium.webdriver.support import expected_conditions
from selenium.webdriver.support.wait import WebDriverWait
from tests.helpers import slow
@pytest.mark.usefixtures('live_server')
@slow
def test_home_page_accessible(selenium)... | from flask import url_for
import pytest
from selenium.webdriver.common.by import By
from selenium.webdriver.support import expected_conditions
from selenium.webdriver.support.wait import WebDriverWait
from tests.helpers import slow
@pytest.mark.usefixtures('live_server')
@slow
def test_home_page_accessible(selenium)... |
Increment static resources for Firebase. | import json
import os
DEBUG = os.environ.get('SERVER_SOFTWARE', '').startswith('Dev')
# For choosing what the main landing page displays
KICKOFF = 1
BUILDSEASON = 2
COMPETITIONSEASON = 3
OFFSEASON = 4
# The CONFIG variables should have exactly the same structure between environments
# Eventually a test environment s... | import json
import os
DEBUG = os.environ.get('SERVER_SOFTWARE', '').startswith('Dev')
# For choosing what the main landing page displays
KICKOFF = 1
BUILDSEASON = 2
COMPETITIONSEASON = 3
OFFSEASON = 4
# The CONFIG variables should have exactly the same structure between environments
# Eventually a test environment s... |
Make development version badge less prominent | /**
* Background tasks
*/
class PathmarksBackground {
static standardIcon() {
chrome.browserAction.setIcon({path: '../images/icon38.png'});
}
static devBadge() {
if (chrome.runtime.getManifest().short_name === 'PathDev') {
chrome.browserAction.setBadgeText({text: "µ"});
chrome.browserAction.setBadgeBac... | /**
* Background tasks
*/
class PathmarksBackground {
static standardIcon() {
chrome.browserAction.setIcon({path: '../images/icon38.png'});
}
static devBadge() {
if (chrome.runtime.getManifest().short_name === 'PathDev') {
chrome.browserAction.setBadgeText({text: "µ"});
chrome.browserAction.setBadgeBac... |
Fix `migrate:reset` args as it doesn't accept --step | <?php
declare(strict_types=1);
namespace Rinvex\Attributes\Console\Commands;
use Illuminate\Console\Command;
class RollbackCommand extends Command
{
/**
* The name and signature of the console command.
*
* @var string
*/
protected $signature = 'rinvex:rollback:attributes {--force : Force... | <?php
declare(strict_types=1);
namespace Rinvex\Attributes\Console\Commands;
use Illuminate\Console\Command;
class RollbackCommand extends Command
{
/**
* The name and signature of the console command.
*
* @var string
*/
protected $signature = 'rinvex:rollback:attributes {--force : Force... |
Change widget attribute to string
In Django 1.8, widget attribute data-date-picker=True will be rendered
as 'data-date-picker'. This patch will just look for the presence of the
attribute, ignoring the actual value.
Change-Id: I0beabddfe13c060ef2222a09636738428135040a
Closes-Bug: #1467935 | horizon.metering = {
init_create_usage_report_form: function() {
horizon.datepickers.add('input[data-date-picker]');
horizon.metering.add_change_event_to_period_dropdown();
horizon.metering.show_or_hide_date_fields();
},
init_stats_page: function() {
if (typeof horizon.d3_line_chart !== 'undefined... | horizon.metering = {
init_create_usage_report_form: function() {
horizon.datepickers.add('input[data-date-picker="True"]');
horizon.metering.add_change_event_to_period_dropdown();
horizon.metering.show_or_hide_date_fields();
},
init_stats_page: function() {
if (typeof horizon.d3_line_chart !== 'un... |
Fix neverending creation of migrations on heroku | from celery import states
from django.db import models
ALL_STATES = sorted(states.ALL_STATES)
STATES_CHOICES = zip(ALL_STATES, ALL_STATES)
class TaskStatus(models.Model):
"""
Task status.
With this the status of celery tasks can be monitored, more reliably than
depending on the broker or celery itse... | from celery import states
from django.db import models
STATES_CHOICES = zip(states.ALL_STATES, states.ALL_STATES)
class TaskStatus(models.Model):
"""
Task status.
With this the status of celery tasks can be monitored, more reliably than
depending on the broker or celery itself.
"""
status =... |
Change msgpack-python requirement to msgpack
This package has been renamed to `msgpack` starting with their `0.5.0` version. The old package seems likely to be deprecated soon, but this change will keep the dependency being updated as intended.
https://pypi.python.org/pypi/msgpack
https://pypi.python.org/pypi/msgp... | import sys
from setuptools import setup
_requires = [
'msgpack',
]
if sys.version_info < (2, 7, 0, ) :
_requires.append('ordereddict', )
setup(
name='serf-python',
version='0.2.2',
description='serf client for python',
long_description="""
For more details, please see https://github.... | import sys
from setuptools import setup
_requires = [
'msgpack-python',
]
if sys.version_info < (2, 7, 0, ) :
_requires.append('ordereddict', )
setup(
name='serf-python',
version='0.2.2',
description='serf client for python',
long_description="""
For more details, please see https://... |
Use separate component for TexMath, so model changes lead to a rerender. | import { NodeComponent } from 'substance'
import katex from 'katex'
export default class InlineFormulaComponent extends NodeComponent {
render($$) {
const node = this.props.node
// TODO: Find out why node.find('tex-math') returns null here
const texMath = node.findChild('tex-math')
const el = $$('sp... | import { NodeComponent } from 'substance'
import katex from 'katex'
export default class InlineFormulaComponent extends NodeComponent {
render($$) {
const node = this.props.node
// TODO: Find out why node.find('tex-math') returns null here
const texMath = node.findChild('tex-math').textContent
// TO... |
Update broken link to DS.attr docs
Closes #5816 | import { isNone as none } from '@ember/utils';
import Transform from './transform';
/**
The `DS.StringTransform` class is used to serialize and deserialize
string attributes on Ember Data record objects. This transform is
used when `string` is passed as the type parameter to the
[DS.attr](./DS/methods/attr?anc... | import { isNone as none } from '@ember/utils';
import Transform from './transform';
/**
The `DS.StringTransform` class is used to serialize and deserialize
string attributes on Ember Data record objects. This transform is
used when `string` is passed as the type parameter to the
[DS.attr](../../data#method_att... |
Allow double quotes to avoid escaping single quotes | import path from 'path';
import {CLIEngine, linter} from 'eslint';
import PackageJson from '../lib/package_json';
const project = PackageJson.load();
const baseConfig = linter.defaults();
const options = {
baseConfig: Object.assign(baseConfig, {
parser: 'babel-eslint',
env: Object.assign(baseConfig.env, {
... | import path from 'path';
import {CLIEngine, linter} from 'eslint';
import PackageJson from '../lib/package_json';
const project = PackageJson.load();
const baseConfig = linter.defaults();
const options = {
baseConfig: Object.assign(baseConfig, {
parser: 'babel-eslint',
env: Object.assign(baseConfig.env, {
... |
Fix async test - return the promise | /*
* Copyright 2017, Emanuel Rabina (http://www.ultraq.net.nz/)
*
* 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... | /*
* Copyright 2017, Emanuel Rabina (http://www.ultraq.net.nz/)
*
* 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... |
Correct types on the error toaster
Bug:
This copy was hardcoded to just 'comment' but the action applies to both
comments and posts. When something went wrong on a post upvote we'd show
"failed to upvote the comment", which makes no sense.
Fix:
Use the `type` (which is either 'post' or 'comment') in the copy. | import { models, errors } from '@r/api-client';
import * as platformActions from '@r/platform/actions';
import { apiOptionsFromState } from 'lib/apiOptionsFromState';
import { LOGGEDOUT_REDIRECT } from 'app/constants';
const { ResponseError } = errors;
export const PENDING = 'VOTE__PENDING';
export const SUCCESS = ... | import { models, errors } from '@r/api-client';
import * as platformActions from '@r/platform/actions';
import { apiOptionsFromState } from 'lib/apiOptionsFromState';
import { LOGGEDOUT_REDIRECT } from 'app/constants';
const { ResponseError } = errors;
export const PENDING = 'VOTE__PENDING';
export const SUCCESS = ... |
Add start dates to Semester Types | package at.ac.tuwien.inso.entity;
public enum SemesterType {
WinterSemester("WS", 10, 1),
SummerSemester("SS", 3, 1);
/**
* Name of the semester: WS or SS
*/
private final String name;
/**
* Month the semester starts
*/
private final int startMonth;
/**
* Day i... | package at.ac.tuwien.inso.entity;
public enum SemesterType {
WinterSemester("WS"),
SummerSemester("SS");
private final String name;
SemesterType(String name) {
this.name = name;
}
@Override
public String toString() {
return name;
}
/**
* Reverse of toString... |
Enhance readability of time out command test | package name.webdizz.fault.tolerance.inventory.client.command;
import static org.hamcrest.core.Is.is;
import static org.junit.Assert.assertThat;
import static name.webdizz.fault.tolerance.inventory.client.InventoryApiTestConstants.DEFAULT_PRODUCT;
import static name.webdizz.fault.tolerance.inventory.client.InventoryAp... | package name.webdizz.fault.tolerance.inventory.client.command;
import static org.hamcrest.core.Is.is;
import static org.junit.Assert.assertThat;
import static name.webdizz.fault.tolerance.inventory.client.InventoryApiTestConstants.DEFAULT_PRODUCT;
import static name.webdizz.fault.tolerance.inventory.client.InventoryAp... |
Update testing request sheet in debug mode | import logging
import os
from .test_settings import *
try:
import debug_panel
except ImportError:
# no debug panel, no use trying to add it to our middleware
pass
else:
# if debug_panel exists, add it to our INSTALLED_APPS
INSTALLED_APPS += ('debug_panel', 'debug_toolbar', 'pympler')
MIDDLEWA... | import logging
import os
from .test_settings import *
try:
import debug_panel
except ImportError:
# no debug panel, no use trying to add it to our middleware
pass
else:
# if debug_panel exists, add it to our INSTALLED_APPS
INSTALLED_APPS += ('debug_panel', 'debug_toolbar', 'pympler')
MIDDLEWA... |
Add proper Python version classifiers. | # -*- coding: utf-8 -*-
VERSION = '0.2'
from setuptools import setup
setup(
name='nutshell',
packages=["nutshell"],
version=VERSION,
description='A minimal python library to access Nutshell CRM:s JSON-RPC API.',
author=u'Emil Stenström',
author_email='em@kth.se',
url='https://github.com/Em... | # -*- coding: utf-8 -*-
VERSION = '0.2'
from setuptools import setup
setup(
name='nutshell',
packages=["nutshell"],
version=VERSION,
description='A minimal python library to access Nutshell CRM:s JSON-RPC API.',
author=u'Emil Stenström',
author_email='em@kth.se',
url='https://github.com/Em... |
Make sure that the Imgur ID can be correctly extracted from the URL
This was made to address the case where the URL might end with '/' | import logging
LOGGER = logging.getLogger(__name__)
def tidy_up_url(url):
if url.startswith("//"):
# If no protocol was supplied, add https
url = "https:" + url
if '?' in url:
url = url[:url.rfind('?')]
if url.endswith("/"):
url = url[:-1]
return url
def limit_file... | import logging
LOGGER = logging.getLogger(__name__)
def tidy_up_url(url):
if url.startswith("//"):
# If no protocol was supplied, add https
url = "https:" + url
if '?' in url:
url = url[:url.rfind('?')]
return url
def limit_file_name(file_name, length=65):
if len(file_name)... |
[Telemetry] Disable flaky MSR power monitor unit test.
BUG=chromium:712486
Review-Url: https://codereview.chromium.org/2827723002 | # Copyright 2014 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import logging
import time
import unittest
from telemetry import decorators
from telemetry.internal.platform.power_monitor import msr_power_monitor
from tel... | # Copyright 2014 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import logging
import time
import unittest
from telemetry import decorators
from telemetry.internal.platform.power_monitor import msr_power_monitor
from tel... |
Use fixed queries for population script | <?php
include_once '../../config/config-local.php';
include_once '../../models/database.php';
include_once '../../models/db.php';
include_once 'countries_array.php';
$countries = getCountries();
$array = array();
$count = 0;
$keys = array_keys( $countries );
foreach ( $keys a... | <?php
include_once '../../config/config-local.php';
include_once '../../models/database.php';
include_once 'countries_array.php';
$array = array();
$count = 0;
$keys = array_keys( $countries );
foreach ( $keys as $key ) {
$value = $countries[ $key ];
$array[] = "INSER... |
Allow real <= and >= in LateX | # Configuration file for the Sphinx documentation builder.
#
# This file only contains a selection of the most common options. For
# a full list see the documentation:
# https://www.sphinx-doc.org/en/master/usage/configuration.html
#
# To see the default sample conf.py, run sphinx-quickstart in an empty
# directory. Mo... | # Configuration file for the Sphinx documentation builder.
#
# This file only contains a selection of the most common options. For
# a full list see the documentation:
# https://www.sphinx-doc.org/en/master/usage/configuration.html
#
# To see the default sample conf.py, run sphinx-quickstart in an empty
# directory. Mo... |
Disable Encoding not specified inspection in console. | package com.jetbrains.python.console;
import com.intellij.psi.PsiFile;
import com.jetbrains.python.inspections.*;
import com.jetbrains.python.validation.DocStringAnnotator;
import org.jetbrains.annotations.NotNull;
/**
* User : catherine
*
* filter out some python inspections and annotations if we're in console
*... | package com.jetbrains.python.console;
import com.intellij.psi.PsiFile;
import com.jetbrains.python.inspections.*;
import com.jetbrains.python.validation.DocStringAnnotator;
import org.jetbrains.annotations.NotNull;
/**
* User : catherine
*
* filter out some python inspections and annotations if we're in console
*... |
Change legacy to use Symfony session and set username to session | <?php
function StartSession($name) {
global $user_id;
$user_id = 1;
$session = $GLOBALS['container']->get('session');
$session->set('user_id', $user_id);
$session->set('username', 'admin');
}
function get_body($path) {
global $basePath;
return '<img src="' . $basePath . 'images/legacy.jp... | <?php
function StartSession($name) {
global $user_id;
$user_id = 1;
session_name($name);
session_start();
}
function get_body($path) {
global $basePath;
return '<img src="' . $basePath . 'images/legacy.jpg"/><br>'
. 'Image by order_242 <a href="https://www.flickr.com/photos/juanelo2... |
Print actual port number in server init log | 'use strict';
/**
* Imports.
*/
const express = require('express');
const http = require('http');
/**
* Initialize Express.
*/
const app = express();
// Setup locals variable in config/index.js.
app.locals = require('./config');
// Configure express app based on local configuration.
app.set('env', app.locals.ex... | 'use strict';
/**
* Imports.
*/
const express = require('express');
/**
* Initialize Express.
*/
const app = express();
// Setup locals variable in config/index.js.
app.locals = require('./config');
// Configure express app based on local configuration.
app.set('env', app.locals.express.env);
/**
* Routing.
... |
Bring google syncs back online | module.exports = {
port: 8001,
//cdns: ['bootstrap', 'cdnjs', 'google', 'jsdelivr', 'jquery'],
cdns: ['bootstrap-cdn', 'jsdelivr', 'cdnjs', 'google'],
//cdns: ['bootstrap-cdn', 'jsdelivr', 'cdnjs'],
//cdns: ['bootstrap','google'],
db: 'db',
cdnCollections: [
{name: 'bootstrap-cdn', aliases: ['bootstra... | module.exports = {
port: 8001,
//cdns: ['bootstrap', 'cdnjs', 'google', 'jsdelivr', 'jquery'],
//cdns: ['bootstrap-cdn', 'jsdelivr', 'cdnjs', 'google'],
cdns: ['bootstrap-cdn', 'jsdelivr', 'cdnjs'],
//cdns: ['bootstrap','google'],
db: 'db',
cdnCollections: [
{name: 'bootstrap-cdn', aliases: ['bootstra... |
Update pypi description and release new version | """
==============
PiPocketGeiger
==============
Radiation Watch Pocket Geiger Type 5 library for Raspberry Pi.
Usage
=====
::
from PiPocketGeiger import RadiationWatch
import time
with RadiationWatch(24, 23) as radiationWatch:
while 1:
print(radiationWatch.status())
... | """
PiPocketGeiger
-----
Radiation Watch Pocket Geiger Type 5 library for Raspberry Pi.
Links
`````
* `code and documentation <https://github.com/MonsieurV/PiPocketGeiger>`_
"""
import re
import ast
from setuptools import setup
setup(
name='PiPocketGeiger',
version=0.1,
url='https://github... |
Check for amount of li's |
"use strict";
describe('Footer component', () => {
let element = undefined;
let $rootScope = undefined;
let $compile = undefined;
let mod = angular.module('tests.footer', []).service('Authentication', function () {
this.check = false;
this.attempt = credentials => {
if (cr... |
"use strict";
describe('Footer component', () => {
let element = undefined;
let $rootScope = undefined;
let $compile = undefined;
let mod = angular.module('tests.footer', []).service('Authentication', function () {
this.check = false;
this.attempt = credentials => {
if (cr... |
Use a relative path to fetch the data.json file | import { h, render, Component } from 'preact';
import lunr from 'lunr';
import SearchForm from 'js/components/search-form';
import SearchResults from 'js/components/search-results';
export default class CheatSheet extends Component {
state = {
data: [],
results: []
}
search = (term) => {
let result... | import { h, render, Component } from 'preact';
import lunr from 'lunr';
import SearchForm from 'js/components/search-form';
import SearchResults from 'js/components/search-results';
export default class CheatSheet extends Component {
state = {
data: [],
results: []
}
search = (term) => {
let result... |
INFORCRM-15838: Change chart type to column to match 3.6 | import declare from 'dojo/_base/declare';
import lang from 'dojo/_base/lang';
import View from 'argos/View';
import _ChartMixin from './_ChartMixin';
/**
* @class crm.Views.Charts.GenericBar
*
* @extends argos.View
* @mixins crm.Views.Charts._ChartMixin
*
* @requires argos.View
*
*/
const __class = declare('cr... | import declare from 'dojo/_base/declare';
import lang from 'dojo/_base/lang';
import View from 'argos/View';
import _ChartMixin from './_ChartMixin';
/**
* @class crm.Views.Charts.GenericBar
*
* @extends argos.View
* @mixins crm.Views.Charts._ChartMixin
*
* @requires argos.View
*
*/
const __class = declare('cr... |
Set more turns for testing. | package com.ibm.sk;
public class WorldConstans {
public static final int X_BOUNDRY = 15;
public static final int Y_BOUNDRY = 10;
/**
* number of TURNS to evaluate game.
*/
public static final int TURNS = 500;
/**
* the amount of ants in one anthill at the beginning of the world.
*/
public s... | package com.ibm.sk;
public class WorldConstans {
public static final int X_BOUNDRY = 15;
public static final int Y_BOUNDRY = 10;
/**
* number of TURNS to evaluate game.
*/
public static final int TURNS = 50;
/**
* the amount of ants in one anthill at the beginning of the world.
*/
public st... |
Remove redundant exception handling in exportCollection | const { search, exportSearch } = require('../services')
const { transformApiResponseToSearchCollection } = require('../transformers')
function getCollection (searchEntity, entityDetails, ...itemTransformers) {
return async function (req, res, next) {
try {
res.locals.results = await search({
search... | const { search, exportSearch } = require('../services')
const { transformApiResponseToSearchCollection } = require('../transformers')
function getCollection (searchEntity, entityDetails, ...itemTransformers) {
return async function (req, res, next) {
try {
res.locals.results = await search({
search... |
Set correct service type for light bulb service | package service
import(
"github.com/brutella/hap/model/characteristic"
)
type LightBulb struct {
*Service
On *characteristic.On
Name *characteristic.Name
Brightness *characteristic.Brightness
Saturation *characteristic.Saturation
Hue *characteristic.Hue
}
func NewLightBulb(name string, ... | package service
import(
"github.com/brutella/hap/model/characteristic"
)
type LightBulb struct {
*Service
On *characteristic.On
Name *characteristic.Name
Brightness *characteristic.Brightness
Saturation *characteristic.Saturation
Hue *characteristic.Hue
}
func NewLightBulb(name string, ... |
Clean up exception handler. Add new ignores. | <?php
namespace App\Exceptions;
use Exception;
use Illuminate\Auth\Access\UnauthorizedException;
use Illuminate\Database\Eloquent\ModelNotFoundException;
use Symfony\Component\HttpKernel\Exception\HttpException;
use Illuminate\Foundation\Validation\ValidationException;
use Symfony\Component\HttpKernel\Exception\NotFo... | <?php
namespace App\Exceptions;
use Exception;
use Illuminate\Database\Eloquent\ModelNotFoundException;
use Symfony\Component\HttpKernel\Exception\HttpException;
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
use Illuminate\Foundation\Exceptions\Handler as ExceptionHandler;
class Handler extends E... |
Add some test card numbers. | import React, { Component } from 'react';
import { faintBlack, cyan500 } from 'material-ui/styles/colors';
import MenuItem from 'material-ui/MenuItem';
import IconMenu from 'material-ui/IconMenu';
import IconButton from 'material-ui/IconButton/IconButton';
import ActionHelpOutline from 'material-ui/svg-icons/action/hel... | import React, { Component } from 'react';
import { faintBlack, cyan500 } from 'material-ui/styles/colors';
import MenuItem from 'material-ui/MenuItem';
import IconMenu from 'material-ui/IconMenu';
import IconButton from 'material-ui/IconButton/IconButton';
import ActionHelpOutline from 'material-ui/svg-icons/action/hel... |
Use a const and a ternary, rather than mutate | const { merge } = require('webpack-merge')
const baseConfig = require('./base')
const devServer = require('../dev_server')
const { runningWebpackDevServer } = require('../env')
const { outputPath: contentBase, publicPath } = require('../config')
let devConfig = {
mode: 'development',
devtool: 'cheap-module-sourc... | const { merge } = require('webpack-merge')
const baseConfig = require('./base')
const devServer = require('../dev_server')
const { runningWebpackDevServer } = require('../env')
const { outputPath: contentBase, publicPath } = require('../config')
let devConfig = {
mode: 'development',
devtool: 'cheap-module-sourc... |
Increase number of SoundCloud episodes pulled in
This is related to the fact that unpublished episodes still pull through. | import os
import inspect
# Flask
DEBUG = True
# Amazon S3 Settings
AWS_KEY = ''
AWS_SECRET_KEY = ''
AWS_BUCKET = 'www.vpr.net'
AWS_DIRECTORY = 'sandbox/app/'
SOUNDCLOUD_API = {
"client_id": "",
"client_secret": "",
"username": "",
"password": ""}
SOUNDCLOUD_NUM_TRACKS = 10
# Cache Settings (units in seconds)... | import os
import inspect
# Flask
DEBUG = True
# Amazon S3 Settings
AWS_KEY = ''
AWS_SECRET_KEY = ''
AWS_BUCKET = 'www.vpr.net'
AWS_DIRECTORY = 'sandbox/app/'
SOUNDCLOUD_API = {
"client_id": "",
"client_secret": "",
"username": "",
"password": ""}
SOUNDCLOUD_NUM_TRACKS = 5
# Cache Settings (units in seconds)
... |
Update webpack static, remove webpack clean so dist builds work again. | const path = require('path');
const HtmlWebPackPlugin = require('html-webpack-plugin');
const MiniCssExtractPlugin = require("mini-css-extract-plugin");
module.exports = {
entry: {
index: ['./src/index.css', './src/index.js']
},
node: false,
output: {
path: path.join(__dirname, 'dist'),
chunkFilen... | const path = require('path');
const HtmlWebPackPlugin = require('html-webpack-plugin');
const MiniCssExtractPlugin = require("mini-css-extract-plugin");
module.exports = {
entry: {
index: ['./src/index.css', './src/index.js']
},
node: false,
output: {
path: path.join(__dirname, 'dist'),
chunkFilen... |
Return statusCode 0 if request was aborted | var BufferList = require('bl');
var onFinished = require('on-finished');
module.exports = function bufferResponse(res, cb) {
var write = res.write;
var end = res.end;
var buf = new BufferList();
res.write = function(data, enc) {
if (data != undefined) bufferAdd(buf, data, enc)
write.bind(res)(data, enc);
};
... | var BufferList = require('bl');
var onFinished = require('on-finished');
module.exports = function bufferResponse(res, cb) {
var write = res.write;
var end = res.end;
var buf = new BufferList();
res.write = function(data, enc) {
if (data != undefined) bufferAdd(buf, data, enc)
write.bind(res)(data, enc);
};
... |
Fix typo in initial state | import React from 'react';
import PropTypes from 'prop-types';
import GatewayRegistry from './GatewayRegistry';
import {deprecated} from 'react-prop-types';
export default class GatewayDest extends React.Component {
static contextTypes = {
gatewayRegistry: PropTypes.instanceOf(GatewayRegistry).isRequired
};
... | import React from 'react';
import PropTypes from 'prop-types';
import GatewayRegistry from './GatewayRegistry';
import {deprecated} from 'react-prop-types';
export default class GatewayDest extends React.Component {
static contextTypes = {
gatewayRegistry: PropTypes.instanceOf(GatewayRegistry).isRequired
};
... |
Add support for prototype mocking | var assert = require('chai').assert;
var deepEqual = require('deep-equal');
var makeMockFunction = require('./makeMockFunction');
module.exports = function makeMock(object, type) {
var args = [];
var mockObj = function mockObj() {};
var prop;
for (prop in object) {
console.log('Prop: ', prop);
var mo... | var assert = require('chai').assert;
var deepEqual = require('deep-equal');
var makeMockFunction = require('./makeMockFunction');
module.exports = function makeMock(object, type) {
var args = [];
var mockObj = function mockObj() {};
var prop;
for (prop in object) {
var mocked = getMockForProp(prop, objec... |
Send headers with local queries | const axios = require('axios')
const path = require('path')
let GraphQL
try {
// do to GraphQL schema issue [see](https://github.com/graphql/graphiql/issues/58)
GraphQL = require(path.join(process.cwd(), './node_modules/graphql'))
} catch (e) {
// fallback if graphql is not installed locally
GraphQL = require(... | const axios = require('axios')
const path = require('path')
let GraphQL
try {
// do to GraphQL schema issue [see](https://github.com/graphql/graphiql/issues/58)
GraphQL = require(path.join(process.cwd(), './node_modules/graphql'))
} catch (e) {
// fallback if graphql is not installed locally
GraphQL = require(... |
Adjust test_polint to be less stdout-spammy | from django.core.management import call_command
from fjord.base.tests import TestCase
class TestGenerateData(TestCase):
def test_generate_data(self):
"""Make sure ./manage.py generatedata runs."""
call_command('generatedata')
call_command('generatedata', bigsample=True)
class TestPOLint... | from django.core.management import call_command
from fjord.base.tests import TestCase
class TestGenerateData(TestCase):
def test_generate_data(self):
"""Make sure ./manage.py generatedata runs."""
call_command('generatedata')
call_command('generatedata', bigsample=True)
class TestPOLint... |
Remove the commented out block | """Example Rejected Consumer"""
from rejected import consumer
import random
from tornado import gen
from tornado import httpclient
__version__ = '1.0.0'
class ExampleConsumer(consumer.SmartConsumer):
def process(self):
self.logger.info('Message: %r', self.body)
action = random.randint(0, 100)
... | """Example Rejected Consumer"""
from rejected import consumer
import random
from tornado import gen
from tornado import httpclient
__version__ = '1.0.0'
class ExampleConsumer(consumer.SmartConsumer):
def process(self):
self.logger.info('Message: %r', self.body)
"""
action = random.rand... |
Configure json.dumps() to use an item separator of "," instead of the default ", " to prevent single whitespace at the end of lines.
Without this option, all prettyfied JSON has one space at the end of each line, which is not so pretty:
{
"key": "value",_
"key": "value",_
"key": "value"
}
This could ... | import sublime
import sublime_plugin
import json
s = sublime.load_settings("Pretty JSON.sublime-settings")
class PrettyjsonCommand(sublime_plugin.TextCommand):
""" Pretty Print JSON
"""
def run(self, edit):
for region in self.view.sel():
# If no selection, use the entire file as the s... | import sublime
import sublime_plugin
import json
s = sublime.load_settings("Pretty JSON.sublime-settings")
class PrettyjsonCommand(sublime_plugin.TextCommand):
""" Pretty Print JSON
"""
def run(self, edit):
for region in self.view.sel():
# If no selection, use the entire file as the s... |
Remove deprecated version requirement settings
Linter plugins can no longer set version requirements.
https://github.com/SublimeLinter/SublimeLinter/issues/1087 | #
# linter.py
# Markdown Linter for SublimeLinter, a code checking framework
# for Sublime Text 3
#
# Written by Jon LaBelle
# Copyright (c) 2018 Jon LaBelle
#
# License: MIT
#
"""This module exports the Markdownlint plugin class."""
from SublimeLinter.lint import NodeLinter, util
class MarkdownLint(NodeLinter):
... | #
# linter.py
# Markdown Linter for SublimeLinter, a code checking framework
# for Sublime Text 3
#
# Written by Jon LaBelle
# Copyright (c) 2018 Jon LaBelle
#
# License: MIT
#
"""This module exports the Markdownlint plugin class."""
from SublimeLinter.lint import NodeLinter, util
class MarkdownLint(NodeLinter):
... |
Add ContentItemRelation to SharedContent model
Displays objects in the admin delete screen. | from django.db import models
from django.utils.translation import ugettext_lazy as _
from parler.models import TranslatableModel, TranslatedFields
from fluent_contents.models import ContentItem, PlaceholderField, ContentItemRelation
class SharedContent(TranslatableModel):
"""
The parent hosting object for sha... | from django.db import models
from django.utils.translation import ugettext_lazy as _
from parler.models import TranslatableModel, TranslatedFields
from fluent_contents.models import ContentItem, PlaceholderField
class SharedContent(TranslatableModel):
"""
The parent hosting object for shared content
"""
... |
Fix import error when CUDA is not available | import chainerx
try:
import cupy
_cupy_available = True
except Exception:
_cupy_available = False
_chainerx_allocator = None
def cupy_share_allocator(owner=chainerx._global_context):
# Replace CuPy's allocator with ChainerX's if ChainerX is available with
# the CUDA backend. This is needed in o... | import chainerx
from chainerx import _pybind_cuda
try:
import cupy
_cupy_available = True
except Exception:
_cupy_available = False
_chainerx_allocator = None
def cupy_share_allocator(owner=chainerx._global_context):
# Replace CuPy's allocator with ChainerX's if ChainerX is available with
# the... |
Revert "Bundle the position service with the lib for now so users dont have to depend on ng2-bootstrap"
This reverts commit 807a45bfcc7140124271e7e0e47e6fb4a22093b0. | module.exports = {
entry: './angular2-bootstrap-confirm.ts',
output: {
filename: './angular2-bootstrap-confirm.js',
libraryTarget: 'umd',
library: 'ng2BootstrapConfirm'
},
externals: {
'angular2/core': {
root: ['ng', 'core'],
commonjs: 'angular2/core',
commonjs2: 'angular2/core... | module.exports = {
entry: './angular2-bootstrap-confirm.ts',
output: {
filename: './angular2-bootstrap-confirm.js',
libraryTarget: 'umd',
library: 'ng2BootstrapConfirm'
},
externals: {
'angular2/core': {
root: ['ng', 'core'],
commonjs: 'angular2/core',
commonjs2: 'angular2/core... |
Fix arrays being converted to objects
typeof new Array() is 'object', so the check if the thing was an array never hit | function forIn(object, callback) {
for (const key in object) {
if (!object.hasOwnProperty(key)) {
continue;
}
callback(key);
}
}
function normalize(metaInformation) {
const normalized = {};
forIn(metaInformation, function cb(key) {
if (Array.isArray(metaInformation[key])) {
// Nor... | function forIn(object, callback) {
for (const key in object) {
if (!object.hasOwnProperty(key)) {
continue;
}
callback(key);
}
}
function normalize(metaInformation) {
const normalized = {};
forIn(metaInformation, function cb(key) {
if (typeof metaInformation[key] === 'object') {
/... |
Check if checkbox value has updated. |
from scriptcore.testing.testcase import TestCase
from scriptcore.console.asciimatics.widgets.checkbox import CheckBox
from asciimatics.widgets import CheckBox as ACheckBox
class TestCheckBox(TestCase):
def test_checkbox(self):
"""
Test the checkbox
:return: void
"""
c... |
from scriptcore.testing.testcase import TestCase
from scriptcore.console.asciimatics.widgets.checkbox import CheckBox
from asciimatics.widgets import CheckBox as ACheckBox
class TestCheckBox(TestCase):
def test_checkbox(self):
"""
Test the checkbox
:return: void
"""
c... |
Handle FObejcts in foam.swift.stringify during generation. | /**
* @license
* Copyright 2018 The FOAM Authors. All Rights Reserved.
* http://www.apache.org/licenses/LICENSE-2.0
*/
foam.LIB({
name: 'foam.swift',
methods: [
function stringify(v) {
var type = foam.typeOf(v);
if ( type == foam.Number || type == foam.Boolean ) {
return `${v}`;
... | /**
* @license
* Copyright 2018 The FOAM Authors. All Rights Reserved.
* http://www.apache.org/licenses/LICENSE-2.0
*/
foam.LIB({
name: 'foam.swift',
methods: [
function stringify(v) {
var type = foam.typeOf(v);
if ( type == foam.Number || type == foam.Boolean ) {
return `${v}`;
... |
Add penalty for not making food | function collectWood(){
wood = wood + woodAdd;
update();
}
function collectStone(){
if(wood >= 5){
wood = wood - 5;
stone = stone + stoneAdd;
}
update();
}
function collectFood(){
if(stone >= 5){
food = food + foodAdd;
stone = stone - 5;
}
update();
}
function makePop(){
if(food >= 5){
if(wood >= ... | function collectWood(){
wood = wood + woodAdd;
update();
}
function collectStone(){
if(wood >= 5){
wood = wood - 5;
stone = stone + stoneAdd;
}
update();
}
function collectFood(){
if(stone >= 5){
food = food + foodAdd;
stone = stone - 5;
}
update();
}
function makePop(){
if(food >= 5){
if(wood >= ... |
Make article_aggregated_views user_id column non-nullable | <?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateArticleAggregatedViewsTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('... | <?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateArticleAggregatedViewsTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('... |
Add __all__ variable to enforce ordering in docs | # -*- coding: utf-8 -*-
#
# Artifacts - Artifactory Search Client
#
# Copyright 2015 Smarter Travel
#
# Available under the MIT license. See LICENSE for details.
#
"""
artifacts.exceptions
~~~~~~~~~~~~~~~~~~~~
Exceptions raised by the Artifacts library.
"""
from __future__ import print_function, division
__all__ = ... | # -*- coding: utf-8 -*-
#
# Artifacts - Artifactory Search Client
#
# Copyright 2015 Smarter Travel
#
# Available under the MIT license. See LICENSE for details.
#
"""
artifacts.exceptions
~~~~~~~~~~~~~~~~~~~~
Exceptions raised by the Artifacts library.
"""
from __future__ import print_function, division
class Art... |
Fix misnamed SwatHtmltag
This was probably never caught because we seldom (if ever) use SwatDisplableContainer's own display() method
svn commit r10293 | <?php
require_once 'Swat/SwatContainer.php';
/**
* Base class for containers that display an XHTML element
*
* @package Swat
* @copyright 2006 silverorange
* @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1
*/
class SwatDisplayableContainer extends SwatContainer
{
// {{{ public function di... | <?php
require_once 'Swat/SwatContainer.php';
/**
* Base class for containers that display an XHTML element
*
* @package Swat
* @copyright 2006 silverorange
* @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1
*/
class SwatDisplayableContainer extends SwatContainer
{
// {{{ public function di... |
Fix smelting and crafting with subtypes | package me.zford.jobs.bukkit.actions;
import me.zford.jobs.container.ActionInfo;
import me.zford.jobs.container.ActionType;
import me.zford.jobs.container.BaseActionInfo;
import org.bukkit.inventory.ItemStack;
public class ItemActionInfo extends BaseActionInfo implements ActionInfo {
private ItemStack i... | package me.zford.jobs.bukkit.actions;
import me.zford.jobs.container.ActionInfo;
import me.zford.jobs.container.ActionType;
import me.zford.jobs.container.BaseActionInfo;
import org.bukkit.inventory.ItemStack;
public class ItemActionInfo extends BaseActionInfo implements ActionInfo {
private ItemStack i... |
Increase character length for food | from django.db import models
class Menu(models.Model):
day = models.CharField(max_length=10, blank=False, null=False)
food = models.CharField(max_length=120, blank=False, null=False)
meal = models.CharField(max_length=10, blank=False, null=False)
option = models.IntegerField(null=False)
week = mo... | from django.db import models
class Menu(models.Model):
day = models.CharField(max_length=10, blank=False, null=False)
food = models.CharField(max_length=60, blank=False, null=False)
meal = models.CharField(max_length=10, blank=False, null=False)
option = models.IntegerField(null=False)
week = mod... |
Rename variables, var -> const/let | const MESSAGE_RANGE = 1000
class Shouty {
constructor() {
this.locationsByShouter = new Map()
this.messagesByShouter = new Map()
}
setLocation(person, coordinate) {
this.locationsByShouter.set(person, coordinate)
}
shout(person, message) {
this.messagesByShouter.set(person, message)
}
... | const MESSAGE_RANGE = 1000
class Shouty {
constructor() {
this.locations = new Map()
this.messages = new Map()
}
setLocation(person, coordinate) {
this.locations.set(person, coordinate)
}
shout(person, message) {
this.messages.set(person, message)
}
getMessagesHeardBy(listener) {
v... |
Handle stealable element with utils | # Copyright (C) 2015 Google Inc., authors, and contributors <see AUTHORS file>
# Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file>
# Created By: jernej@reciprocitylabs.com
# Maintained By: jernej@reciprocitylabs.com
"""A module for extended info page models (visible in LHN on hover over
obje... | # Copyright (C) 2015 Google Inc., authors, and contributors <see AUTHORS file>
# Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file>
# Created By: jernej@reciprocitylabs.com
# Maintained By: jernej@reciprocitylabs.com
"""A module for extended info page models (visible in LHN on hover over
obje... |
Remove "Programming Language :: Foxpro" classifier. | # coding=utf-8
from __future__ import absolute_import, division, print_function
import sys
from setuptools import setup
VERSION='0.1.0'
setup(
name='vfp2py',
version=VERSION,
description='Convert foxpro code to python',
author='Michael Wisslead',
author_email='michael.wisslead@gmail.com',
url... | # coding=utf-8
from __future__ import absolute_import, division, print_function
import sys
from setuptools import setup
VERSION='0.1.0'
setup(
name='vfp2py',
version=VERSION,
description='Convert foxpro code to python',
author='Michael Wisslead',
author_email='michael.wisslead@gmail.com',
url... |
Use httputil DumpRequest instead of just %v formatting
This makes logplexd output a lot more useful in most cases.
DumpRequest is set up to render the request body, also.
Signed-off-by: Daniel Farina <3d0f3b9ddcacec30c4008c5e030e6c13a478cb4f@fdr.io> | package main
import (
"fmt"
"log"
"net/http"
"net/http/httptest"
"net/http/httputil"
"os"
"os/signal"
)
type LogplexPrint struct{}
func (*LogplexPrint) ServeHTTP(w http.ResponseWriter, r *http.Request) {
dump, err := httputil.DumpRequest(r, true)
if err != nil {
log.Printf("Could not dump request: %#v", e... | package main
import (
"fmt"
"log"
"net/http"
"net/http/httptest"
"os"
"os/signal"
)
type LogplexPrint struct{}
func (*LogplexPrint) ServeHTTP(w http.ResponseWriter, r *http.Request) {
log.Printf("Request: %#v", *r)
w.WriteHeader(http.StatusNoContent)
}
func main() {
s := httptest.NewTLSServer(&LogplexPrint... |
Add some basic error handling and remove tuples.
No need for tuples when the lists are going to be
so small. The speed difference between the two
will be minimal. | #!/usr/bin/env python3
from config import WOLFRAM_KEY
import sys
import wolframalpha
POD_TITLE = 'Average nutrition facts'
QUERY = input()
def get_macros(pod_text):
items = pod_text.split("|")
for t in items:
chunks = t.split()
if 'protein' in chunks:
protein = chunks[-2::]
... | #!/usr/bin/env python3
from config import WOLFRAM_KEY
import wolframalpha
POD_TITLE = 'Average nutrition facts'
QUERY = input()
def get_macros(pod_text):
items = pod_text.split("|")
for t in items:
chunks = t.split()
if 'protein' in chunks:
protein = tuple(chunks[-2::])
el... |
Update inline documentation for `NodeList` -> `Array` change. | import settings from './settings';
/*
The findAll test helper uses `querySelectorAll` to search inside the test
DOM (based on app configuration for the rootElement).
Alternalively, a second argument may be passed which is an element as the
DOM context to search within.
@method findAll
@param {String} CSS... | import settings from './settings';
/*
The findAll test helper uses `querySelectorAll` to search inside the test
DOM (based on app configuration for the rootElement).
Alternalively, a second argument may be passed which is an element as the
DOM context to search within.
@method findAll
@param {String} CSS... |
[R] Add empty line after imports | #!/usr/bin/env python3
"""
Follow the white house rabbit
This fetches tweets from an user and prints
the full json output from the api.
"""
import os
import sys
import json
from twython import Twython
from twython import TwythonError
CONSUMER_KEY = os.environ.get('TWITTER_CONSUMER_KEY')
CONSUMER_SECRET_KEY = os.env... | #!/usr/bin/env python3
"""
Follow the white house rabbit
This fetches tweets from an user and prints
the full json output from the api.
"""
import os
import sys
import json
from twython import Twython
from twython import TwythonError
CONSUMER_KEY = os.environ.get('TWITTER_CONSUMER_KEY')
CONSUMER_SECRET_KEY = os.envi... |
BB-1049: Address form om frontend does not work | define([
'backbone',
'routing',
'oroaddress/js/region/model',
'underscore'
], function(Backbone, routing, RegionModel, _) {
'use strict';
/**
* @export oroaddress/js/region/collection
* @class oroaddress.region.Collection
* @extends Backbone.Collection
*/
return Backb... | define([
'backbone',
'routing',
'oroaddress/js/region/model'
], function(Backbone, routing, RegionModel) {
'use strict';
/**
* @export oroaddress/js/region/collection
* @class oroaddress.region.Collection
* @extends Backbone.Collection
*/
return Backbone.Collection.extend... |
Use specially registered domain instead of real domain test.com | <?php
$config = null;
$client = null;
/* @var $client KalturaClient */
require_once __DIR__ . '/lib/init.php';
$partner = new KalturaPartner();
$partner->name = 'sanity-test';
$partner->website = 'sanity.example.com';
$partner->adminName = 'sanity-test';
$partner->adminEmail = uniqid('sanity.') . '@example.com';
$pa... | <?php
$config = null;
$client = null;
/* @var $client KalturaClient */
require_once __DIR__ . '/lib/init.php';
$partner = new KalturaPartner();
$partner->name = 'sanity-test';
$partner->website = 'sanity.test.com';
$partner->adminName = 'sanity-test';
$partner->adminEmail = uniqid('sanity.') . '@test.com';
$partner-... |
Add Onimaru to the character list | export const characters = Object.assign({},
require('./characters/geiger.jsx'),
require('./characters/grave.jsx'),
require('./characters/gwen.jsx'),
require('./characters/jaina.jsx'),
require('./characters/midori.jsx'),
require('./characters/rook.jsx'),
require('./characters/setsuki.jsx'),
... | export const characters = Object.assign({},
require('./characters/geiger.jsx'),
require('./characters/grave.jsx'),
require('./characters/gwen.jsx'),
require('./characters/jaina.jsx'),
require('./characters/midori.jsx'),
require('./characters/rook.jsx'),
require('./characters/setsuki.jsx'),
... |
Make sure there is a default for LOG Group | import os
EQ_RABBITMQ_URL = os.getenv('EQ_RABBITMQ_URL', 'amqp://admin:admin@localhost:5672/%2F')
EQ_RABBITMQ_QUEUE_NAME = os.getenv('EQ_RABBITMQ_QUEUE_NAME', 'eq-submissions')
EQ_RABBITMQ_TEST_QUEUE_NAME = os.getenv('EQ_RABBITMQ_TEST_QUEUE_NAME', 'eq-test')
EQ_PRODUCTION = os.getenv("EQ_PRODUCTION", 'True')
EQ_RRM_P... | import os
EQ_RABBITMQ_URL = os.getenv('EQ_RABBITMQ_URL', 'amqp://admin:admin@localhost:5672/%2F')
EQ_RABBITMQ_QUEUE_NAME = os.getenv('EQ_RABBITMQ_QUEUE_NAME', 'eq-submissions')
EQ_RABBITMQ_TEST_QUEUE_NAME = os.getenv('EQ_RABBITMQ_TEST_QUEUE_NAME', 'eq-test')
EQ_PRODUCTION = os.getenv("EQ_PRODUCTION", 'True')
EQ_RRM_P... |
Correct linearization/delinearization of this linking function. | <?php
namespace mcordingley\Regression\Linking;
/**
* Power
*
* Linking implementation that transforms data that follows a geometric curve.
*/
class Power implements LinkingInterface
{
protected $exponent;
/**
* __construct
*
* @param float|null $exponent The exponent that best descr... | <?php
namespace mcordingley\Regression\Linking;
/**
* Power
*
* Linking implementation that transforms data that follows a geometric curve.
*/
class Power implements LinkingInterface
{
protected $exponent;
/**
* __construct
*
* @param float|null $exponent The exponent that best descr... |
Fix proptypes error related to validation | import {PropTypes} from 'react'
function lazy(fn) {
let cachedFn
return (...args) => (cachedFn || (cachedFn = fn()))(...args)
}
const field = PropTypes.shape({
name: PropTypes.string,
title: PropTypes.string,
description: PropTypes.string,
placeholder: PropTypes.string,
type: PropTypes.string,
to: laz... | import {PropTypes} from 'react'
function lazy(fn) {
let cachedFn
return (...args) => (cachedFn || (cachedFn = fn()))(...args)
}
const field = PropTypes.shape({
name: PropTypes.string,
title: PropTypes.string,
description: PropTypes.string,
placeholder: PropTypes.string,
type: PropTypes.string,
to: laz... |
[FIX] Fix 'installable' syntax in manifest file | # © 2016 Therp BV <http://therp.nl>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
{
"name": "Pdf watermark",
"version": "12.0.1.0.0",
"author": "Therp BV, "
"Odoo Community Association (OCA)",
"license": "AGPL-3",
"category": "Technical Settings",
"summary": ... | # © 2016 Therp BV <http://therp.nl>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
{
"name": "Pdf watermark",
"version": "12.0.1.0.0",
"author": "Therp BV, "
"Odoo Community Association (OCA)",
"license": "AGPL-3",
"category": "Technical Settings",
"summary": ... |
Handle sign in failure from traccar | import os, graphene, requests
from flask_jwt_extended import get_jwt_identity, get_jwt_claims
from graphql import GraphQLError
from traccar_graphql.models import ServerType, UserType
from traccar_graphql.mutations import LoginType, RegisterType
from traccar_graphql.utils import request2object
TRACCAR_BACKEND = os.env... | import os, graphene, requests
from flask_jwt_extended import get_jwt_identity, get_jwt_claims
from graphql import GraphQLError
from traccar_graphql.models import ServerType, UserType
from traccar_graphql.mutations import LoginType, RegisterType
from traccar_graphql.utils import request2object
TRACCAR_BACKEND = os.env... |
Add OrderCreator to global scope | /**
* This file is part of Shuup.
*
* Copyright (c) 2012-2018, Shuup Inc. All rights reserved.
*
* This source code is licensed under the OSL-3.0 license found in the
* LICENSE file in the root directory of this source tree.
*/
//-- jQuery
var jquery = require("jquery");
window.$ = window.jQuery = jquery;
cons... | /**
* This file is part of Shuup.
*
* Copyright (c) 2012-2018, Shuup Inc. All rights reserved.
*
* This source code is licensed under the OSL-3.0 license found in the
* LICENSE file in the root directory of this source tree.
*/
//-- jQuery
var jquery = require("jquery");
window.$ = window.jQuery = jquery;
cons... |
Fix subscribe link in sidebar widget. | <?php
require_once 'mnw.php';
function mnw_subscribe_widget_register() {
register_sidebar_widget (__('mnw Subscribe'), 'mnw_subscribe_widget');
}
add_action('init', 'mnw_subscribe_widget_register');
function mnw_subscribe_widget($args) {
extract($args);
global $wpdb;
$count = $wpdb->get_var('SELECT C... | <?php
require_once 'mnw.php';
function mnw_subscribe_widget_register() {
register_sidebar_widget (__('mnw Subscribe'), 'mnw_subscribe_widget');
}
add_action('init', 'mnw_subscribe_widget_register');
function mnw_subscribe_widget($args) {
extract($args);
global $wpdb;
$count = $wpdb->get_var('SELECT C... |
Put back the authentication to pass Travis CI tests | // Load environment variables
if (process.env.NODE_ENV === 'development') {
require('dotenv').config({ path: './env/development.env' });
}
var express = require('express');
var passport = require('passport');
var util = require('./lib/utility.js');
var app = express();
// Initial Configuration, Static Assets, & Vi... | // Load environment variables
if (process.env.NODE_ENV === 'development') {
require('dotenv').config({ path: './env/development.env' });
}
var express = require('express');
var passport = require('passport');
var util = require('./lib/utility.js');
var app = express();
// Initial Configuration, Static Assets, & Vi... |
Fix case: tostring to toString | define(function() {
'use strict';
return function(item) {
return item.getBytes().then(function(bytes) {
var dv = new DataView(bytes.buffer, bytes.byteOffset, bytes.byteLength);
if (dv.getUint32(0, false) !== bytes.length) {
return Promise.reject('length does not match data');
}
... | define(function() {
'use strict';
return function(item) {
return item.getBytes().then(function(bytes) {
var dv = new DataView(bytes.buffer, bytes.byteOffset, bytes.byteLength);
if (dv.getUint32(0, false) !== bytes.length) {
return Promise.reject('length does not match data');
}
... |
Check jQuery dependency, minor syntax adjustments | if (typeof jQuery === 'undefined') {
throw new Error('The jQuery equal height extension requires jQuery!');
}
jQuery.fn.equalHeight = function() {
var $ = jQuery;
var that = this;
var setHeights = function() {
var elems = {};
var cont = $(that);
// Reset the elements heights
cont.each(function() {
$... | jQuery.fn.equalHeight = function() {
var $ = jQuery;
var that = this;
var setHeights = function() {
var elems = {};
var cont = $(that);
// Reset the elements heights
cont.each(function() {
$(this).height('');
});
// Create a mapping of elements and the max height for all elements at that top offse... |
Delete message more verbose: title included | $(function() {
$('a.deleteShow').click(function(e) {
e.preventDefault();
var url = $(this).attr('href');
var title = $(this).closest('tr').find('td:eq(1)').text();
var userConfig = {
captionOk: 'Yes',
captionCancel: 'No',
title: 'Confirmation',
... | $(function() {
$('a.deleteShow').click(function(e) {
e.preventDefault();
var url = $(this).attr('href');
var userConfig = {
captionOk: 'Yes',
captionCancel: 'No',
title: 'Confirmation',
onOk: function() {
location.href = url;
... |
Add function to TaxonPresenter to resolve view template path from request
Still uses the selected tab for the template name, but now looks for the
template in a directory names after the base path.
e.g. - '/taxons/:taxonSlug' will render templates from 'app/views/taxons' | var taxonHelpers = require('../helpers/taxon-helpers.js');
var filterHelpers = require('../helpers/filter-helpers.js');
function TaxonPresenter (taxonSlug, request) {
this.taxonSlug = taxonSlug; // the slug of the taxon in the Content Store
this.selectedTab = request.query.tab;
if (this.selectedTab == undefined)... | var taxonHelpers = require('../helpers/taxon-helpers.js');
var filterHelpers = require('../helpers/filter-helpers.js');
function TaxonPresenter (taxonSlug, request) {
this.taxonSlug = taxonSlug; // the slug of the taxon in the Content Store
this.selectedTab = request.query.tab;
if (this.selectedTab == undefined)... |
Fix initialization of the Set trough comma separated values | package af.props;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;
import org.springframework.boot.context.properties.ConfigurationProperties;
import lombok.Getter;
import lombok.Setter;
/**
* Java collections.
* <p>... | package af.props;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;
import org.springframework.boot.context.properties.ConfigurationProperties;
import lombok.Getter;
/**
* Java collections.
* <p>
* As per documentati... |
Use proper PSR4 in example | <?php
use laserred\lrcpt;
class ExampleCPT extends lrcpt{
public $name;
public $labels = array('name' => 'Blaa');
public $args = array();
public $metaboxes = array();
/**
* Call the parent constuctor to do all the work.
*/
public function __construct(){
$this->metaboxes[] =... | <?php
class ExampleCPT extends LRCPT{
public $name;
public $labels = array('name' => 'Blaa');
public $args = array();
public $metaboxes = array();
/**
* Call the parent constuctor to do all the work.
*/
public function __construct(){
$this->metaboxes[] = array(
'... |
Make the printing of sqlite version in verbose mode work with regrtest -w. | import test.support
# Skip test if _sqlite3 module not installed
test.support.import_module('_sqlite3')
import sqlite3
from sqlite3.test import (dbapi, types, userfunctions,
factory, transactions, hooks, regression,
dump)
def test_main():
if test.su... | from test.support import run_unittest, import_module, verbose
# Skip test if _sqlite3 module not installed
import_module('_sqlite3')
import sqlite3
from sqlite3.test import (dbapi, types, userfunctions,
factory, transactions, hooks, regression,
dump)
de... |
[wapitit] Add one signature for wapiti 2.2.1 | """
Wapiti does not provide ranking for the vulnerabilities it has found.
This file tries to define a ranking for every vulnerability Wapiti might
find.
"""
from libptp.constants import HIGH, MEDIUM, LOW, INFO
SIGNATURES = {
# High ranked vulnerabilities
'SQL Injection': HIGH,
'Blind SQL I... | """
Wapiti does not provide ranking for the vulnerabilities it has found.
This file tries to define a ranking for every vulnerability Wapiti might
find.
"""
from libptp.constants import HIGH, MEDIUM, LOW, INFO
SIGNATURES = {
# High ranked vulnerabilities
'SQL Injection': HIGH,
'Blind SQL I... |
Fix ohe type in ce | """ Contains base tf losses """
import tensorflow as tf
def softmax_cross_entropy(labels, logits, *args, **kwargs):
""" Multi-class CE which takes plain or one-hot labels
Parameters
----------
labels : tf.Tensor
logits : tf.Tensor
args
other positional parameters from `tf.losses.sof... | """ Contains base tf losses """
import tensorflow as tf
def softmax_cross_entropy(labels, logits, *args, **kwargs):
""" Multi-class CE which takes plain or one-hot labels
Parameters
----------
labels : tf.Tensor
logits : tf.Tensor
args
other positional parameters from `tf.losses.sof... |
Add CSRF filter to '/profile' Route. | <?php
/**
* Routes - all standard routes are defined here.
*
* @author David Carr - dave@daveismyname.com
* @version 3.0
*/
use Core\Router;
use Helpers\Hooks;
/** Define static routes. */
// Default Routing
Router::any('', 'App\Controllers\Welcome@index');
Router::any('subpage', 'App\Controllers\Welcome@subPa... | <?php
/**
* Routes - all standard routes are defined here.
*
* @author David Carr - dave@daveismyname.com
* @version 3.0
*/
use Core\Router;
use Helpers\Hooks;
/** Define static routes. */
// Default Routing
Router::any('', 'App\Controllers\Welcome@index');
Router::any('subpage', 'App\Controllers\Welcome@subPa... |
Fix an edge case when a file is dropped outside <body> | import union from 'lodash/array/union';
import without from 'lodash/array/without';
export default class EnterLeaveCounter {
constructor() {
this.entered = [];
}
enter(enteringNode) {
this.entered = union(
this.entered.filter(node =>
document.documentElement.contains(node) &&
(!nod... | import union from 'lodash/array/union';
import without from 'lodash/array/without';
export default class EnterLeaveCounter {
constructor() {
this.entered = [];
}
enter(enteringNode) {
this.entered = union(
this.entered.filter(node =>
document.body.contains(node) &&
(!node.contains ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.