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
waxClass{"SomePlugin", Plugin}
function init(self)
self = self.super(self)
-- Any initialization goes here
return self
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{"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)
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{"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
@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{"AppDelegate", protocols = {"UIApplicationDelegate"}}
-- Well done! You are almost ready to run a lua app on your iPhone!
--
-- Just run the app (βŒ˜β†΅) in the simulator or on a device!
-- You will see a dull, bland "hello world" app (it is your job to spice it up.)
--
-- If your prefer using TextMate to edit the Lua code just type
-- 'rake tm' from the command line to setup a wax TextMate project.
--
@probablycorey
probablycorey / WaxRetainIssueAppDelegate.m
Created February 18, 2011 19:12
WaxRetainIssueAppDelegate.m
//
// WaxRetainIssueAppDelegate.m
// WaxRetainIssue
//
// Created by Martin Cote on 11-02-17.
// Copyright Loopycube 2011. All rights reserved.
//
#import "WaxRetainIssueAppDelegate.h"
#import "WaxRetainIssueViewController.h"
$('head').prepend('<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, minimum-scale=1, user-scalable=0" />');