Skip to content

Instantly share code, notes, and snippets.

View soffes's full-sized avatar

Sam Soffes soffes

View GitHub Profile
@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"
<!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 / 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
+ (BOOL)isConnectedToNetwork {
// Recover reachability flags
SCNetworkReachabilityRef reachability = SCNetworkReachabilityCreateWithName(kCFAllocatorSystemDefault, [@"twitter.com" UTF8String]);
SCNetworkReachabilityFlags flags;
BOOL didRetrieveFlags = SCNetworkReachabilityGetFlags(reachability, &flags);
CFRelease(reachability);
if (!didRetrieveFlags) {
#!/bin/sh
# Install ImageMagick on Snow Leopard: by kain, improved by mislav and samsoffes
# http://www.icoretech.org/2009/08/install-imagemagick-in-leopard-snow-leopard/
# Work with 64bit kernel mode
set -e
PREFIX=/usr/local
# Passenger users: amend your Apache global configuration with the following directive
# SetEnv PATH /usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin
// TinyMCE Settings.
tinyMCE.init({
extended_valid_elements: 'style',
mode: 'exact',
elements: 'id_name',
theme: 'advanced',
theme_advanced_toolbar_location: 'top',
theme_advanced_toolbar_align: 'left',
plugins: 'safari, style, table, paste, media',
theme_advanced_buttons1: 'bold, italic, underline, justifyleft, justifycenter, justifyright, justifyfull, formatselect, fontselect, fontsizeselect',
class RenderDirectly < ActionController::Base
include ActionController::Rendering
include AbstractController::Layouts
append_view_path Rails.root.join("app", "views").to_s
layout "application"
def index
render *env["generic_views.render_args"]
end
//
// roommateappAppDelegate.m
// roommateapp
//
// Created by Court Simas on 4/4/10.
// Copyright Court Simas 2010. All rights reserved.
//
#import "roommateappAppDelegate.h"
#import "RootViewController.h"
POST /book/:id/notes
note[content]
selection[spine_item_id] or selection[spine_item_play_order]
selection[chunk_offset]
selection[character_offset]
selection[character_length]
@soffes
soffes / html5_template.html
Created December 7, 2011 01:48 — forked from nathansmith/html5_template.html
Simple HTML5 Template
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>untitled</title>
<link rel="stylesheet" href="">
</head>
<body>
</body>