Skip to content

Instantly share code, notes, and snippets.

@hashar
hashar / spec_helper.rb
Created Jun 26, 2017 — forked from maxlinc/spec_helper.rb
rspec puppet debugging
View spec_helper.rb
RSpec.configure do |conf|
conf.module_path = File.join(fixture_path, 'modules')
conf.manifest_dir = File.join(fixture_path, 'manifests')
conf.hiera_config = File.join(fixture_path, 'hiera.yaml')
end
# Not sure this works for all types of https://github.com/rodjek/rspec-puppet tests. I think it works with host tests
if ENV['PUPPET_DEBUG']
Puppet::Util::Log.level = :debug
Puppet::Util::Log.newdestination(:console)
View ser_php_T156364.php
<?php
# Acknowledging Stas Malyshev
# https://phabricator.wikimedia.org/T156364#2977719
# Given two classes with the same property name but different visibility
class WithPublic {
public $property;
function __construct( $p ) { $this->property = $p; }
function getProperty() { print $this->property; }
}
View 503wait.py
#!/usr/bin/env python3
import random
import time
arm = 'v^<>'
eye = '^Oo*'
body = '\r%s(%s%s)%s'
@hashar
hashar / 503waitdancing.py
Created Oct 6, 2015
Wait for 503 for a few seconds while dancing
View 503waitdancing.py
#!/usr/bin/env python3
import random
import time
arm = 'v^<>'
eye = '^Oo*'
body = '\r%s(%s%s)%s'
@hashar
hashar / monkeyprogress.py
Created Jul 24, 2014
monkeys based spinner
View monkeyprogress.py
import sys
import time
monkeys = [
u'\U0001F648',
u'\U0001F649',
u'\U0001F64A',
]
try:
View out.txt
TAP version 13
ok 1 - BatchRowUpdateTest::testWriterBasicFunctionality
ok 2 - BatchRowUpdateTest::testReaderBasicIterate
ok 3 - BatchRowUpdateTest::testReaderGetPrimaryKey with data set #0 ('Must return single column pk when requested', array(42), array(42, 'dvorak', 'samurai'))
ok 4 - BatchRowUpdateTest::testReaderGetPrimaryKey with data set #1 ('Must return multiple column pks when requested', array(42, 'samurai'), array(42, 'dvorak', 'samurai'))
ok 5 - BatchRowUpdateTest::testReaderSetFetchColumns with data set #0 ('Must merge primary keys into select conditions', array('foo', 'bar'), array('foo'), array('bar'))
ok 6 - BatchRowUpdateTest::testReaderSetFetchColumns with data set #1 ('Must not merge primary keys into the all columns selector', array('*'), array('foo'), array('*'))
ok 7 - BatchRowUpdateTest::testReaderSetFetchColumns with data set #2 ('Must not duplicate primary keys into column selector', array('foo', 'bar', 'baz'), array('foo', 'bar'), array('bar', 'baz'))
ok 8 - BatchRowUpdateTest::testRe
@hashar
hashar / CommonSettings.php
Created Oct 30, 2013
CommonSettings.php for a hacker local MediaWiki install
View CommonSettings.php
<?php
$wgDebugDumpSql = false;
$wgAllowUserCss = true;
$wgDebugTimestamps = true;
#$wgDebugToolbar = true; # true: no file cache!
$wgDevelopmentWarnings = true;
$wgEnableJavaScriptTest = true;
@hashar
hashar / gist:7215603
Created Oct 29, 2013
are function args in exceptions traced passed by reference?
View gist:7215603
<?php
# Example for https://gerrit.wikimedia.org/r/#/c/92334/
function blame($a) {
throw new Exception();
}
try {
blame( array('foobar') );
} catch (Exception $e) {
View gist:6975914
hashar@gallium:~$ tail -n15 /srv/ssd/jenkins-slave/workspace/mwext-Wikibase-qunit/LocalSettings.php
# End of automatically generated settings.
# Add more configuration options below.
$wgWikimediaJenkinsCI = true;
require_once( '/var/lib/jenkins/tools/extensions-loader.php' );
ini_set( 'display_errors', 1 );