Skip to content

Instantly share code, notes, and snippets.

View lxneng's full-sized avatar
🎯
Focusing

Eric Luo lxneng

🎯
Focusing
View GitHub Profile
@turicas
turicas / Makefile
Created December 3, 2011 23:22
Create slugs and abbreviate names using Python
test:
clear
nosetests --with-coverage --cover-package name_utils test_name_utils.py
clean:
find -regex '.*\.pyc' -exec rm {} \;
find -regex '.*~' -exec rm {} \;
.PHONY: test clean
@roidrage
roidrage / ebooks.md
Created December 2, 2011 15:15
Self-published and awesome
@PaulusTM
PaulusTM / passenger_status
Created October 27, 2011 08:37
passenger status for munin
#!/usr/bin/env ruby
# by Daniel Paulus | 27 - 10 - 2011
#
# put in /usr/share/munin/plugins/passenger_status
# chmod a+x /usr/share/munin/plugins/passenger_status
# ln -s /usr/share/munin/plugins/passenger_status /etc/munin/plugins/passenger_status
#
# add this to /etc/munin/plugin-conf.d/munin-node:
# [passenger_*]
# user root
@spicycode
spicycode / tmux.conf
Created September 20, 2011 16:43
The best and greatest tmux.conf ever
# 0 is too far from ` ;)
set -g base-index 1
# Automatically set window title
set-window-option -g automatic-rename on
set-option -g set-titles on
#set -g default-terminal screen-256color
set -g status-keys vi
set -g history-limit 10000
@kennethreitz
kennethreitz / history.txt
Created September 14, 2011 23:33
Most used commands, in order by usage, since last install
1665 git
1180 mate
912 ls
879 cd
751 gitx
596 python
359 ./manage.py
198 j
180 rm
169 clear
@andreyp
andreyp / gist:1084193
Created July 15, 2011 06:23
screenshot with selenium
#!/usr/bin/env python
from selenium import webdriver
browser = webdriver.Firefox()
browser.get('http://lenta.ru/')
browser.save_screenshot('screenie.png')
browser.close()
@baijum
baijum / flask.rst
Created July 10, 2011 18:03
Flask Notes
@philippeowagner
philippeowagner / fabfile.py
Created June 7, 2011 07:26 — forked from onyxfish/fabfile.py
Chicago Tribune News Applications fabric deployment script
from fabric.api import *
"""
Base configuration
"""
env.project_name = '$(project)'
env.database_password = '$(db_password)'
env.site_media_prefix = "site_media"
env.admin_media_prefix = "admin_media"
env.newsapps_media_prefix = "na_media"
@ChuckJHardy
ChuckJHardy / app.rake
Created May 29, 2011 12:34
Rake Task for Database Population
------------ From Rake Task
namespace :app do
# Checks and ensures task is not run in production.
task :ensure_development_environment => :environment do
if Rails.env.production?
raise "\nI'm sorry, I can't do that.\n(You're asking me to drop your production database.)"
end
end
@groner
groner / command.py
Created May 19, 2011 16:58
pyramid paster command template
import logging
import os.path as path
from paste.script.command import Command, BadCommand
from paste.deploy import loadapp
from pyramid.threadlocal import manager as threadlocal_manager