This file contains 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
let mapleader = " " | |
" Load the janus vimrc file | |
runtime vimrc | |
" My Mappings | |
noremap ; : | |
colorscheme vividchalk |
This file contains 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
waxClass{"User", Base} | |
-- Class Methods | |
---------------- | |
function login(class, login, password) | |
class:get{class:url("user/show/%s", login), callback = function(body, response) | |
puts(body) | |
end, | |
authCallback = function(challenge) | |
if challenge:previousFailureCount() == 0 and not challenge:proposedCredential() then |
This file contains 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
waxClass{"User", Base} | |
-- Class Methods | |
---------------- | |
function login(class, login, password) | |
class:get{class:url("user/show/%s", login), callback = function(body, response) | |
puts(body) | |
end, | |
authCallback = function(challenge) | |
if challenge:previousFailureCount() == 0 and not challenge:proposedCredential() then |
This file contains 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
function runString_debug(s, d) | |
local u,v=loadstring(s) | |
if (v~=nil) then | |
print(v) | |
else | |
-- Set up a debug hook. | |
if d==1 then | |
local function callb() | |
print("called callb") | |
error() |
This file contains 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
waxClass{"Comic", Base} | |
function all(callback) | |
return get{url("/features"), callback = function(json, response) | |
local success, error = wasSuccessful(response) | |
if success then | |
local comics = table.map(json, function(c) | |
return Comic:initWithAttrs(c) | |
end) |
This file contains 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
# text_view is a NSTextView | |
text_view.insertText("0123456789") | |
atts = {NSBackgroundColorAttributeName => NSColor.redColor} | |
range = NSRange.new(0, 5) | |
text_view.textStorage.setAttributes(attrs, range:range) |
This file contains 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
waxClass{"SomePlugin", Plugin} | |
function init(self) | |
self = self.super(self) | |
-- Any initialization goes here | |
return self | |
end |
This file contains 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
h = {:a => 1, :b => 2, :c => 3} | |
h.find {|k, v| v == 2} |
This file contains 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
#define NSZombies | |
set env NSZombieEnabled=YES | |
set env NSDeallocateZombies=NO | |
set env MallocCheckHeapEach=100000 | |
set env MallocCheckHeapStart=100000 | |
set env MallocScribble=YES | |
set env MallocGuardEdges=YES | |
set env MallocCheckHeapAbort=1 | |
set env MallocHelp=YES |
This file contains 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
def test | |
a = 5 | |
end |