Skip to content

Instantly share code, notes, and snippets.

# Make this code more readable or remove duplication... or both!
require 'micromachine'
self.class.const_set(:Event, Class.new)
self.class.const_get(:Event).class_eval do
def method_missing(method_sym, *arguments, &block)
case method_sym
when :confirm!, :cancel!, :reset!
confirmation.method(:trigger)[method_sym.to_s.gsub('!','').to_sym]
override func awakeFromNib() {
self.statusItem = NSStatusBar.systemStatusBar().statusItemWithLength(-1)
self.statusItem!.menu = self.statusMenu
var icon = NSImage(named: "StatusMenu")
icon?.setTemplate(true)
self.statusItem!.image = icon
self.statusItem!.highlightMode = true
}
@csexton
csexton / config.md
Last active August 29, 2015 14:18
Secure Shell Spaceman Spiff Color Scheme

For the Secure Shell teminal emulator.

color-palette-overrides

{"0":"#27292C","1":"#D67C7B","2":"#C2C67F","3":"#F3CC85","4":"#94B2C9","5":"#C0A7C6","6":"#9CC9C4","7":"#D0D2D1","8":"#D0D2D1","9":"#D0D2D1","10":"#D0D2D1","11":"#D0D2D1","12":"#D0D2D1","13":"#D0D2D1","14":"#D0D2D1","15":"#D0D2D1"}

font-family

@csexton
csexton / art.md
Created April 2, 2015 16:23
ASCII Radius Logo
           ..+===========+.
        ..==================+.
      .=======+.........+======.
     .+====+...............======.
    .=====..........+........=====.
   .====............=.........:====.
  .====............==...........====
 +===............===...........====.
@csexton
csexton / 0_reuse_code.js
Last active August 29, 2015 14:18
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
asciidoc 8.6.9
autoconf 2.69
automake 1.14.1
binutils 2.25
chruby 0.3.9
cloog 0.18.1
cmake 3.1.0
coreutils 8.23_1
cscope 15.8a
dfu-util 0.8
@csexton
csexton / radbeacon.urls
Created March 23, 2015 14:09
Configure udev to allow non-root to dfu a RadBeacon
# udev can be configured to automatically set suitable file permissions on the USB device nodes.
#
# This will allow any member of the plugdev group access to the device nodes. It should be placed in the following file:
#
# /etc/udev/rules.d/radbeacon.rules
#
SUBSYSTEM=="usb", ATTR{idVendor}=="2458", ATTR{idProduct}=="0001", MODE="660", GROUP="plugdev"
SUBSYSTEM=="usb", ATTR{idVendor}=="2458", ATTR{idProduct}=="fffe", MODE="660", GROUP="plugdev"
@csexton
csexton / radbeacon-flasher
Last active August 29, 2015 14:17
Flasher Script for RadBeacon USB
#!/usr/bin/env ruby
#
# radbeacon-flasher
#
# USAGE
#
# On a mac you should not need to pass any options in to flash the default
# firmware to the beacon. The firmware will be automatically downloaded. Use
# the `-w` option to "watch" for the beacon to be plugged in and continue
# flashing beacon.
#!/bin/bash
# Utility to try every dfu method so that we don't have to care which firmware is installed
# Known DFU codes (see id-beacon-type/fingerprint.yaml for latest)
NATIVE_BLUEGIGA="0001090001"
RADBEACON2_1="aa"
RADBEACON2_0="aa"
RADBEACON1_0="30"
# -*- mode: ruby -*-
# vi: set ft=ruby :
Vagrant.configure(2) do |config|
# All Vagrant configuration is done here. The most common configuration
# options are documented and commented below. For a complete reference,
# please see the online documentation at vagrantup.com.
# Every Vagrant virtual environment requires a box to build off of.
config.vm.box = "ubuntu/trusty64"