This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Parse C C++ C# enum definition to make a ruby hash of the values and names | |
# By Nigel Thorne (nwt) www.nigelthorne.com | |
# https://gist.github.com/1403153 | |
require 'rubygems' | |
require 'parslet' | |
include Parslet | |
class Array | |
def to_h |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# GOAL - immutable objects | |
# to make these composable they need to both have the same signature... | |
compose = (f, g) -> (x) -> g(f(x)) | |
c = (f, args...) -> | |
if(f) | |
compose(f, c.apply(this,args)) | |
else | |
nil |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* I use Stylish (a chome addin) to set these styles | |
* URLs on the domain workflowy | |
*/ | |
.next-row { | |
border: 2px solid #46A546 !important; | |
border-top-left-radius:0.5em; | |
background-color: #CCFFCC !important; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
; AutoHotKey script file | |
; press Ctrl+win+1 to make Win+1 give focus to whatever the current window is | |
; press Ctrl+win+2 to make Win+2 give focus to whatever the current window is | |
; press Ctrl+win+3 to make Win+3 give focus to whatever the current window is | |
; press Ctrl+win+4 to make Win+4 give focus to whatever the current window is | |
; press Ctrl+win+5 to make Win+5 give focus to whatever the current window is | |
;;;;;;;;;;;;;;;;;CNC KEYS;;;;;;;;;;;;;;;;;;;;;;;;; | |
CNCKey1 = | |
^#1:: ;save current focused window to a variable |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Taken from http://www.jquery4u.com/javascript/dynamically-load-jquery-library-javascript/ | |
//Load jQuery library using plain JavaScript | |
(function(){ | |
var newscript = document.createElement('script'); | |
newscript.type = 'text/javascript'; | |
newscript.async = true; | |
newscript.src = 'https://ajax.googleapis.com/ajax/libs/jquery/1.6.1/jquery.min.js'; | |
(document.getElementsByTagName('head')[0]||document.getElementsByTagName('body')[0]).appendChild(newscript); | |
})(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require './hash_inverse' | |
describe Hash do | |
describe "when empty and asked for the inverse" do | |
it "returns an empty hash" do | |
{}.inverse.must_equal Hash.new | |
end | |
end | |
describe "when mapping are unique and asked for the inverse" do |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@REM On windows grep's slashes are the wrong way around. | |
@"%~dp0tools\grep.exe" %* | ruby -n -e' x = $_.split(":"); x[0].gsub!(/\//, "\\"); puts x.join(":")' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
' You need to make a mail folder called "Archive" for the emails to move into, and add this email to your menu bar and call it "&[Archive" | |
' You also need to open an email and add the macro to your quickbar (I expect it to be item 6, which you can check by typing 'alt') | |
Sub Archive() | |
Dim myItem | |
If TypeName(Application.ActiveWindow) = "Inspector" Then | |
Set myItem = Application.ActiveWindow.CurrentItem | |
myItem.UnRead = False | |
myItem.Move (Application.GetNamespace("MAPI").Folders("Archive")) | |
Else |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'java' | |
java_import org.kitteh.tag.PlayerReceiveNameTagEvent | |
java_import org.kitteh.tag.TagAPI | |
module Purugin | |
module Event | |
# FIXME: This only handles normal priority. Real fix is to generate these on demand versus up | |
# front. We can reify what we need. This will also fix custom event types. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'java' | |
module Purugin | |
module Event | |
# FIXME: This only handles normal priority. Real fix is to generate these on demand versus up | |
# front. We can reify what we need. This will also fix custom event types. | |
require 'jruby/core_ext' |