Skip to content

Instantly share code, notes, and snippets.

View reebalazs's full-sized avatar

Balázs Reé reebalazs

View GitHub Profile
# work around bug in xml report
echo '<?xml version="1.0" encoding="UTF-8" ?>\n<testsuites>' > buster.xml
sed "s|^<.*$||g" buster0.xml >> buster.xml
echo "\n</testsuites>" >> buster.xml
[buildout]
extends = buildout.cfg
unzip = true
parts +=
# omelette
codeintel
[omelette]
recipe = collective.recipe.omelette
eggs = ${sdidemo:eggs}
buster.assertions.add('keys', {
assert: function (actual, keys) {
var keyMap = {};
var keyCnt = 0;
for (var i=0; i<keys.length; i++) {
keyMap[keys[i]] = true;
keyCnt += 1;
}
for (var key in actual) {
if (actual.hasOwnProperty(key)) {
$('#messages')
.empty()
.append(
$('<div class="alert"></div>')
.append(args.flash)
)
.height(0)
.animate({
height: '100%'
});
@reebalazs
reebalazs / buster.js
Created January 22, 2013 09:33
BusterJS how do I pass parameters to an extension?
//
// Running the reference example: eat our own dogfood.
//
var libs = [
'examples/testlib/jquery-1.6.2.min.js',
'examples/testlib/jquery.ui.widget.js'
];
config.Dogfood = {
@reebalazs
reebalazs / Gruntfile.js
Created February 19, 2013 14:21
gruntfile
module.exports = function(grunt) {
var jsFiles = {
'src/substanced/substanced/sdi/static/js/slickgrid.upstream.js': [
'src/slickgrid/plugins/slick.responsiveness.js',
'src/slickgrid/bootstrap/bootstrap-slickgrid.js',
'src/slickgrid/lib/jquery-ui-1.8.16/jquery.ui.core.js',
'src/slickgrid/lib/jquery-ui-1.8.16/jquery.ui.widget.js',
@reebalazs
reebalazs / buster_example.js
Created February 26, 2013 10:25
buster assert exception
buster.assert.exception(block, function (err) {
return err.message.slice(0, expected.length) == expected; // startswith
}, message);
@reebalazs
reebalazs / component.json
Last active December 14, 2015 15:19
component.json
{
"name": "sdidev-resources",
"version": "0.1.0",
"dependencies": {
"jquery": "*",
"bootstrap": "*",
"slickgrid": "*"
},
"development": {
@reebalazs
reebalazs / latency.sh
Last active December 18, 2015 08:38
How to simulate network latency and errors on macosx
#! /bin/sh
# --
# How to simulate network latency and errors on macosx.
#
# After this you can access the 127.0.0.10 as an alias
# to your localhost, but with a roundtrip delay.
#
# delay 150ms adds the delay to the given pipe (*)
# plr 0.05 simulates packet loss.
@reebalazs
reebalazs / map.json
Created August 15, 2013 09:53
map.json
{
"bootstrap": {
"source": {}
},
"jquery": {
"source": {
"scripts": "components/jquery/jquery.js"
}
},
"jquery-ui": {