Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View nicerobot's full-sized avatar
🤖
☯️ ☮️ 🐶 🐾 👾 🎮 🎼 🎶 🕺 🎧 🌻 🌱 🏞 🌊 🌔 🌎

nicerobot nicerobot

🤖
☯️ ☮️ 🐶 🐾 👾 🎮 🎼 🎶 🕺 🎧 🌻 🌱 🏞 🌊 🌔 🌎
View GitHub Profile
@nicerobot
nicerobot / README.md
Last active August 29, 2015 13:57
Golang Pastry

Based on the main README and the docs, i wrote what i thought should have been a fairly simple peer that i can test on a single machine using multiple ports.

The first peer is started with just a single port, that being the "cluster-port", that is, it's used to identify the cluster subsequent nodes will Join.

Subsequent peers start by specifying two ports, the first being the new node's port, the second being the "cluster-port".

Messages are created from the intial node every second and the message-id is simply a cycle of (currently 10) static values.

This example will launch five processes and watch the output of each node for 120 seconds (it seems at times it takes a long time for nodes to join.)

@nicerobot
nicerobot / README.md
Last active August 29, 2015 14:02
ElasticSearch 1.2.1 Bug - InvalidShapeException: Too few distinct points in geometry component at - https://github.com/elasticsearch/elasticsearch/issues/6492
@nicerobot
nicerobot / largo.geojson
Last active August 29, 2015 14:02
Largo
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@nicerobot
nicerobot / README.md
Last active August 29, 2015 14:05
Stylebot themes to correct horrible, dark-themed sites. Light themes are easier to read. If you want your site to be read, choose a light theme.
@nicerobot
nicerobot / ramdisk.sh
Created January 16, 2015 20:15
Mac OS X 100MB RAM Disk /Volumes/shm
#!/bin/bash
if [ -d /Volumes/shm ]; then
hdiutil detach /Volumes/shm
else
diskutil erasevolume HFS+ shm $(hdiutil attach -nomount ram://204800)
fi
@nicerobot
nicerobot / flatMap.scala
Created September 8, 2015 02:01
map vs flatMap
// flatMap is basically just building a List by appending Lists:
// List(1) ++ List(2) ++ List(3) ++ Nil = List(1, 2, 3)
def flatMap[A, B](list: List[A])(f: A => List[B]): List[B] = list match {
// ++ appends two Lists, so the reason flatMap flattens is that the List returned by f
// is appended onto the front of the List returned by flatMap. So append is the flattener.
case (x::xs) => f(x) ++ flatMap(xs)(f)
case _ => Nil
}
@nicerobot
nicerobot / make-timemachine-bundle
Created May 23, 2011 02:50
Create a Time Machine sparse bundle
hdiutil create \
-size 200G \
-fs HFS+J \
-volname "Time Machine" \
${HOSTNAME%%.*}_$(/sbin/ifconfig en0 | grep ether | awk '{print $2}' | tr -d ':').sparsebundle
@nicerobot
nicerobot / make-sxt-tmbundle
Created June 10, 2011 18:16
Install Struxt TextMate Bundle
mkdir -p ~/"Library/Application Support/TextMate/Bundles/"
cd ~/"Library/Application Support/TextMate/Bundles/"
git clone git://github.com/nicerobot/struxt.tmbundle "struxt.tmbundle"
osascript -e 'tell app "TextMate" to reload bundles'
@nicerobot
nicerobot / dock-orientation.sh
Last active September 27, 2015 01:57
Pin Mac OS X Dock to the bottom-left of the screen and disable "mirror" effect, making it translucence.
# curl -ks https://gist.github.com/nicerobot/1193218/raw/dock-orientation.sh | sh
defaults write com.apple.dock orientation left
defaults write com.apple.dock pinning end
defaults write com.apple.dock hide-mirror -bool true
killall Dock