Skip to content

Instantly share code, notes, and snippets.

View soffes's full-sized avatar

Sam Soffes soffes

View GitHub Profile
user nginx;
worker_processes 1;
#error_log logs/error.log;
#error_log logs/error.log notice;
#error_log logs/error.log info;
#pid logs/nginx.pid;
events {
server {
listen 80;
server_name example.com;
location / {
root /var/www/example.com/html;
index index.php index.html;
if (!-e $request_filename) {
rewrite ^/(.*)$ /index.php?$1 last;
#! /bin/sh
# chkconfig: 2345 98 02
# description: PostgreSQL RDBMS
# This is an example of a start/stop script for SysV-style init, such
# as is used on Linux systems. You should edit some of the variables
# and maybe the 'echo' commands.
#
# Place this file at /etc/init.d/postgresql (or
#! /bin/sh
### BEGIN INIT INFO
# Provides: php-fastcgi
# Required-Start: $all
# Required-Stop: $all
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Start and stop php-cgi in external FASTCGI mode
# Description: Start and stop php-cgi in external FASTCGI mode
### END INIT INFO
@soffes
soffes / gist:87159
Created March 28, 2009 18:02
/etc/init.d/nginx (Debian)
#! /bin/sh
### BEGIN INIT INFO
# Provides: nginx
# Required-Start: $all
# Required-Stop: $all
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: starts the nginx web server
# Description: starts nginx using start-stop-daemon
NSString *foo = @"hello world";
NSString *google = [NSString stringWithFormat:@"http://google.com/?q=%@", [foo stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding]];
// google = http://google.com/?q=hello%20world
@soffes
soffes / Rest.php
Created April 20, 2009 18:52
Rest.php
<?php defined('SYSPATH') or die('No direct script access.');
/**
* Rest Library
*
* @author Sam Soffes
* @author Josh Turmel
*/
class Rest_Core {
private $use_cache;
// NSDate+dateFromString.h
@interface NSDate (dateFromString)
+ (NSDate *)dateFromString:(NSString *)string;
@end
// NSDate+dateFromString.m
#import "NSDate+dateFromString.h"
- (NSString *)previewMenuItemTitle
{
NSWindow *previewWindow = [(MyDocument *)[self currentDocument] previewWindow];
return ([previewWindow isVisible] ? @"Hide Preview" : @"Show Preview");
}
//
// LoadingView.h
//
// Created by Sam Soffes on 7/8/09.
// Copyright 2009 Sam Soffes. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface LoadingView : UIView {