text stringlengths 16 4.96k | positive stringlengths 321 2.24k | negative stringlengths 310 2.21k |
|---|---|---|
Add comment to streamingprf_test's limitFromHash().
PiperOrigin-RevId: 476540085 | // Copyright 2022 Google LLC
//
// 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 2022 Google LLC
//
// 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 ... |
Change babel to stage 1 | var path = require('path');
module.exports = {
entry: {
auth: "./app/scripts/auth/auth.js",
scraper: "./app/scripts/scraper/scraper.js",
background: "./app/scripts/background/background.js",
popup: "./app/scripts/popup.js",
app: "./app/scripts/app.js"
},
devtool: 'source-map',
output: {
path: path.join... | var path = require('path');
module.exports = {
entry: {
auth: "./app/scripts/auth/auth.js",
scraper: "./app/scripts/scraper/scraper.js",
background: "./app/scripts/background/background.js",
popup: "./app/scripts/popup.js",
app: "./app/scripts/app.js"
},
devtool: 'source-map',
output: {
path: path.join... |
add: Copy icons directory under extra resources | /**
* Copyright (c) Ajay Sreedhar. All rights reserved.
*
* Licensed under the MIT License.
* Please see LICENSE file located in the project root for more information.
*/
'use strict';
const releaseConfig = {
appId: 'com.kongdash',
productName: 'KongDash',
copyright: 'Copyright (c) 2022 Ajay Sreedhar... | /**
* Copyright (c) Ajay Sreedhar. All rights reserved.
*
* Licensed under the MIT License.
* Please see LICENSE file located in the project root for more information.
*/
'use strict';
const releaseConfig = {
appId: 'com.kongdash',
productName: 'KongDash',
copyright: 'Copyright (c) 2022 Ajay Sreedhar... |
Remove data attributes from obfuscated email address | ;(function($){
var email_obfuscated_class = 'obfuscated';
var email_data_attr_prefix = 'data-email-';
$(document)
.on('mouseenter focus click touchstart keydown', 'a.obfuscated-email.' + email_obfuscated_class, function(e){
assemble_email(e);
})
;
function assemble_email(e) {
e.stopPro... | ;(function($){
var email_obfuscated_class = 'obfuscated';
var email_data_attr_prefix = 'data-email-';
$(document)
.on('mouseenter focus click touchstart keydown', 'a.obfuscated-email.' + email_obfuscated_class, function(e){
assemble_email(e);
})
;
function assemble_email(e) {
e.stopPro... |
Make the tests more reader friendly | var testCase = require('nodeunit').testCase,
parser = require('../language/parser'),
tokenizer = require('../language/tokenizer')
/* TESTS */
test('text literal', '"hello world"', static("hello world"))
test('number literal', '1', static(1))
test('declaration', 'let greeting = "hello"', { type:'DECLARATION', name:'g... | var testCase = require('nodeunit').testCase,
parser = require('../language/parser'),
tokenizer = require('../language/tokenizer')
test('TextLiteral', '"hello world"', static("hello world"))
test('NumberLiteral', '1', static(1))
test('Declaration', 'let greeting = "hello"', {
type:'DECLARATION',
name:'greeting',
v... |
Use output name from input name | import argparse
import os
import fiona
from shapely.geometry import Polygon, mapping
def remove_file(file_name):
try:
os.remove(file_name)
except OSError:
pass
def read_polygon(polygon_filename):
with open(polygon_filename) as f:
return f.readlines()
def clean_poylgon(polygon_d... | import argparse
import os
import fiona
from shapely.geometry import Polygon, mapping
def remove_file(file_name):
try:
os.remove(file_name)
except OSError:
pass
def read_polygon(polygon_filename):
with open(polygon_filename) as f:
return f.readlines()
def clean_poylgon(polygon_d... |
Remove unreliable integration tests from automated testing | module.exports = function(grunt) {
'use strict';
// Project configuration.
grunt.initConfig({
jshint: {
all: ['Gruntfile.js', 'index.js', 'test/*.js'],
options: {
jshintrc: '.jshintrc'
}
},
mochaTest: {
test: {
... | module.exports = function(grunt) {
'use strict';
// Add the grunt-mocha-test tasks.
grunt.loadNpmTasks('grunt-mocha-test');
// Project configuration.
grunt.initConfig({
jshint: {
all: ['Gruntfile.js', 'index.js', 'test/*.js'],
options: {
jshintrc: '.... |
Add get raw key from KeyPair | import base64
import sha3
import os
from collections import namedtuple
class KeyPair:
def __init__(self, pub, pri):
self.private_key = pri
self.public_key = pub
def raw_public_key(self):
return base64.b64decode(self.public_key)
from iroha_cli.crypto_ed25519 import generate_keypair_... | import base64
import sha3
import os
from collections import namedtuple
class KeyPair:
def __init__(self, pub, pri):
self.private_key = pri
self.public_key = pub
from iroha_cli.crypto_ed25519 import generate_keypair_ed25519, sign_ed25519, verify_ed25519, ed25519_sha3_512, \
ed25519_sha3_256... |
Disable `add tag` shortcut on mobile | import detectIt from 'detect-it';
const { deviceType } = detectIt;
export default {
bind(_el, _, { context: $vue }) {
const el = _el;
el.addEventListener('keydown', (e) => {
const { key } = e;
if (deviceType === 'touchOnly') return;
if (key === '#') {
const { value: content, sel... | export default {
bind(_el, _, { context: $vue }) {
const el = _el;
el.addEventListener('keydown', (e) => {
const { key } = e;
if (typeof key === 'undefined') return;
if (key === '#') {
const { value: content, selectionStart: caret } = el;
if (content.substring(caret - 1, ... |
Fix function reference in `getSuggestFields` | <?php
namespace App\Transformers\Outbound;
trait HasSuggestFields
{
protected function getSuggestFields()
{
return array_replace_recursive(parent::getSuggestFields(), [
'suggest_autocomplete_boosted' => [
'filter' => function ($item) {
return $item->is... | <?php
namespace App\Transformers\Outbound;
trait HasSuggestFields
{
protected function getSuggestFields()
{
return array_replace_recursive(parent::getSearchFields(), [
'suggest_autocomplete_boosted' => [
'filter' => function ($item) {
return $item->isB... |
Remove hover state from label | @can(App\Policies\UserPolicy::ADMIN, App\User::class)
<a href="{{ route('admin.users.show', $user->username()) }}">
<img class="rounded-full" src="{{ $user->gravatarUrl($avatarSize ?? 150) }}">
</a>
@else
<a href="{{ route('profile', $user->username()) }}">
<img class="rounded-full" src="{{ ... | @can(App\Policies\UserPolicy::ADMIN, App\User::class)
<a href="{{ route('admin.users.show', $user->username()) }}">
<img class="rounded-full" src="{{ $user->gravatarUrl($avatarSize ?? 150) }}">
</a>
@else
<a href="{{ route('profile', $user->username()) }}">
<img class="rounded-full" src="{{ ... |
core: Change autotuning 'none' to 'off' | """
The ``core`` Devito backend is simply a "shadow" of the ``base`` backend,
common to all other backends. The ``core`` backend (and therefore the ``base``
backend as well) are used to run Devito on standard CPU architectures.
"""
from devito.dle import (BasicRewriter, AdvancedRewriter, AdvancedRewriterSafeMath,
... | """
The ``core`` Devito backend is simply a "shadow" of the ``base`` backend,
common to all other backends. The ``core`` backend (and therefore the ``base``
backend as well) are used to run Devito on standard CPU architectures.
"""
from devito.dle import (BasicRewriter, AdvancedRewriter, AdvancedRewriterSafeMath,
... |
Improve storage manager with method validation and key prefixing | function StorageManager(storageMethod, prefix) {
try {
storageMethod.setItem('__available__', true);
if(storageMethod.removeItem) {
storageMethod.removeItem('__available__');
}
} catch(e) {
throw "Storage method is not currently available.";
}
this.storageMeth... | function StorageManager(storageMethod) {
this.storageMethod = storageMethod;
}
StorageManager.prototype.setCurrentLevel = function(level) {
this.storageMethod.setItem('currentLevel', level);
};
StorageManager.prototype.incrementCurrentLevel = function() {
this.setCurrentLevel(this.getCurrentLevel() + 1);
}... |
Add HouseInventory.jsx to be compiled | var path = require('path');
var SRC_DIR = path.join(__dirname, '/client/src');
var DIST_DIR = path.join(__dirname, '/client/dist');
module.exports = {
entry: {
index: `${SRC_DIR}/index.jsx`,
login: `${SRC_DIR}/login.jsx`,
inventory: `${SRC_DIR}/HouseInventory.jsx`
},
output: {
path: DIST_DIR,
... | var path = require('path');
var SRC_DIR = path.join(__dirname, '/client/src');
var DIST_DIR = path.join(__dirname, '/client/dist');
module.exports = {
entry: {
index: `${SRC_DIR}/index.jsx`,
login: `${SRC_DIR}/login.jsx`
},
output: {
path: DIST_DIR,
filename: '[name]-bundle.js'
},
module : {
... |
Add Django >= 1.5 requirement | import os
from setuptools import setup
README = open(os.path.join(os.path.dirname(__file__), 'README.md')).read()
# allow setup.py to be run from any path
os.chdir(os.path.normpath(os.path.join(os.path.abspath(__file__), os.pardir)))
setup(
name='django-swiftbrowser',
version='0.1',
packages=['swiftbrows... | import os
from setuptools import setup
README = open(os.path.join(os.path.dirname(__file__), 'README.md')).read()
# allow setup.py to be run from any path
os.chdir(os.path.normpath(os.path.join(os.path.abspath(__file__), os.pardir)))
setup(
name='django-swiftbrowser',
version='0.1',
packages=['swiftbrows... |
Make sure array buffer does not leak across vm. | var bs58 = require('bs58')
function serialize(data) {
// Using == on purpose.
if (data == null) {
return null
}
if (data instanceof Error) {
data = {
$type: 'Error',
msg: '' + data,
stack: data.stack
}
}
else if (data instanceof ArrayBuffer) {
data = {
$type: 'Array... | var bs58 = require('bs58')
function serialize(data) {
// Using == on purpose.
if (data == null) {
return null
}
if (data instanceof Error) {
data = {
$type: 'Error',
msg: '' + data,
stack: data.stack
}
}
else if (data instanceof ArrayBuffer) {
data = {
$type: 'Array... |
Check if Backbone.history matches a route when started. [rev:
alex.scown]
BaseApp starts Backbone.History. It now checks the return value of
Backbone.history.start to see if a route was matched, if not, it
navigates to the default route. | /*
* Copyright 2014-2015 Hewlett-Packard Development Company, L.P.
* Licensed under the MIT License (the "License"); you may not use this file except in compliance with the License.
*/
define([
'backbone',
'jquery',
'find/app/util/test-browser',
'find/app/vent'
], function(Backbone, $, testBrowser, ... | /*
* Copyright 2014-2015 Hewlett-Packard Development Company, L.P.
* Licensed under the MIT License (the "License"); you may not use this file except in compliance with the License.
*/
define([
'backbone',
'find/app/util/test-browser',
'find/app/vent'
], function(Backbone, testBrowser, vent) {
retur... |
Exclude mock directory from coverage. | <?php
use mageekguy\atoum\reports;
$runner
->addTestsFromDirectory(__DIR__ . '/tests/units/classes')
->disallowUndefinedMethodInInterface()
;
$runner->getScore()->getCoverage()->excludeDirectory(__DIR__ . '/tests/units/mock');
$travis = getenv('TRAVIS');
if ($travis)
{
$script->addDefaultReport();
$coverallsT... | <?php
use mageekguy\atoum\reports;
$runner
->addTestsFromDirectory(__DIR__ . '/tests/units/classes')
->disallowUndefinedMethodInInterface()
;
$travis = getenv('TRAVIS');
if ($travis)
{
$script->addDefaultReport();
$coverallsToken = getenv('COVERALLS_REPO_TOKEN');
if ($coverallsToken)
{
$coverallsReport = ... |
Add SweetAlert for authentication errors | import Ember from 'ember';
import swalert from 'sweetAlert';
/**
* This is the basic route to handle all routes that needs authentication.
* If there's a route that needs previous auth, it will need to extend this one.
*/
var AuthenticatedRoute = Ember.Route.extend({
// verify that there's a session token.
// ... | import Ember from 'ember';
/**
* This is the basic route to handle all routes that needs authentication.
* If there's a route that needs previous auth, it will need to extend this one.
*/
var AuthenticatedRoute = Ember.Route.extend({
// verify that there's a session token.
// if not, redirect to the login rout... |
Upgrade dependency appdirs to ==1.4.1 | import os
from setuptools import setup
from withtool import __version__
def read(fname):
path = os.path.join(os.path.dirname(__file__), fname)
with open(path, encoding='utf-8') as f:
return f.read()
setup(
name='with',
version=__version__,
description='A shell context manager',
lon... | import os
from setuptools import setup
from withtool import __version__
def read(fname):
path = os.path.join(os.path.dirname(__file__), fname)
with open(path, encoding='utf-8') as f:
return f.read()
setup(
name='with',
version=__version__,
description='A shell context manager',
lon... |
Add more to debug message. | var PythonShell = require('python-shell');
module.exports = function(RED) {
function AdafruitMax31855Node(config) {
RED.nodes.createNode(this,config);
var node = this;
var scriptPath = './spi_read.py'
var args = []
console.log("Adafruit MAX 31855: Checking for muxi... | var PythonShell = require('python-shell');
module.exports = function(RED) {
function AdafruitMax31855Node(config) {
RED.nodes.createNode(this,config);
var node = this;
var scriptPath = './spi_read.py'
var args = []
console.log("Adafruit MAX 31855: Checking for muxi... |
Allow commas in assessment fees and expenses values | "use strict";
var adp = adp || {};
adp.determination = {
init : function(container_id) {
this.addChangeEvent(container_id);
},
calculateAmount: function(fee, expenses) {
var f = fee || 0,
e = expenses || 0;
f = f < 0 ? 0 : f;
e = e < 0 ? 0 : e;
var t = (f + e).toFixed(2);
t = t < ... | "use strict";
var adp = adp || {};
adp.determination = {
init : function(container_id) {
this.addChangeEvent(container_id);
},
calculateAmount: function(fee, expenses) {
var f = fee || 0,
e = expenses || 0;
f = f < 0 ? 0 : f;
e = e < 0 ? 0 : e;
var t = (f + e).toFixed(2);
t = t < ... |
Create both admin test user and no permissions test user | 'use strict'
process.env.NODE_ENV = 'testing'
let db = require('../api/db').db
let User = require('../api/db').User
let bcrypt = require('bcrypt')
let winston = require('winston')
db.sync({ force: true }).then(function () {
bcrypt.hash('testuser', 16, function (error, hash) {
let adminTestUser = {
email:... | 'use strict'
process.env.NODE_ENV = 'testing'
let db = require('../api/db').db
let User = require('../api/db').User
let bcrypt = require('bcrypt')
let winston = require('winston')
db.sync({ force: true }).then(function () {
bcrypt.hash('testuser', 16, function (error, hash) {
let testUser = {
email: 'sup... |
Remove the now unused Log import | <?php
namespace Rogue\Services;
use Softonic\GraphQL\ClientBuilder;
class GraphQL
{
/**
* Build a new GraphQL client.
*/
public function __construct()
{
$this->client = ClientBuilder::build(config('services.graphql.url'));
}
/**
* Run a GraphQL query using the client and r... | <?php
namespace Rogue\Services;
use Illuminate\Support\Facades\Log;
use Softonic\GraphQL\ClientBuilder;
class GraphQL
{
/**
* Build a new GraphQL client.
*/
public function __construct()
{
$this->client = ClientBuilder::build(config('services.graphql.url'));
}
/**
* Run a ... |
Add rotation of CSRF token to prevent form resubmission | from django.shortcuts import render, HttpResponse
from django.shortcuts import HttpResponseRedirect
from django.template import Context, Template
from django.middleware.csrf import rotate_token
from models import UploadFileForm
from models import extGenOptimizer1
OPTIONS = """
header: {
left: 'prev,next today',
cent... | from django.shortcuts import render, HttpResponse
from django.shortcuts import HttpResponseRedirect
from django.template import Context, Template
from models import UploadFileForm
from models import extGenOptimizer1
OPTIONS = """
header: {
left: 'prev,next today',
center: 'title',
right: 'month,agendaWeek',
},
defau... |
Return string instead of list | # encoding=utf8
from lxml import html
import json
def _recursive_convert(element):
# All strings outside tags should be ignored
fragment_root_element = {
'_': element.tag
}
content = []
if element.text:
content.append({'t': element.text})
if element.attrib:
fragment_... | # encoding=utf8
from lxml import html
def _recursive_convert(element):
# All strings outside tags should be ignored
if not isinstance(element, html.HtmlElement):
return
fragment_root_element = {
'_': element.tag
}
content = []
if element.text:
content.append({'t': ele... |
Add copyright to source files | /*
Copyright (c) 2013, Yahoo! Inc. All rights reserved.
Copyrights licensed under the New BSD License.
See the accompanying LICENSE file for terms.
*/
'use strict';
var walk = require('rework-walk');
exports.prefix = prefixSelector;
exports.replace = replaceSelector;
function prefixSelector(prefix) {
retur... | 'use strict';
var walk = require('rework-walk');
exports.prefix = prefixSelector;
exports.replace = replaceSelector;
function prefixSelector(prefix) {
return function (style) {
walk(style, function (rule) {
if (!rule.selectors) { return; }
rule.selectors = rule.selectors.map(fun... |
Add SlideShow folder to the dependency graph. | //= require_directory ./AbstractDocument
//= require_directory ./BrowserWidget
//= require_directory ./ComponentStateManager
//= require_directory ./Desktop
//= require_directory ./DiagramWidget
//= require_directory ./DocumentEditor
//= require_directory ./FundamentalTypes
//= require_directory ./HierarchicalMe... | //= require_directory ./AbstractDocument
//= require_directory ./BrowserWidget
//= require_directory ./ComponentStateManager
//= require_directory ./Desktop
//= require_directory ./DiagramWidget
//= require_directory ./DocumentEditor
//= require_directory ./FundamentalTypes
//= require_directory ./HierarchicalMe... |
Add total monthly amount to clients container | import React, { Component } from 'react'
import ClientCard from '../views/ClientCard'
import { Container } from 'semantic-ui-react'
import styled from 'styled-components'
const StyledLeads = styled.div`
display: flex;
flex-wrap: wrap;
`
class ClientsContainer extends Component {
render() {
const clients = t... | import React, { Component } from 'react'
import ClientCard from '../views/ClientCard'
import { Container } from 'semantic-ui-react'
import styled from 'styled-components'
const StyledLeads = styled.div`
display: flex;
flex-wrap: wrap;
`
class ClientsContainer extends Component {
render() {
console.log(this... |
Include from the functions directory | //Get the required shit together
const config = require("./config.json");
const Discord = require("discord.js");
const client = new Discord.Client();
const MSS = require("./functions/");
const fs = require("fs");
var command = [];
//Login to Discord
client.login(config.API.discord);
//Include all files in the command... | //Get the required shit together
const config = require("./config.json");
const Discord = require("discord.js");
const client = new Discord.Client();
const MSS = require("./functions/");
const fs = require("fs");
var command = [];
//Login to Discord
client.login(config.API.discord);
//Include all files in the command... |
[AC-4875] Improve history sorting and remove dead comments | # MIT License
# Copyright (c) 2017 MassChallenge, Inc.
from rest_framework.response import Response
from rest_framework.views import APIView
from impact.permissions import (
V1APIPermissions,
)
from impact.v1.metadata import (
ImpactMetadata,
READ_ONLY_LIST_TYPE,
)
class BaseHistoryView(APIView):
me... | # MIT License
# Copyright (c) 2017 MassChallenge, Inc.
from rest_framework.response import Response
from rest_framework.views import APIView
from impact.permissions import (
V1APIPermissions,
)
from impact.v1.metadata import (
ImpactMetadata,
READ_ONLY_LIST_TYPE,
)
class BaseHistoryView(APIView):
me... |
[lib] Fix bug in multimedia upload
`uploadBlob` expects an array of multimedia, not a single one. | // @flow
import type { FetchJSON } from '../utils/fetch-json';
import type { UploadMultimediaResult } from '../types/media-types';
async function uploadMultimedia(
fetchJSON: FetchJSON,
multimedia: Object,
onProgress: (percent: number) => void,
abortHandler: (abort: () => void) => void,
): Promise<UploadMulti... | // @flow
import type { FetchJSON } from '../utils/fetch-json';
import type { UploadMultimediaResult } from '../types/media-types';
async function uploadMultimedia(
fetchJSON: FetchJSON,
multimedia: Object,
onProgress: (percent: number) => void,
abortHandler: (abort: () => void) => void,
): Promise<UploadMulti... |
Add more titles and suffixes | import tldextract
import pyphen
from random import choice
TITLES = ('Mister', 'Little Miss', 'Señor', 'Queen')
SUFFIXES = ('Destroyer of Worlds', 'the Monkey Botherer', 'PhD',
'Ah-gowan-gowan-gowan')
def generate_name(domain):
title = choice(TITLES)
_parts = tldextract.extract(domain)
_parts... | import tldextract
import pyphen
from random import choice
TITLES = ('Mister', 'Little Miss')
SUFFIXES = ('Destroyer of Worlds', 'the Monkey Botherer', 'PhD')
def generate_name(domain):
title = choice(TITLES)
_parts = tldextract.extract(domain)
_parts = [_parts.subdomain, _parts.domain]
parts = []
... |
Remove newline that snuck in | package certstream
import (
"time"
"github.com/gorilla/websocket"
"github.com/jmoiron/jsonq"
"github.com/pkg/errors"
)
func CertStreamEventStream(skipHeartbeats bool) (chan jsonq.JsonQuery, chan error) {
outputStream := make(chan jsonq.JsonQuery)
errStream := make(chan error)
go func() {
for {
c, _, err ... | package certstream
import (
"time"
"github.com/gorilla/websocket"
"github.com/jmoiron/jsonq"
"github.com/pkg/errors"
)
func CertStreamEventStream(skipHeartbeats bool) (chan jsonq.JsonQuery, chan error) {
outputStream := make(chan jsonq.JsonQuery)
errStream := make(chan error)
go func() {
for {
c, _, err... |
Fix displaying of Factlink Bubble
Signed-off-by: tomdev <96835dd8bfa718bd6447ccc87af89ae1675daeca@codigy.nl> | (function () {
function createIframe() {
var body = document.getElementsByTagName("body")[0];
var iframe = document.createElement("iframe");
var div = document.createElement("div");
iframe.style.display = "none";
iframe.id = "factlink-iframe";
div.id = "fl";
body.appendChild(div);
di... | (function () {
function createIframe() {
var body = document.getElementsByTagName("body")[0];
var iframe = document.createElement("iframe");
var div = document.createElement("div");
iframe.style.display = "none";
iframe.id = "factlink-iframe";
div.id = "fl";
div.style.display = "none";
... |
Fix encoding issue with legacy python (2.7) | # -*- coding: utf-8 -*-
# This software is distributed under the two-clause BSD license.
# Copyright (c) The django-ldapdb project
from django.conf import settings
import sys
import ldap.filter
def escape_ldap_filter(value):
if sys.version_info[0] < 3:
text_value = unicode(value)
else:
text_... | # -*- coding: utf-8 -*-
# This software is distributed under the two-clause BSD license.
# Copyright (c) The django-ldapdb project
from django.conf import settings
import ldap.filter
def escape_ldap_filter(value):
return ldap.filter.escape_filter_chars(str(value))
# Legacy single database support
if hasattr(set... |
Update github link to cloudenvy org | try:
from setuptools import setup
except:
from distutils.core import setup
import os
def parse_requirements(requirements_filename='requirements.txt'):
requirements = []
if os.path.exists(requirements_filename):
with open(requirements_filename) as requirements_file:
for requirement... | try:
from setuptools import setup
except:
from distutils.core import setup
import os
def parse_requirements(requirements_filename='requirements.txt'):
requirements = []
if os.path.exists(requirements_filename):
with open(requirements_filename) as requirements_file:
for requirement... |
[FEATURE] Use new validations, clean up ripple addresses express controller. | var RippleAddress = require('../models/ripple_address');
module.exports = (function(){
function create(req, res) {
req.validate('user_id', 'isInt');
req.validate('ripple_address', 'isAlpha');
req.validate('cash_amount', 'isFloat');
if (req.user.admin || (req.user.id == req.body.user_id)) {
Rippl... | var RippleAddress = require('../models/ripple_address');
function respondToValidationErrors(req, res) {
var errors = req.validationErrors();
if (errors) {
res.end({ error: util.inspect(errors) }, 400)
return;
}
}
module.exports = (function(){
function userIndex(req, res) {
RippleAddress.findAll({ where: ... |
lxd/state: Update tests with NewState usage
Signed-off-by: Thomas Parrott <6b778ce645fb0e3dde76d79eccad490955b1ae74@canonical.com> | //go:build linux && cgo && !agent
// +build linux,cgo,!agent
package state
import (
"context"
"testing"
"github.com/lxc/lxd/lxd/db"
"github.com/lxc/lxd/lxd/firewall"
"github.com/lxc/lxd/lxd/sys"
)
// NewTestState returns a State object initialized with testable instances of
// the node/cluster databases and of... | //go:build linux && cgo && !agent
// +build linux,cgo,!agent
package state
import (
"context"
"testing"
"github.com/lxc/lxd/lxd/db"
"github.com/lxc/lxd/lxd/firewall"
"github.com/lxc/lxd/lxd/sys"
)
// NewTestState returns a State object initialized with testable instances of
// the node/cluster databases and of... |
Use latest version of schemer | import setuptools
setuptools.setup(
name="Mongothon",
version="0.7.8",
author="Tom Leach",
author_email="tom@gc.io",
description="A MongoDB object-document mapping layer for Python",
license="BSD",
keywords="mongo mongodb database pymongo odm validation",
url="http://github.com/gamecha... | import setuptools
setuptools.setup(
name="Mongothon",
version="0.7.7",
author="Tom Leach",
author_email="tom@gc.io",
description="A MongoDB object-document mapping layer for Python",
license="BSD",
keywords="mongo mongodb database pymongo odm validation",
url="http://github.com/gamecha... |
Fix build.xml (add javadoc target) and fix version numbers in V8 impl
Review URL: https://chromiumcodereview.appspot.com/10693036
git-svn-id: 1dc80909446f7a7ee3e21dd4d1b8517df524e9ee@1010 fc8a088e-31da-11de-8fef-1f5ae417a2df | // Copyright (c) 2009 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.
package org.chromium.sdk.internal.v8native;
import org.chromium.sdk.Version;
/**
* Stores milestone version numbers that marks when a particular fe... | // Copyright (c) 2009 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.
package org.chromium.sdk.internal.v8native;
import org.chromium.sdk.Version;
/**
* Stores milestone version numbers that marks when a particular fe... |
Include spider name in item dedupe pipeline | # -*- coding: utf-8 -*-
# Define your item pipelines here
#
# Don't forget to add your pipeline to the ITEM_PIPELINES setting
# See: http://doc.scrapy.org/en/latest/topics/item-pipeline.html
from scrapy.exceptions import DropItem
class DuplicatesPipeline(object):
def __init__(self):
self.ids_seen = set(... | # -*- coding: utf-8 -*-
# Define your item pipelines here
#
# Don't forget to add your pipeline to the ITEM_PIPELINES setting
# See: http://doc.scrapy.org/en/latest/topics/item-pipeline.html
from scrapy.exceptions import DropItem
class DuplicatesPipeline(object):
def __init__(self):
self.ids_seen = set(... |
Add sourceIsTarget for Android client to work | package algorithms;
import graphrep.GraphRep;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
public class NNLookupFactory extends GraphAlgorithmFactory {
public NNLookupFactory(GraphRep graph) {
super(graph);
}
@Override
public List<Map<String, Object>> getPointConstraints() {
retur... | package algorithms;
import graphrep.GraphRep;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
public class NNLookupFactory extends GraphAlgorithmFactory {
public NNLookupFactory(GraphRep graph) {
super(graph);
}
@Override
public List<Map<String, Object>> getPointConstraints() {
retur... |
Support for meta and selectAccount properties.
Added meta parameter and selectAccount component property. | import Ember from 'ember';
const OPTIONS = ['clientName', 'product', 'key', 'env', 'webhook', 'longtail', 'selectAccount'];
const DEFAULT_LABEL = 'Link Bank Account';
export default Ember.Component.extend({
tagName: 'button',
type: 'button',
action: 'processPlaidToken',
attributeBindings: ['type'],
label: ... | import Ember from 'ember';
const OPTIONS = ['clientName', 'product', 'key', 'env', 'webhook', 'longtail', 'selectAccount'];
const DEFAULT_LABEL = 'Link Bank Account';
export default Ember.Component.extend({
tagName: 'button',
type: 'button',
action: 'processPlaidToken',
attributeBindings: ['type'],
label: ... |
Fix extending service provider name | <?php
/*
* This file is part of Laravel Carriers.
*
* (c) Brian Faust <hello@brianfaust.de>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
declare(strict_types=1);
/*
* This file is part of Laravel Carriers.
*
* (c) Brian Fa... | <?php
/*
* This file is part of Laravel Carriers.
*
* (c) Brian Faust <hello@brianfaust.de>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
declare(strict_types=1);
/*
* This file is part of Laravel Carriers.
*
* (c) Brian Fa... |
Remove JSON serialization usages (PY-16388, PY-16389) | import sys
IS_PY3K = False
try:
if sys.version_info[0] >= 3:
IS_PY3K = True
except AttributeError:
pass #Not all versions have sys.version_info
if IS_PY3K:
# noinspection PyUnresolvedReferences
from thriftpy3 import TSerialization
# noinspection PyUnresolvedReferences
from thriftpy3... | import sys
IS_PY3K = False
try:
if sys.version_info[0] >= 3:
IS_PY3K = True
except AttributeError:
pass #Not all versions have sys.version_info
if IS_PY3K:
# noinspection PyUnresolvedReferences
from thriftpy3 import TSerialization
# noinspection PyUnresolvedReferences
from thriftpy3... |
Add usage of nbins_cats to RF pyunit. | import sys
sys.path.insert(1, "../../../")
import h2o
def bigcatRF(ip,port):
# Connect to h2o
h2o.init(ip,port)
# Training set has 100 categories from cat001 to cat100
# Categories cat001, cat003, ... are perfect predictors of y = 1
# Categories cat002, cat004, ... are perfect predictors of y = 0
... | import sys
sys.path.insert(1, "../../../")
import h2o
def bigcatRF(ip,port):
# Connect to h2o
h2o.init(ip,port)
# Training set has 100 categories from cat001 to cat100
# Categories cat001, cat003, ... are perfect predictors of y = 1
# Categories cat002, cat004, ... are perfect predictors of y = 0
... |
Fix sort order since we now display the module logo right aligned to the module name cell | jQuery(function ($) {
setup_search_box();
$('.tablesorter').tablesorter({
sortList: [[1,0]],
headers: {
1: { sorter: 'text'},
2: { sorter: false }
}
});
});
function setup_search_box() {
var el = $('#my_search_box .search');
if ( ! el.length ) { retur... | jQuery(function ($) {
setup_search_box();
$('.tablesorter').tablesorter({
sortList: [[1,0]],
headers: {
0: { sorter: false },
1: { sorter: 'text'},
3: { sorter: false }
}
});
});
function setup_search_box() {
var el = $('#my_search_box .search... |
Add buffer test package information | /*
Copyright (c) 2014, Colorado State University
All rights reserved.
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice, this
list of conditions and ... | /*
Copyright (c) 2014, Colorado State University
All rights reserved.
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice, this
list of conditions and ... |
Reduce grid layout logic delay. | module.exports = Zeppelin.CollectionView.extend({
tagName: 'ol',
className: 'cards-list list-unstyled clearfix',
subscriptions: {
'cardsList:layout': 'triggerLayout'
},
itemView: function(model) {
return require('account/views/' + model.get('type'));
},
collection: function() {
return App.... | module.exports = Zeppelin.CollectionView.extend({
tagName: 'ol',
className: 'cards-list list-unstyled clearfix',
subscriptions: {
'cardsList:layout': 'triggerLayout'
},
itemView: function(model) {
return require('account/views/' + model.get('type'));
},
collection: function() {
return App.... |
Revert "[FIX] website_quote: make 'Pay & Confirm' work without website_sale"
No dependency change in stable version
This reverts commit 65a589eb54a1421baa71074701bea2873a83c75f. | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
{
'name': 'Online Proposals',
'category': 'Website',
'summary': 'Sales',
'website': 'https://www.odoo.com/page/quote-builder',
'version': '1.0',
'description': "",
'depends': ['website', 'sale_... | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
{
'name': 'Online Proposals',
'category': 'Website',
'summary': 'Sales',
'website': 'https://www.odoo.com/page/quote-builder',
'version': '1.0',
'description': "",
'depends': ['website', 'sale_... |
Improve print message for the server address | #!/usr/bin/env python3
import subprocess
import sys
def main():
ip = '127.0.0.1'
port = 5000
workers_count = 4
if len(sys.argv) > 1:
for arg in sys.argv[1:]:
if ':' in arg:
ip, port = arg.split(':')
port = int(port)
break
... | #!/usr/bin/env python3
import subprocess
import sys
def main():
ip = '127.0.0.1'
port = 5000
workers_count = 4
if len(sys.argv) > 1:
for arg in sys.argv[1:]:
if ':' in arg:
ip, port = arg.split(':')
port = int(port)
break
... |
Change from IDs to pl-js- classes | /*!
* Simple Layout Rendering for Pattern Lab
*
* Copyright (c) 2014 Dave Olsen, http://dmolsen.com
* Licensed under the MIT license
*/
try {
/* load pattern nav */
var template = document.querySelector(".pl-js-pattern-nav-template");
var templateCompiled = Hogan.compile(template.innerHTML);
va... | /*!
* Simple Layout Rendering for Pattern Lab
*
* Copyright (c) 2014 Dave Olsen, http://dmolsen.com
* Licensed under the MIT license
*/
try {
/* load pattern nav */
var template = document.getElementById("pl-pattern-nav-template");
var templateCompiled = Hogan.compile(template.innerHTML);
var t... |
Increase integration cli test memory
Signed-off-by: Euan <82ce0a5f500076a0414f27984d8e19adc458729b@amazon.com> | // +build !windows
package main
import (
"github.com/docker/docker/pkg/integration/checker"
"github.com/go-check/check"
)
func (s *DockerSuite) TestInspectOomKilledTrue(c *check.C) {
testRequires(c, DaemonIsLinux, memoryLimitSupport)
name := "testoomkilled"
_, exitCode, _ := dockerCmdWithError("run", "--name",... | // +build !windows
package main
import (
"github.com/docker/docker/pkg/integration/checker"
"github.com/go-check/check"
)
func (s *DockerSuite) TestInspectOomKilledTrue(c *check.C) {
testRequires(c, DaemonIsLinux, memoryLimitSupport)
name := "testoomkilled"
_, exitCode, _ := dockerCmdWithError("run", "--name",... |
refactor(match): Change for loop to Array.find | import resolveNode from "./resolveNode";
// import {resolve} from "path";
export default function (filename, regexps, root, extensions) {
const redirectPair = regexps.find(([regexp]) => regexp.test(filename));
if(redirectPair) {
let [regexp, redirect] = redirectPair;
console.log("FOUND MATCH", regexp);
conso... | import resolveNode from "./resolveNode";
// import {resolve} from "path";
export default function (filename, regexps, root, extensions) {
for(let redirectPair of regexps) {
const regexp = redirectPair[0];
if(regexp.test(filename)) {
console.log("FOUND MATCH", regexp);
let redirect = redirectPair[1];
c... |
Replace deprecated use of `bw.openDevTools` | var app = require('app'); // Module to control application life.
var BrowserWindow = require('browser-window'); // Module to create native browser window.
// Report crashes to our server.
require('crash-reporter').start();
// Keep a global reference of the window object, if you don't, the window will
// be closed a... | var app = require('app'); // Module to control application life.
var BrowserWindow = require('browser-window'); // Module to create native browser window.
// Report crashes to our server.
require('crash-reporter').start();
// Keep a global reference of the window object, if you don't, the window will
// be closed a... |
[Bugfix] Correct misspelled method name 'contant' to 'constant' | (function() {
'use strict';
angular.module('app', [
'app.config',
'app.core',
'app.feature'
]);
angular.module('app').config([
'$logProvider', 'LOG', '$locationProvider',
function($logProvider, log, $locationProvider) {
// Enable or disable debug logging
$logProvider.debugEnabl... | (function() {
'use strict';
angular.module('app', [
'app.config',
'app.core',
'app.feature'
]);
angular.module('app').config([
'$logProvider', 'LOG', '$locationProvider',
function($logProvider, log, $locationProvider) {
// Enable or disable debug logging
$logProvider.debugEnabl... |
Make a variable out of the refresh timeout for testing purposes | package cache
import (
"encoding/json"
"github.com/centurylinkcloud/clc-go-cli/state"
"time"
)
var (
LONG_AUTOCOMPLETE_REFRESH_TIMEOUT = 30 // seconds
)
func Put(key string, opts []string) {
data, err := json.Marshal(opts)
if err == nil {
state.WriteToFile(data, key, 0666)
}
}
func Get(key string) ([]strin... | package cache
import (
"encoding/json"
"github.com/centurylinkcloud/clc-go-cli/state"
"time"
)
const (
LONG_AUTOCOMPLETE_REFRESH_TIMEOUT = 30 // seconds
)
func Put(key string, opts []string) {
data, err := json.Marshal(opts)
if err == nil {
state.WriteToFile(data, key, 0666)
}
}
func Get(key string) ([]str... |
Update Marbles.State: Add willUpdate/didUpdate hooks | //= require ./core
(function () {
"use strict";
/*
* State object mixin
*
* Requires Object `state` and Array `__changeListeners` properties
*/
Marbles.State = {
addChangeListener: function (handler) {
this.__changeListeners.push(handler);
},
removeChangeListener: function (handler) {
this.__changeListen... | //= require ./core
(function () {
"use strict";
/*
* State object mixin
*
* Requires Object `state` and Array `__changeListeners` properties
*/
Marbles.State = {
addChangeListener: function (handler) {
this.__changeListeners.push(handler);
},
removeChangeListener: function (handler) {
this.__changeListen... |
Fix textarea / label association | var html = require('choo/html')
var picoModal = require('picomodal')
var _ = require('../util')
module.exports = function (props, emit) {
var moves = _.chunksOf(2, props.game.game.moveHistory)
.map(function (move, idx) {
return (idx + 1) + '. ' + move[0].algebraic + (move[1] ? (' ' + move[1].algebraic) : '... | var html = require('choo/html')
var picoModal = require('picomodal')
var _ = require('../util')
module.exports = function (props, emit) {
var moves = _.chunksOf(2, props.game.game.moveHistory)
.map(function (move, idx) {
return (idx + 1) + '. ' + move[0].algebraic + (move[1] ? (' ' + move[1].algebraic) : '... |
Add conditional logic to support asset path resolution for both autocomplete-python and atom-plugin. | const fs = require('fs');
const path = require('path');
let LogoPath = '../../../assets/logo.svg';
let LogoSmallPath = '../../../assets/logo-small.svg';
let ScreenshotPath = '../../../assets/plotscreenshot.png';
let DemoVideoPath = '../../../assets/demo.mp4';
let InstallLessPath = '../../../styles/install.less';
// E... | const fs = require('fs');
const path = require('path');
const WEBPACK_FILELOADER_PATH_KEY = "default";
const LogoPath = require('../../../assets/logo.svg')[WEBPACK_FILELOADER_PATH_KEY];
const LogoSmallPath = require('../../../assets/logo-small.svg')[WEBPACK_FILELOADER_PATH_KEY];
const ScreenshotPath = require('../../... |
Add console logging to script | var _ = require('underscore');
var AWS = require('aws-sdk');
var moment = require('moment');
var DynamoBackup = require('./lib/dynamo-backup');
var runningAsScript = require.main === module;
if (runningAsScript) {
var runTimes = {};
var dynamoBackup = new DynamoBackup({ bucket: 'markitx-backups-test', stopO... | var _ = require('underscore');
var AWS = require('aws-sdk');
var moment = require('moment');
var path = require('path');
var async = require('async');
var Uploader = require('s3-streaming-upload').Uploader;
var DynamoBackup = require('./lib/dynamo-backup');
var runningAsScript = require.main === module;
if (running... |
Check if brfss data for years 2000 to 2010 available | from survey_stats.datasets import SurveyDataset
from survey_stats import log
lgr = log.getLogger(__name__)
dset = {}
def initialize(dbc, cache, init_des, use_feather, init_svy, init_soc):
lgr.info('was summoned into being, loading up some data', dbc=dbc, cache=cache, use_feather=use_feather)
dset['brfss'] =... | from survey_stats.datasets import SurveyDataset
from survey_stats import log
lgr = log.getLogger(__name__)
dset = {}
def initialize(dbc, cache, init_des, use_feather, init_svy, init_soc):
lgr.info('was summoned into being, loading up some data', dbc=dbc, cache=cache, use_feather=use_feather)
dset['brfss'] =... |
Add placeholder attribute to textarea | <?php namespace Laraplus\Form\Fields;
use Laraplus\Form\Fields\Base\Element;
class TextArea extends Element
{
/**
* @param string $cols
* @return $this
*/
public function cols($cols)
{
$this->attributes['cols'] = $cols;
return $this;
}
/**
* @param string $row... | <?php namespace Laraplus\Form\Fields;
use Laraplus\Form\Fields\Base\Element;
class TextArea extends Element
{
/**
* @param string $cols
* @return $this
*/
public function cols($cols)
{
$this->attributes['cols'] = $cols;
return $this;
}
/**
* @param string $row... |
Use only absolute imports for python 3 | """This package contains interface adapters for pandas.
On import, this package detects if pandas is installed. If it is installed,
then the contained modules are imported to register the pandas classes with
Gaia. If pandas is not found, this package will contain no modules.
"""
try:
import pandas
except Impor... | """This package contains interface adapters for pandas.
On import, this package detects if pandas is installed. If it is installed,
then the contained modules are imported to register the pandas classes with
Gaia. If pandas is not found, this package will contain no modules.
"""
try:
import pandas
except Impor... |
Fix a bug with an empty database | from pages.models import Page, Language, Content
from pages.utils import auto_render
from django.contrib.admin.views.decorators import staff_member_required
from django import forms
from django.http import Http404
import settings
@auto_render
def details(request, page_id=None):
template = None
lang = Language.... | from pages.models import Page, Language, Content
from pages.utils import auto_render
from django.contrib.admin.views.decorators import staff_member_required
from django import forms
from django.http import Http404
import settings
@auto_render
def details(request, page_id=None):
template = None
lang = Language.... |
Fix profile photo upload indentation | <?
require_once('php/classes/member.php');
$profileEdited = $currentUser;
// TODO: Allow administrators to edit other member's profile pictures
?><div class="row">
<div class="large-12 columns">
<h1>Edit Profile Picture: <?=$profileEdited->rcsid()?></h1>
<p>This picture is displayed publicly on the "About Us... | <?
require_once('php/classes/member.php');
$profileEdited = $currentUser;
// TODO: Allow administrators to edit other member's profile pictures
?><div class="row">
<div class="large-12 columns">
<h1>Edit Profile Picture: <?=$profileEdited->rcsid()?></h1>
<p>This picture is displayed publicly on the "About Us... |
Make some util functions static | package com.impossibl.stencil.api.impl;
import java.io.IOException;
import java.io.Reader;
import java.io.StringReader;
import java.net.URI;
import com.google.common.hash.Hashing;
import com.impossibl.stencil.api.TemplateSource;
public class InlineTemplateSource implements TemplateSource {
URI uri;
String text;
... | package com.impossibl.stencil.api.impl;
import java.io.IOException;
import java.io.Reader;
import java.io.StringReader;
import java.net.URI;
import com.google.common.hash.Hashing;
import com.impossibl.stencil.api.TemplateSource;
public class InlineTemplateSource implements TemplateSource {
URI uri;
String text;
... |
Add stability annotation to ol.source.TopoJSON | goog.provide('ol.source.TopoJSON');
goog.require('ol.format.TopoJSON');
goog.require('ol.source.VectorFile');
/**
* @constructor
* @extends {ol.source.VectorFile}
* @param {olx.source.TopoJSONOptions=} opt_options Options.
* @todo stability experimental
*/
ol.source.TopoJSON = function(opt_options) {
var op... | goog.provide('ol.source.TopoJSON');
goog.require('ol.format.TopoJSON');
goog.require('ol.source.VectorFile');
/**
* @constructor
* @extends {ol.source.VectorFile}
* @param {olx.source.TopoJSONOptions=} opt_options Options.
*/
ol.source.TopoJSON = function(opt_options) {
var options = goog.isDef(opt_options) ... |
Fix bug when no tools were installed | import React from 'react'
import ToolSwitcher from './ToolSwitcher'
import RenderTool from './RenderTool'
import {Router, Route, NotFound, Redirect} from 'router:@sanity/base/router'
import styles from '../styles/DefaultLayout.css'
import tools from 'all:tool:@sanity/base/tool'
import absolutes from 'all:component:@san... | import React from 'react'
import ToolSwitcher from './ToolSwitcher'
import RenderTool from './RenderTool'
import {Router, Route, NotFound, Redirect} from 'router:@sanity/base/router'
import styles from '../styles/DefaultLayout.css'
import tools from 'all:tool:@sanity/base/tool'
import absolutes from 'all:component:@san... |
Comment out wemo stuff for now. | """Wemo proxy code."""
import logging
import sys
import threading
#from wemo import upnp
class Wemo(object):
"""Hue proxy object."""
def __init__(self, refresh_period, callback):
self._refresh_period = refresh_period
self._callback = callback
def _wemo_callback(self, address, headers):
logging.in... | """Wemo proxy code."""
import logging
import sys
import threading
from wemo import upnp
class Wemo(object):
"""Hue proxy object."""
def __init__(self, refresh_period, callback):
self._refresh_period = refresh_period
self._callback = callback
def _wemo_callback(self, address, headers):
logging.inf... |
Send JWT token with file uploads | import Ember from 'ember';
import EmberUploader from 'ember-uploader';
const { FileField, Uploader } = EmberUploader;
const { inject, computed } = Ember;
const { service } = inject;
let IliosUploader = Uploader.extend({
iliosHeaders: [],
ajaxSettings: computed('iliosHeaders.[]', function() {
return {
he... | import Ember from 'ember';
import EmberUploader from 'ember-uploader';
const { FileField, Uploader } = EmberUploader;
const { inject, computed } = Ember;
const { service } = inject;
let IliosUploader = Uploader.extend({
iliosHeaders: [],
ajaxSettings: function() {
let settings = this._super(...arguments);
... |
Fix style loading in production. | import React from 'react'
import ReactDOM from 'react-dom'
import {Router, browserHistory} from 'react-router'
import configureStore from './store'
import {Provider} from 'react-redux'
import {syncHistoryWithStore} from 'react-router-redux'
import APIUtils from './utils/APIUtils'
import { AppContainer } from 'react-hot... | import React from 'react'
import ReactDOM from 'react-dom'
import {Router, browserHistory} from 'react-router'
import configureStore from './store'
import {Provider} from 'react-redux'
import {syncHistoryWithStore} from 'react-router-redux'
import APIUtils from './utils/APIUtils'
import { AppContainer } from 'react-hot... |
Remove .only from test case | var should = require('should');
var QueryCompiler = require('../lib/compiler');
describe('QueryCompiler', function () {
describe('compile', function () {
it('compile ne null query', function () {
var query = {
attachmentId: { $ne: null }
};
var compiler = new QueryCompiler();
shou... | var should = require('should');
var QueryCompiler = require('../lib/compiler');
describe('QueryCompiler', function () {
describe.only('compile', function () {
it('compile ne null query', function () {
var query = {
attachmentId: { $ne: null }
};
var compiler = new QueryCompiler();
... |
Fix webpack hot module reload | var path = require('path');
var webpack = require('webpack');
module.exports = {
entry: {
app: ['./static/js/src/app.js'],
},
output: {
path: 'static/js/build/',
pathInfo: true,
publicPath: '/static/js/build/',
filename: 'tchaik.js'
},
devtool: 'inline-source-maps',
plugins: [
ne... | var path = require('path');
var webpack = require('webpack');
module.exports = {
entry: {
app: ['./static/js/src/app.js'],
},
output: {
path: 'static/js/build',
pathInfo: true,
publicPath: '/static/js/build',
filename: 'tchaik.js'
},
devtool: 'inline-source-maps',
plugins: [
new ... |
Change author and bump version. | from __future__ import absolute_import
from pyelasticsearch.client import ElasticSearch
from pyelasticsearch.exceptions import (Timeout, ConnectionError,
ElasticHttpError,
InvalidJsonResponseError,
E... | from __future__ import absolute_import
from pyelasticsearch.client import ElasticSearch
from pyelasticsearch.exceptions import (Timeout, ConnectionError,
ElasticHttpError,
InvalidJsonResponseError,
E... |
Update parcel bundler to use correct package name | module.exports = {
presetPackages: [
['browserify', 'webpack', 'rollup', 'parcel-bundler'],
['recompose', 'mobx'],
[
'glamor',
'aphrodite',
'radium',
'glamorous',
'styled-components',
'jss',
'emotion',
],
// ['lodash', 'underscore'],
['node-sass', 'les... | module.exports = {
presetPackages: [
['browserify', 'webpack', 'rollup', 'parcel'],
['recompose', 'mobx'],
[
'glamor',
'aphrodite',
'radium',
'glamorous',
'styled-components',
'jss',
'emotion',
],
// ['lodash', 'underscore'],
['node-sass', 'less', 'sty... |
fix(referrals-invite): Fix sms link for iOS | (function () {
'use strict';
console.log('test');
var smsElem = $('#invite_sms');
var emailElem = $('#invite_email');
var codeElem = $('#invitation_code');
rogerthat.callbacks.ready(function () {
console.log('rogerthat is ready');
var code = rogerthat.user.data.invitation_code;
var userName = ro... | (function () {
'use strict';
console.log('test');
var smsElem = $('#invite_sms');
var emailElem = $('#invite_email');
var codeElem = $('#invitation_code');
rogerthat.callbacks.ready(function () {
console.log('rogerthat is ready');
var code = rogerthat.user.data.invitation_code;
var userName = ro... |
fix(key): Add QueryParameters in Key struct to fix typo | package algoliasearch
type Key struct {
ACL []string `json:"acl"`
CreatedAt int `json:"createdAt,omitempty"`
Description string `json:"description,omitempty"`
Indexes []string `json:"indexes,omitempty"`
MaxHitsPerQuery int `json:"maxHits... | package algoliasearch
type Key struct {
ACL []string `json:"acl"`
CreatedAt int `json:"createdAt,omitempty"`
Description string `json:"description,omitempty"`
Indexes []string `json:"indexes,omitempty"`
MaxHitsPerQuery int `json:"maxHits... |
Add the Routing's cacheTime option | <?php
/**
* Config
*
* @author Virgil-Adrian Teaca - virgil@giulianaeassociati.com
* @version 3.0
*/
use Nova\Config\Config;
/**
* PREFER to be used in Database calls or storing Session data, default is 'nova_'
*/
define('PREFIX', 'nova_');
/**
* Setup the Config API Mode.
* For using the 'database' mode, y... | <?php
/**
* Config
*
* @author Virgil-Adrian Teaca - virgil@giulianaeassociati.com
* @version 3.0
*/
use Nova\Config\Config;
/**
* PREFER to be used in Database calls or storing Session data, default is 'nova_'
*/
define('PREFIX', 'nova_');
/**
* Setup the Config API Mode.
* For using the 'database' mode, y... |
Add function for accumulating disable validator reject approvals count | package keeper
import (
"fmt"
"math"
"github.com/cosmos/cosmos-sdk/codec"
sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/tendermint/tendermint/libs/log"
"github.com/zigbee-alliance/distributed-compliance-ledger/x/validator/types"
)
type (
Keeper struct {
cdc codec.BinaryCodec
storeKey sdk.Store... | package keeper
import (
"fmt"
"math"
"github.com/cosmos/cosmos-sdk/codec"
sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/tendermint/tendermint/libs/log"
"github.com/zigbee-alliance/distributed-compliance-ledger/x/validator/types"
)
type (
Keeper struct {
cdc codec.BinaryCodec
storeKey sdk.Store... |
Add test for force_pathable_endpoint pathfind param
This parameter is intended to allow pathing to adjacent squares
of an unpassable square. This is necessary because if you want to
pathfind to a monster which blocks a square, you don't want to
actually go *onto* the square, you just want to go next to it,
presumably ... | import unittest
from hunting.level.map import LevelTile, LevelMap
class TestPathfinding(unittest.TestCase):
def test_basic_diagonal(self):
level_map = LevelMap([[LevelTile() for _ in range(0, 5)] for _ in range(0, 5)])
self.assertEqual([(1, 1), (2, 2), (3, 3), (4, 4)], level_map.a_star_path(0, 0... | import unittest
from hunting.level.map import LevelTile, LevelMap
class TestPathfinding(unittest.TestCase):
def test_basic_diagonal(self):
level_map = LevelMap()
level_map.set_map([[LevelTile() for _ in range(0, 5)] for _ in range(0, 5)])
self.assertEqual([(1, 1), (2, 2), (3, 3), (4, 4)]... |
Set "new Scanner()" to "f" :pencil2: | import java.io.File;
public class Wift {
/**
* Wift - The BASIC Programming Language
*
* BASIC FUNCTIONALITY:
* - STRINGS []
* - INTEGERS []
* - ARITHMETIC []
* - VARIABLES []
*
* FUNCTIONS:
* - PRINT []
* ... | import java.io.File;
public class Wift {
/**
* Wift - The BASIC Programming Language
*
* BASIC FUNCTIONALITY:
* - STRINGS []
* - INTEGERS []
* - ARITHMETIC []
* - VARIABLES []
*
* FUNCTIONS:
* - PRINT []
* ... |
Select one Question at random. | var models = require('../models');
var express = require('express');
var router = express.Router();
/* GET home page. */
router.get('/', function(req, res, next) {
models.Question.find({
include: [{ model: models.Choice }],
order: [ models.sequelize.fn('RANDOM') ]
})
.then(function(question) {
return... | var models = require('../models');
var express = require('express');
var router = express.Router();
/* GET home page. */
router.get('/', function(req, res, next) {
models.Question.findAll({
include: [{ model: models.Choice }]
})
.then(function(questions) {
var qs = questions.map(function(question) {
... |
Allow unsafeInstance() for ppc64le archiecture | package net.jpountz.util;
/*
* 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 wri... | package net.jpountz.util;
/*
* 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 wri... |
Enable rules that already pass
These rules pass with our current codebase and require no changes. | /* eslint-env node */
'use strict';
var defaultAllowedBaseStrings = ['(', ')', ',', '.', '&', '+', '-', '=', '*', '/', '#', '%', '!', '?', ':', '[', ']', '{', '}', '<', '>', '•', '—', ' ', '|'];
module.exports = {
extends: 'recommended',
rules: {
'bare-strings': ['?', '»', '—'].concat(defaultAllowedBase... | /* eslint-env node */
'use strict';
var defaultAllowedBaseStrings = ['(', ')', ',', '.', '&', '+', '-', '=', '*', '/', '#', '%', '!', '?', ':', '[', ']', '{', '}', '<', '>', '•', '—', ' ', '|'];
module.exports = {
extends: 'recommended',
rules: {
'bare-strings': ['?', '»', '—'].concat(defaultAllowedBase... |
Resolve name conflict between commands "list" and "retrieve" | package main
import (
"fmt"
"github.com/atotto/clipboard"
)
func init() {
registerSubcommand(&Subcommand{
Name: "retrieve",
Aliases: []string{"r", "checkout", "co"},
Usage: "<website> [username]",
Hint: "Load a password from storage to clipboard",
Handler: cmdRetrieve,
})
}
func cmdRetrieve(ar... | package main
import (
"fmt"
"github.com/atotto/clipboard"
)
func init() {
registerSubcommand(&Subcommand{
Name: "retrieve",
Aliases: []string{"r", "load", "l", "checkout", "co"},
Usage: "<website> [username]",
Hint: "Load a password from storage to clipboard",
Handler: cmdRetrieve,
})
}
func c... |
Include valueName in results for consistency with other converters | /**
* Copyright (C) 2011 - present by OpenGamma Inc. and the OpenGamma group of companies
*
* Please see distribution for license.
*/
package com.opengamma.financial.conversion;
import java.util.HashMap;
import java.util.Map;
import com.opengamma.financial.analytics.LabelledMatrix1D;
/**
*
*/
public class Lab... | /**
* Copyright (C) 2011 - present by OpenGamma Inc. and the OpenGamma group of companies
*
* Please see distribution for license.
*/
package com.opengamma.financial.conversion;
import java.util.HashMap;
import java.util.Map;
import com.opengamma.financial.analytics.LabelledMatrix1D;
/**
*
*/
public class Lab... |
Load to structs from config yaml file | package main
import (
"flag"
"fmt"
"io/ioutil"
yaml "gopkg.in/yaml.v2"
"github.com/aws/aws-sdk-go/aws/session"
"github.com/aws/aws-sdk-go/service/cloudwatchevents"
)
func main() {
var apply bool
var dryrun bool
var file string
flag.BoolVar(&apply, "apply", false, "apply to CloudWatch Events")
flag.BoolV... | package main
import (
"flag"
"fmt"
"github.com/aws/aws-sdk-go/aws/session"
"github.com/aws/aws-sdk-go/service/cloudwatchevents"
)
func main() {
var apply bool
var dryrun bool
var file string
flag.BoolVar(&apply, "apply", false, "apply to CloudWatch Events")
flag.BoolVar(&dryrun, "dry-run", false, "dry-run"... |
Use lazy regex for parsing html <title/>
/* returns: 'foo</title>bar<title>baz' */
/<title>(.+)<\/title>/.exec('<title>foo</title>bar<title>baz</title>')[1]
/* returns: 'foo' */
/<title>(.+?)<\/title>/.exec('<title>foo</title>bar<title>baz</title>')[1] | 'use strict';
var httpclient = require('../../http-client');
function messageListener(db, from, channel, message) {
var match = /(https?:\/\/[^ ]+)/.exec(message)
if (match) {
var res = httpclient(db, match[1]);
var match = /<title>(.+?)<\/title>/.exec(res);
if (match) {
var decoded = match[... | 'use strict';
var httpclient = require('../../http-client');
function messageListener(db, from, channel, message) {
var match = /(https?:\/\/[^ ]+)/.exec(message)
if (match) {
var res = httpclient(db, match[1]);
var match = /<title>(.+)<\/title>/.exec(res);
if (match) {
var decoded = match[1... |
Hide storage reservation and persistent volume claims
https://github.com/rancher/rancher/issues/14859 | import { get, set } from '@ember/object';
import { inject as service } from '@ember/service';
import Component from '@ember/component';
import layout from './template';
const IGNORED = ['requestsStorage', 'persistentVolumeClaims'];
export default Component.extend({
globalStore: service(),
layout,
tagName: ... | import { get, set } from '@ember/object';
import { inject as service } from '@ember/service';
import Component from '@ember/component';
import layout from './template';
export default Component.extend({
globalStore: service(),
layout,
tagName: 'TR',
classNames: 'main-row',
resourceChoices: null,
in... |
Restructure GPX according to GPX schema | define(['jquery'], function($) {
function Gpx($gpx) {
var tracks = [];
$gpx.find("trk").each(function() {
tracks.push(new Track($(this)));
});
this.tracks = tracks;
}
function Track($trk) {
this.name = $trk.find("name").text();
var trackSegments = [];
$trk.find("trkseg").each(function() {
track... | define(['jquery'], function($) {
function Gpx(data) {
this.points = [];
var trkpts = data.documentElement.getElementsByTagName("trkpt");
for (var i = 0; i < trkpts.length; i++) {
var trkpt = trkpts[i];
var lat = parseFloat(trkpt.getAttribute("lat"));
var lon = parseFloat(trkpt.getAttribute("lon"));
... |
Deal with errors in a more humane way | // Require the http module and the proxy module
var http = require('http'),
httpProxy = require('http-proxy'),
routes = require('./config/routes');
console.log(routes);
// Create the proxy
var proxy = httpProxy.createProxyServer({});
// Setup the proxy server and determine routing
var server = http.cr... | // Require the http module and the proxy module
var http = require('http'),
httpProxy = require('http-proxy'),
routes = require('./config/routes');
console.log(routes);
// Create the proxy
var proxy = httpProxy.createProxyServer({});
// Setup the proxy server and determine routing
var server = http.cr... |
Fix division by zero error when calculating tax rate on migration. | # Generated by Django 3.1.6 on 2021-02-20 15:24
from django.db import migrations
from django.db.models import F
def calculate_taxrate(apps, schema_editor):
'''
Calculate the tax rate based on current totals for any InvoiceItem that
does not currently have a tax rate, so that we can make taxRate non-nulla... | # Generated by Django 3.1.6 on 2021-02-20 15:24
from django.db import migrations
from django.db.models import F
def calculate_taxrate(apps, schema_editor):
'''
Calculate the tax rate based on current totals for any InvoiceItem that
does not currently have a tax rate, so that we can make taxRate non-nulla... |
Allow setting email when creating a staff account.
Otherwise makes it hard to start using HomePort as it requires email validation. | from django.contrib.auth import get_user_model
from django.core.management.base import BaseCommand, CommandError
from django.utils import timezone
class Command(BaseCommand):
help = "Create a user with a specified username and password. User will be created as staff."
def add_arguments(self, parser):
... | from django.contrib.auth import get_user_model
from django.core.management.base import BaseCommand, CommandError
from django.utils import timezone
class Command(BaseCommand):
help = "Create a user with a specified username and password. User will be created as staff."
def add_arguments(self, parser):
... |
Add course: opens new page correctly in ROLE | /**
* @file courses-widget.js
* Additional js functions if the course-overview is loaded as separate widget
*/
/**
* change normal overview page to separate widget page
*/
function initCourseOverviewWidget(){
// add url-parameter widget=true to all course page links
var aElememts = document.getElementsByTag... | /**
* @file courses-widget.js
* Additional js functions if the course-overview is loaded as separate widget
*/
/**
* change normal overview page to separate widget page
*/
function initCourseOverviewWidget(){
// add url-parameter widget=true to all course page links
var aElememts = document.getElementsByTag... |
Adjust search expander so that it closes when no child elements are focused | // JavaScript Document
// Scripts written by __gulp_init_author_name__ @ __gulp_init_author_company__
const SEARCH_TOGGLE = document.querySelector("[data-toggle=mobile-search]");
const SEARCH_FORM = document.querySelector("#mobile-search");
const SEARCH_INPUT = SEARCH_FORM ? SEARCH_FORM.querySelector("input[... | // JavaScript Document
// Scripts written by __gulp_init_author_name__ @ __gulp_init_author_company__
const SEARCH_TOGGLE = document.querySelector("[data-toggle=mobile-search]");
const SEARCH_FORM = document.querySelector("#mobile-search");
const SEARCH_INPUT = SEARCH_FORM ? SEARCH_FORM.querySelector("input[type=s... |
Simplify readable concat w/ Buffer.isBuffer and [].map | 'use strict'
var toArray = require('stream-to-array')
var Promise = require('bluebird')
module.exports = streamToPromise
function streamToPromise (stream) {
var promise
if (stream.readable) {
promise = fromReadable(stream)
} else if (stream.writable) {
promise = fromWritable(stream)
} else {
prom... | 'use strict'
var toArray = require('stream-to-array')
var Promise = require('bluebird')
module.exports = streamToPromise
function streamToPromise (stream) {
var promise
if (stream.readable) {
promise = fromReadable(stream)
} else if (stream.writable) {
promise = fromWritable(stream)
} else {
prom... |
Change Ace editor default size. | /**
* @license
* Copyright 2019 The FOAM Authors. All Rights Reserved.
* http://www.apache.org/licenses/LICENSE-2.0
*/
foam.CLASS({
package: 'io.c9.ace',
name: 'Config',
properties: [
{
class: 'Int',
name: 'height',
value: 400
},
{
class: 'Int',
name: 'width',
... | /**
* @license
* Copyright 2019 The FOAM Authors. All Rights Reserved.
* http://www.apache.org/licenses/LICENSE-2.0
*/
foam.CLASS({
package: 'io.c9.ace',
name: 'Config',
properties: [
{
class: 'Int',
name: 'height',
value: 500
},
{
class: 'Int',
name: 'width',
... |
Allow "-" chars in the resync view | # Amara, universalsubtitles.org
#
# Copyright (C) 2013 Participatory Culture Foundation
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your op... | # Amara, universalsubtitles.org
#
# Copyright (C) 2013 Participatory Culture Foundation
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your op... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.