Skip to content

Instantly share code, notes, and snippets.

View karlbunch's full-sized avatar

Karl Bunch karlbunch

View GitHub Profile
@karlbunch
karlbunch / README.md
Created April 12, 2016 11:04 — forked from robschmuecker/README.md
D3.js Drag and Drop, Zoomable, Panning, Collapsible Tree with auto-sizing.

This example pulls together various examples of work with trees in D3.js.

The panning functionality can certainly be improved in my opinion and I would be thrilled to see better solutions contributed.

One can do all manner of housekeeping or server related calls on the drop event to manage a remote tree dataset for example.

Dragging can be performed on any node other than root (flare). Dropping can be done on any node.

Panning can either be done by dragging an empty part of the SVG around or dragging a node towards an edge.

@karlbunch
karlbunch / Makefile
Created March 7, 2016 13:00 — forked from toolmantim/Makefile
An example of using Make instead of Grunt for fast, simple and maintainable front-end asset compilation.
# A simple Makefile alternative to using Grunt for your static asset compilation
#
## Usage
#
# $ npm install
#
# And then you can run various commands:
#
# $ make # compile files that need compiling
# $ make clean all # remove target files and recompile from scratch
@karlbunch
karlbunch / gfm2html.sh
Created January 10, 2016 18:47 — forked from evertton/gfm2html.sh
Convert a Github Flavored Markdown Syntax file to HTML
#!/bin/bash
# Convert a Github Flavored Markdown Syntax file to HTML
#
# The MIT License (MIT)
# Copyright © 2012 Evertton de Lima <e.everttonlima@gmail.com>
# http://evertton.mit-license.org/
# Stylesheet feature by Dan Untenzu <mail@pixelbrackets.de>
#
# Requirements: cURL (sudo apt-get install curl)
@karlbunch
karlbunch / test_luajit.go
Last active August 29, 2015 14:12 — forked from benbjohnson/lj.go
package main
/*
#cgo CFLAGS: -I/usr/local/include
#cgo LDFLAGS: -L/usr/local/lib -lluajit-5.1
#include <stdlib.h>
#include <stdio.h>
#include <luajit-2.0/lua.h>
#include <luajit-2.0/lualib.h>
#include <luajit-2.0/lauxlib.h>
@karlbunch
karlbunch / init.go
Last active August 29, 2015 14:08 — forked from saljam/init.go
// +build linux
package main
import (
"log"
"time"
"syscall"
"errors"
"os"
"os/exec"
#!/usr/bin/python
import Foundation
import objc
import AppKit
import sys
NSUserNotification = objc.lookUpClass('NSUserNotification')
NSUserNotificationCenter = objc.lookUpClass('NSUserNotificationCenter')
@karlbunch
karlbunch / long2ip.sh
Last active July 19, 2021 10:37
Quick way to convert integer ip4 ip address to dot notation
#!/bin/bash
#
# long2ip - Bash example to convert integer ip to long
#
# Example: long2ip 201691728
#
long2ip() {
local ip=$1
echo $((ip >> 24 & 255))"."$((ip >> 16 & 255))"."$((ip >> 8 & 255 ))"."$((ip & 255))