Skip to content

Instantly share code, notes, and snippets.

@olim7t
olim7t / LogbackCapture.java
Created March 22, 2011 14:46
Temporarily captures Logback output (mostly useful for tests).
import static ch.qos.logback.classic.Level.ALL;
import static org.slf4j.Logger.ROOT_LOGGER_NAME;
import java.io.ByteArrayOutputStream;
import java.io.OutputStream;
import java.io.UnsupportedEncodingException;
import java.nio.charset.Charset;
import ch.qos.logback.classic.Level;
import ch.qos.logback.classic.Logger;
@jewelsea
jewelsea / CodeEditor.java
Created December 11, 2011 23:30
CodeMirror based code editor for JavaFX
import javafx.scene.layout.StackPane;
import javafx.scene.web.WebView;
/**
* A syntax highlighting code editor for JavaFX created by wrapping a
* CodeMirror code editor in a WebView.
*
* See http://codemirror.net for more information on using the codemirror editor.
*/
public class CodeEditor extends StackPane {
@elidupuis
elidupuis / handlebars-helpers.js
Last active December 7, 2021 02:24
Simple Handlebars.js helpers
/*! ******************************
Handlebars helpers
*******************************/
// debug helper
// usage: {{debug}} or {{debug someValue}}
// from: @commondream (http://thinkvitamin.com/code/handlebars-js-part-3-tips-and-tricks/)
Handlebars.registerHelper("debug", function(optionalValue) {
console.log("Current Context");
console.log("====================");
@mbostock
mbostock / .block
Last active December 4, 2021 22:40
Brush & Zoom Redirect [UNLISTED]
redirect: 34f08d5e11952a80609169b7917d4172
@bunkat
bunkat / index.html
Last active January 10, 2024 18:18
Swimlane Chart using d3.js
<!--
The MIT License (MIT)
Copyright (c) 2013 bill@bunkat.com
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
@sr75
sr75 / run-ie-7-8-9-virtualbox-on-osx.txt
Created March 15, 2012 13:52
Run IE 7, 8, and 9 in Mac OS X
# the admin password for all of the IE VMs is “Password1″ without the quotes, it's also used for the password hints
1) Install VirtuaBox on your mac
http://download.virtualbox.org/virtualbox/4.1.10/VirtualBox-4.1.10-76795-OSX.dmg
2) Decide which versions of Internet Explorer you want to download and install – each version of Internet Explorer is contained within a separate virtual machine that runs within VirtualBox. In other words, if you want to run Internet Explorer 7, 8, and 9, you will need to download three separate VM’s, which may take a while so keep that in mind. Select the text below and copy it:
# Install ALL versions of Internet Explorer: IE 7, IE 8, and IE 9 (for now this script will also pull down a IE 6 vm with windows xp)
@Jpunt
Jpunt / drobo_check.py
Created May 7, 2013 06:57
Python script I use to check the health of my Drobo, which is connected to a Raspberry Pi. Output is emailed by the cronjob daily. Needs Drobo-Utils to work properly: http://drobo-utils.sourceforge.net and you will have to edit the paths for your setup.
#! /usr/bin/env python
import subprocess
import re
# Settings
diskPath = '/dev/sda'
mountPath = '/media/drobo'
# Get status
command = "/usr/sbin/drobom status"
@willurd
willurd / web-servers.md
Last active May 30, 2024 02:54
Big list of http static server one-liners

Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.

Discussion on reddit.

Python 2.x

$ python -m SimpleHTTPServer 8000
@elsherbini
elsherbini / data.js
Last active December 18, 2015 16:58
Attempting to extend dc.js with a simpleLineChart
var dummyData = [
["2013/05/20","00:00","322.2","35.3","21.4","67","East","6","0","63","87%","30.05","+","0.00","1.40"],
["2013/05/20","00:05","322.2","35.3","21.4","67","East","6","0","63","87%","30.05","+","0.00","1.40"],
["2013/05/20","00:10","322.1","35.3","21.4","67","East","6","0","63","87%","30.05","+","0.00","1.40"],
["2013/05/20","00:15","322.1","35.3","21.4","67","East","6","0","63","87%","30.05","+","0.00","1.40"],
["2013/05/20","00:20","321.8","35.3","21.4","67","East","6","0","63","87%","30.05","+","0.00","1.40"],
["2013/05/20","00:25","322.1","35.3","21.4","67","East","6","0","63","87%","30.05","+","0.00","1.40"],
["2013/05/20","00:30","322.1","35.4","21.4","67","East","6","0","63","87%","30.05","+","0.00","1.40"],
["2013/05/20","00:35","322.1","35.3","21.4","67","East","6","0","63","87%","30.05","+","0.00","1.40"],
["2013/05/20","00:40","322.1","35.3","21.4","67","East","6","0","63","87%","30.05","+","0.00","1.40"],
@mbostock
mbostock / .block
Last active December 17, 2023 21:17
Save SVG as PNG
license: gpl-3.0