Skip to content

Instantly share code, notes, and snippets.

View andreif's full-sized avatar
👾
invading spaces

Andrei Fokau andreif

👾
invading spaces
View GitHub Profile
@andreif
andreif / django-heroku.md
Created August 24, 2011 10:22
Initial Django site setup to run on Heroku (work in progress)
@andreif
andreif / pip_git_dmsl.txt
Created August 25, 2011 10:56
Cannot install DMSL from github repo using pip
$ pythonbrew venv use test
$ pip freeze
Cython==0.15
distribute==0.6.21
lxml==2.3
wsgiref==0.1.2
@andreif
andreif / virtualenv.rb
Created September 4, 2011 18:11
Pip helper
#!/usr/bin/env ruby
require 'open-uri'
require 'json'
class GitHubRepo
attr_reader :user, :repo, :ref
def initialize hash
@user = hash[:user]
@repo = hash[:repo]
@ref = hash[:ref] || 'master'
@andreif
andreif / ldap_admin.rb
Created September 8, 2011 19:22 — forked from tritonrc/ldap_admin.rb
Simple Sinatra based LDAP admin tool
require 'rubygems'
require 'sinatra'
require 'net-ldap'
require 'digest/sha1'
require 'base64'
require 'haml'
LDAP_HOST = 'localhost'
ADMIN_DN = 'cn=admin,dc=company,dc=com'
@andreif
andreif / install_packages.md
Created November 5, 2011 14:48
Installing prerequisites (Mac OS X)

1. Installing prerequisites (Mac OS X)

curl -kL https://raw.github.com/utahta/pythonbrew/master/pythonbrew-install | bash
alias pyb='pythonbrew'

1.2. Python, pip, and setuptools

pyb install --no-test 2.7.2

# Copyright (c) 2011 Konstantin Haase
require 'sinatra/base'
require 'capture_stdout'
require 'escape_utils'
require 'slim'
require 'sass'
require 'coffee-script'
require 'eventmachine'
@andreif
andreif / readme.md
Created December 29, 2011 22:44 — forked from mralex/sinatra-memcacher.rb
Simple memcached helper for Sinatra.

Simple memcached module, derived from [gioext/sinatra-memcache][1], updated to use the 'memcached' gem.

Compatible with Sinatra 1.2

Usage

Activate in a modular Sinatra app:

 register Sinatra::Memcacher
@andreif
andreif / chat.rb
Created December 30, 2011 18:00 — forked from rkh/chat.rb
Simple Chat Application using the Sinatra Streaming API
# coding: utf-8
require 'sinatra'
set server: 'thin', connections: []
get '/' do
halt erb(:login) unless params[:user]
erb :chat, locals: { user: params[:user].gsub(/\W/, '') }
end
get '/stream', provides: 'text/event-stream' do
// ==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==
@andreif
andreif / hack.sh
Created March 31, 2012 19:57 — forked from erikh/hack.sh
OSX For Hackers
#!/usr/bin/env sh
##
# This is script with usefull tips taken from:
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx
#
# install it:
# curl -sL https://raw.github.com/gist/2108403/hack.sh | sh
#