Skip to content

Instantly share code, notes, and snippets.

View probablycorey's full-sized avatar
πŸ‘―β€β™‚οΈ
Dancing with my twin

Corey Johnson probablycorey

πŸ‘―β€β™‚οΈ
Dancing with my twin
View GitHub Profile
@probablycorey
probablycorey / vim.rc
Created February 8, 2011 22:04
vim.rc
let mapleader = " "
" Load the janus vimrc file
runtime vimrc
" My Mappings
noremap ; :
colorscheme vividchalk
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
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
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()
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)
# 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)
waxClass{"SomePlugin", Plugin}
function init(self)
self = self.super(self)
-- Any initialization goes here
return self
end
h = {:a => 1, :b => 2, :c => 3}
h.find {|k, v| v == 2}
#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
def test
a = 5
end