Skip to content

Instantly share code, notes, and snippets.

@tim-peterson
tim-peterson / gist:eb180321a079acc21355
Created July 15, 2014 14:11
localhost nginx.conf
user www;
worker_processes 5;
events {
worker_connections 1024;
}
http {
include /Applications/MNPP/conf/nginx/mime.types;
@tim-peterson
tim-peterson / gist:ad2c1fae03f850ec7247
Created July 15, 2014 14:14
/Applications/MNPP/conf/nginx/sites-enabled/app2
server {
listen 81;
server_name localhost;
#client_max_body_size 999m; # or whatever size limit you want
#charset koi8-r;
#access_log logs/host.access.log main;
@tim-peterson
tim-peterson / gist:32a67466c7c8d52ceda6
Created July 15, 2014 14:16
/Applications/MNPP/conf/nginx/sites-enabled/app1
server {
listen 80;
server_name notify.localhost;
return 301 http://localhost/notify$request_uri;
}
server {
listen 80;
server_name test.localhost;
return 301 http://localhost/test$request_uri;
@tim-peterson
tim-peterson / Fibonacci sequence.playground
Created October 28, 2014 00:02
Fibonacci sequence.playground Tim Peterson
// Thinkful Playground
// Thinkful.com
// Fibonacci Sequence
// By definition, the first two numbers in the Fibonacci sequence are 1 and 1, or 0 and 1, depending on the chosen starting point of the sequence, and each subsequent number is the sum of the previous two.
import UIKit
class FibonacciSequence {
class Dog {
let name: String
let color: UIColor
init(name: String, color: UIColor) {
self.name = name
self.color = color
}
class func genus() -> String {
@tim-peterson
tim-peterson / json?
Created November 19, 2014 03:00
swift post
var parameters = ["email_address": userEmail, "full_name": userName, "facebook_user_id": userId]
let manager = AFHTTPRequestOperationManager()
//manager.requestSerializer = AFJSONRequestSerializer()
manager.responseSerializer = AFJSONResponseSerializer()
// manager.responseSerializer.
//manager.responseSerializer = [AFHTTPResponseSerializer serializer];
@tim-peterson
tim-peterson / world map svg
Created February 22, 2015 15:45
world map svg
<svg width="1228" class="datamap" height="690" style="overflow: hidden;"><g id="" class="datamaps-subunits"><path d="M823.0123512351236,348.1766536522087L826.453895389539,349.80846884324325L829.0350535053506,349.2417758895402L829.7725272527252,347.32211584781317L832.476597659766,346.67977481231844L834.3202820282028,345.3913554353195L835.0577557755776,342.00316559038953L837.8847384738474,341.20506902568883L838.499299929993,339.6759215845118L840.0971597159717,340.76891101398206L841.0804580458047,340.91436259476586L843.0470547054706,340.9870637732197L845.5053005300531,341.8582034411959L846.6115111511152,342.36528772633324L849.0697569756976,340.9870637732197L850.1759675967597,341.8582034411959L851.2821782178219,339.8948174675947L853.3716871687169,339.9677495493079L853.8633363336334,339.3107621492031L854.2320732073208,337.55215112663507L855.7070207020702,336.07914859503353L857.5507050705071,337.03738186053L857.1819681968198,338.35938829916205L858.2881788178818,338.57918836103886L857.9194419441944,342.2204873591328
function load_main($view = '', $view_data = array(), $return = FALSE)
{
$this->set('nav_list', array('Home', 'Photos', 'About', 'Contact'));
$this->load('template', $view, $view_data, $return);
// $this->load('template2' $view, $view_data, $return);
}
Corresponding code in your controller:
$out = array();
$myArray=array(
array(
'date' => '2011-05-13',
'value' => 2
),
array(
'date' => '2011-05-14',
'value' => 5
),
@tim-peterson
tim-peterson / nginx.conf
Created August 29, 2012 19:12
full nginx.conf for mysite.com
user www-data;
worker_processes 4;
pid /var/run/nginx.pid;
events {
worker_connections 768;
# multi_accept on;
}
http{