Skip to content

Instantly share code, notes, and snippets.

View ndarville's full-sized avatar

N. Darville ndarville

  • Europe
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
diff --git a/iPhoneTrackingAppDelegate.m b/iPhoneTrackingAppDelegate.m
index 1d22ecb..4af2bcf 100644
--- a/iPhoneTrackingAppDelegate.m
+++ b/iPhoneTrackingAppDelegate.m
@@ -146,7 +146,7 @@
return NO;
}
- const float precision = 100;
+ const float precision = 10000;
@lucasfais
lucasfais / gist:1207002
Created September 9, 2011 18:46
Sublime Text 2 - Useful Shortcuts

Sublime Text 2 – Useful Shortcuts (Mac OS X)

General

⌘T go to file
⌘⌃P go to project
⌘R go to methods
⌃G go to line
⌘KB toggle side bar
⌘⇧P command prompt
@mattyoho
mattyoho / ios-test.css
Created October 19, 2011 19:12 — forked from tonywok/ios-test.css
iOS Media Queries
// iOS Media Queries
// Goal: capture styles for iPhone, iPhone 3G, iPhone 3GS, iPhone 4, iPhone 4S, iPad, and iPad 2
//
// Author: Tony Schneider (@tonywok)
// Please tell me where I fail. :)
// iPhone v(4,4S) portrait
// test: black text (overwritten by v* portrait) with blue background
@media all and (-webkit-min-device-pixel-ratio: 2) and (orientation: portrait) {
a {
@eikes
eikes / hnpolls.js
Created October 23, 2011 20:18
Hacker News Polls Visualisation JavaScript Bookmarklet
javascript:(function(){
var s = document.createElement("script");
s.setAttribute("src", "http://code.jquery.com/jquery.js");
document.body.appendChild(s);
s.addEventListener("load", function() {
var $ = jQuery;
var max = 0;
var table = "table tr:eq(3) table:eq(1) ";
$(table).width("100%");
$(table + "tr td:eq(0)").width("15px");
@soemarko
soemarko / theme.html
Created November 26, 2011 16:18
embed github gist to tumblr
<!-- Add the following lines to theme's html code right before </head> -->
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.0/jquery.min.js"></script>
<script src="http://static.tumblr.com/fpifyru/VCxlv9xwi/writecapture.js"></script>
<script src="http://static.tumblr.com/fpifyru/AKFlv9zdu/embedgist.js"></script>
<!--
Usage: just add <div class="gist">[gist URL]</div>
Example: <div class="gist">https://gist.github.com/1395926</div>
-->
// ==UserScript==
// @name Show Full Domain on Hacker News posts
// @description Sets full domain on hacker news posts.
// @namespace http://userscripts.org/users/119115
// @include http://news.ycombinator.com/*
// @include https://news.ycombinator.com/*
// @match https://news.ycombinator.com/*
// @match http://news.ycombinator.com/*
// ==/UserScript==
@aemkei
aemkei / LICENSE.txt
Last active April 12, 2024 21:27 — forked from 140bytes/LICENSE.txt
Binary Tetris - 140byt.es
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Version 2, December 2004
Copyright (C) 2011 YOUR_NAME_HERE <YOUR_URL_HERE>
Everyone is permitted to copy and distribute verbatim or modified
copies of this license document, and changing it is allowed as long
as the name is changed.
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
@vwood
vwood / gist:1725650
Created February 2, 2012 20:44
Pythonic Java
import java.net.* ;
import java.io.* ;
import java.util.* ;
public class Server {
public static void main( String[] args) {
try {
ServerSocket sock = new ServerSocket(4712,100) ;
while(true) new Handler(sock.accept()).start() ;}
catch(IOException e) {
System.err.println(e) ;};}}
@hrldcpr
hrldcpr / tree.md
Last active May 1, 2024 00:11
one-line tree in python

One-line Tree in Python

Using Python's built-in defaultdict we can easily define a tree data structure:

def tree(): return defaultdict(tree)

That's it!