Instruction stringlengths 14 778 | input_code stringlengths 0 4.24k | output_code stringlengths 1 5.44k |
|---|---|---|
Fix a pass by reference, and don't create APIs for hidden directories | <?php
namespace App\Providers;
use Illuminate\Routing\Router;
use Illuminate\Foundation\Support\Providers\RouteServiceProvider as ServiceProvider;
class RouteServiceProvider extends ServiceProvider
{
/**
* This namespace is applied to the controller routes in your routes file.
*
* In addition, it ... | <?php
namespace App\Providers;
use Illuminate\Routing\Router;
use Illuminate\Foundation\Support\Providers\RouteServiceProvider as ServiceProvider;
class RouteServiceProvider extends ServiceProvider
{
/**
* This namespace is applied to the controller routes in your routes file.
*
* In addition, it ... |
Fix to build mock from DbInterface | <?php
namespace Spika\Controller;
use Silex\WebTestCase;
class AuthControllerTest extends WebTestCase
{
public function createApplication()
{
require realpath(__DIR__ . '/../../../') . '/etc/app.php';
$spikadb = $this->getMockBuilder('\Spika\SpikaDBHandler')
->setMethods(array('doS... | <?php
namespace Spika\Controller;
use Silex\WebTestCase;
class AuthControllerTest extends WebTestCase
{
public function createApplication()
{
require realpath(__DIR__ . '/../../../') . '/etc/app.php';
$spikadb = $this->getMock('\Spika\Db\DbInterface');
$spikadb->expects($this->once())
... |
Add support for subcontexts too | <?php
namespace swestcott\MonologExtension\Context\Initializer;
use Behat\Behat\Context\Initializer\InitializerInterface,
Behat\Behat\Context\ContextInterface;
class MonologInitializer implements InitializerInterface
{
private $container;
public function __construct($container)
{
$this->cont... | <?php
namespace swestcott\MonologExtension\Context\Initializer;
use Behat\Behat\Context\Initializer\InitializerInterface,
Behat\Behat\Context\ContextInterface;
class MonologInitializer implements InitializerInterface
{
private $container;
public function __construct($container)
{
... |
Add initial styling to project | <!DOCTYPE html>
<html>
<head>
<title>Genesys - Home</title>
<link rel="stylesheet" type="text/css" href="{{ asset('css/main.css') }}">
</head>
<body class="home">
<div class="search-container">
<a class="log-out" href="#">Log Out</a>
<input class="member-search" type="search" placeholder="S... | <!DOCTYPE html>
<html>
<head>
<title>Genesys - Home</title>
<link rel="stylesheet" type="text/css" href="{{ asset('css/main.css') }}">
</head>
<body class="home">
<div class="search-container">
<a class="log-out" href="#">Log Out</a>
<input class="member-search" type="search" placeholder="S... |
Add checkbox for tasks form | <!-- form partial for tasks create and edit views -->
<!-- form partial for projects create and edit views -->
<div class="form-group">
{!! Form::label('name', 'Name:') !!}
{!! Form::text('name') !!}
</div>
<div class="form-group">
{!! Form::label('slug', 'Slug:') !!}
{!! Form::text('slug') !!}
</div>
<div class=... | <!-- form partial for tasks create and edit views -->
<!-- form partial for projects create and edit views -->
<div class="form-group">
{!! Form::label('name', 'Name:') !!}
{!! Form::text('name') !!}
</div>
<div class="form-group">
{!! Form::label('slug', 'Slug:') !!}
{!! Form::text('slug') !!}
</div>
<div class=... |
Fix cancel action in post form |
<?php
$action = empty($post['id']) ? url_for('posts') : url_for('posts', $post['id']);
$method = empty($post['id']) ? 'POST' : 'PUT';
?>
<form action="<?=$action?>" method="POST">
<fieldset id="post_form">
<legend>Post</legend>
<?php if(!empty($post['id'])): ?>
<input type="hidden" name="_method" va... |
<?php
$action = empty($post['id']) ? url_for('posts') : url_for('posts', $post['id']);
$method = empty($post['id']) ? 'POST' : 'PUT';
?>
<form action="<?=$action?>" method="POST">
<fieldset id="post_form">
<legend>Post</legend>
<?php if(!empty($post['id'])): ?>
<input type="hidden" name="_method" va... |
Use absolute path instead of relative. | <?php
$server = proc_open(PHP_BINARY . " PocketMine-MP/PocketMine-MP.phar --no-wizard --disable-readline", [
0 => ['pipe', 'r'],
1 => ['pipe', 'w'],
2 => ['pipe', 'w'],
], $pipes);
fwrite($pipes[0], "blocksniper\nmakeplugin BlockSniper\nstop\n\n");
while(!feof($pipes[1])) {
echo fgets($pipes[1]);
}
fclose($pipes... | <?php
$server = proc_open(PHP_BINARY . " /home/travis/build/PocketMine-MP/PocketMine-MP.phar --no-wizard --disable-readline", [
0 => ['pipe', 'r'],
1 => ['pipe', 'w'],
2 => ['pipe', 'w'],
], $pipes);
fwrite($pipes[0], "blocksniper\nmakeplugin BlockSniper\nstop\n\n");
while(!feof($pipes[1])) {
echo fgets($pipes[1]... |
Fix text color for account disabled page | {{--
Copyright (c) ppy Pty Ltd <contact@ppy.sh>.
This file is part of osu!web. osu!web is distributed with the hope of
attracting more community contributions to the core ecosystem of osu!.
osu!web is free software: you can redistribute it and/or modify
it under the terms of the Affero GNU General... | {{--
Copyright (c) ppy Pty Ltd <contact@ppy.sh>.
This file is part of osu!web. osu!web is distributed with the hope of
attracting more community contributions to the core ecosystem of osu!.
osu!web is free software: you can redistribute it and/or modify
it under the terms of the Affero GNU General... |
Add missing doc-blocks to keep consistent | <?php
namespace MetricsMonitor\Service\Storage;
use Doctrine\DBAL\Connection;
abstract class AbstractStorage
{
/**
* @var Connection
*/
protected $connection;
public function __construct(Connection $connection)
{
$this->connection = $connection;
}
}
| <?php
namespace MetricsMonitor\Service\Storage;
use Doctrine\DBAL\Connection;
/**
* @package MetricsMonitor\Service\Storage
*/
abstract class AbstractStorage
{
/**
* @var Connection
*/
protected $connection;
/**
* @param Connection $connection
*/
public function __construct(Con... |
Move Timber class check to the top of the file | <?php
use Roots\Sage\Setup;
/**
* Timber
*/
class TwigSageTheme extends TimberSite {
function __construct() {
add_filter( 'timber_context', array( $this, 'add_to_context' ) );
parent::__construct();
}
function add_to_context( $context ) {
/* Add extra data */
$context['f... | <?php
use Roots\Sage\Setup;
/**
* Check if Timber is activated
*/
if ( ! class_exists( 'Timber' ) ) {
add_action( 'admin_notices', function() {
echo '<div class="error"><p>Timber not activated. Make sure you activate the plugin in <a href="' . esc_url( admin_url( 'plugins.php#timber' ) ) . '">' . esc_u... |
Make 'UserRegistrationRequest' order by 'created_at' | <?php
namespace App\Http\Controllers;
use Illuminate\Http\Request;
use App\UserRegistrationRequest;
class UserRegistrationRequestController extends Controller
{
public function __construct()
{
$this->middleware('auth:api');
$this->middleware('admin');
}
public function index(Request $request)
{
... | <?php
namespace App\Http\Controllers;
use Illuminate\Http\Request;
use App\UserRegistrationRequest;
class UserRegistrationRequestController extends Controller
{
public function __construct()
{
$this->middleware('auth:api');
$this->middleware('admin');
}
public function index(Request $request)
{
... |
Add PHP that queries the Database for a user based on ID and return JSON | <?php
echo 'Hello from PHP '.$_GET['customerID']; | <?php
// Connect to the database
$dbc = new mysqli('localhost', 'root', '', 'ajax_customers');
// Filter the ID
$customerID = $dbc->real_escape_string( $_GET['customerID'] );
// Prepare the SQL
$sql = "SELECT phone, email
FROM customers
WHERE id = $customerID";
// Run the query
$resultDB = $dbc->query($sql);
/... |
Fix email obfuscate when they contain a subject | <?php namespace Exolnet\Html;
/**
* Copyright © 2014 eXolnet Inc. All rights reserved. (http://www.exolnet.com)
*
* This file contains copyrighted code that is the sole property of eXolnet Inc.
* You may not use this file except with a written agreement.
*
* This code is distributed on an 'AS IS' basis, WITHOUT W... | <?php namespace Exolnet\Html;
/**
* Copyright © 2014 eXolnet Inc. All rights reserved. (http://www.exolnet.com)
*
* This file contains copyrighted code that is the sole property of eXolnet Inc.
* You may not use this file except with a written agreement.
*
* This code is distributed on an 'AS IS' basis, WITHOUT W... |
Include correct Paweł's email :camel: | <?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.
*/
namespace Sylius\Component\Shipping\Model;
use Doctrine\Common\Collections\Collection;
/**
* @autho... | <?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.
*/
namespace Sylius\Component\Shipping\Model;
use Doctrine\Common\Collections\Collection;
/**
* @autho... |
Update docblock to relect rename to canCreate() | <?php
/**
* Zend Framework (http://framework.zend.com/)
*
* @link http://github.com/zendframework/zf2 for the canonical source repository
* @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
namespace ... | <?php
/**
* Zend Framework (http://framework.zend.com/)
*
* @link http://github.com/zendframework/zf2 for the canonical source repository
* @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
namespace ... |
Enforce the limit to be reset in get query : | <?php
/*
* This file is part of the Pagerfanta package.
*
* (c) Pablo Díez <pablodip@gmail.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Pagerfanta\Adapter;
/**
* PropelAdapter.
*
* @author William DURAND <wi... | <?php
/*
* This file is part of the Pagerfanta package.
*
* (c) Pablo Díez <pablodip@gmail.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Pagerfanta\Adapter;
/**
* PropelAdapter.
*
* @author William DURAND <wi... |
Allow foriegn keys on photo table to default to null so we can rollback migrations | <?php
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class RemoveEventIdFromPhotos extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('photos', function (Blueprint $table) {
... | <?php
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class RemoveEventIdFromPhotos extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('photos', function (Blueprint $table) {
... |
Fix logic for determining whether users can add tags to a discussion | <?php
/*
* This file is part of Flarum.
*
* For detailed copyright and license information, please view the
* LICENSE file that was distributed with this source code.
*/
namespace Flarum\Tags\Access;
use Flarum\Tags\Tag;
use Flarum\User\Access\AbstractPolicy;
use Flarum\User\User;
class TagPolicy extends Abstr... | <?php
/*
* This file is part of Flarum.
*
* For detailed copyright and license information, please view the
* LICENSE file that was distributed with this source code.
*/
namespace Flarum\Tags\Access;
use Flarum\Tags\Tag;
use Flarum\User\Access\AbstractPolicy;
use Flarum\User\User;
class TagPolicy extends Abstr... |
Add the "img-responsive" class to classes of images in posts | <?php
/**
* Clean up the_excerpt()
*/
function roots_excerpt_more() {
return ' … <a href="' . get_permalink() . '">' . __('Continued', 'roots') . '</a>';
}
add_filter('excerpt_more', 'roots_excerpt_more');
/**
* Disable page scroll when clicking the more link
*/
function disable_more_link_scroll($link) {
... | <?php
/**
* Clean up the_excerpt()
*/
function roots_excerpt_more() {
return ' … <a href="' . get_permalink() . '">' . __('Continued', 'roots') . '</a>';
}
add_filter('excerpt_more', 'roots_excerpt_more');
/**
* Disable page scroll when clicking the more link
*/
function disable_more_link_scroll($link) {
... |
Correct buggy behavior for development proxy e-mail address filter | <?php
// Remove the «Private» label from the beginning of private posts' titles
add_filter('private_title_format', function($title) {
return '%s';
});
// Hide frontend admin bar from regular users
add_filter('show_admin_bar', function($show_admin_bar) {
return current_user_can('manage_options');
});
// In de... | <?php
// Remove the «Private» label from the beginning of private posts' titles
add_filter('private_title_format', function($title) {
return '%s';
});
// Hide frontend admin bar from regular users
add_filter('show_admin_bar', function($show_admin_bar) {
return current_user_can('manage_options');
});
// In de... |
Allow to update cache key | <?php
return array(
'default' => 'default',
'path' => base_path('themes'),
'cache' => [
'enabled' => true,
'lifetime' => 86400,
]
); | <?php
return array(
'default' => 'default',
'path' => base_path('themes'),
'cache' => [
'enabled' => true,
'key' => 'pingpong.themes',
'lifetime' => 86400,
]
); |
Fix lexer test error message | <?php
namespace igorw\edn;
class LexerTest extends \PHPUnit_Framework_TestCase {
/**
* @test
* @dataProvider provideInvalidEdn
* @expectedException Phlexy\LexingException
*/
function parseShouldRejectInvalidSyntax($edn) {
$data = tokenize($edn);
$this->fail(sprintf('Expect... | <?php
namespace igorw\edn;
class LexerTest extends \PHPUnit_Framework_TestCase {
/**
* @test
* @dataProvider provideInvalidEdn
* @expectedException Phlexy\LexingException
*/
function parseShouldRejectInvalidSyntax($edn) {
$data = tokenize($edn);
$this->fail(sprintf('Expect... |
Update search:uninstall to work with multiple indexes | <?php
namespace App\Console\Commands;
use Illuminate\Console\Command;
use Elasticsearch;
class UninstallSearch extends Command
{
protected $signature = 'search:uninstall {index? : The name of the index to delete}';
protected $description = 'Tear down the Search Service index';
/**
* The name of t... | <?php
namespace App\Console\Commands;
use Illuminate\Console\Command;
use Elasticsearch;
use App\Console\Helpers\Indexer;
class UninstallSearch extends Command
{
use Indexer;
protected $signature = 'search:uninstall {prefix? : The prefixes of the indexes to delete} {--y|yes : Answer "yes" to all prompts c... |
Allow user email address to be mass assigned | <?php
namespace App;
use Illuminate\Notifications\Notifiable;
use Illuminate\Foundation\Auth\User as Authenticatable;
class User extends Authenticatable
{
use Notifiable;
/**
* The attributes that are mass assignable.
*
* @var array
*/
protected $fillable = [
'username', 'ful... | <?php
namespace App;
use Illuminate\Notifications\Notifiable;
use Illuminate\Foundation\Auth\User as Authenticatable;
class User extends Authenticatable
{
use Notifiable;
/**
* The attributes that are mass assignable.
*
* @var array
*/
protected $fillable = [
'username', 'ful... |
Check match with identity operator against a boolean | <?php
namespace PHPSpec2\Matcher;
abstract class BasicMatcher implements MatcherInterface
{
final public function positiveMatch($name, $subject, array $arguments)
{
if (!$this->matches($subject, $arguments)) {
throw $this->getFailureException($name, $subject, $arguments);
}
... | <?php
namespace PHPSpec2\Matcher;
abstract class BasicMatcher implements MatcherInterface
{
final public function positiveMatch($name, $subject, array $arguments)
{
if (false === $this->matches($subject, $arguments)) {
throw $this->getFailureException($name, $subject, $arguments);
... |
Add execute method so generate command can run. | <?php
namespace FeatureBrowser\FeatureBrowser\Cli;
use Symfony\Component\Console\Command\Command as BaseCommand;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
final class GenerateCommand extends BaseCommand
{
protected function configure()
{
... | <?php
namespace FeatureBrowser\FeatureBrowser\Cli;
use Symfony\Component\Console\Command\Command as BaseCommand;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
final class GenerateCommand extends BaseCommand
{
protected function configure()
{
... |
Fix parameter for action AuthRevoke | <?php
///////////////////////////////////////////////////////////////////////////////
//
// Copyright f-project.net 2010-present. All Rights Reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of th... | <?php
///////////////////////////////////////////////////////////////////////////////
//
// Copyright f-project.net 2010-present. All Rights Reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of th... |
Reorder down() for migrate:refresh and migrate:rollback consistency | <?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
class Scaffoldinterfaces extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('scaffoldinterfaces', function (Blueprint $table) {
... | <?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
class Scaffoldinterfaces extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('scaffoldinterfaces', function (Blueprint $table) {
... |
Add support for Symfony 5 to process runner | <?php
namespace Studio\Shell;
use RuntimeException;
use Symfony\Component\Process\Process;
class Shell
{
public static function run($task, $directory = null)
{
$process = new Process("$task", $directory);
$process->setTimeout(3600);
$process->run();
if (! $process->isSuccess... | <?php
namespace Studio\Shell;
use ReflectionClass;
use RuntimeException;
use Symfony\Component\Process\Process;
class Shell
{
public static function run($task, $directory = null)
{
$process = static::makeProcess($task, $directory);
$process->setTimeout(3600);
$process->run();
... |
Use page-based pagination instead of cursor-based | <?php
namespace ZfrShopify\Iterator;
use Guzzle\Service\Command\CommandInterface;
use Guzzle\Service\Resource\ResourceIterator;
/**
* @author Daniel Gimenes
*/
final class ShopifyResourceIterator extends ResourceIterator
{
/**
* @param CommandInterface $command
* @param array $data
*/... | <?php
namespace ZfrShopify\Iterator;
use Guzzle\Service\Command\CommandInterface;
use Guzzle\Service\Resource\ResourceIterator;
/**
* @author Daniel Gimenes
*/
final class ShopifyResourceIterator extends ResourceIterator
{
/**
* @param CommandInterface $command
* @param array $data
*/... |
Mark test that does not perform assertions as such | <?php
declare(strict_types=1);
/*
* This file is part of the Sonata Project package.
*
* (c) Thomas Rabaix <thomas.rabaix@sonata-project.org>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Sonata\DoctrinePHPCRAdminBun... | <?php
declare(strict_types=1);
/*
* This file is part of the Sonata Project package.
*
* (c) Thomas Rabaix <thomas.rabaix@sonata-project.org>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Sonata\DoctrinePHPCRAdminBun... |
Load Backbone app on selective pages | <?php
function theme_enqueue_styles() {
$parent_style = 'parent-style';
wp_enqueue_script( 'jquery' );
wp_enqueue_style( 'bootstrap-css', get_stylesheet_directory_uri().'/bootstrap/css/bootstrap.css' );
wp_enqueue_script( 'bootstrap-js', get_stylesheet_directory_uri().'/bootstrap/js/bootstrap.js' );
... | <?php
function theme_enqueue_styles() {
$parent_style = 'parent-style';
wp_enqueue_script( 'jquery' );
wp_enqueue_style( 'bootstrap-css', get_stylesheet_directory_uri().'/bootstrap/css/bootstrap.css' );
wp_enqueue_script( 'bootstrap-js', get_stylesheet_directory_uri().'/bootstrap/js/bootstrap.js' );
... |
Add project_id to invoice detail | <?php
namespace Picqer\Financials\Moneybird\Entities\Generic;
use Picqer\Financials\Moneybird\Model;
/**
* Class InvoiceDetail.
*/
abstract class InvoiceDetail extends Model
{
/**
* @var array
*/
protected $fillable = [
'id',
'tax_rate_id',
'ledger_account_id',
'am... | <?php
namespace Picqer\Financials\Moneybird\Entities\Generic;
use Picqer\Financials\Moneybird\Model;
/**
* Class InvoiceDetail.
*/
abstract class InvoiceDetail extends Model
{
/**
* @var array
*/
protected $fillable = [
'id',
'tax_rate_id',
'ledger_account_id',
'am... |
Increase items per blog (archive) page. | <?php
/* -----------------------------------------------------------------------------
Archive pagination
--------------------------------------------------------------------------------
The number of items on a `target` page. To have all items listed
on one page (e.g. no pagination) set varaible to `false`.
The `... | <?php
/* -----------------------------------------------------------------------------
Archive pagination
--------------------------------------------------------------------------------
The number of items on a `target` page. To have all items listed
on one page (e.g. no pagination) set varaible to `false`.
The `... |
Add _cc parameter to tracking codes. | <?php
namespace Neuron\Net;
use Neuron\Config;
/**
* Class QueryTrackingParameters
* @package Neuron\Net
*/
class QueryTrackingParameters
{
/**
* @return QueryTrackingParameters
*/
public static function instance()
{
static $in;
if (!isset($in)) {
$in = new self();
// Can we set these from confi... | <?php
namespace Neuron\Net;
use Neuron\Config;
/**
* Class QueryTrackingParameters
* @package Neuron\Net
*/
class QueryTrackingParameters
{
/**
* @return QueryTrackingParameters
*/
public static function instance()
{
static $in;
if (!isset($in)) {
$in = new self();
// Can we set these from confi... |
Change PHP-only to curly brackets format | <?php
/**
* Default hero template file.
*
* This is the default hero image for page templates, called
* 'block'. Strictly air specific.
*
* @package air-light
*/
// Block settings
if ( is_front_page() ) :
$block_class = ' block-front';
else :
$block_class = ' block-' . get_post_type();
endif;
// Featured ima... | <?php
/**
* Default hero template file.
*
* This is the default hero image for page templates, called
* 'block'. Strictly air specific.
*
* @package air-light
*/
// Block settings
if ( is_front_page() ) {
$block_class = ' block-front';
} else {
$block_class = ' block-' . get_post_type();
}
// Featured image
... |
Add url rewrite for if a product is added below a grouped product | <?php
class GroupedProduct_CatalogueProduct extends DataExtension {
private static $has_one = array(
"ProductGroup" => "Product"
);
public function updateCMSFields(FieldList $fields) {
$fields->addFieldToTab(
"Root.Settings",
DropdownField::create(
... | <?php
class GroupedProduct_CatalogueProduct extends DataExtension {
private static $has_one = array(
"ProductGroup" => "Product"
);
public function updateCMSFields(FieldList $fields) {
$fields->addFieldToTab(
"Root.Settings",
DropdownField::create(
... |
Check for autoloader file before trying to include it | <?php
/**
* A (quick and dirty) scanner to scanning all (linked) pages of an https-enabled website for Mixed Content
* @author Bramus! <bramus@bram.us>
* @version 1.0
*
* NO NEED TO TOUCH THIS FILE ... PLEASE REFER TO THE README.MD FILE ;-)
*/
// Error settings
error_reporting(E_ERROR);
ini_set('display_errors'... | <?php
/**
* A (quick and dirty) scanner to scanning all (linked) pages of an https-enabled website for Mixed Content
* @author Bramus! <bramus@bram.us>
* @version 1.0
*
* NO NEED TO TOUCH THIS FILE ... PLEASE REFER TO THE README.MD FILE ;-)
*/
// Error settings
error_reporting(E_ERROR);
ini_set('display_errors'... |
Fix bug on country joint | <?php
namespace WBB\BarBundle\Repository;
use WBB\BarBundle\Entity\Ad;
use WBB\CoreBundle\Repository\EntityRepository;
/**
* AdRepository
*
* This class was generated by the Doctrine ORM. Add your own custom
* repository methods below.
*/
class AdRepository extends EntityRepository
{
public function findOne... | <?php
namespace WBB\BarBundle\Repository;
use WBB\BarBundle\Entity\Ad;
use WBB\CoreBundle\Repository\EntityRepository;
/**
* AdRepository
*
* This class was generated by the Doctrine ORM. Add your own custom
* repository methods below.
*/
class AdRepository extends EntityRepository
{
public function findOne... |
Add a test for teams page data | <?php
namespace Tests\Feature;
use Tests\TestCase;
use Illuminate\Foundation\Testing\DatabaseTransactions;
use App\Org;
use App\User;
class DataTest extends TestCase
{
use DatabaseTransactions;
/**
* Test dashboard gets orgs.
*
* @return void
*/
public function testDashboard()
{
... | <?php
namespace Tests\Feature;
use Tests\TestCase;
use Illuminate\Foundation\Testing\DatabaseTransactions;
use App\Org;
use App\User;
class DataTest extends TestCase
{
use DatabaseTransactions;
/**
* Test dashboard gets orgs.
*
* @return void
*/
public function testDashboard()
{
... |
Add field name to the enrollments export list | <!DOCTYPE html>
<html>
<table>
<tr>
<th>Course</th>
<th>Student ID</th>
<th>Student Name</th>
<th>Student E-mail</th>
<th>Enrollment Date</th>
</tr>
@foreach($enrollments as $enrollment)
<tr>
<td>{{ $enrollment->course->id }}</td>
<td>{{ $enrollmen... | <!DOCTYPE html>
<html>
<table>
<tr>
<th>Course ID</th>
<th>Course</th>
<th>Student ID</th>
<th>Student Name</th>
<th>Student E-mail</th>
<th>Enrollment Date</th>
</tr>
@foreach($enrollments as $enrollment)
<tr>
<td>{{ $enrollment->course->id }}</td... |
Return types in routing and news bundle | <?php
/*
* WellCommerce Open-Source E-Commerce Platform
*
* This file is part of the WellCommerce package.
*
* (c) Adam Piotrowski <adam@wellcommerce.org>
*
* For the full copyright and license information,
* please view the LICENSE file that was distributed with this source code.
*/
namespace WellCommerce\Bu... | <?php
/*
* WellCommerce Open-Source E-Commerce Platform
*
* This file is part of the WellCommerce package.
*
* (c) Adam Piotrowski <adam@wellcommerce.org>
*
* For the full copyright and license information,
* please view the LICENSE file that was distributed with this source code.
*/
namespace WellCommerce\Bu... |
Correct capitalisation for LLoydsTSB bank according to our internal DB format. | <?php
require '../../util.php';
if (count($argv) < 3)
{
echo "php import_csv.php [bank_name] [CSV]\n";
exit(-1);
}
$bank_name = $argv[1];
$lines = file($argv[2], FILE_IGNORE_NEW_LINES);
if ($bank_name != 'LloydsTSB' && $bank_name != 'HSBC')
{
echo "Incorrect bank specified.\n";
exit(-1);
}
foreach (... | <?php
require '../../util.php';
if (count($argv) < 3)
{
echo "php import_csv.php [bank_name] [CSV]\n";
exit(-1);
}
$bank_name = $argv[1];
$lines = file($argv[2], FILE_IGNORE_NEW_LINES);
if ($bank_name != 'LLoydsTSB' && $bank_name != 'HSBC')
{
echo "Incorrect bank specified.\n";
exit(-1);
}
foreach (... |
Make Essence autoloader not attempt to load non-Essence classes. | <?php
/**
* @author Félix Girault <felix.girault@gmail.com>
* @license FreeBSD License (http://opensource.org/licenses/BSD-2-Clause)
*/
namespace Essence\Utility;
/**
* A simple PSR-0 compliant class loader.
*
* @package Essence.Utility
*/
class Autoload {
/**
* Sets autoload up on the given path.
*
... | <?php
/**
* @author Félix Girault <felix.girault@gmail.com>
* @license FreeBSD License (http://opensource.org/licenses/BSD-2-Clause)
*/
namespace Essence\Utility;
/**
* A simple PSR-0 compliant class loader.
*
* @package Essence.Utility
*/
class Autoload {
/**
* Sets autoload up on the given path.
*
... |
Include correct Paweł's email :camel: | <?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.
*/
namespace Sylius\Component\Payment\Model;
use Doctrine\Common\Collections\Collection;
/**
* Interfa... | <?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.
*/
namespace Sylius\Component\Payment\Model;
use Doctrine\Common\Collections\Collection;
/**
* Interfa... |
Remove probably outdated error suppression | <?php
class Bundler {
private function sort( &$array ) {
// We have to ignore the error here (use @usort)
// otherwise this code fails when executed by unit tests
// See: https://bugs.php.net/bug.php?id=50688
// phpcs:ignore Generic.PHP.NoSilencedErrors
@usort( $array, static function ( Bundleable $a, Bun... | <?php
class Bundler {
private function sort( &$array ) {
usort( $array, static function ( Bundleable $a, Bundleable $b ) {
return strcmp( $b->getSortingKey(), $a->getSortingKey() );
} );
}
/**
* Bundle bundleable elements that can be bundled by their bundling keys
*
* @param Bundleable[] $bundleables... |
Change route param to GET or POST param | <?php
namespace CodeDay\Clear\Http\Controllers\Api;
use \CodeDay\Clear\Models;
use \CodeDay\Clear\ModelContracts;
class TokenController extends ApiController {
public function getToken()
{
$user = Models\User::fromToken(\Route::input('token'));
if(isset($user)){
retu... | <?php
namespace CodeDay\Clear\Http\Controllers\Api;
use \CodeDay\Clear\Models;
use \CodeDay\Clear\ModelContracts;
class TokenController extends ApiController {
public function getToken()
{
$user = Models\User::fromToken(\Input::get('token'));
if(isset($user)){
return... |
Test case for devload command bug | [ f
[ \ x : * ->
g := ? : * ;
] ;
a := ? : f.g ;
]
| [ f
[ \ x : * ->
g := ? : * ;
] [| make h : * |] ;
a := ? : f.g ;
]
|
Set SVN properties for new file. | ## $Id: README.pod 20863 2007-08-26 18:47:04Z coke $
=head1 Things that NQP needs
This list is based on discussions with pmichaud and unimplemented
items in the grammar, C<src/Grammar.pg>.
=head2 Code
=over 4
=item * return
Return needs to work on an exception model, and will likely require
PAST/POST changes to ... | ## $Id$
=head1 Things that NQP needs
This list is based on discussions with pmichaud and unimplemented
items in the grammar, C<src/Grammar.pg>.
=head2 Code
=over 4
=item * return
Return needs to work on an exception model, and will likely require
PAST/POST changes to support it.
=item * $( ... )
Scalar context... |
Set svn:keywords and svn:eol-style appropriately | # Copyright (C) 2007, The Perl Foundation.
# $Id: metacommitter_guide.pod 17497 2007-03-15 18:50:37Z paultcochrane $
=head1 Cage Cleaner Guide
From F<docs/roles_responsibilities.pod>:
Fixes failing tests, makes sure coding standards are implemented, reviews
documentation and examples. A class of tickets in the tra... | # Copyright (C) 2007, The Perl Foundation.
# $Id$
=head1 Cage Cleaner Guide
From F<docs/roles_responsibilities.pod>:
Fixes failing tests, makes sure coding standards are implemented, reviews
documentation and examples. A class of tickets in the tracking system (RT)
has been created for use by this group. This is ... |
Add documentation for SNI APIs | =pod
=head1 NAME
SSL_CTX_set_tlsext_servername_callback, SSL_CTX_set_tlsext_servername_arg,
SSL_get_servername_type, SSL_get_servername - handle server name indication
(SNI)
=head1 SYNOPSIS
#include <openssl/ssl.h>
long SSL_CTX_set_tlsext_servername_callback(SSL_CTX *ctx,
int (... | |
Add documentation for the ability to control the number of tickets | =pod
=head1 NAME
SSL_set_num_tickets,
SSL_get_num_tickets,
SSL_CTX_set_num_tickets,
SSL_CTX_get_num_tickets
- control the number of TLSv1.3 session tickets that are issued
=head1 SYNOPSIS
#include <openssl/ssl.h>
int SSL_set_num_tickets(SSL *s, size_t num_tickets);
size_t SSL_get_num_tickets(SSL *s);
int SSL_C... | |
Fix Appveyor test result reporting | "$($env:PYTHON)/python.exe -m pytest --junixtml=TestResults.xml"
$client = New-Object "System.Net.WebClient"
$client.UploadFile("https://ci.appveyor.com/api/testresults/junit/$($env:APPVEYOR_JOB_ID)", (Resolve-Path TestResults.xml))
| python -m pytest --junixtml=TestResults.xml
$client = New-Object "System.Net.WebClient"
$client.UploadFile("https://ci.appveyor.com/api/testresults/junit/$($env:APPVEYOR_JOB_ID)", (Resolve-Path TestResults.xml))
|
Add the sample POV-Ray file included in the download to the repo. | #include "colors.inc"
#declare lookFrom = 0;
#declare lookAt = -z; // Use this for loop graphs
#declare lookAt = -x; // Use this when defining the honeycomb with 6 angles
//background { CHSL2RGB( <220, 1, .15> ) }
background { White }
light_source { lookFrom White }
global_settings
{
assumed_gamma 1.5
... | |
Upgrade to Dolphin VM 7.0.28 |
# Powershell script to pull the VM files from GitHub into the current folder.
# Edit the following to match the version of the VM that is compatible with this image
param
(
[string]$VMversion="v7.0.27"
)
Try
{
$scriptDir = Split-Path $script:MyInvocation.MyCommand.Path;
Write-Host "Fetching DolphinVM.zip" $V... |
# Powershell script to pull the VM files from GitHub into the current folder.
# Edit the following to match the version of the VM that is compatible with this image
param
(
[string]$VMversion="v7.0.28"
)
Try
{
$scriptDir = Split-Path $script:MyInvocation.MyCommand.Path;
Write-Host "Fetching DolphinVM.zip" $V... |
Set PSReadLine edit mode to Emacs | function prompt {
$location = ([string]$(get-location)).Replace($HOME, '~')
"$location |-/ "
}
Set-Alias g git
function e {
emacsclient --alternate-editor="" $Args
}
$local = "$PSScriptRoot/profile_local.ps1"
(Test-Path $local) -And (. $local) > $null
| if (Get-Module PSReadLine) {
Set-PSReadLineOption -EditMode Emacs
}
function prompt {
$location = ([string]$(get-location)).Replace($HOME, '~')
"$location |-/ "
}
Set-Alias g git
function e {
emacsclient --alternate-editor="" $Args
}
$local = "$PSScriptRoot/profile_local.ps1"
(Test-Path $local) -And ... |
Remove Octopus error hack now that it breaks Octopus. | $deployToolsDir = Split-Path ((Get-Variable MyInvocation -Scope 0).Value.MyCommand.Path)
if (Test-Path variable:\OctopusParameters)
{
foreach($kp in $OctopusParameters.GetEnumerator())
{
Set-Content ("env:\" + $kp.Key) ($kp.Value) -Force
}
}
if(!(Test-Path "env:\ConfigOnly"))
{
Set-Content "e... | $deployToolsDir = Split-Path ((Get-Variable MyInvocation -Scope 0).Value.MyCommand.Path)
if (Test-Path variable:\OctopusParameters)
{
foreach($kp in $OctopusParameters.GetEnumerator())
{
Set-Content ("env:\" + $kp.Key) ($kp.Value) -Force
}
}
if(!(Test-Path "env:\ConfigOnly"))
{
Set-Content "e... |
Fix typo: installes -> installed | #Script based on https://raw.githubusercontent.com/Azure/azure-quickstart-templates/master/visual-studio-dev-vm-chocolatey/scripts/SetupChocolatey.ps1
param([Parameter(Mandatory=$true)][string]$chocoPackages)
Write-Host "File packages URL: $linktopackages"
#Changing ExecutionPolicy
Set-ExecutionPolicy -ExecutionPolic... | #Script based on https://raw.githubusercontent.com/Azure/azure-quickstart-templates/master/visual-studio-dev-vm-chocolatey/scripts/SetupChocolatey.ps1
param([Parameter(Mandatory=$true)][string]$chocoPackages)
Write-Host "File packages URL: $linktopackages"
#Changing ExecutionPolicy
Set-ExecutionPolicy -ExecutionPolic... |
Fix for C++/CLI to ensure that the assembly gets removed | param($installPath, $toolsPath, $package, $project)
$obj = $project.Object
$getRefsMethod = [Microsoft.VisualStudio.Project.VisualC.VCProjectEngine.VCProjectShim].GetMethod("get_References")
$refs = $getRefsMethod.Invoke($obj, $null)
$assemblyRef = $refs.Find("RestSharp.Portable.Encodings")
if ($assemblyRef -ne $NULL)... | param($installPath, $toolsPath, $package, $project)
$obj = $project.Object
$getRefsMethod = [Microsoft.VisualStudio.Project.VisualC.VCProjectEngine.VCProjectShim].GetMethod("get_References")
$refs = $getRefsMethod.Invoke($obj, $null)
$assemblyRef = $refs.Find("RestSharp.Portable")
if ($assemblyRef -ne $NULL) {
$assem... |
Update script to get proper incremental versions in develop branch | $publishVersion = $Env:GitVersion_MajorMinorPatch
# Regular expression pattern to find the version in the build number
# and then apply it to the assemblies
$versionRegex = "\d+\.\d+\.\d+\.\d+"
$vsixManifestSearchPattern = "./source.extension.vsixmanifest"
$vsixManifestCollection = (Get-ChildItem $vsixManifestSearch... | $publishVersion = $Env:GitVersion_MajorMinorPatch+"."+$Env:GitVersion_PreReleaseNumber
# Regular expression pattern to find the version in the build number
# and then apply it to the assemblies
$versionRegex = "\d+\.\d+\.\d+\.\d+"
$vsixManifestSearchPattern = "./source.extension.vsixmanifest"
$vsixManifestCollection... |
Add script to source VC env into powershell | # Setups VC environment from bat.
# It runs environment in cmd and extract all variables into temp file.
# which then is used to source environment.
function set_vc($arch) {
$vc_env = "vcvars$arch.bat"
if (Get-Command $vc_env -errorAction SilentlyContinue)
{
$tempFile = [IO.Path]::GetTempFileName()... | |
Add powershell script to build installer. | $launcherExe = "../RXL.WPFClient/bin/Release/RXL.exe"
$versionObj = [System.Reflection.Assembly]::LoadFrom($launcherExe).GetName().Version
$version = $versionObj.Major.ToString() + "." + $versionObj.Minor.ToString() + "." + $versionObj.Build.ToString()
"Building installer, setting version to " + $version + "."
Remove... | |
Deploy test app for vnetRouteAllEnabled | $location = 'Australia East'
$loc = 'aue'
$rg = 'hellovnetrouteall-rg'
$plan = "hellovnetrouteall-$loc-plan"
$tags = 'project=private-paas'
$app = "hellovnetrouteall-$loc"
$vnet = "hellovnetrouteall-$loc-vnet"
$planSubnet = 'asp'
$nsg = 'deny-all-internet-out'
# Create resource group
az group create -n $rg --location ... | |
Make Add-Type test -Pending until it passes on Windows | Describe "Add-Type" {
It "Should not throw given a simple class definition" {
{ Add-Type -TypeDefinition "public static class foo { }" } | Should Not Throw
}
}
| Describe "Add-Type" {
It -Pending "Should not throw given a simple class definition" {
{ Add-Type -TypeDefinition "public static class foo { }" } | Should Not Throw
}
}
|
Change test framework to use 4 chars of guid for random names. | function New-Guid {
[System.Guid]::NewGuid().ToString("d").Substring(0, 6).Replace("-", "")
}
| function New-Guid {
[System.Guid]::NewGuid().ToString("d").Substring(0, 4).Replace("-", "")
}
|
Add ll function as alias | sal gh help
function sl.. { sl .. }
function sl~ { sl ~ }
function prompt {
$Host.UI.RawUI.WindowTitle = "PS $($ExecutionContext.SessionState.Path.CurrentLocation)$('>' * ($NestedPromptLevel + 1))"
return 'PS> '
}
| sal gh help
function ll([string[]]$Path = '.') { gci $Path -Exclude .* }
function sl.. { sl .. }
function sl~ { sl ~ }
function prompt {
$Host.UI.RawUI.WindowTitle = "PS $($ExecutionContext.SessionState.Path.CurrentLocation)$('>' * ($NestedPromptLevel + 1))"
return 'PS> '
}
|
Fix package restore for solution packages. | param(
[int]$buildNumber = 0
)
if(Test-Path Env:\APPVEYOR_BUILD_NUMBER){
$buildNumber = [int]$Env:APPVEYOR_BUILD_NUMBER
Write-Host "Using APPVEYOR_BUILD_NUMBER"
}
"Build number $buildNumber"
$packageConfigs = Get-ChildItem . -Recurse | where{$_.Name -like "packages.*.config"}
foreach($packageConfig i... | param(
[int]$buildNumber = 0
)
if(Test-Path Env:\APPVEYOR_BUILD_NUMBER){
$buildNumber = [int]$Env:APPVEYOR_BUILD_NUMBER
Write-Host "Using APPVEYOR_BUILD_NUMBER"
}
"Build number $buildNumber"
src\.nuget\nuget.exe i src\.nuget\packages.config -o src\packages
$packageConfigs = Get-ChildItem . -Recurse ... |
Revert "Use native powershell way to create dir if it doesn't exist" | $packageName = '{{PackageName}}'
$url = '{{DownloadUrl}}'
$checksum = '{{Checksum}}'
$checksumType = 'sha1'
$toolsDir = "$(Split-Path -parent $MyInvocation.MyCommand.Definition)"
$installFile = Join-Path $toolsDir "$($packageName).exe"
$chocTempDir = Join-Path $Env:Temp "chocolatey"
$tempDir = Join-Path $chocTempDir "... | $packageName = '{{PackageName}}'
$url = '{{DownloadUrl}}'
$checksum = '{{Checksum}}'
$checksumType = 'sha1'
$toolsDir = "$(Split-Path -parent $MyInvocation.MyCommand.Definition)"
$installFile = Join-Path $toolsDir "$($packageName).exe"
$chocTempDir = Join-Path $Env:Temp "chocolatey"
$tempDir = Join-Path $chocTempDir "... |
Improve error handling of cd | # Provides linux like aliases
Remove-Item -ErrorAction SilentlyContinue alias:\cd
Remove-Item -ErrorAction SilentlyContinue alias:\pwd
Remove-Item -ErrorAction SilentlyContinue alias:\which
Remove-Item -ErrorAction SilentlyContinue alias:\pwd
#get only definition
function which($name) {
Get-Command $name | Select... | # Provides linux like aliases
Remove-Item -ErrorAction SilentlyContinue alias:\cd
Remove-Item -ErrorAction SilentlyContinue alias:\pwd
Remove-Item -ErrorAction SilentlyContinue alias:\which
Remove-Item -ErrorAction SilentlyContinue alias:\pwd
#get only definition
function which($name) {
Get-Command $name... |
Remove explicit import of PSScriptAnalyzer module | Import-Module PSScriptAnalyzer
$directory = Split-Path -Parent $MyInvocation.MyCommand.Path
$ruleName = 'PSDSCUseIdenticalMandatoryParametersForDSC'
$resourceBasepath = "$directory\DSCResourceModule\DSCResources"
$badResourceFilepath = [System.IO.Path]::Combine(
$resourceBasepath,
'MSFT_WaitForAnyNoIdenticalMan... | $directory = Split-Path -Parent $MyInvocation.MyCommand.Path
$ruleName = 'PSDSCUseIdenticalMandatoryParametersForDSC'
$resourceBasepath = "$directory\DSCResourceModule\DSCResources"
$badResourceFilepath = [System.IO.Path]::Combine(
$resourceBasepath,
'MSFT_WaitForAnyNoIdenticalMandatoryParameter',
'MSFT_Wai... |
Add tests for Error stream | Describe "Native streams behavior with PowerShell" -Tags 'CI' {
$powershell = Join-Path -Path $PsHome -ChildPath "powershell"
Context "Error stream" {
# we are using powershell itself as an example of a native program.
# we can create a behavior we want on the fly and test complex scenarios.
... | |
Set timeout for windows tests to 15 minutes | $ErrorActionPreference = "Stop";
trap { $host.SetShouldExit(1) }
cd gr-release-develop
$env:PWD = (Get-Location)
$env:GOPATH = ${env:PWD} + "\src\gopath"
$env:PATH = $env:GOPATH + "/bin;C:/go/bin;" + $env:PATH
Write-Host "Installing Ginkgo"
go.exe install ./src/gopath/src/github.com/onsi/ginkgo/ginkgo
if ($LastExitC... | $ErrorActionPreference = "Stop";
trap { $host.SetShouldExit(1) }
cd gr-release-develop
$env:PWD = (Get-Location)
$env:GOPATH = ${env:PWD} + "\src\gopath"
$env:PATH = $env:GOPATH + "/bin;C:/go/bin;" + $env:PATH
Write-Host "Installing Ginkgo"
go.exe install ./src/gopath/src/github.com/onsi/ginkgo/ginkgo
if ($LastExitC... |
Add setting preset for OTBS formatting | @{
IncludeRules = @(
'PSPlaceOpenBrace',
'PSPlaceCloseBrace',
'PSUseConsistentWhitespace',
'PSUseConsistentIndentation',
'PSAlignAssignmentStatement'
)
Rules = @{
PSPlaceOpenBrace = @{
Enable = $true
OnSame... | |
Remove Preview 4 specific hack | set-variable -name LastExitCode 0
set-strictmode -version 2.0
$ErrorActionPreference="Stop"
$CPCLocation="C:/CPC"
./build/scripts/cleanup_perf.ps1 $CPCLocation
if ( -not $? )
{
echo "cleanup failed"
exit 1
}
Invoke-WebRequest -Uri http://dotnetci.blob.core.windows.net/roslyn-perf/cpc.zip -OutFile cpc.zip
[R... | set-variable -name LastExitCode 0
set-strictmode -version 2.0
$ErrorActionPreference="Stop"
$CPCLocation="C:/CPC"
./build/scripts/cleanup_perf.ps1 $CPCLocation
if ( -not $? )
{
echo "cleanup failed"
exit 1
}
Invoke-WebRequest -Uri http://dotnetci.blob.core.windows.net/roslyn-perf/cpc.zip -OutFile cpc.zip
[R... |
Add a file that contains helper functions for tests | Function Get-ExtentText
{
Param(
[Microsoft.Windows.PowerShell.ScriptAnalyzer.Generic.CorrectionExtent] $violation,
[string] $scriptPath
)
$scriptContent = Get-Content -Path $scriptPath
$start = [System.Management.Automation.Language.ScriptPosition]::new($scriptPath, $violation.StartLineNumber, $violation.StartCo... | |
Move script to msgpack repo | $globalJson = Get-Content -Raw -Path global.json | ConvertFrom-Json
$version = $globalJson.Sdk.Version
Write-Host "##teamcity[setParameter name='DotnetCoreVersion' value='$version']" | |
Use native powershell for unzipping | Write-Host "Installing chocolatey"
Set-ExecutionPolicy Unrestricted
iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))
Write-Host "Installing unzip"
choco install -y unzip
((New-Object System.Net.WebClient).DownloadFile('https://github.com/ctfhacker/windows-setup/archive/mast... | Write-Host "Installing chocolatey"
Set-ExecutionPolicy Unrestricted
iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))
((New-Object System.Net.WebClient).DownloadFile('https://github.com/ctfhacker/windows-setup/archive/master.zip', 'C:\Windows\Temp\master.zip'))
cd C:\Windows... |
Remove any already existing coverage exports | $rootPath = (Get-Item -Path ".\" -Verbose).FullName
dotnet restore
Set-Location 'src\Stranne.VasttrafikNET.Tests'
$resultsFile = $rootPath + '\artifacts\Stranne.VasttrafikNET_coverage.xml'
$openCoverConsole = $ENV:USERPROFILE + '\.nuget\packages\OpenCover\4.6.690\tools\OpenCover.Console.exe'
$target = '-target:C:\Pr... | $rootPath = (Get-Item -Path ".\" -Verbose).FullName
dotnet restore
Set-Location 'src\Stranne.VasttrafikNET.Tests'
$resultsFile = $rootPath + '\artifacts\Stranne.VasttrafikNET_coverage.xml'
If (Test-Path $resultsFile){
Remove-Item $resultsFile
}
$openCoverConsole = $ENV:USERPROFILE + '\.nuget\packages\OpenCover\4.6... |
Add PS command to add transformation config to csproj | function Add-Transformation($pattern, $values, $output){
$project = Get-Project
$buildProject = @([Microsoft.Build.Evaluation.ProjectCollection]::GlobalProjectCollection.GetLoadedProjects($project.FullName))[0]
$afterBuildTarget= $buildProject.Xml.Targets | Where-Object {$_.Name -eq "AfterBuild"}
if($afterBuildTarget ... | function Add-Transformation($pattern, $values, $output){
$project = Get-Project
$buildProject = @([Microsoft.Build.Evaluation.ProjectCollection]::GlobalProjectCollection.GetLoadedProjects($project.FullName))[0]
$afterBuildTarget= $buildProject.Xml.Targets | Where-Object {$_.Name -eq "AfterBuild"}
if($afterBuildTar... |
Remove auth params for doc generation Authentication and repo management should be moved to another script... | param($username, $password, [switch]$Buildserver)
$PSScriptRoot = split-path -parent $MyInvocation.MyCommand.Definition
$module = "Keith"
Import-Module "$PSScriptRoot\src\$module" -Force
New-PsDoc -Module $module -Path "$PSScriptRoot\docs\" -OutputLocation "$PSScriptRoot\docs-generated"
New-GitBook "$PS... | $PSScriptRoot = split-path -parent $MyInvocation.MyCommand.Definition
$module = "Keith"
Import-Module "$PSScriptRoot\src\$module" -Force
New-PsDoc -Module $module -Path "$PSScriptRoot\docs\" -OutputLocation "$PSScriptRoot\docs-generated"
New-GitBook "$PSScriptRoot\docs-generated" "$PSScriptRoot\temp" |
Fix windows install script to set Path for the user | param
(
$Path = "C:\telepresence"
)
echo "Installing telepresence to $Path"
Start-Process msiexec -Wait -verb runAs -Args "/i $current_directory\winfsp.msi /passive /qn /L*V winfsp-install.log"
Start-Process msiexec -Wait -verb runAs -Args "/i $current_directory\sshfs-win.msi /passive /qn /L*V sshfs-win-i... | param
(
$Path = "C:\telepresence"
)
echo "Installing telepresence to $Path"
Start-Process msiexec -Wait -verb runAs -Args "/i $current_directory\winfsp.msi /passive /qn /L*V winfsp-install.log"
Start-Process msiexec -Wait -verb runAs -Args "/i $current_directory\sshfs-win.msi /passive /qn /L*V sshfs-win-i... |
Add a script to decode kubernetes secret. | # Copyright (c) 2019 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 writin... | |
Make sure repo is not dirty. | Write-Host ""
Write-Host "Pulling the latest:" -ForegroundColor Green
git pull
# if(git status --porcelain | Where-Object {$_ -match '^\?\?'}){
# throw "Untracked files exist"
# exit
# }
# elseif(git status --porcelain | Where-Object {$_ -notmatch '^\?\?'}) {
# throw "Uncommitted changes"
# }
Push-Loca... | Write-Host ""
Write-Host "Pulling the latest:" -ForegroundColor Green
git pull
if(git status --porcelain | Where-Object {$_ -match '^\?\?'}){
throw "Untracked files exist"
exit
}
elseif(git status --porcelain | Where-Object {$_ -notmatch '^\?\?'}) {
throw "Uncommitted changes"
}
Push-Location packages
... |
Remove -Confirm flag from test | function Start-Test
{
Import-Module -Name (Join-Path $TestDir 'RivetTest') -ArgumentList 'ForcePop'
Start-RivetTest
}
function Stop-Test
{
Stop-RivetTest
Remove-Module RivetTest
}
function Test-ForcePop
{
@'
function Push-Migration
{
Add-Table -Name 'Foobar1' -Column {
... | function Start-Test
{
Import-Module -Name (Join-Path $TestDir 'RivetTest') -ArgumentList 'ForcePop'
Start-RivetTest
}
function Stop-Test
{
Stop-RivetTest
Remove-Module RivetTest
}
function Test-ForcePop
{
@'
function Push-Migration
{
Add-Table -Name 'Foobar1' -Column {
... |
Change location to script's directory | sv version $env:APPVEYOR_BUILD_NUMBER
sv version 9999.0.$version-nightly
.\build-version.ps1 $version
| $scriptpath = $MyInvocation.MyCommand.Path
$dir = Split-Path $scriptpath
Push-Location $dir
sv version $env:APPVEYOR_BUILD_NUMBER
sv version 9999.0.$version-nightly
.\build-version.ps1 $version
|
Add expID as a parameter | #
#
param (
[string] $drive = "Y",
[string] $solutionPath = "LongTest2",
[string] $solutionName = "LongTest2",
[int] $machines = 1,
[int] $numberOfMethods = 100
)
# http://orleansservicedg.cloudapp.net:8080/api/Experiments?drive=Y&solutionPath=LongTest2&solutionName=LongTest2&machines=1
if($env:ISEMULATED -... | #
#
param (
[string] $drive = "Y",
[string] $solutionPath = "LongTest2",
[string] $solutionName = "LongTest2",
[int] $machines = 1,
[string] expID= "",
[int] $numberOfMethods = 100
)
# http://orleansservicedg.cloudapp.net:8080/api/Experiments?drive=Y&solutionPath=LongTest2&solutionName=LongTest2&machines=1
... |
Add status to query and message | # Based on a conversation at the Seattle SWUG about using the API
# to clean up non-up interfaces, this has been written/provided.
Import-Module SwisPowerShell
$OrionServer = 'localhost'
$Username = 'admin'
$Password = ''
$swis = Connect-Swis -Hostname $OrionServer -Username $Username -Password $Password
# query to... | # Based on a conversation at the Seattle SWUG about using the API
# to clean up non-up interfaces, this has been written/provided.
Import-Module SwisPowerShell
$OrionServer = 'localhost'
$Username = 'admin'
$Password = ''
$swis = Connect-Swis -Hostname $OrionServer -Username $Username -Password $Password
# query to... |
Add a script to install vscode extensions | # Script to install extensions for Visual Studio Code
# Install golang extensions
code --install-extension lukehoban.go
# Install Python extensions
code --install-extension freakypie.code-python-isort
code --install-extension ms-python.python
code --install-extension njpwerner.autodocstring
# Install C++ extensions
... | |
Use script path to relative paths | dotnet --version
$buildExitCode=0
Write-Output "*** Restoring packages"
dotnet restore
$buildExitCode = $LASTEXITCODE
if ($buildExitCode -ne 0){
Write-Output "*** Restore failed"
exit $buildExitCode
}
Write-Output "*** Building projects"
$buildExitCode=0
Get-Content build\build-order.txt | ForEach-Object { ... | $here = Split-Path -Parent $MyInvocation.MyCommand.Path
dotnet --version
$buildExitCode=0
Write-Output "*** Restoring packages"
dotnet restore
$buildExitCode = $LASTEXITCODE
if ($buildExitCode -ne 0){
Write-Output "*** Restore failed"
exit $buildExitCode
}
Write-Output "*** Building projects"
$buildExitCod... |
Fix NugetRestore.ps1 to not look for packages.config | $NuGetExe = "$PSScriptRoot\NuGet.exe"
& $NuGetExe install xunit.runner.console -version 2.0.0 -OutputDirectory "$PSScriptRoot\..\..\packages"
& $NuGetExe restore "$PSScriptRoot\packages.config" -PackagesDirectory "$PSScriptRoot\..\..\packages"
& $NuGetExe restore "$PSScriptRoot\..\Analyzers.sln" -PackagesDirectory "$P... | $NuGetExe = "$PSScriptRoot\NuGet.exe"
$NuGetConfig = "$PSScriptRoot\NuGet.config"
& $NuGetExe restore "$PSScriptRoot\..\Analyzers.sln" -configfile "$NuGetConfig"
|
Update machine 0.9.0, compose 1.10.0 | # install docker tools
choco install -y docker-machine -version 0.8.2
choco install -y docker-compose -version 1.9.0
| # install docker tools
choco install -y docker-machine -version 0.9.0
choco install -y docker-compose -version 1.10.0
|
Print message when restoring nuget packages | <#
.SYNOPSIS
Restores NuGet packages.
.PARAMETER Path
The path of the solution, directory, packages.config or project.json file to restore packages from.
If not specified, the current directory is used.
.PARAMETER Verbosity
#>
Param(
[Parameter(Position=1)]
[string]$Path=(Get-Location),
[Paramet... | <#
.SYNOPSIS
Restores NuGet packages.
.PARAMETER Path
The path of the solution, directory, packages.config or project.json file to restore packages from.
If not specified, the current directory is used.
.PARAMETER Verbosity
#>
Param(
[Parameter(Position=1)]
[string]$Path=(Get-Location),
[Paramet... |
Enable WSL during choco install. | $osVersion = [Environment]::OSVersion.Version.Major
$osRelId = (gp 'HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion').ReleaseId
if ($osVersion -ne 10 -or $osRelId -lt 1703) {
throw "This package requires Windows 10 Fall Creators Update or later."
}
if ($Env:PROCESSOR_ARCHITECTURE -ne 'AMD64') {
throw "This... | $osVersion = [Environment]::OSVersion.Version.Major
$osRelId = (gp 'HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion').ReleaseId
if ($osVersion -ne 10 -or $osRelId -lt 1703) {
throw "This package requires Windows 10 Fall Creators Update or later."
}
if ($Env:PROCESSOR_ARCHITECTURE -ne 'AMD64') {
throw "This... |
Upgrade to VM version 7.0.40 |
# Powershell script to pull the VM files from GitHub into the current folder.
# Edit the following to match the version of the VM that is compatible with this image
param
(
[string]$VMversion="v7.0.39"
)
Try
{
$scriptDir = Split-Path $script:MyInvocation.MyCommand.Path;
Write-Host "Fetching DolphinVM.zip" $V... |
# Powershell script to pull the VM files from GitHub into the current folder.
# Edit the following to match the version of the VM that is compatible with this image
param
(
[string]$VMversion="v7.0.40"
)
Try
{
$scriptDir = Split-Path $script:MyInvocation.MyCommand.Path;
Write-Host "Fetching DolphinVM.zip" $V... |
Add output to show the progress of the export powershell script | $docsFolderName = "..\docs";
$angularOutputFolderName = "dist";
If (Test-Path $docsFolderName) {
Remove-Item $docsFolderName -Recurse;
}
ng build --prod --base-href "https://bigeggtools.github.io/PowerMode/";
Copy-Item $angularOutputFolderName -Destination $docsFolderName -Recurse;
| $docsFolderName = "..\docs";
$angularOutputFolderName = "dist";
If (Test-Path $docsFolderName) {
Write-Output "Cleanup the GitHub pages folder.";
Remove-Item $docsFolderName -Recurse;
}
Write-Output "Start build the Angular SAP.";
ng build --prod --base-href "https://bigeggtools.github.io/PowerMode/";
Write-... |
Fix Dropbox Documents Library Link | param(
[string]$a
)
<#
.\go.ps1 "Text Comment for Commit"
#>
if (!$a)
{
$a = Read-Host 'comment: or (<cr> for generic comment)'
}
if (!$a)
{
$a = Get-Date
$a = $a + " page updated."
}
git add -A
git commit -m $a
git push
echo "Copying webpage to Dropbox"
copy "$env:USERPROFILE\Documents\github\webpage\index.html" ... | param(
[string]$a
)
<#
.\go.ps1 "Text Comment for Commit"
Make sure to have a "My Dropbox" link in the Documents Library
#>
if (!$a)
{
$a = Read-Host 'comment: or (<cr> for generic comment)'
}
if (!$a)
{
$a = Get-Date
$a = $a + " page updated."
}
git add -A
git commit -m $a
git push
echo "Copying webpage to Drop... |
Write out time as part of CI build | write-host "Present working directory: $($pwd)"
$testsuites = [xml](get-content .\test-results\*.xml)
$anyFailures = $FALSE
foreach ($testsuite in $testsuites.testsuite) {
write-host " $($testsuite.name)"
foreach ($testcase in $testsuite.testcase){
$failed = $testcase.failure
$time = [decima... | write-host "Present working directory: $($pwd)"
$testsuites = [xml](get-content .\test-results\*.xml)
$anyFailures = $FALSE
foreach ($testsuite in $testsuites.testsuite) {
write-host " $($testsuite.name)"
foreach ($testcase in $testsuite.testcase){
$failed = $testcase.failure
$time = [decima... |
Create PowerShell Script for Windows users | $VERSION="0.4.2"
$AMMONIUM_VERSION="0.8.3-1"
$SCALA_VERSION="2.11.11" # Set to 2.12.2 for Scala 2.12
$TYPELEVEL_SCALA=$false # If true, set SCALA_VERSION above to a both ammonium + TLS available version (e.g. 2.11.8)
$EXTRA_OPTS=@()
function Make-Temp
{
$find_temp=$false
$random=Get-Random
$result="$env:... | |
Add tool to create package. | $msbuild = "C:\Windows\Microsoft.NET\Framework\v4.0.30319\MSBuild.exe"
cd ..\KLibrary2_1
Invoke-Expression ($msbuild + " KLibrary2_1.sln /p:Configuration=Release /t:Clean")
Invoke-Expression ($msbuild + " KLibrary2_1.sln /p:Configuration=Release /t:Rebuild")
cd .\ComponentModel
.\NuGetPackup.exe
move *.nupkg ..\..\... | |
Allow multiple providers for a notification | function Send-ALNotification
{
param
(
[Parameter(Mandatory = $true)]
[System.String]
$Activity,
[Parameter(Mandatory = $true)]
[System.String]
$Message,
[ValidateSet('Toast','Ifttt','Mail','Voice')]
$Provider
)
begin
{
$lab ... | function Send-ALNotification
{
param
(
[Parameter(Mandatory = $true)]
[System.String]
$Activity,
[Parameter(Mandatory = $true)]
[System.String]
$Message,
[ValidateSet('Toast','Ifttt','Mail','Voice')]
[string[]]
$Provider
)
begin
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.