Skip to content

Instantly share code, notes, and snippets.

View soffes's full-sized avatar

Sam Soffes soffes

View GitHub Profile
+ (BOOL)isConnectedToNetwork {
// Recover reachability flags
SCNetworkReachabilityRef reachability = SCNetworkReachabilityCreateWithName(kCFAllocatorSystemDefault, [@"twitter.com" UTF8String]);
SCNetworkReachabilityFlags flags;
BOOL didRetrieveFlags = SCNetworkReachabilityGetFlags(reachability, &flags);
CFRelease(reachability);
if (!didRetrieveFlags) {
@soffes
soffes / nginx
Created July 8, 2009 20:00 — forked from kmorey/nginx
#!/bin/bash
#chkconfig: 2345 80 05
#description: Nginx
. /etc/rc.d/init.d/functions
INITLOG_ARGS=""
nginx=/usr/local/nginx/sbin/nginx
prog=nginx
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<head>
<title></title>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"></script>
<script type="text/javascript">
$(document).ready(function () {
var list = $('ul#books');
$.ajax({
url: 'http://api.new.youversion.com/1.0/bible/books.json',
@soffes
soffes / gist:67133
Created February 19, 2009 21:33 — forked from kmorey/gist:67120
#!/bin/bash
while [ 1 ]
do
if [ ! -e $1 ]
then
echo "Created"
echo $2 > $1
fi
n=$RANDOM
let "n = (n % 1) + 5"