Skip to content

Instantly share code, notes, and snippets.

View cthree's full-sized avatar
💭
Fully Hydrated

Erik Petersen cthree

💭
Fully Hydrated
View GitHub Profile
@cthree
cthree / app_delegate.rb
Created November 28, 2012 13:20
Example crashes CocoaAsyncSocket in rubymotion
class AppDelegate
def application(application, didFinishLaunchingWithOptions:launchOptions)
@payload = "M-SEARCH * HTTP/1.1\r\nHOST: 239.255.255.250\r\nMAN: ssdp:discover\r\nST: upnp:rootdevice\r\n"
@socket = GCDAsyncUdpSocket.alloc.initWithDelegate(self, delegateQueue:Dispatch::Queue.main)
@socket.bindToPort(1900, error:nil)
@socket.beginReceiving(nil)
puts "Socket Ready"
@socket.sendData(@payload.dataUsingEncoding(NSUTF8StringEncoding),
@cthree
cthree / gist:1712457
Created January 31, 2012 19:37
Bookmark to show QR code image for current browser location
javascript:void(window.open('http://chart.apis.google.com/chart?cht=qr&chs=300x300&chl='+encodeURIComponent(location.href),'Qr%20code','top=100,left=200,width=350,height=350,status=yes'));