Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View hboon's full-sized avatar

Hwee-Boon Yar hboon

View GitHub Profile
@hboon
hboon / rubymotion-proc-leak
Created February 20, 2014 12:57
RubyMotion proc leak
class AppDelegate
def application(application, didFinishLaunchingWithOptions:launchOptions)
@window = UIWindow.alloc.initWithFrame(UIScreen.mainScreen.bounds)
@window.makeKeyAndVisible
vc = UIViewController.new
vc.view.backgroundColor = UIColor.redColor
View.show_in_view(vc.view)
@window.rootViewController = vc
true

Keybase proof

I hereby claim:

  • I am hboon on github.
  • I am hboon (https://keybase.io/hboon) on keybase.
  • I have a public key whose fingerprint is 1545 BD4C CFD4 F2C8 3949 C3E6 2039 F178 DFE5 69B6

To claim this, I am signing this object:

-- Adapted from http://www.macosxhints.com/article.php?story=20031018154841400
tell application "System Preferences"
activate
end tell
tell application "System Events"
tell process "System Preferences"
click menu item "Sharing" of menu "View" of menu bar 1
delay 2
$ ./configure
Checking for program g++,c++ : ok /usr/bin/g++
Checking for program cpp : ok /usr/bin/cpp
Checking for program ar : ok /usr/bin/ar
Checking for program ranlib : ok /usr/bin/ranlib
Checking for g++ : ok
Checking for program gcc,cc : ok /usr/bin/gcc
Checking for gcc : ok
Checking for library dl : ok
Checking for library execinfo : not found
@hboon
hboon / gist:278281
Created January 15, 2010 18:12
Script to Remove Core Data's SQLite Database File During Development Cycles
#!/bin/sh
# Adapted from http://furbo.org/2009/03/03/open-sesame/
if [ -z "$1" ]; then
echo "usage: $0 <app> [ Preferences | <document> ]"
else
app=`ls -1td ~/Library/Application\ Support/iPhone\ Simulator/User/Applications/*/$1.app | head -1`
dir=`dirname "$app"`
if [ "$2" = "Preferences" ]; then
@hboon
hboon / gist:285098
Created January 24, 2010 08:27
CSS to disable callout for links on iPhone/iPod touch UIWebView
<a href="foo:somevalue" style='-webkit-touch-callout:none;'>Press and hold this link on iPhone will not highlight and show a callout</a>
import socket
from twisted.internet import reactor
from twisted.web import server, resource
class S(resource.Resource):
isLeaf = True
def render_POST(self, request):
print request.args
print dir(request)
; a macro in redis-clojure.
(defmacro with-connection [name pool server-spec & body]
`(let [~name (get-connection ~pool ~server-spec)]
(try
~@body
(catch Exception e#
; if we reach here, i.e. an exception, we don't want to run (release-connection) in finally
(release-connection ~pool ~name e#)
(throw e#))
(finally
@hboon
hboon / markdown.css
Created October 5, 2015 08:32 — forked from imjasonh/markdown.css
Render Markdown as unrendered Markdown (see http://jsbin.com/huwosomawo)
* {
font-size: 12pt;
font-family: monospace;
font-weight: normal;
font-style: normal;
text-decoration: none;
color: black;
cursor: default;
}
@hboon
hboon / new-textdrive-email
Created October 29, 2012 15:58
"New" TextDrive email
Dear <recipient>
As you know, Joyent will soon cease providing shared hosting services. In recent weeks I've been readying the relaunch of TextDrive (the company I started in 2004, which subsequently became Joyent) as a shared hosting provider open to the public. The new TextDrive shall also offer replacement hosting to existing Joyent accounts.
The process has been exciting and chaotic, and I can say things are looking great: I've been serving websites and data feeds from the new infrastructure for some time now, and the speed and responsiveness are fantastic. If, like me, you enjoy exploring the nuts and bolts of how things get published online, you'll be impressed.
We're making available some conveniences that may be new to you, such as one-click software installers for popular content management systems, wikis, and so forth. Of course there is a web interface for account and data administration, but these are early days, and for the time being you'll be best off knowing your way around the command lin