Skip to content

Instantly share code, notes, and snippets.

@io41
io41 / paginated_collection.js
Created February 22, 2011 10:10 — forked from zerowidth/paginated_collection.js
Pagination with Backbone.js
// includes bindings for fetching/fetched
var PaginatedCollection = Backbone.Collection.extend({
initialize: function() {
_.bindAll(this, 'parse', 'url', 'pageInfo', 'nextPage', 'previousPage');
typeof(options) != 'undefined' || (options = {});
this.page = 1;
typeof(this.perPage) != 'undefined' || (this.perPage = 10);
},
fetch: function(options) {
@lengarvey
lengarvey / gist:5095281
Created March 5, 2013 23:17
Enabling Cross Origin Resource Sharing header in AWS for serving fonts through CloudFront.
# Log into the AWS console
# Select S3, and check out the properties on the bucket you want to change
# Expand permissions and click "Edit CORS Configuration"
# paste the thing below, edit in the AllowedOrigin things to be your url/s and you should be done
# make sure that you set this up before hitting your CloudFront distribution because caching will fuck you :(
<?xml version="1.0" encoding="UTF-8"?>
<CORSConfiguration xmlns="http://s3.amazonaws.com/doc/2006-03-01/">
<CORSRule>
<AllowedOrigin>
@saikatbhadra
saikatbhadra / dmv_appointment_booking.py
Created September 19, 2013 20:00
Script to book an appointment with CA DMV if a spot opens before your target date
import mechanize
from bs4 import BeautifulSoup
from datetime import datetime
TGT_DATE = 'MONTH DAY, YEAR' #i.e. 'September 30, 2014'
OFFICE_ID = '503' # officeid for SF DMV. See HTML code for other office ids
NUMBERITEMS = 'Num' # number of tasks for dmv; should be between 1-3
FIRSTNAME = 'FIRST_NAME'
LASTNAME = 'LAST_NAME'
# Number looks like (TELAREA) TELPREFIX-TELSUFFIX
@kevin-smets
kevin-smets / iterm2-solarized.md
Last active May 9, 2025 19:18
iTerm2 + Oh My Zsh + Solarized color scheme + Source Code Pro Powerline + Font Awesome + [Powerlevel10k] - (macOS)

Default

Default

Powerlevel10k

Powerlevel10k

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@staltz
staltz / introrx.md
Last active May 9, 2025 12:50
The introduction to Reactive Programming you've been missing