text stringlengths 16 4.96k | positive stringlengths 321 2.24k | negative stringlengths 310 2.21k |
|---|---|---|
Fix clicking on dots bug | import React, { Component, PropTypes } from 'react';
import {districtColors, partyData} from './Constants';
class Precinct extends Component {
renderDots(dots, party) {
const color = party ? partyData[party].color: "black";
// TODO(benkraft): make dots clickable too
return dots && dots.map(({x, y}, i) =>... | import React, { Component, PropTypes } from 'react';
import {districtColors, partyData} from './Constants';
class Precinct extends Component {
renderDots(dots, party) {
const color = party ? partyData[party].color: "black";
// TODO(benkraft): make dots clickable too
return dots && dots.map(({x, y}, i) =>... |
OAK-2954: Add MBean to enforce session refresh on all open sessions
Update package export version as required
git-svn-id: 67138be12999c61558c3dd34328380c8e4523e73@1683423 13f79535-47bb-0310-9956-ffa450edef68 | /*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you ... | /*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you ... |
Apply revert to the draft page. | # -*- coding: utf-8 -*-
from cms.management.commands.subcommands.base import SubcommandsCommand
from cms.models import CMSPlugin
from cms.models.pagemodel import Page
from django.core.management.base import NoArgsCommand
class ModeratorOnCommand(NoArgsCommand):
help = 'Turn moderation on, run AFTER upgrading to 2... | # -*- coding: utf-8 -*-
from cms.management.commands.subcommands.base import SubcommandsCommand
from cms.models import CMSPlugin
from cms.models.pagemodel import Page
from django.core.management.base import NoArgsCommand
class ModeratorOnCommand(NoArgsCommand):
help = 'Turn moderation on, run AFTER upgrading to 2... |
Remove final of 'has' method | <?php
namespace Bauhaus;
use Bauhaus\Container\ItemNotFoundException;
class Container implements ContainerInterface
{
private $items = [];
public function __construct(array $items = [])
{
$this->items = $items;
}
public function has($label)
{
return array_key_exists($label, ... | <?php
namespace Bauhaus;
use Bauhaus\Container\ItemNotFoundException;
class Container implements ContainerInterface
{
private $items = [];
public function __construct(array $items = [])
{
$this->items = $items;
}
final public function has($label)
{
return array_key_exists($l... |
Use sendAction when no return value is needed
[skip ci] | import Ember from 'ember';
import layout from './template';
import permissions from 'ember-osf/const/permissions';
export default Ember.Component.extend({
READ: permissions.READ,
WRITE: permissions.WRITE,
ADMIN: permissions.ADMIN,
layout: layout,
permissionChanges: {},
bibliographicChanges: {}... | import Ember from 'ember';
import layout from './template';
import permissions from 'ember-osf/const/permissions';
export default Ember.Component.extend({
READ: permissions.READ,
WRITE: permissions.WRITE,
ADMIN: permissions.ADMIN,
layout: layout,
permissionChanges: {},
bibliographicChanges: {}... |
Use absolute path for assets | <!DOCTYPE html>
<html lang="en-us">
<head>
<meta charset="utf-8">
<title>Lifecycle Building Center</title>
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="description" content="">
<meta name="viewport" content="width=device-width" />
... | <!DOCTYPE html>
<html lang="en-us">
<head>
<meta charset="utf-8">
<title>Lifecycle Building Center</title>
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="description" content="">
<meta name="viewport" content="width=device-width" />
... |
Make sure the StartupEvent is fired after the runtime config is set | package io.quarkus.arc.deployment;
import static io.quarkus.deployment.annotations.ExecutionTime.RUNTIME_INIT;
import java.util.List;
import io.quarkus.arc.runtime.ArcRecorder;
import io.quarkus.deployment.annotations.BuildStep;
import io.quarkus.deployment.annotations.Consume;
import io.quarkus.deployment.annotatio... | package io.quarkus.arc.deployment;
import static io.quarkus.deployment.annotations.ExecutionTime.RUNTIME_INIT;
import java.util.List;
import io.quarkus.arc.runtime.ArcRecorder;
import io.quarkus.deployment.annotations.BuildStep;
import io.quarkus.deployment.annotations.Record;
import io.quarkus.deployment.builditem.... |
Switch Django version from 1.0 to 1.1 | """Configuration."""
import logging
import os
import re
from google.appengine.ext.appstats import recording
logging.info('Loading %s from %s', __name__, __file__)
# Custom webapp middleware to add Appstats.
def webapp_add_wsgi_middleware(app):
app = recording.appstats_wsgi_middleware(app)
return app
# Appstats... | """Configuration."""
import logging
import os
import re
from google.appengine.ext.appstats import recording
logging.info('Loading %s from %s', __name__, __file__)
# Custom webapp middleware to add Appstats.
def webapp_add_wsgi_middleware(app):
app = recording.appstats_wsgi_middleware(app)
return app
# Appstats... |
Use try/finally to ensure oldValue is cleared
If any JS exception is thrown during event delivery the oldValue
should still be set to null to enable garbage collection.
Change-Id: I740db06e93162f86982ffd418c2072bfb4d5d75c | // Copyright (C) 2012 The Android Open Source Project
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable ... | // Copyright (C) 2012 The Android Open Source Project
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable ... |
Select - update name to name[] when multiple=true | <?php
class Form_Select extends Form_Input
{
protected $_values;
protected $_value;
public function __construct($title, $value, array $values, $allowMultiple = false)
{
parent::__construct($title, null);
if ($allowMultiple)
{
$this->_attributes['multiple'] = 'multiple';
$this->_attributes['name'] .= ... | <?php
class Form_Select extends Form_Input
{
protected $_values;
protected $_value;
public function __construct($title, $value, array $values, $allowMultiple = false)
{
parent::__construct($title, null);
if ($allowMultiple)
$this->_attributes['multiple'] = 'multiple';
$this->_value = $value;
$this->_... |
Refactor codes and revise main | """Leetcode 172. Factorial Trailing Zeroes
Easy
URL: https://leetcode.com/problems/factorial-trailing-zeroes/
Given an integer n, return the number of trailing zeroes in n!.
Example 1:
Input: 3
Output: 0
Explanation: 3! = 6, no trailing zero.
Example 2:
Input: 5
Output: 1
Explanation: 5! = 120, one trailing zero.
... | """Leetcode 172. Factorial Trailing Zeroes
Easy
URL: https://leetcode.com/problems/factorial-trailing-zeroes/
Given an integer n, return the number of trailing zeroes in n!.
Example 1:
Input: 3
Output: 0
Explanation: 3! = 6, no trailing zero.
Example 2:
Input: 5
Output: 1
Explanation: 5! = 120, one trailing zero.
... |
Revert "make the property protected instead of private"
This reverts commit 409669ec1686f71ae3804003540423e45d842f2e. | <?php
namespace WsdlToPhp\DomHandler;
class NameSpaceHandler extends AttributeHandler
{
/**
* @var \DOMNameSpaceNode
*/
private $nodeNameSpace;
/**
* @param \DOMNameSpaceNode $nameSpaceNode
* @param AbstractDomDocumentHandler $domDocumentHandler
* @param int $index
*/
pub... | <?php
namespace WsdlToPhp\DomHandler;
class NameSpaceHandler extends AttributeHandler
{
/**
* @var \DOMNameSpaceNode
*/
protected $nodeNameSpace;
/**
* @param \DOMNameSpaceNode $nameSpaceNode
* @param AbstractDomDocumentHandler $domDocumentHandler
* @param int $index
*/
... |
[Promotion] Change misleading PromotionCouponRepository method name | <?php
/*
* This file is part of the Sylius package.
*
* (c) Paweł Jędrzejewski
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
declare(strict_types=1);
namespace Sylius\Component\Promotion\Repository;
use Doctrine\ORM\QueryBuil... | <?php
/*
* This file is part of the Sylius package.
*
* (c) Paweł Jędrzejewski
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
declare(strict_types=1);
namespace Sylius\Component\Promotion\Repository;
use Doctrine\ORM\QueryBuil... |
Add a class for sign button
What will make it easier to manipulate the theme | from django.forms import ModelForm
from django import forms
from django.forms.widgets import TextInput
from django.core.urlresolvers import reverse
from django.utils.translation import ugettext as _
from braces.forms import UserKwargModelFormMixin
from crispy_forms.helper import FormHelper
from crispy_forms.layout impo... | from django.forms import ModelForm
from django import forms
from django.forms.widgets import TextInput
from django.core.urlresolvers import reverse
from django.utils.translation import ugettext as _
from braces.forms import UserKwargModelFormMixin
from crispy_forms.helper import FormHelper
from crispy_forms.layout impo... |
Fix version resolve in browser - check if in node | /* global exports */
"use strict";
var fs = require('fs');
var path = require('path');
// module Docopt.FFI
/**
* Try and detect the version as indicated in the package.json neighbouring
* the main module. Uses `require.main` to detect the main module and traverses
* the parent directories in a search for a `pack... | /* global exports */
"use strict";
var fs = require('fs');
var path = require('path');
// module Docopt.FFI
/**
* Try and detect the version as indicated in the package.json neighbouring
* the main module. Uses `require.main` to detect the main module and traverses
* the parent directories in a search for a `pack... |
Disable join button before contest enrolment started | import React from 'react';
import moment from 'moment';
import Button from 'material-ui/Button';
import { Link } from 'react-router';
import { FormattedMessage } from 'react-intl';
import messages from './messages';
function ContestButton(props) {
const { canJoinStarted, signupDuration, start, id } = props.contest;... | import React from 'react';
import moment from 'moment';
import Button from 'material-ui/Button';
import { Link } from 'react-router';
import { FormattedMessage } from 'react-intl';
import messages from './messages';
function ContestButton(props) {
const { canJoinStarted, signupDuration, start, id } = props.contest;... |
Rename parameter DEFAULT_PROTOCOL to DEFAULT_URL_PROTOCOL | # -*- coding: utf-8 -*-
# standard library
import collections
# django
from django.utils.translation import ugettext_lazy as _
ParameterDefinition = collections.namedtuple(
'Parameter',
[
'name',
'default',
'kind',
'verbose_name',
]
)
class ParameterDefinitionList(object... | # -*- coding: utf-8 -*-
# standard library
import collections
# django
from django.utils.translation import ugettext_lazy as _
ParameterDefinition = collections.namedtuple(
'Parameter',
[
'name',
'default',
'kind',
'verbose_name',
]
)
class ParameterDefinitionList(object... |
Update help_text in api_auth initial migration
I'm updating the help_text in the original migration rather than
creating a new migration that doesn't affect the db, but does do a
bunch of SQL stuff in the migration. | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
]
operations = [
migrations.CreateModel(
name='Token',
fields=[
('token', models.CharField(hel... | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
]
operations = [
migrations.CreateModel(
name='Token',
fields=[
('token', models.CharField(hel... |
Format and mark as InternalAPI | package org.jctools.queues;
import org.jctools.util.InternalAPI;
import org.jctools.util.JvmInfo;
import org.jctools.util.UnsafeRefArrayAccess;
@InternalAPI
public final class PaddedCircularArrayOffsetCalculator
{
static final int REF_BUFFER_PAD;
static final long REF_ARRAY_BASE;
static
{
// ... | package org.jctools.queues;
import org.jctools.util.JvmInfo;
import org.jctools.util.UnsafeRefArrayAccess;
public final class PaddedCircularArrayOffsetCalculator {
static final int REF_BUFFER_PAD;
static final long REF_ARRAY_BASE;
static {
// 2 cache lines pad
REF_BUFFER_PAD = (JvmInfo.CAC... |
Add make console task mock utility method | <?php
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
use Aedart\Scaffold\Contracts\Tasks\ConsoleTask;
use Mockery as m;
/**
* Console Test
*
* Provides a few helpers for CLI / Console related
* testing
*
* @author Alin Eugen Deac <aedart@gmail.com>
*/
... | <?php
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
use Mockery as m;
/**
* Console Test
*
* Provides a few helpers for CLI / Console related
* testing
*
* @author Alin Eugen Deac <aedart@gmail.com>
*/
abstract class ConsoleTest extends BaseUnitTest
{... |
Fix PHP 7.1 related failures | <?php
/*
* This file is part of the Symfony package.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Component\HttpKernel\CacheWarmer;
/**
* Abstract cache warmer ... | <?php
/*
* This file is part of the Symfony package.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Component\HttpKernel\CacheWarmer;
/**
* Abstract cache warmer ... |
Change DEVICE_OWNER to make it more Neutron compliant
Change-Id: Id7a2973928c6df9e134e7b91000e90f244066703 | # Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under t... | # Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under t... |
Revert "fixed run_unit_test.php system commands"
This reverts commit dac7b56be5f32296cb6c98d72f15a65037017a33.
Conflicts:
tools/run_unit_tests.php | <?php
system('php vendor/phpunit/phpunit/phpunit --bootstrap config/bootstrap.php tools/unit_tests/classes/core/Dinkly.php');
system('php vendor/phpunit/phpunit/phpunit --bootstrap config/bootstrap.php tools/unit_tests/classes/core/DinklyBuilder.php');
system('php vendor/phpunit/phpunit/phpunit --bootstrap config/boot... | <?php
system('php vendor/phpunit/phpunit/phpunit --bootstrap config/bootstrap.php tools/unit_tests/classes/core/Dinkly.php');
system('php vendor/phpunit/phpunit/phpunit --bootstrap config/bootstrap.php tools/unit_tests/classes/core/DinklyBuilder.php');
system('php vendor/phpunit/phpunit/phpunit --bootstrap config/boot... |
Fix missing type in array hydrator | <?php
/*
* Copyright 2014 Jack Sleight <http://jacksleight.com/>
* This source file is subject to the MIT license that is bundled with this package in the file LICENCE.
*/
namespace Coast\Doctrine\ORM\Internal\Hydration;
use Doctrine\ORM\Internal\Hydration\ArrayHydrator as DoctrineArrayHydrator;
class ArrayHydr... | <?php
/*
* Copyright 2014 Jack Sleight <http://jacksleight.com/>
* This source file is subject to the MIT license that is bundled with this package in the file LICENCE.
*/
namespace Coast\Doctrine\ORM\Internal\Hydration;
use Doctrine\ORM\Internal\Hydration\ArrayHydrator as DoctrineArrayHydrator;
class ArrayHydr... |
Add another Google Maps URL. | // These URL paths will be transformed to CN mirrors.
var mirrors = {
"//developers.google.com" : "//developers.google.cn",
"//firebase.google.com" : "//firebase.google.cn",
"//developer.android.com" : "//developer.android.google.cn",
"//angular.io" : "//angular.cn",
"//maps.google.com" : "... | // These URL paths will be transformed to CN mirrors.
var mirrors = {
"//developers.google.com" : "//developers.google.cn",
"//firebase.google.com" : "//firebase.google.cn",
"//developer.android.com" : "//developer.android.google.cn",
"//angular.io" : "//angular.cn",
"google.com/maps" : "... |
Clear activity on pick image intents. | package org.beryl.intents;
import android.content.Context;
import android.content.Intent;
import android.content.pm.PackageManager;
import android.net.Uri;
import android.webkit.MimeTypeMap;
public class IntentHelper {
public static boolean canHandleIntent(final Context context, final Intent intent) {
... | package org.beryl.intents;
import android.content.Context;
import android.content.Intent;
import android.content.pm.PackageManager;
import android.net.Uri;
import android.webkit.MimeTypeMap;
public class IntentHelper {
public static boolean canHandleIntent(final Context context, final Intent intent) {
... |
Fix import in ssh connection | # (c) 2012, Michael DeHaan <michael.dehaan@gmail.com>
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any lat... | # (c) 2012, Michael DeHaan <michael.dehaan@gmail.com>
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any lat... |
Update (function-list) to return a proper Desmond collection. | <?php
namespace Desmond\functions\core;
use Desmond\functions\DesmondFunction;
use Desmond\functions\FileOperations;
class FunctionList extends DesmondFunction
{
use \Desmond\TypeHelper;
public function id()
{
return 'function-list';
}
public function run(array $args)
{
$list ... | <?php
namespace Desmond\functions\core;
use Desmond\functions\DesmondFunction;
use Desmond\functions\FileOperations;
use Desmond\data_types\ListType;
class FunctionList extends DesmondFunction
{
public function id()
{
return 'function-list';
}
public function run(array $args)
{
$li... |
RM8864: Reset lost reason field on copy | /**
* Axelor Business Solutions
*
* Copyright (C) 2017 Axelor (<http://axelor.com>).
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License, version 3,
* as published by the Free Software Foundation.
*
* This program is distribute... | /**
* Axelor Business Solutions
*
* Copyright (C) 2017 Axelor (<http://axelor.com>).
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License, version 3,
* as published by the Free Software Foundation.
*
* This program is distribute... |
Increase ngram size to four | INDEX_SETTINGS = {
"settings": {
"analysis": {
"analyzer": {
"default": {
"type": "custom",
"tokenizer": "standard",
"filter": [
"standard",
"lowercase",
... | INDEX_SETTINGS = {
"settings": {
"analysis": {
"analyzer": {
"default": {
"type": "custom",
"tokenizer": "standard",
"filter": [
"standard",
"lowercase",
... |
Add more tests to YamlFile class | import unittest
import random
try:
from unittest import mock
except ImportError:
import mock
from conda_env import env
from conda_env.specs.yaml_file import YamlFileSpec
class TestYAMLFile(unittest.TestCase):
def test_no_environment_file(self):
spec = YamlFileSpec(name=None, filename='not-a-file'... | import unittest
try:
from unittest import mock
except ImportError:
import mock
from conda_env import env
from conda_env.specs.yaml_file import YamlFileSpec
class TestYAMLFile(unittest.TestCase):
def test_no_environment_file(self):
spec = YamlFileSpec(name=None, filename='not-a-file')
self... |
Bump version: 0.0.6 -> 0.0.7
[ci skip] | from conans import ConanFile
from conans.tools import download, unzip
import os
VERSION = "0.0.7"
class ToolingCMakeUtilConan(ConanFile):
name = "tooling-cmake-util"
version = os.environ.get("CONAN_VERSION_OVERRIDE", VERSION)
generators = "cmake"
requires = ("cmake-include-guard/master@smspillaz/cmak... | from conans import ConanFile
from conans.tools import download, unzip
import os
VERSION = "0.0.6"
class ToolingCMakeUtilConan(ConanFile):
name = "tooling-cmake-util"
version = os.environ.get("CONAN_VERSION_OVERRIDE", VERSION)
generators = "cmake"
requires = ("cmake-include-guard/master@smspillaz/cmak... |
Change install directory for dev to mocks dir | var
env = process.env.NODE_ENV || 'development',
config;
config = {
production : {
db : {
URL : process.env['wac_service_mongodb_url']
},
componentsURL : 'http://50.116.26.197/components/all',
componentInstallDir : __dirname + '/components',
componentBuildDir : __dirname + '/build',
... | var
env = process.env.NODE_ENV || 'development',
config;
config = {
production : {
db : {
URL : process.env['wac_service_mongodb_url']
},
componentsURL : 'http://50.116.26.197/components/all',
componentInstallDir : __dirname + '/components',
componentBuildDir : __dirname + '/build',
... |
Remove 'only' from Story tests | import { expect } from 'chai'
import { clean, run } from '../helper'
describe('Stories', () => {
beforeEach(clean)
it('should add stories to test cases', () => {
return run(['story']).then((results) => {
expect(results).to.have.lengthOf(1)
const result = results[0]
... | import { expect } from 'chai'
import { clean, run } from '../helper'
describe('Stories', () => {
beforeEach(clean)
it.only('should add stories to test cases', () => {
return run(['story']).then((results) => {
expect(results).to.have.lengthOf(1)
const result = results[0]
... |
Check NIL channel.
This will happen if it did not yet get to starting to watch the directory. | package main
import (
"fmt"
"github.com/zero-boilerplate/go-api-helpers/service"
"path/filepath"
service2 "github.com/ayufan/golang-kardianos-service"
)
type app struct {
logger service2.Logger
watcherDoneChannel chan bool
}
func (a *app) OnStop() {
defer recover()
if a.watcherDoneChannel != nil... | package main
import (
"fmt"
"github.com/zero-boilerplate/go-api-helpers/service"
"path/filepath"
service2 "github.com/ayufan/golang-kardianos-service"
)
type app struct {
logger service2.Logger
watcherDoneChannel chan bool
}
func (a *app) OnStop() {
defer recover()
close(a.watcherDoneChannel)
}
... |
Fix unhandled rejection in test cases | import promisify from 'promisify-object'
import semverRegex from 'semver-regex'
const ghissues = promisify(require('ghissues'), ['createComment', 'list'])
import {logger} from '../logging'
function writeComment (authData, owner, project, pr, comment) {
return ghissues.createComment(authData, owner, project, pr, co... | import promisify from 'promisify-object'
import semverRegex from 'semver-regex'
const ghissues = promisify(require('ghissues'), ['createComment', 'list'])
import {logger} from '../logging'
function writeComment (authData, owner, project, pr, comment) {
return ghissues.createComment(authData, owner, project, pr, co... |
Fix error in getting port from config | const express = require('express');
const morgan = require('morgan');
const compression = require('compression');
const config = require('./config');
const { generateTitle, lorem } = require('./lib/utils');
const app = express();
app.locals = Object.assign({}, app.locals, config.locals);
app.set('env', config.env)... | const express = require('express');
const morgan = require('morgan');
const compression = require('compression');
const config = require('./config');
const { generateTitle, lorem } = require('./lib/utils');
const app = express();
app.locals = Object.assign({}, app.locals, config.locals);
app.set('env', config.env)... |
Fix for RSF-42, binding to empty String | /*
* Created on 13-Jan-2006
*/
package uk.org.ponder.rsf.components;
import uk.org.ponder.beanutil.BeanUtil;
/** A special class to hold EL references so they may be detected in the
* component tree. When held in this member, it is devoid of the packaging #{..}
* characters - they are removed and replace... | /*
* Created on 13-Jan-2006
*/
package uk.org.ponder.rsf.components;
import uk.org.ponder.beanutil.BeanUtil;
/** A special class to hold EL references so they may be detected in the
* component tree. When held in this member, it is devoid of the packaging #{..}
* characters - they are removed and replace... |
Add concepts to parser-spi's requires
This is another tiny change for Eclipse's sake.
Change-Id: I2d50dedf232d63456f3574bc1f025f92d558a736
Signed-off-by: Robert Varga <91ae5aa8c7a9f7e57b701db766e23e544aaa6ae9@pantheon.tech> | /*
* Copyright (c) 2020 PANTHEON.tech, s.r.o. and others. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v1.0 which accompanies this distribution,
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
module org... | /*
* Copyright (c) 2020 PANTHEON.tech, s.r.o. and others. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v1.0 which accompanies this distribution,
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
module org... |
Add new tracking methods to API | /*-
* Copyright 2015 Diamond Light Source Ltd.
*
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*/
package org.eclipse... | /*-
* Copyright 2015 Diamond Light Source Ltd.
*
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*/
package org.eclipse... |
Convert md to rst readme specially for PyPi | from distutils.core import setup
with open('README.md') as readme:
with open('HISTORY.md') as history:
long_description = readme.read() + '\n\n' + history.read()
try:
import pypandoc
long_description = pypandoc.convert(long_description, 'rst')
except(IOError, ImportError):
long_description = ... | from distutils.core import setup
with open('README.md') as readme:
with open('HISTORY.md') as history:
long_description = readme.read() + '\n\n' + history.read()
VERSION = '1.0'
setup(
name='argparse-autogen',
py_modules=['argparse_autogen'],
version=VERSION,
url='https://github.com/sashg... |
Fix bug on create a new application | <?php
Part::input($controller, 'Controller');
Part::input($objects, 'ModelSet');
Part::input($columns, 'int', 4);
$count = $objects->count();
$perColumn = ceil($count / $columns);
echo '<table>';
for($row = 0 ; $row < $perColumn ; $row++) {
echo '<tr>';
for($col = 0 ; $col < $columns ; $col++) {
$object = isset($o... | <?php
Part::input($controller, 'Controller');
Part::input($objects, 'ModelSet');
Part::input($columns, 'int', 4);
$count = $objects->count();
$perColumn = ceil($count / $columns);
echo '<table>';
for($row = 0 ; $row < $perColumn ; $row++) {
echo '<tr>';
for($col = 0 ; $col < $columns ; $col++) {
$object = isset($o... |
Fix multiple bug IDs on presubmit.
BUG=#1212
TBR=nduca@chromium.org
Review URL: https://codereview.chromium.org/1282273002 | # Copyright (c) 2015 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 re
def CheckChangeLogBug(input_api, output_api):
if input_api.change.BUG is None or re.match(
'(\#\d+)(,\s*\#\d+)*$', input_api.change.BU... | # Copyright (c) 2015 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 re
def CheckChangeLogBug(input_api, output_api):
if input_api.change.BUG is None or re.match('\#\d+$', input_api.change.BUG):
return []
e... |
Fix user and attempts sqlalchemia request. | # Copyright 2016 Mirantis, 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 ... | # Copyright 2016 Mirantis, 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 ... |
Convert squashed migration to regular migration
This confuses the hell out of me every time | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
import django.contrib.gis.db.models.fields
class Migration(migrations.Migration):
dependencies = [
]
operations = [
migrations.CreateModel(
name='Address',
fields=[
... | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
import django.contrib.gis.db.models.fields
class Migration(migrations.Migration):
replaces = [('addressbase', '0001_initial'), ('addressbase', '0002_auto_20160611_1700'), ('addressbase', '0003_auto_20160611_... |
Make a correction to how the event link is created | // Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed ... | // Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed ... |
Speed up account creation by lowering password security
Reduce saltRounds to 8 saves ~50ms per password hash generation. | var bcrypt = require('bcrypt');
var mongoose = require('mongoose');
const saltRounds = 8;
var userSchema = new mongoose.Schema({
signupDate: { type: Date, default: Date.now },
username: { type: String, required: true, unique: true },
email: { type: String, required: true, unique: true },
password: { type: Stri... | var bcrypt = require('bcrypt');
var mongoose = require('mongoose');
const saltRounds = 10;
var userSchema = new mongoose.Schema({
signupDate: { type: Date, default: Date.now },
username: { type: String, required: true, unique: true },
email: { type: String, required: true, unique: true },
password: { type: Str... |
Remove 'Or Login with' text from the list view. Make it more reusable. | @unless(Butler::providers()->isEmpty())
<div class="row">
<div class="col-sm-4 col-sm-offset-4 text-center">
@foreach (\Butler::providers() as $code => $details)
<a href="{{ route('butler.redirect', $code) }}" class="btn btn-default btn-block {{ $details->class }}">
... | @unless(Butler::providers()->isEmpty())
<div class="row">
<div class="col-sm-4 col-sm-offset-4 text-center">
<h4>Or, login with</h4>
@foreach (\Butler::providers() as $code => $details)
<a href="{{ route('butler.redirect', $code) }}" class="btn btn-default btn-block {... |
Fix prefix for windows azure | var path = require('path');
module.exports = function (start, opts) {
var modules = opts.moduleDirectory || 'node_modules';
var prefix = '/';
if (/^([A-Za-z]:)/.test(start)) {
prefix = '';
} else if (/^\\\\/.test(start)) {
prefix = '\\\\';
}
var splitRe = process.platform === '... | var path = require('path');
module.exports = function (start, opts) {
var modules = opts.moduleDirectory || 'node_modules';
var splitRe = process.platform === 'win32' ? /[\/\\]/ : /\/+/;
var parts = start.split(splitRe);
var dirs = [];
for (var i = parts.length - 1; i >= 0; i--) {
if (par... |
[MIG] Change the version of module. | # -*- coding: utf-8 -*-
# Copyright (C) 2009 Renato Lima - Akretion
# License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html
{
'name': 'Brazilian Localisation ZIP Codes',
'license': 'AGPL-3',
'author': 'Akretion, Odoo Community Association (OCA)',
'version': '9.0.1.0.0',
'depends': [
... | # -*- coding: utf-8 -*-
# Copyright (C) 2009 Renato Lima - Akretion
# License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html
{
'name': 'Brazilian Localisation ZIP Codes',
'license': 'AGPL-3',
'author': 'Akretion, Odoo Community Association (OCA)',
'version': '8.0.1.0.1',
'depends': [
... |
Add a comment to custom yaml_safe_load() method. | # Copyright 2020 The StackStorm Authors.
# Copyright 2019 Extreme Networks, 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 ... | # Copyright 2020 The StackStorm Authors.
# Copyright 2019 Extreme Networks, 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 ... |
Add new Stripe webhook config values
See https://github.com/laravel/cashier/pull/565 | <?php
return [
/*
|--------------------------------------------------------------------------
| Third Party Services
|--------------------------------------------------------------------------
|
| This file is for storing the credentials for third party services such
| as Stripe, Mailgun, ... | <?php
return [
/*
|--------------------------------------------------------------------------
| Third Party Services
|--------------------------------------------------------------------------
|
| This file is for storing the credentials for third party services such
| as Stripe, Mailgun, ... |
Use new currentActionSet in async | import fetch from 'isomorphic-fetch';
export function invalidateReddit({ reddit }) {}
export function requestPosts({ reddit }) {}
export function receivePosts({ reddit, json }) {
return {
reddit,
posts: json.data.children.map(child => child.data),
receivedAt: Date.now()
};
}
function fetchPosts({ r... | import fetch from 'isomorphic-fetch';
export function invalidateReddit({ reddit }) {
return arguments[0];
}
function requestPosts({ reddit }) {
return arguments[0];
}
function receivePosts({ reddit, json }) {
return {
reddit,
posts: json.data.children.map(child => child.data),
receivedAt: Date.now... |
Fix some code style idiosyncrasies | 'use strict';
const Fs = require('fs');
const Hoek = require('hoek');
const Thurston = require('thurston');
const Items = require('items');
const Some = require('lodash.some');
const internals = {
defaults: {
pattern: ['bytes', 'filename', 'headers', 'path']
}
};
internals.validate = function (paylo... | 'use strict';
const Fs = require('fs');
const Hoek = require('hoek');
const Thurston = require('thurston');
const Items = require('items');
const Some = require('lodash.some');
const internals = {
defaults: {
pattern: ['bytes', 'filename', 'headers', 'path']
}
};
internals.validate = function (paylo... |
Upgrade libchromiumcontent to loose iframe sandbox. | #!/usr/bin/env python
import platform
import sys
NODE_VERSION = 'v0.11.13'
BASE_URL = 'https://gh-contractor-zcbenz.s3.amazonaws.com/libchromiumcontent'
LIBCHROMIUMCONTENT_COMMIT = 'afb4570ceee2ad10f3caf5a81335a2ee11ec68a5'
ARCH = {
'cygwin': '32bit',
'darwin': '64bit',
'linux2': platform.architecture()[... | #!/usr/bin/env python
import platform
import sys
NODE_VERSION = 'v0.11.13'
BASE_URL = 'https://gh-contractor-zcbenz.s3.amazonaws.com/libchromiumcontent'
LIBCHROMIUMCONTENT_COMMIT = '432720d4613e3aac939f127fe55b9d44fea349e5'
ARCH = {
'cygwin': '32bit',
'darwin': '64bit',
'linux2': platform.architecture()[... |
Add missing typehint on chain sender | <?php
/*
* This file is part of the Symfony package.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Component\Messenger\Transport;
use Symfony\Component\Messenger\... | <?php
/*
* This file is part of the Symfony package.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Component\Messenger\Transport;
/**
* @author Tobias Schultze <... |
Fix for [ticket:281]. Do not forward livebookmarks request.
git-svn-id: 87d19257dd11500985d055ec4730e446075a5f07@1261 78c7df6f-8922-0410-bcd3-9426b1ad491b | # Copyright (c) 2006-2007 Open Source Applications Foundation
# Copyright (c) 2008-2009 Mikeal Rogers <mikeal.rogers@gmail.com>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# ... | # Copyright (c) 2006-2007 Open Source Applications Foundation
# Copyright (c) 2008-2009 Mikeal Rogers <mikeal.rogers@gmail.com>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# ... |
Replace str_contains with strpos method to support PHP 7 | <?php
/*
* This file is part of the Sylius package.
*
* (c) Paweł Jędrzejewski
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
declare(strict_types=1);
namespace Sylius\Bundle\ShopBundle\SectionResolver;
use Sylius\Bundle\CoreB... | <?php
/*
* This file is part of the Sylius package.
*
* (c) Paweł Jędrzejewski
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
declare(strict_types=1);
namespace Sylius\Bundle\ShopBundle\SectionResolver;
use Sylius\Bundle\CoreB... |
Fix missing id of project in discussion of activities | /*****************************************************************************/
/* ActivityDiscuss: Event Handlers */
/*****************************************************************************/
Template.ActivityDiscuss.events({
});
/*****************************************************************************/
/* ... | /*****************************************************************************/
/* ActivityDiscuss: Event Handlers */
/*****************************************************************************/
Template.ActivityDiscuss.events({
});
/*****************************************************************************/
/* ... |
Remove _k parameter from url. This is used for old browsers. | import React from 'react';
import ReactDOM from 'react-dom';
import App from './App.js';
import Home from './components/Home';
import Programs from './components/Programs';
import Program from './components/Program';
import Login from './components/Login';
import Register from './components/Register';
import { Router, ... | import React from 'react';
import ReactDOM from 'react-dom';
import App from './App.js';
import Home from './components/Home';
import Programs from './components/Programs';
import Program from './components/Program';
import Login from './components/Login';
import Register from './components/Register';
import { Router, ... |
Replace hardcoded coordinates with randomly generated values | import Prop from 'props/prop';
import canvas from 'canvas';
import collision from 'lib/collision';
import events from 'lib/events';
export default class Ball extends Prop {
constructor() {
const width = 10;
const height = 10;
const x = (canvas.width / 2) - (width / 2);
const y = (canvas.height / 2) ... | import Prop from 'props/prop';
import canvas from 'canvas';
import collision from 'lib/collision';
import events from 'lib/events';
// Maybe make these coords an array so we can easily multiply without lodash _.mapValues for speed.
const coords = {
northEast: {
x: 1,
y: -1,
},
southEast: {
x: 1,
... |
Access weights using new interface. | #!/usr/bin/env python
import climate
import matplotlib.pyplot as plt
import theanets
from utils import load_cifar, plot_layers, plot_images
g = climate.add_arg_group('CIFAR Example')
g.add_argument('--features', type=int, default=32, metavar='N',
help='train a model using N^2 hidden-layer features')
... | #!/usr/bin/env python
import climate
import matplotlib.pyplot as plt
import theanets
from utils import load_cifar, plot_layers, plot_images
g = climate.add_arg_group('CIFAR Example')
g.add_argument('--features', type=int, default=32, metavar='N',
help='train a model using N^2 hidden-layer features')
... |
Update the PyPI version to 7.0.17. | # -*- coding: utf-8 -*-
import os
from setuptools import setup
def read(fname):
try:
return open(os.path.join(os.path.dirname(__file__), fname)).read()
except:
return ''
setup(
name='todoist-python',
version='7.0.17',
packages=['todoist', 'todoist.managers'],
author='Doist Team... | # -*- coding: utf-8 -*-
import os
from setuptools import setup
def read(fname):
try:
return open(os.path.join(os.path.dirname(__file__), fname)).read()
except:
return ''
setup(
name='todoist-python',
version='7.0.16',
packages=['todoist', 'todoist.managers'],
author='Doist Team... |
Fix minor issue (jackson security) | package fr.insee.rmes.api.utils;
import javax.ws.rs.core.MediaType;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.dataformat.xml.XmlMapper;
public class ResponseUtils {
private static Logger log... | package fr.insee.rmes.api.utils;
import javax.ws.rs.core.MediaType;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.dataformat.xml.XmlMapper;
public class ResponseUtils {
private static Logger log... |
Use reflection to extract Netty's default level
See gh-27046 | /*
* Copyright 2012-2021 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by a... | /*
* Copyright 2012-2021 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by a... |
Add timer to check for new mail | // @ngInject
module.exports = function($scope, $stateParams, EmailState, API, $interval) {
var vm = this;
vm.emails = [];
vm.label = 'inbox';
vm.emailFilter = EmailState.filter;
vm.fetchEmails = function(label) {
vm.label = label || 'inbox';
var request = vm.label === 'inbox' ? API.getInbox : API.g... | // @ngInject
module.exports = function($scope, $stateParams, EmailState, API) {
var vm = this;
vm.emails = [];
vm.label = 'inbox';
vm.emailFilter = EmailState.filter;
vm.fetchEmails = function(label) {
vm.label = label || 'inbox';
var request = vm.label === 'inbox' ? API.getInbox : API.getLabel;
... |
Fix test error with YamlSource | <?php
namespace Neos\Flow\Tests\Functional\Configuration\Fixtures;
/*
* This file is part of the Neos.Flow package.
*
* (c) Contributors of the Neos Project - www.neos.io
*
* This package is Open Source Software. For the full copyright and license
* information, please view the LICENSE file which was distributed... | <?php
namespace Neos\Flow\Tests\Functional\Configuration\Fixtures;
/*
* This file is part of the Neos.Flow package.
*
* (c) Contributors of the Neos Project - www.neos.io
*
* This package is Open Source Software. For the full copyright and license
* information, please view the LICENSE file which was distributed... |
Add possibility to add custom plugin prefix
Summary: The problem with a fixed prefix is that babel 7 uses a scoped packages and every (standard) plugin is now part of that scope so the prefix is no longer `babel-plugin-` but instead `babel/plugin-`. There are more changes. This one will at least fix most of them.
Rev... | /**
* Copyright (c) 2015-present, Facebook, Inc.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @format
*/
'use strict';
/**
* Manually resolve all default Babel plugins.
* `babel.transform` will attempt to resolve all base plu... | /**
* Copyright (c) 2015-present, Facebook, Inc.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
'use strict';
/**
* Manually resolve all default Babel plugins.
* `babel.transform` will attempt to resolve all base plugins relative ... |
[YAKHMI-870] SCTUnit: Create abstract SGenGenerator for SCTUnit
-added generated Code | package org.yakindu.sct.generator.core;
import org.eclipse.core.resources.IWorkspaceRoot;
import org.eclipse.xtext.generator.JavaIoFileSystemAccess;
import org.yakindu.sct.model.sgen.GeneratorEntry;
import com.google.inject.Inject;
import com.google.inject.Injector;
/**
* @author oliver bohl
*
*/
public abstra... | package org.yakindu.sct.generator.core;
import org.eclipse.core.resources.IWorkspaceRoot;
import org.eclipse.xtext.generator.JavaIoFileSystemAccess;
import org.yakindu.sct.model.sgen.GeneratorEntry;
import com.google.inject.Inject;
import com.google.inject.Injector;
/**
* @author oliver bohl
*
*/
public abstra... |
Create a new object instead of modifying original
Fixing the root problem will require more severe changes, basically
avoiding passing objects by reference to prevent this kind of bugs. | var _ = require('underscore');
var StylesFactory = require('../../styles-factory');
var StyleFormDefaultModel = require('../style-form-default-model');
module.exports = StyleFormDefaultModel.extend({
parse: function (r) {
var geom = r.geom;
var attrs = {
fill: r.fill,
stroke: r.stroke,
ble... | var _ = require('underscore');
var StylesFactory = require('../../styles-factory');
var StyleFormDefaultModel = require('../style-form-default-model');
module.exports = StyleFormDefaultModel.extend({
parse: function (r) {
var geom = r.geom;
var attrs = {
fill: r.fill,
stroke: r.stroke,
ble... |
Return active dir for use by clients. | """
Helper functions for pushing content to a staging directory, moving the old directory aside, and moving the staging directory into place.
"""
from fabric.api import env
from fabric.operations import sudo
from . import debug
from os import path
import time
import re
def make_staging_directory(basename = "project", ... | """
Helper functions for pushing content to a staging directory, moving the old directory aside, and moving the staging directory into place.
"""
from fabric.api import env
from fabric.operations import sudo
from . import debug
from os import path
import time
import re
def make_staging_directory(basename = "project", ... |
Update the script to create EC2 instance.
This creates an EC2 i3.8xlarge. | import boto3
import botocore
import time
ec2 = boto3.resource('ec2', region_name='us-east-1')
client = boto3.client('ec2')
# Create a security group
try:
sg = ec2.create_security_group(GroupName='jupyter', Description='EC2 for Jupyter Notebook')
response = client.authorize_security_group_ingress(GroupName='ju... | import boto3
import botocore
import time
ec2 = boto3.resource('ec2', region_name='us-east-1')
client = boto3.client('ec2')
# Create a security group
try:
sg = ec2.create_security_group(GroupName='jupyter', Description='EC2 for Jupyter Notebook')
response = client.authorize_security_group_ingress(GroupName='ju... |
Make mutation hoc accept mutations without arguments | /*
HoC that provides a simple mutation that expects a single JSON object in return
Example usage:
export default withMutation({
name: 'getEmbedlyData',
args: {url: 'String'},
})(EmbedlyURL);
*/
import { graphql } from 'react-apollo';
import gql from 'graphql-tag';
export default function withMutation({name, a... | /*
HoC that provides a simple mutation that expects a single JSON object in return
Example usage:
export default withMutation({
name: 'getEmbedlyData',
args: {url: 'String'},
})(EmbedlyURL);
*/
import { graphql } from 'react-apollo';
import gql from 'graphql-tag';
export default function withMutation({name, a... |
Add allow/deny for post editing/deleting | Posts = new Mongo.Collection('posts');
Posts.allow({
update: function(userId, post) {
return ownsDocument(userId, post);
},
remove: function(userId, post) {
return ownsDocument(userId, post);
}
});
Posts.deny({
update: function(userId, post, fieldNames) {
return (_.without(fieldNames, 'url', 'ti... | Posts = new Mongo.Collection('posts');
Meteor.methods({
postInsert: function(postAttributes) {
check(Meteor.userId(), String);
check(postAttributes, {
title: String,
url: String
});
var postWithSameLink = Posts.findOne({ url: postAttributes.url });
if (postWithSameLink) {
retu... |
Use a dynamic url to secure webhook | import json
import os
import ieeebot
from flask import Flask, request, abort
from storage import Storage
app = Flask(__name__)
app.config['PROPAGATE_EXCEPTIONS'] = True
ieeebot.logger.debug(ieeebot.TOKEN)
ieeebot.logger.debug(ieeebot.DATABASE_FILE)
@app.route('/webhook/<token>', methods=['POST'])
def hello(token=N... | import json
import os
import ieeebot
from flask import Flask, request, abort
from storage import Storage
app = Flask(__name__)
app.config['PROPAGATE_EXCEPTIONS'] = True
ieeebot.logger.debug(ieeebot.TOKEN)
ieeebot.logger.debug(ieeebot.DATABASE_FILE)
@app.route('/ieeetestbot', methods=['POST'])
def hello():
upda... |
Fix js style on RailsRouteBuilder | import PathBuilder from './path-builder'
class RailsRouteBuilder {
constructor (configs = {}) {
// TODO
// Make an option for switching to GET for destroy actions
this.pathBuilder = new PathBuilder()
}
//
// RESTful Actions
//
index (...args) {
this.list(args)
}
list (resource, params... | import Axios from 'axios'
import PathBuilder from './path-builder'
class RailsRouteBuilder {
constructor (configs = {}) {
// TODO
// Make an option for switching to GET for destroy actions
this.pathBuilder = new PathBuilder
}
//
// RESTful Actions
//
index (...args) {
this.list(args)
}
... |
Update tests to remove pgf.preamble | import matplotlib
import fishbowl
original = True
updated = False
def test_context_set():
fishbowl.reset_style()
with fishbowl.style(axes='minimal', palette='gourami', font='Arbitrary'):
assert matplotlib.rcParams['axes.spines.left'] == updated
def test_context_reset():
fishbowl.reset_style()
... | import matplotlib
import fishbowl
original = []
updated = [r'\usepackage{mathspec}',
r'\setallmainfonts(Digits,Latin,Greek){Arbitrary}']
def test_context_set():
fishbowl.reset_style()
with fishbowl.style(axes='minimal', palette='gourami', font='Arbitrary'):
assert matplotlib.rcParams['pgf... |
Update JednostkaAdministracyjnaFilter for new django-filters | import django_filters
from django.shortcuts import get_object_or_404
from django.utils.translation import ugettext_lazy as _
try:
from django_filters import rest_framework as filters
except ImportError: # Back-ward compatible for django-rest-framework<3.7
from rest_framework import filters
from rest_framework... | import django_filters
from django.shortcuts import get_object_or_404
try:
from django_filters import rest_framework as filters
except ImportError: # Back-ward compatible for django-rest-framework<3.7
from rest_framework import filters
from rest_framework import viewsets
from teryt_tree.models import JednostkaA... |
Make sure commit finishes before tagging | var request = require('request'),
fs = require('fs'),
path = require('path'),
exec = require('child_process').exec,
version = require('../package.json').version;
var urlStub = 'http://code.angularjs.org/',
files = ['/angular.min.js', '/angular.min.js.map'];
function getFile (index) {
var file = files[index],
... | var request = require('request'),
fs = require('fs'),
path = require('path'),
exec = require('child_process').exec,
version = require('../package.json').version;
var urlStub = 'http://code.angularjs.org/',
files = ['/angular.min.js', '/angular.min.js.map'];
function getFile (index) {
var file = files[index],
... |
Use .set() rather than direct assignment | from django.core.management.base import BaseCommand, CommandError
from judge.models import Language
class Command(BaseCommand):
help = 'allows the problems allowed to be submitted in the <source> language to be submitted in <target> language'
def add_arguments(self, parser):
parser.add_argument('sou... | from django.core.management.base import BaseCommand, CommandError
from judge.models import Language
class Command(BaseCommand):
help = 'allows the problems allowed to be submitted in the <source> language to be submitted in <target> language'
def add_arguments(self, parser):
parser.add_argument('sou... |
Remove a left over comment from when getConfigValidityReport just returned a true/false rather than actual error messages. | 'use strict';
module.exports = {
port: 8080,
googlePlacesApiKey: '', // define this in local.js
/**
* Shortcut function to get only the isValid property from config validity report.
* @returns {boolean}
*/
isValid: function() {
return this.getConfigValidityReport().isValid;
},
/**
* Genera... | 'use strict';
module.exports = {
port: 8080,
googlePlacesApiKey: '', // define this in local.js
/**
* Shortcut function to get only the isValid property from config validity report.
* @returns {boolean}
*/
isValid: function() {
return this.getConfigValidityReport().isValid;
},
/**
* Genera... |
Fix shapes in SWF assets on NPM | module.exports = require("./../../_gen/openfl/utils/AssetLibrary");
// TODO: Put elsewhere?
var internal = {
FilterType: require ("../../_gen/openfl/_internal/swf/FilterType").default,
ShapeCommand: require ("../../_gen/openfl/_internal/swf/ShapeCommand").default,
SWFLiteLibrary: require ("../../_gen/openfl/_intern... | module.exports = require("./../../_gen/openfl/utils/AssetLibrary");
// TODO: Put elsewhere?
var internal = {
SWFLiteLibrary: require ("../../_gen/openfl/_internal/swf/SWFLiteLibrary").default,
BitmapSymbol: require ("../../_gen/openfl/_internal/symbols/BitmapSymbol").default,
ButtonSymbol: require ("../../_gen/open... |
Add method for getting PIL image
Also change function names to be uniform throughout | import json
import os
import random
import requests
from io import BytesIO
from PIL import Image
# GLOBALS
endpoint = "https://www.googleapis.com/customsearch/v1"
searchid = "013060195084513904668:z7-hxk7q35k"
# Retrieve my API key from a secret file
with open(os.path.join(os.path.dirname(__file__), "API_KEY.txt"),... | import json
import os
import random
import requests
from PIL import Image
# GLOBALS
endpoint = "https://www.googleapis.com/customsearch/v1"
searchid = "013060195084513904668:z7-hxk7q35k"
# Retrieve my API key from a secret file
with open(os.path.join(os.path.dirname(__file__), "API_KEY.txt"), "r") as f:
API_KE... |
Make the tenacity propertykeys resource path a publicly accessible static final. | package com.yammer.tenacity.client;
import com.google.common.base.Optional;
import com.google.common.collect.ImmutableList;
import com.sun.jersey.api.client.Client;
import javax.ws.rs.core.MediaType;
import java.net.URI;
public class TenacityClient {
private final Client client;
public static final String TE... | package com.yammer.tenacity.client;
import com.google.common.base.Optional;
import com.google.common.collect.ImmutableList;
import com.sun.jersey.api.client.Client;
import javax.ws.rs.core.MediaType;
import java.net.URI;
public class TenacityClient {
private final Client client;
public TenacityClient(Client... |
Fix event_dispatcher replacement in DependencyInjection | <?php
/**
* @LICENSE_TEXT
*/
namespace EventBand\Bundle\DependencyInjection\Compiler;
use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface;
use Symfony\Component\DependencyInjection\ContainerBuilder;
/**
* Class InitBandPass
*
* @author Kirill chEbba Chebunin <iam@chebba.org>
*/
class Repla... | <?php
/**
* @LICENSE_TEXT
*/
namespace EventBand\Bundle\DependencyInjection\Compiler;
use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface;
use Symfony\Component\DependencyInjection\ContainerBuilder;
/**
* Class InitBandPass
*
* @author Kirill chEbba Chebunin <iam@chebba.org>
*/
class Repla... |
Use 'stable' Django version for intersphinx
This will ensure documentation references always point at the latest version. | import os
import sys
import sphinx_rtd_theme
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "settings")
sys.path.insert(0, os.path.abspath("../.."))
import django
django.setup()
project = "django-postgres-extra"
copyright = "2019, Sector Labs"
author = "Sector Labs"
extensions = [
"sphinx_rtd_theme",
"sphin... | import os
import sys
import sphinx_rtd_theme
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "settings")
sys.path.insert(0, os.path.abspath("../.."))
import django
django.setup()
project = "django-postgres-extra"
copyright = "2019, Sector Labs"
author = "Sector Labs"
extensions = [
"sphinx_rtd_theme",
"sphin... |
Update comments in the layout test | from seleniumbase import BaseCase
class VisualLayoutTest(BaseCase):
def test_applitools_helloworld(self):
self.open('https://applitools.com/helloworld?diff1')
print('Creating baseline in "visual_baseline" folder...')
self.check_window(name="helloworld", baseline=True)
self.click('... | from seleniumbase import BaseCase
class VisualLayoutTest(BaseCase):
def test_applitools_helloworld(self):
self.open('https://applitools.com/helloworld?diff1')
print('Creating baseline in "visual_baseline" folder...')
self.check_window(name="helloworld", baseline=True)
self.click('... |
Add option for name and path of cloudConfig.yml file
This change adds a command line option to the dns script to specify
the name and location of the `cloudConfig.yml` file.
Signed-off-by: Nicolas Bock <4ad6fd604400c7892c7a2cb53bf674987bcaa405@suse.com> | #!/usr/bin/env python
import argparse
import yaml
def parse_commandline():
parser = argparse.ArgumentParser()
parser.add_argument(
"--dns-servers",
metavar="NAME",
help="A list of nameservers",
nargs="+",
default=[])
parser.add_argument(
"--ntp-servers",
... | #!/usr/bin/env python
import argparse
import yaml
def parse_commandline():
parser = argparse.ArgumentParser()
parser.add_argument(
"--dns-servers",
metavar="NAME",
help="A list of nameservers",
nargs="+",
default=[])
parser.add_argument(
"--ntp-servers",
... |
Print statistics easier to parse | package com.nurkiewicz.monkeys.actions;
import com.nurkiewicz.monkeys.behaviours.Cheater;
import com.nurkiewicz.monkeys.behaviours.Grudger;
import com.nurkiewicz.monkeys.behaviours.Sucker;
import com.nurkiewicz.monkeys.simulation.Population;
import com.nurkiewicz.monkeys.simulation.Statistics;
import org.slf4j.Logger;... | package com.nurkiewicz.monkeys.actions;
import com.google.common.collect.ImmutableSet;
import com.nurkiewicz.monkeys.simulation.Population;
import com.nurkiewicz.monkeys.simulation.Statistics;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.time.Clock;
import java.time.Duration;
import java.util.... |
Disable redux logger in test environment | import {createHistory} from 'history';
import {createStore, applyMiddleware, compose, combineReducers} from 'redux';
import thunkMiddleware from 'redux-thunk';
import {reduxReactRouter} from 'redux-react-router';
import routes from './routes';
import reducers from './reducers';
export default function createAppStore(... | import {createHistory} from 'history';
import {createStore, applyMiddleware, compose, combineReducers} from 'redux';
import thunkMiddleware from 'redux-thunk';
import {reduxReactRouter} from 'redux-react-router';
import routes from './routes';
import reducers from './reducers';
export default function createAppStore(... |
Update the version to 1.6.1 | __version_info__ = {
'major': 1,
'minor': 6,
'micro': 1,
'releaselevel': 'final',
'serial': 1
}
def get_version(short=False):
assert __version_info__['releaselevel'] in ('alpha', 'beta', 'final')
vers = ["%(major)i.%(minor)i" % __version_info__, ]
if __version_info__['micro'] and not s... | __version_info__ = {
'major': 1,
'minor': 6,
'micro': 0,
'releaselevel': 'final',
'serial': 1
}
def get_version(short=False):
assert __version_info__['releaselevel'] in ('alpha', 'beta', 'final')
vers = ["%(major)i.%(minor)i" % __version_info__, ]
if __version_info__['micro'] and not s... |
Add a URL to urlpatterns for home page | """bookshop URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/1.10/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: url(r'^$', views.home, name='home')
Class-b... | """bookshop URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/1.10/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: url(r'^$', views.home, name='home')
Class-b... |
Update export csv function to close file when finished | from s3v3 import *
import csv
# ORIGINAL VERSION - Leaves file open
# def write_to_file(filename, data_sample):
# example = csv.writer(open(filename, 'w', encoding='utf-8'), dialect='excel') # example is the variable of the new file that is open and which we can write to (using utf-8 encoding and an excel dialect).
... | from s3v3 import *
import csv
def write_to_file(filename, data_sample):
example = csv.writer(open(filename, 'w', encoding='utf-8'), dialect='excel') # example is the variable of the new file that is open and which we can write to (using utf-8 encoding and an excel dialect).
example.writerows(data_sample) # write ro... |
Fix clientside tests to use plugin interface | 'use strict';
/*jshint asi: true */
var browserify = require('browserify');
var proxyquire = require('../..');
var vm = require('vm');
function run(name) {
var src = '';
browserify()
.plugin(proxyquire.plugin)
.require(require.resolve('../..'), { expose: 'proxyquireify' })
.require(requir... | 'use strict';
/*jshint asi: true */
var proxyquire = require('../..');
var vm = require('vm');
function run(name) {
var src = '';
proxyquire.browserify()
.require(require.resolve('../..'), { expose: 'proxyquireify' })
.require(require.resolve('./' + name), { entry: true })
.bundle()
.o... |
Move todos into issues tracking on GitHub | #!/usr/bin/env python
import sys
def longest_duplicated_substring(string):
"""Return the longest duplicated substring.
Keyword Arguments:
string -- the string to examine for duplicated substrings
This approach examines each possible pair of starting points
for duplicated substrings. If the char... | #!/usr/bin/env python
import sys
# O(n^4) approach: generate all possible substrings and
# compare each for equality.
def longest_duplicated_substring(string):
"""Return the longest duplicated substring.
Keyword Arguments:
string -- the string to examine for duplicated substrings
This approach exa... |
Change mobx dependency version requirement from 2.3.x to 2.x | import { Tracker } from 'meteor/tracker';
import { checkNpmVersions } from 'meteor/tmeasday:check-npm-versions';
checkNpmVersions({
'mobx': '2.x'
}, 'space:tracker-mobx-autorun');
const { autorun } = require('mobx');
export default (trackerMobxAutorun) => {
let mobxDisposer = null;
let computation = null;
le... | import { Tracker } from 'meteor/tracker';
import { checkNpmVersions } from 'meteor/tmeasday:check-npm-versions';
checkNpmVersions({
'mobx': '2.3.x'
}, 'space:tracker-mobx-autorun');
const { autorun } = require('mobx');
export default (trackerMobxAutorun) => {
let mobxDisposer = null;
let computation = null;
... |
Set Animated GIFs to repeat | package com.github.rtyley.android.screenshot.paparazzo.processors;
import com.madgag.gif.fmsware.AnimatedGifEncoder;
import java.awt.image.BufferedImage;
import java.io.File;
import java.util.Map;
public class AnimatedGifCreator implements ScreenshotProcessor {
private final AnimatedGifEncoder gifEncoder;
pr... | package com.github.rtyley.android.screenshot.paparazzo.processors;
import com.madgag.gif.fmsware.AnimatedGifEncoder;
import java.awt.image.BufferedImage;
import java.io.File;
import java.util.Map;
public class AnimatedGifCreator implements ScreenshotProcessor {
private final AnimatedGifEncoder gifEncoder;
pr... |
Comment out preload as fetch headers | const fs = require('fs')
const path = require('path')
const promisify = require('util').promisify
const writeFile = promisify(fs.writeFile)
const globby = require('globby')
;(async () => {
// const posts = require('./dist/content/posts/index.json')
const files = await globby('./dist/**/*.{css,mjs}')
const header... | const fs = require('fs')
const path = require('path')
const promisify = require('util').promisify
const writeFile = promisify(fs.writeFile)
const globby = require('globby')
;(async () => {
const posts = require('./dist/content/posts/index.json')
const files = await globby('./dist/**/*.{css,mjs}')
const headers =... |
Resolve the promise once we know the model is valid | import Ember from 'ember';
export default Ember.Controller.extend({
form: function() {
return this.store.createRecord('ssh-key');
},
actions: {
deleteKey: function(key) {
this.store.find('ssh-key', key.id).then(function(key) {
key.destroyRecord();
});
},
save: function(deferr... | import Ember from 'ember';
export default Ember.Controller.extend({
form: function() {
return this.store.createRecord('ssh-key');
},
actions: {
deleteKey: function(key) {
this.store.find('ssh-key', key.id).then(function(key) {
key.destroyRecord();
});
},
save: function(deferr... |
Add support for CA certificates
better SSL support | from logging.handlers import SocketHandler
import ssl
class LogstashHandler(SocketHandler):
"""
Sends output to an optionally encrypted streaming logstash TCP listener.
"""
def __init__(self, host, port, keyfile=None, certfile=None, ca_certs=None, ssl=True):
SocketHandler.__init__(self, host, port)
se... | from logging.handlers import SocketHandler
import ssl
class LogstashHandler(SocketHandler):
"""
Sends output to an optionally encrypted streaming logstash TCP listener.
"""
def __init__(self, host, port, keyfile=None, certfile=None, ssl=True):
SocketHandler.__init__(self, host, port)
self.keyfile = ke... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.