Skip to content

Instantly share code, notes, and snippets.

Avatar
🏠
Working from home

Erik Hellman ErikHellman

🏠
Working from home
View GitHub Profile
@dlew
dlew / File.java
Created Mar 1, 2016
Automated onError() message generation
View File.java
public static Action1<Throwable> crashOnError() {
final Throwable checkpoint = new Throwable();
return throwable -> {
StackTraceElement[] stackTrace = checkpoint.getStackTrace();
StackTraceElement element = stackTrace[1]; // First element after `crashOnError()`
String msg = String.format("onError() crash from subscribe() in %s.%s(%s:%s)",
element.getClassName(),
element.getMethodName(),
element.getFileName(),
element.getLineNumber());
@nikreiman
nikreiman / clion64.properties.txt
Last active Aug 29, 2015
CLion64 JVM properties for big, boosty projects (requires JDK8)
View clion64.properties.txt
-ea
-server
-Xms1g
-Xmx4g
-Xss16m
-XX:+DoEscapeAnalysis
-XX:+UnlockExperimentalVMOptions
-XX:+UseConcMarkSweepGC
-XX:LargePageSizeInBytes=256m
-XX:ReservedCodeCacheSize=96m
@jwalton
jwalton / RickshawGraph.md
Last active Jul 30, 2021
Rickshaw Graph is a drop in replacement for Dashing's graph
View RickshawGraph.md

Graphing Widget

The graphing widget shows graphs using the Rickshaw graphing library. The names of data fields should be (vaguely) familiar if you've used Rickshaw before.

It's recommended that you replace the /assets/javascripts/rickshaw.min.js from your dashboard with the latest from here.

Supported HTML data fields

@archevel
archevel / gistit.txt
Last active Dec 17, 2015
Gistit is a bashscript for instantly uploading selected text to github and placing the url to that gist in your clipboard. It relies on curl, xclip, python, sed, grep and notify-send. Use f.i. xbindkeys-config to add a keybinding to the script and you've got instant sharing. The script takes one parameter which is a OAuth token for github.
View gistit.txt
#!/bin/bash
if [ $# -eq 0 ]
then
echo "No OAuth token supplied. Create one with: "
echo "curl -u 'YOUR_GIT_USERNAME' -d '{\"scopes\":[\"gist\"],\"note\":\"Help example\"}' https://api.github.com/authorizations"
echo "Use the token value that is shown in the json output."
else
URL=$(xclip -o | python -c "import sys, json; print json.dumps({ 'public': True, 'files': { 'gistit.txt': { 'content': sys.stdin.read() } } })" | curl -H "Authorization: token $1" https://api.github.com/gists -d @- 2>&1 | grep -E '"html_url": ".*gist.*' | sed 's/.*html_url": "\([^ ]*gist[^"]*\)",/\1/')
echo $URL | xclip -i -selection clipboard
@alco
alco / ripple.frag
Created Jul 8, 2012
Ripple effect for GLSL
View ripple.frag
// simple fragment shader
// 'time' contains seconds since the program was linked.
uniform float time;
uniform sampler2D tex;
uniform sampler2D tex2;
float radius = .5;