Skip to content

Instantly share code, notes, and snippets.

View scottwater's full-sized avatar

Scott Watermasysk scottwater

View GitHub Profile
@scottwater
scottwater / gist:1537789
Created December 30, 2011 04:11
wikipedia
$(document).ready(function(){
$('#siteNotice').hide();
});
@scottwater
scottwater / gist:1531929
Created December 29, 2011 04:37
Quick Notes on BootStrap vs. Foundation
- Bootstrap feels more opinionated and ready launch (prototypes)
- Bootstrap is being used everywhere. This is great for bug fixes, plugins, etc...
- Bootstraps popularity sucks because I suspect 1 in 5 new sites will look identical next year.
- Foundation uses sass. Bootstrap (conversions/ports) favor scss. I prefer scss.
- I also like how you can override BootStrap variables without changing the actual source
- Foundation has responsive support today.
- Foundation has some interesting mobile style options
- Bootstrap appears poised for a V2 with lots of breaking changes.
@scottwater
scottwater / full_constraint.rb
Created December 2, 2011 21:00
Possible Authenticated Constraint for Sorcery
# SCOPE GETS CROSSED - DO NOT USE AS IS!
class AuthenticatedConstraint
extend Sorcery::Controller::InstanceMethods
def self.matches?(request)
Sorcery::Controller::InstanceMethods.send(:define_method, :session, proc{request.session})
Sorcery::Controller::InstanceMethods.send(:define_method, :request, proc{request})
logged_in?
end
end
curl -d 'email=scott@kickofflabs.com' http://api.kickofflabs.com/v1/1905/subscribe
curl -G -d "email=scott@kickofflabs.com" http://api.kickofflabs.com/v1/1905/info
@scottwater
scottwater / api.rb
Created November 3, 2011 17:33
Thoughts on how to properly handle exceptions in a web service request?
require 'httparty'
require 'crack'
class KickoffLabsAPI
include HTTParty
base_uri 'http://api.kickofflabs.com'
def self.subscribe(page_id, args={})
response = post("/v1/#{page_id}/subscribe", :body => args)
@scottwater
scottwater / kickoff.json
Last active August 6, 2019 17:57
KickoffLabs API Demo Response
{
"avatar": "https://d1ts43dypk8bqh.cloudfront.net/v1/avatars/310c4ac2-7026-4700-afde-496b1d217b03",
"counter": 252,
"contest_score": 300,
"contest_score_rank": 19588,
"custom_fields": {},
"email": "scott@kickofflabs.com",
"family_name": "Watermasysk",
"given_name": "Scott",
"id": 56999,
@scottwater
scottwater / curl
Last active February 15, 2021 04:07
Quick KickoffLabs API
curl -d 'email=scott@kickofflabs.com&api_key=your_api_key' https://api.kickofflabs.com/v1/1905/subscribe
curl -G -d "email=scott@kickofflabs.com" https://api.kickofflabs.com/v1/1905/info
@scottwater
scottwater / gist:1301070
Created October 20, 2011 12:55
Easy bundle exec (I owe someone else credit for this).
function be {
if [[ -a Gemfile ]]; then
bundle exec $*
else
command $*
fi
}
alias heroku="be heroku"
alias rake="be rake"
@scottwater
scottwater / favicon.html
Created October 18, 2011 13:36
KickoffLabs Favicon
<link href="http://a_domain.com/favicon.ico" rel="shortcut icon" type="image/vnd.microsoft.icon" />
@scottwater
scottwater / hide.html
Created October 12, 2011 19:34
Hiding the signup form
<script>
function getParameterByName(name)
{
name = name.replace(/[\[]/, "\\\[").replace(/[\]]/, "\\\]");
var regexS = "[\\?&]" + name + "=([^&#]*)";
var regex = new RegExp(regexS);
var results = regex.exec(window.location.href);
if(results == null)
return null;
else