Skip to content

Instantly share code, notes, and snippets.

View freidamachoi's full-sized avatar

Bo freidamachoi

View GitHub Profile
======================================================
Setting up Django using Apache/mod_wsgi on Ubuntu 8.10
======================================================
This article will cover setting up Django using Apache/mod_wsgi on Ubuntu
8.10. The article is targeted at a production environment, but keep in mind
this is a more generalized environment. You may have different requirements,
but this article should at least provide the stepping stones.
The article will use distribution packages where nesscary. As of 8.10 the
@StevenBlack
StevenBlack / underscore.mixin.filterObj.js
Created February 7, 2011 19:13
Underscore.js _mixin: _.prune
// Return an object who's members match a reference array of keys
// reference=["b","c","f","r"];
// obj={"a":1, "b":2, "c":3, "d":4, "r":18};
// _.filterObj(obj, reference)
// => { b : 2, c : 3, r : 18}
_.mixin( {
filterObj : function( obj, reference ) {
if ( reference && typeof reference == 'object' ) { reference=_.keys( reference ); }
var intersect = _.intersect(reference, _.keys(obj)), retObj= {};
_.map( intersect, function( el) { retObj[el]=obj[el];})
@caged
caged / gist:1173725
Created August 26, 2011 15:50
d3.js experiment - Donuts, Bars and Crime.
#
# CoffeeScript for http://dealloc.me/demos/crime/2011.html
# Copyright (c) 2011 Justin Palmer <http://github.com/Caged>
# LICENSE: http://www.opensource.org/licenses/mit-license.php
$ ->
hash = document.location.hash
year = if hash then hash.replace('#', '') else 2011
[pt,pl,pb,pr] = [35, 20, 20, 20]
w = (900 - (pl + pr)) / 2
h = w
@enjalot
enjalot / index.html
Created September 15, 2011 04:47
[d3cast] Simple Bar Chart example with d3.js
<!-- Annotated javascript available at http://enja.org/code/tuts/d3/bar -->
<!-- Code walkthrough screencast available at -->
<html>
<head>
<title>Enjalot's Bar</title>
<script type="text/javascript" src="http://mbostock.github.com/d3/d3.js?2.1.3"></script>
<script type="text/javascript" src="http://mbostock.github.com/d3/d3.geom.js?2.1.3"></script>
<script type="text/javascript" src="http://mbostock.github.com/d3/d3.layout.js?2.1.3"></script>
<style type="text/css">
.bar rect
@addyosmani
addyosmani / pubsub.md
Created October 28, 2011 06:49
Four ways to do Pub/Sub with jQuery 1.7 and jQuery UI (in the future)

#Four Ways To Do Pub/Sub With jQuery and jQuery UI (in the future)

Between jQuery 1.7 and some of work going into future versions of jQuery UI, there are a ton of hot new ways for you to get your publish/subscribe on. Here are just four of them, three of which are new.

(PS: If you're unfamiliar with pub/sub, read the guide to it that Julian Aubourg and I wrote here http://msdn.microsoft.com/en-us/scriptjunkie/hh201955.aspx)

##Option 1: Using jQuery 1.7's $.Callbacks() feature:

$.Callbacks are a multi-purpose callbacks list object which can be used as a base layer to build new functionality including simple publish/subscribe systems. We haven't yet released the API documentation for this feature just yet, but for more information on it (including lots of examples), see my post on $.Callbacks() here:

@ifandelse
ifandelse / cartModule.js
Created January 16, 2012 03:59
Client-side Messaging in JavaScript - Part 2 (Postal.js) Example 2
var cartModule = (function(postal, $){
var cartId = 0,
cartTemplate = "#cart-tmpl",
cartItemTemplate = "#cart-item-tmpl",
cartChildrenSelector = "#cart-list",
wireUpCart = function(cart) {
postal.subscribe("cart", "init", _.bind(cart.init,cart));
postal.subscribe("cart", "item.add", function(item) {
var member = cart.id + "-" + item.id;
@erikreagan
erikreagan / mac-apps.md
Created August 4, 2012 19:18
Mac developer must-haves

Mac web developer apps

This gist's comment stream is a collection of webdev apps for OS X. Feel free to add links to apps you like, just make sure you add some context to what it does — either from the creator's website or your own thoughts.

— Erik

@anantn
anantn / firebase_queue_pop.js
Last active December 10, 2015 01:19
Firebase: Using .push() to maintain a queue and ensuring only one client is able to obtain the head of the queue at a time.
var Firebase = require("./firebase-node.js");
function Queue(ref) {
this._ref = ref;
}
Queue.prototype.pop = function(cb) {
this._ref.startAt().limit(1).once("child_added", this._pop.bind(this, cb));
}
@jaredhirsch
jaredhirsch / gist:4971859
Created February 17, 2013 15:19
all about ETags

ETags: a pretty sweet feature of HTTP 1.1

HTTP caching review

HTTP provides two ways for servers to control client-side caching of page components:

  • freshness may be based on a date or a token whose meaning is app-specific
  • whether or not the client needs to confirm the cached version is up-to-date with the server

This breaks down as follows:

  • Cache locally and don't check before using.
@dypsilon
dypsilon / frontendDevlopmentBookmarks.md
Last active July 7, 2024 19:32
A badass list of frontend development resources I collected over time.