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
on run {input, parameters} | |
tell application "Finder" | |
set sel to the selection as text | |
set the clipboard to POSIX path of sel | |
end tell | |
return input | |
end run |
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
on run {input, parameters} | |
tell application "Finder" | |
set dirPath to "\"" & (POSIX path of (input as string)) & "\"" | |
end tell | |
CdTo(dirPath) | |
end run | |
on CdTo(theDir) | |
tell application "iTerm" | |
activate |
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
grammar MyLanguage; | |
// Rules | |
code : line+ ; | |
line : expr NEWLINE | |
| NEWLINE | |
; | |
expr : '(' expr ')' # group |
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
#!/bin/sh | |
# Generate Lexer/Visitor for syntax tree of MyLanguage | |
# You should download the jar file from | |
# http://tunnelvisionlabs.com/downloads/antlr/2013-02-27-antlr4-csharp-4.0.1-SNAPSHOT.7z | |
java -cp .:./antlr4-csharp-4.0.1-SNAPSHOT-complete.jar org.antlr.v4.CSharpTool -Dlanguage=CSharp_v3_5 -no-listener -visitor -package MyNamespace MyLanguage.g4 |
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
private static readonly string unknownEnumId = "unknown"; | |
private static readonly Dictionary<Type, object> enumValuesCache = | |
new Dictionary<Type, object>(); | |
/// <summary> | |
/// List all values anotated by XmlEnum | |
/// </summary> | |
/// <returns></returns> | |
public static List<XmlEnumValue<TEnum>> GetEnumValues<TEnum>() { | |
var t = typeof(TEnum); |
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
// ---------------------------------------------------------- | |
// A short snippet for detecting versions of IE in JavaScript | |
// without resorting to user-agent sniffing | |
// ---------------------------------------------------------- | |
// If you're not in IE (or IE version is less than 5) then: | |
// ie === undefined | |
// If you're in IE (>=5) then you can determine which version: | |
// ie === 7; // IE7 | |
// Thus, to detect IE: | |
// if (ie) {} |
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
/** | |
* Simple JavaScript Inheritance | |
* @see http://ejohn.org/blog/simple-javascript-inheritance/ | |
* | |
* By John Resig http://ejohn.org/ | |
* MIT Licensed. | |
*/ | |
var initializing = false, | |
fnTest = /xyz/.test(function(){xyz;}) ? /\b_super\b/ : /.*/; |
NewerOlder