Skip to content

Instantly share code, notes, and snippets.

@captDaylight
captDaylight / gimme auth
Created December 10, 2011 17:20
for stack
def authenticate(request):
# STEP 1: Generate a request token
post_url = '/auth/reqtoken'
params = urllib.urlencode({'client_id': client_id, 'client_secret':client_secret, 'type':'app'})
data = urllib2.urlopen('%s%s' % (base_url, post_url), params).read()
data = json.loads(data)
token = data['request_token']
print "here is the token"
url = "https://gimmebar.com/authorize?client_id="+client_id+"&token="+token+"&response_type=code"
updates = {'url': url, 'token':token}
@captDaylight
captDaylight / Grains animation
Created June 24, 2013 14:05
Sample CSS animation
/* shake css animation */
.grain-animated{
-webkit-animation-fill-mode:both;
-moz-animation-fill-mode:both;
-ms-animation-fill-mode:both;
-o-animation-fill-mode:both;
animation-fill-mode:both;
-webkit-animation-duration:.3s;
-moz-animation-duration:0.2s;
-ms-animation-duration:1.5s;
MADPRESS.About = {
init: function(data, callback) {
},
index: function(data, callback) {
var scrolling = false;
$('#about-side-nav').localScroll({ duration: 1000, onAfter: function() {
@captDaylight
captDaylight / gist:5850314
Created June 24, 2013 14:09
Landing page animation
MADPRESS.Index = {
init: function(data, callback) {
},
index: function(data, callback) {
// FIRST SLIDE ANIMATION /////////////////////////
var animateFinal = function(){
$('#blue-ball').animate({
/* shake css animation */
.grain-animated{
-webkit-animation-fill-mode:both;
-moz-animation-fill-mode:both;
-ms-animation-fill-mode:both;
-o-animation-fill-mode:both;
animation-fill-mode:both;
-webkit-animation-duration:.3s;
-moz-animation-duration:0.2s;
-ms-animation-duration:1.5s;
MADPRESS.About = {
init: function(data, callback) {
},
index: function(data, callback) {
var scrolling = false;
$('#about-side-nav').localScroll({ duration: 1000, onAfter: function() {
MADPRESS.About = {
init: function(data, callback) {
},
index: function(data, callback) {
var scrolling = false;
$('#about-side-nav').localScroll({ duration: 1000, onAfter: function() {
@captDaylight
captDaylight / gist:9212492
Created February 25, 2014 16:33
show_view
SpreeStore.module('Products.Show',function(Show, SpreeStore, Backbone,Marionette,$,_){
Show.Product = Backbone.Marionette.ItemView.extend({
tagName: 'div',
className: 'product',
template: "#product-template",
events: {
"click button": "addToCart",
"click #product-quantity-list li.quantity-drop": "selectQuantity",
"click #frequency-quantity-list li.quantity-drop": "selectFrequency",
console.log('test');
@captDaylight
captDaylight / tween.js
Created August 31, 2015 14:16
Simple Tween
function tween(finalPos, prevPos, tweenRatio) {
if (finalPos === prevPos) {
return prevPos;
} else {
let dist = Math.abs(finalPos - prevPos);
if (dist < 0.005) {
// set to final position when getting close
return prevPos;
} else {