Skip to content

Instantly share code, notes, and snippets.

🏠
Open Source Saves Lives! <3

Andreas Marschke andreas-marschke

🏠
Open Source Saves Lives! <3
Block or report user

Report or block andreas-marschke

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@andreas-marschke
andreas-marschke / run.sh
Created Dec 17, 2014
Small example LUA script for wg/wrk using a tiny JSON implementation(http://regex.info/blog/lua/json) to log test results to a file.
View run.sh
# Example usage with several configuration sets as in multiple connections durations and threads.
# You may go take the rest of the day off while this will run ;)
for duration in 10s 1m 10m 1h
do
for connections in 100 200 300 400 500 600
do
for thread in 1 2 3 4 5
do
wrk -d$duration -c$connections -t$thread -s wrk-script.lua http://localhost:4001/beacon/0001/demo-load-test/test/web
@andreas-marschke
andreas-marschke / b.js
Created Oct 31, 2014
b.js - Boomerang Setup in around 500 bytes
View b.js
/* b.js - Boomerang Setup in around 500 bytes
* ------------------------------------------
* Complete boomerang.js initialization with essential plugins in around 500 bytes
* It mimics "Google Analytics"-style script injection using document.createElement
* and document.head.appendChild().
*
* Beacon URL configuration + configuring Plugins as a variable to the beacon:
*
* http://boomerang.example.org/beacon/0000/dashboard/start?plugins=BW%7CRT%7Cnavtimin%7Crestiming&...
*
@andreas-marschke
andreas-marschke / gist:5912142
Created Jul 2, 2013
Visualize Nagios Configuration using GraphViz and Perl Usage: recursive copy your /etc/nagios or /etc/icinga to a box of your choosing. Make sure : - GraphViz2, - Nagios::Object::Config, - String::Random from CPAN are installed. From within your copy of the nagios configuration run: perl script.pl -n nagios.cfg -o output.svg Be *amazed* by the s…
View gist:5912142
#!/usr/bin/perl
=head1 NAME
nagios-view - View config of nagios in SVG/PNG
=head1 SYNOPSIS
nagios-view --nagioscfg nagios.cfg --output nagios-config-visualized.svg
@andreas-marschke
andreas-marschke / minify.pm
Last active Dec 17, 2015
Mojolicious Command to minify all CSS/JS Scripts in a directory and save minified versions as .min.{js|css}
View minify.pm
package Mojolicious::Command::minify;
use Mojo::Base 'Mojolicious::Commands';
use File::Find;
use File::Slurp;
has description => "Minify scripts in public/ directory.\n";
has hint => <<"EOF";
Minifies all Javascript and CSS files with the .js instead of the .min.js extension.
EOF
View #01 JARGON of the Day from www.jargon.net
perl -Mojo -E 'say g("http://www.jargon.net/")->dom->at("font")->all_text'
@andreas-marschke
andreas-marschke / gist:4751200
Last active Dec 12, 2015
When you have a set of collapsibles inside a modal events from inside like "shown" are bubbling up. So unless you make sure it's only the modal you are listening to, the callback will fire anyway. Better make sure it only happens once.
View gist:4751200
$("#modal").modal({
show: true,
backdrop: true,
keyboard: true
}).on("shown",function(e) {
/* suppress 'shown' events bubbling up from inside */
if ($(e.target).hasClass('modal')){
/*do something*/
}
});
@andreas-marschke
andreas-marschke / index.html
Created Dec 26, 2012
Example script for using Rickshaw graphing with backbone.js
View index.html
<!doctype html>
<html>
<head>
<link href="https://raw.github.com/shutterstock/rickshaw/master/rickshaw.min.css">
</head>
<body>
<div id="graph"></div>
<div id="legend"></div>
<script type="text/javascript" src="http://code.jquery.com/jquery-1.8.3.min.js"></script>
<script type="text/javascript" src="http://underscorejs.org/underscore-min.js"></script>
You can’t perform that action at this time.