Skip to content

Instantly share code, notes, and snippets.

View alper's full-sized avatar
Always coffee

Alper Cugun alper

Always coffee
View GitHub Profile
@mikeyk
mikeyk / redis_session_backend.py
Created April 8, 2011 18:01
A redis backend for Django Sessions, tested on Django 1.3+
from django.contrib.sessions.backends.base import SessionBase, CreateError
from django.conf import settings
from django.utils.encoding import force_unicode
import redis
class SessionStore(SessionBase):
""" Redis store for sessions"""
def __init__(self, session_key=None):
self.redis = redis.Redis(
@vesan
vesan / rails-install-ubuntu.sh
Created September 13, 2011 18:55
Rails Girls Install Scripts for OS X and Ubuntu
set -e
echo "Updates packages. Asks for your password."
sudo apt-get update -y
echo "Installs packages. Give your password when asked."
sudo apt-get install build-essential bison openssl libreadline6 libreadline6-dev curl git-core zlib1g zlib1g-dev libssl-dev libyaml-dev libsqlite3-0 libsqlite3-dev sqlite3 libxml2-dev libxslt-dev autoconf libc6-dev nodejs -y
echo "Installs ImageMagick for image processing"
sudo apt-get install imagemagick --fix-missing -y

Markdown formatted version of the plain text source document. The views expressed in this document are the original (anonymous) author's.

After reading this, read the response from 10Gen's CTO.

Don't use MongoDB

I've kept quiet for awhile for various political reasons, but I now feel a kind of social responsibility to deter people from banking their business on MongoDB.

@panicsteve
panicsteve / gist:1641705
Created January 19, 2012 18:26
Form letter template for acquired startups
Dear soon-to-be-former user,
We've got some fantastic news! Well, it's great news for us anyway. You, on
the other hand, are fucked.
We've just been acquired by:
[ ] Facebook
[ ] Google
[ ] Twitter
@atduskgreg
atduskgreg / actants.asciidoc
Created February 29, 2012 23:53
A list of every example actant mentioned in the first half of Prince of Networks by Graham Harman

A list of every example actant mentioned in the first half of Prince of Networks by Graham Harman

"These long lists of random actors must continue until their plurality and autonomy is no longer suppressed. We still know nothing about these objects or what they entail. All that is clear is their metaphysical equality. The world is a stage filled with actors; philosophy is object-oriented philosophy." — Harman, Prince of Networks.

"[These lists are] a repeated sorcerer’s chant of the multitude of things that resist any unified empire." — Harman, Prince of Networks

  • lactc acid ferment

  • city of Rouen

  • the laboratory on the Rue d’Ulm

  • God

@jvdgoot
jvdgoot / gist:2427304
Created April 20, 2012 09:19
Allow text selection in Quick Look
# Allow text selection in Quick Look
defaults write com.apple.finder QLEnableTextSelection -bool true
@simonw
simonw / setting-up-sublime-text-2.txt
Created July 11, 2012 12:35
Setting up Sublime Text 2
First, install it from http://www.sublimetext.com/2
Next, install the package control extension from here:
http://wbond.net/sublime_packages/package_control
Installation instructions here: http://wbond.net/sublime_packages/package_control/installation
Restart Sublime, then hit Shift+Apple+P and search for "Package Control: Install Package"
@mattb
mattb / gist:3888345
Created October 14, 2012 11:53
Some pointers for Natural Language Processing / Machine Learning

Here are the areas I've been researching, some things I've read and some open source packages...

Nearly all text processing starts by transforming text into vectors: http://en.wikipedia.org/wiki/Vector_space_model

Often it uses transforms such as TFIDF to normalise the data and control for outliers (words that are too frequent or too rare confuse the algorithms): http://en.wikipedia.org/wiki/Tf%E2%80%93idf

Collocations is a technique to detect when two or more words occur more commonly together than separately (e.g. "wishy-washy" in English) - I use this to group words into n-gram tokens because many NLP techniques consider each word as if it's independent of all the others in a document, ignoring order: http://matpalm.com/blog/2011/10/22/collocations_1/

@cbetta
cbetta / case.sh
Created October 17, 2012 17:02
How to change the case of a filename in Git
git mv readme.md readme.md.temp
git mv readme.md.temp README.md
@cjohansen
cjohansen / gist:4135065
Created November 23, 2012 10:43
Naming this in nested functions

tl;dr

If you must nest functions in a way that requires access to multiple this', alias outer this to something meaningful - describe the value it's holding. Treat this as the invisible first argument.

In general though, avoiding the situation (nested functions and frivolous use of this) will frequently produce clearer results.

Naming this in nested functions

I was accidentally included in a discussion on how to best name this in nested functions in JavaScript. +1's were given to this suggestion of using _this.

Giving style advice on naming nested this without a meaningful context isn't too helpful in my opinion. Examples below have been altered to have at least some context, although a completely contrived and stupid one.