Skip to content

Instantly share code, notes, and snippets.

connection.query('SELECT * from schools where id > 4479 && id < 4490;', function(err, rows, fields) { // and id=35402
if (err) throw err;
var len =rows.length;
for(var i = 0; i < len; i++){
var school_name = rows[i].name;
var parent_org = rows[i].id;
@tim-peterson
tim-peterson / gist:cdb81efba18665181d34
Created October 20, 2015 12:56
Firefox 40.0.3 test.pusher.com Tim Peterson
Event log
08:54:53 debug Pusher : Event recd : {"event":"pusher:pong","data":{}}
08:54:53 debug Pusher : Event sent : {"event":"pusher:ping","data":{}}
08:52:54 debug Pusher : No callbacks on presence-channel for pusher:subscription_error
08:52:54 debug Pusher : Couldn't get auth info from your webapp : 0
08:52:48 status connected
08:52:48 debug Pusher : State changed : connecting -> connected
08:52:47 debug Pusher : Connecting : {"transport":"ws","url":"ws://ws.pusherapp.com:80/app/22364f2f790269bec0a0?protocol=7&client=js&version=3.0.0&flash=false"}
08:52:47 status connecting
Event log
08:45:12 debug Pusher : Event recd : {"event":"pusher:pong","data":{}}
08:45:12 debug Pusher : Event sent : {"event":"pusher:ping","data":{}}
08:43:12 debug Pusher : No callbacks on presence-channel for pusher:subscription_succeeded
08:43:12 debug Pusher : Event recd : {"event":"pusher_internal:subscription_succeeded","data":{"presence":{"count":1,"ids":["669"],"hash":{"669":null}}},"channel":"presence-channel"}
08:43:11 debug Pusher : Event sent : {"event":"pusher:subscribe","data":{"auth":"22364f2f790269bec0a0:61ea01fc007fe6402acf54726b1ded67baedbeae3778bfc5b81da23b3189761b","channel_data":"{\"user_id\":669}","channel":"presence-channel"}}
08:43:08 status connected
08:43:08 debug Pusher : State changed : connecting -> connected
08:43:08 debug Pusher : Connecting : {"transport":"ws","url":"ws://ws.pusherapp.com:80/app/22364f2f790269bec0a0?protocol=7&client=js&version=3.0.0&flash=false"}
@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
@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];
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 / 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 {
@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 / 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: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;