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
-- 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 |
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
$ ./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 |
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
#!/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 |
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
<a href="foo:somevalue" style='-webkit-touch-callout:none;'>Press and hold this link on iPhone will not highlight and show a callout</a> |
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
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) |
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
; 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 |
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
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 |
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
#!/bin/sh | |
#Modified 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/*/Applications/*/$1.app | head -1` | |
#app=`ls -1td ~/Library/Application\ Support/iPhone\ Simulator/User/Applications/*/$1.app | head -1` | |
dir=`dirname "$app"` |
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
// This goes into the header file. | |
void moCampfireSpeak(NSString* aString, NSString* aRoomIDString, NSString* aSubdomainString, NSString* aTokenString); | |
// This goes into the implementation file. | |
// You need the room ID, not room name. You can get it from the campfire room URL. | |
void moCampfireSpeak(NSString* aString, NSString* aRoomIDString, NSString* aSubdomainString, NSString* aTokenString) { | |
NSString* url = [NSString stringWithFormat:@"https://%@.campfirenow.com/room/%@/speak.json", aSubdomainString, aRoomIDString]; | |
NSString* postString = [NSString stringWithFormat:@"<message><type>%@</type><body>%@</body></message>", @"TextMessage", aString]; | |
NSMutableURLRequest* request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:url] cachePolicy:NSURLRequestReloadIgnoringCacheData timeoutInterval:60.0]; |
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
#In Rakefile, set something like app.interface_orientations = [:portrait, :landscape_left, :landscape_right] | |
class AppDelegate | |
def application(application, didFinishLaunchingWithOptions:launchOptions) | |
application.setStatusBarStyle(UIStatusBarStyleBlackOpaque, animated:true) | |
@window = UIWindow.alloc.initWithFrame(UIScreen.mainScreen.bounds) | |
@window.rootViewController = NavigationController.alloc.initWithRootViewController(PortraitViewController.alloc.init) | |
@window.makeKeyAndVisible | |
true | |
end |
OlderNewer