Skip to content

Instantly share code, notes, and snippets.

View Pyrolistical's full-sized avatar

Pyrolistical

View GitHub Profile
#!/usr/bin/env bash
##############################################################################
##
## maven-settings-decoder start up script for UN*X
##
##############################################################################
# Add default JVM options here. You can also use JAVA_OPTS and MAVEN_SETTINGS_DECODER_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS=""
@Pyrolistical
Pyrolistical / bug.groovy
Created January 31, 2014 19:47
Spock framework VerifyError: (class: BuggedTest, method: $spock_feature_0_0 signature: ()V) Stack size too large bug
@Grab("org.spockframework:spock-core:0.7-groovy-2.0")
import spock.lang.Specification
class BuggedTest extends Specification {
def thing = []
def "repo the bug"() {
given:
@Pyrolistical
Pyrolistical / functions.js
Last active December 28, 2017 04:10 — forked from RedBeard0531/functions.js
Mongo map reduce functions to calculate sum, min, max, count, average, population variance, sample variance, population standard deviation, sample standard deviation Public Domain License
function map() {
emit(1, {
sum: this.value, // the field you want stats for
min: this.value,
max: this.value,
count: 1,
diff: 0
});
}
@Pyrolistical
Pyrolistical / bug.html
Created December 6, 2013 19:24
getBBox-rounded-rect bug
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<script src="snap.svg.js"></script>
</head>
<body>
<svg id="main" xmlns="http://www.w3.org/2000/svg" version="1.1" height=100%>
</svg>
<script>
@Pyrolistical
Pyrolistical / cpwd
Created December 26, 2011 01:35
contextural pwd - shows at most the grandparent of the current directory
#!/bin/bash
nicepwd=`pwd | sed "s|$HOME|~|"`;
# count the number of slashes in pwd
slashes=`pwd | perl -pe 's/[^\/]//g' | wc -m`
if [ $slashes -le 2 ]; then
echo "$nicepwd";
else
@Pyrolistical
Pyrolistical / node.magic_dom.js
Created December 5, 2011 02:55
WIP of amix/node.magic_dom which passes jslint
var MagicDOM = {
createDOM: function (name, attrs) {
var i = 0,
attr;
var elm = new Element(name);
var first_attr = attrs[0];
if (MagicDOM._isDict(attrs[i])) {
var z;
for (z = 0; z < first_attr.length; j++) {