This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# vim: ft=sh:ts=4:sw=4:autoindent:expandtab: | |
# Source: https://github.com/django/django/blob/stable/1.5.x/extras/django_bash_completion | |
# ######################################################################### | |
# This bash script adds tab-completion feature to django-admin.py and | |
# manage.py. | |
# | |
# Testing it out without installing | |
# ================================= | |
# |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDN0sO2/S6Q19vOz2ZO7Y+TAFzHQb1LCtlbcGNFACq0M3PXFVQ1rTyayiNcrnfz+ckfCZe38IUZLoAJXiqg2A7Ww8vazuG8exdR1+GXWYSAFsAkJkqptQ2B/fl0ZelJZLEVJVDJw4Y0d/oYlhpL8FKuvrHQJLscPfuxB/VxJBxsaWDQvrNb862R/A5A28VpE1/pZRWp1e/6qtDwxhYhJPoPsdur9l8TOWz/AzBpqxpSB3zKGIK07hHBSYtfZXBO8gcOaGU4s+btAodJ5L0U0E3hXlUGc0e+ZYFU6f6Sz2tzYiwPfS9sYVjBN14vzZh4Bz5cZZQurjcgwaPhyxCzh9ql sunliwen@gmail.com |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# http://lxml.de/installation.html#using-lxml-with-python-libxml2 | |
STATIC_DEPS=true pip install lxml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import json | |
import decimal | |
import pprint | |
# refs: https://djangosnippets.org/snippets/2410/ | |
# refs: http://stackoverflow.com/questions/1960516/python-json-serialize-a-decimal-object | |
class DecimalEncoder(json.JSONEncoder): | |
def default(self, obj): | |
if isinstance(obj, decimal.Decimal): | |
return float(obj) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def init_nmp(): | |
install_nginx() | |
install_php() | |
install_phpfpm() | |
def install_nginx(): | |
sudo("add-apt-repository ppa:nginx/stable") | |
sudo("apt-get update") | |
sudo("apt-get -y -q install nginx-full nginx-common") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="UTF-8"?> | |
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" | |
"http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | |
<plist version="1.0"> | |
<dict> | |
<key>Label</key> | |
<string>org.mongodb.mongod</string> | |
<key>ProgramArguments</key> | |
<array> | |
<string>/opt/local/bin/mongod</string> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# It's not possible to have a "KEYS *" command in memcached directly | |
# but could achieve by two steps | |
➜ ~ telnet 127.0.0.1 11211 | |
Trying 127.0.0.1... | |
Connected to localhost. | |
Escape character is '^]'. | |
set one 0 60 1 | |
1 | |
STORED |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Show hidden characters
{ | |
"color_scheme": "Packages/Color Scheme - Default/Solarized (Dark).tmTheme", | |
"font_size": 15.0, | |
"draw_white_space": "selection", | |
"trim_trailing_white_space_on_save": true, | |
"tab_size": 2, | |
"translate_tabs_to_spaces": true, | |
"tab_completion": true, | |
"save_on_focus_lost": true, | |
"highlight_line": true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script> | |
<script src="http://cdnjs.cloudflare.com/ajax/libs/handlebars.js/1.0.0-rc.3/handlebars.js"></script> | |
<script src="http://cdnjs.cloudflare.com/ajax/libs/ember.js/1.0.0-rc.6/ember.min.js"></script> | |
<link href="http://getbootstrap.com/dist/css/bootstrap.css" rel="stylesheet" type="text/css" /> | |
<script src="http://getbootstrap.com/dist/js/bootstrap.js"></script> | |
<meta charset=utf-8 /> | |
<title>JS Bin</title> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Ubuntu upstart file at /etc/init/mongodb.conf | |
limit nofile 32768 32768 | |
kill timeout 300 # wait 300s between SIGTERM and SIGKILL. | |
pre-start script | |
mkdir -p /data/mongodb &> /dev/null | |
mkdir -p /data/logs/mongo &> /dev/null | |
chown mongodb:nogroup /data/mongodb &> /dev/null |
OlderNewer