Skip to content

Instantly share code, notes, and snippets.

View pwgustafson's full-sized avatar
👋

Paul Gustafson pwgustafson

👋
  • Amazon Alexa
  • San Juan Capistrano
View GitHub Profile
@pwgustafson
pwgustafson / post.json
Last active December 19, 2016 19:22
Streams Callback Post
"stream":
{
"id": #id,
"createdAt": #dateTime,
"url": #url,
"event_type": "stream_created"
}
new L.mapbox.geocoderControl('mapbox.places', {
position: 'topleft'
autocomplete: true
keepOpen: true
queryOptions:
country: 'us'
}).addTo(@map)
@pwgustafson
pwgustafson / example_query.rb
Last active April 8, 2016 01:32
An example query
{
statements: [
{ property: 'city', operation: '=', value: 'Costa Mesa, Newport Beach' },
{ property: 'status', operation: '=', value: 'Active', func: 'and' },
{ property: 'min_beds', operation: '=', value: 3, func: 'and' },
{ property: 'max_beds', operation: '=', value: 4, func: 'and' },
{ property: 'min_baths_search', operation: '=', value: 2, func: 'and' },
{ property: 'max_baths_search', operation: '=', value: 3, func: 'and' },
{ property: 'min_price_list', operation: '=', value: 800000, func: 'and' },
{ property: 'max_price_list', operation: '=', value: 900000, func: 'and' },
@pwgustafson
pwgustafson / beanstalk-benchmark.rb
Last active August 29, 2015 14:22
Beanstalk Benchmark
require 'beaneater'
require 'JSON'
class SimpleBenchmarker
def run(&block)
start_time = Time.now
block.call
end_time = Time.now
elapsed = end_time - start_time
p "Elapsed Time: #{elapsed} seconds"
//NSString *string = [NSString stringWithFormat:@"%@weather.php?format=json", BaseURLString];
NSString *string = [NSString stringWithFormat:@"%@sessions", BaseURLString];
NSURL *url = [NSURL URLWithString:string];
NSURLRequest *request = [NSURLRequest requestWithURL:url];
// 2
NSDictionary *params = @{@"email": email,
@"password": password};
AFHTTPRequestOperation *operation = [[AFHTTPRequestOperation alloc] initWithRequest:request];
1.upto(100).each do |i|
if (i%3==0 && i%5==0)
p "FizzBuzz"
elsif i%3==0
p "Fizz"
elsif i%5==0
p "Buzz"
else
p i
end