Skip to content

Instantly share code, notes, and snippets.

View fallenhitokiri's full-sized avatar

Timo Zimmermann fallenhitokiri

View GitHub Profile
@fadur
fadur / custom_manager.py
Created June 25, 2011 21:57
Subclassing django's QuerySet
from django.db import models, connection
class SearchQuerySet(models.query.QuerySet):
"""SearchQuerySet"""
def __init__(self, model=None, fields=None, using=None, query=None):
super(SearchQuerySet, self).__init__(model, query, using)
self._search_fields = fields
def search(self, squery):
@adamstac
adamstac / ios-media-queries.sass
Created September 17, 2011 13:58
iOS Media Queries for iPhone/iPod, iPad & Retina and Non-Retina Devices
.ipad-only,
.iphone-only,
.retina-only,
.non-retina-only,
.retina-iphone-only,
.non-retina-iphone-only
display: none
// iPad Only
@media only screen and (device-width: 768px)
@pamelafox
pamelafox / send.js
Created November 7, 2011 21:21
CORS XHR (jQuery/Flask)
function sendData(url, data, onSuccess, onError) {
$.ajax({
url: url,
type: 'POST',
data: data,
dataType: 'json',
xhrFields: {
withCredentials: true
},
@rmhall
rmhall / itunes_match_tips.txt
Created November 22, 2011 21:08
iTunes Match tips
My iTunes Match Track upgrading and process info:
If you have less than 25,000 tracks:
1. First let iTunes Match do its things and find all possible matches in your library and finish uploading any non-matching tracks.
2. Once its done, make a new Smart Playlist (I made a folder for all my Smart iTunes Match Related Playlists)
Name this one: iCloud-Upgradeable
Criteria:
MATCH ALL:
Bit Rate is less than 256kbps
@csexton
csexton / xvfb.conf
Created February 28, 2012 20:02
Ubuntu Upstart Script for Xvfb
description "Xvfb X Server"
start on (net-device-up
and local-filesystems
and runlevel [2345])
stop on runlevel [016]
exec /usr/bin/Xvfb :99 -screen 0 1024x768x24
@maccman
maccman / juggernaut.rb
Created June 26, 2012 02:49
Sinatra Server Side Event streaming.
# Usage: redis-cli publish message hello
require 'sinatra'
require 'redis'
conns = []
get '/' do
erb :index
end
@maccman
maccman / juggernaut_channels.rb
Created June 26, 2012 04:56
Sinatra Server Side Event streaming with private channels.
# Usage: redis-cli publish message.achannel hello
require 'sinatra'
require 'redis'
conns = Hash.new {|h, k| h[k] = [] }
Thread.abort_on_exception = true
get '/' do
@pierremarc
pierremarc / test_cc.py
Created September 19, 2012 15:21
Add files to a repo with pygit2
"""
test commit creation with pygit2
To see the result:
rm -rf foo && python test_cc.py && cd foo/ && git log --graph --oneline --date-order --decorate --color --all && git status && cd ..
"""
import os
import sys
import pygit2
@tomschlick
tomschlick / gist:3984898
Created October 31, 2012 05:02
Sublime Text 2 Keybindings to Resize Split Panes
[
{
"keys": ["super+alt+left"],
"command": "set_layout",
"args":
{
"cols": [0.0, 0.33, 1.0],
"rows": [0.0, 1.0],
"cells": [[0, 0, 1, 1], [1, 0, 2, 1]]
}
@dypsilon
dypsilon / frontendDevlopmentBookmarks.md
Last active April 30, 2024 04:42
A badass list of frontend development resources I collected over time.