- k - up
- j - down
- h - left
- l - right
- 0 - start
- ^ - firs non-blank character
Create ctags file for SublimeText containing current floder + used gemsets - ctags --extra=+f --exclude=.git --exclude=log -f .tags -R . `rvm gemdir`/gems/*
RED="\[\033[0;31m\]" | |
YELLOW="\[\033[0;33m\]" | |
GREEN="\[\033[0;32m\]" | |
BLUE="\[\033[0;34m\]" | |
LIGHT_RED="\[\033[1;31m\]" | |
LIGHT_GREEN="\[\033[1;32m\]" | |
WHITE="\[\033[1;37m\]" | |
LIGHT_GRAY="\[\033[0;37m\]" | |
DARK_GRAY="\[\033[0;90m\]" | |
COLOR_NONE="\[\e[0m\]" |
```bash | |
# Make a POST request with post parameter | |
# -i for showing headers | |
# -d for passing post parameters | |
curl -i -d "site_key=almost_random" -X POST http://localhost:3001/api/visits | |
# Save a cookie in a file | |
curl -c visits_cookie.txt -d "site_key=almost_random" -X POST http://localhost:3001/api/visits | |
# Make a POST request with cookie |
#! /bin/sh | |
### BEGIN INIT INFO | |
# Provides: redis-server | |
# Required-Start: $syslog $remote_fs | |
# Required-Stop: $syslog $remote_fs | |
# Should-Start: $local_fs | |
# Should-Stop: $local_fs | |
# Default-Start: 2 3 4 5 | |
# Default-Stop: 0 1 6 | |
# Short-Description: redis-server - Persistent key-value db |
// Creating a script tag & adding it to page | |
jCookie=document.createElement('script'); | |
jCookie.type = 'text/javascript'; | |
jCookie.src = "https://raw.github.com/carhartl/jquery-cookie/master/jquery.cookie.js"; | |
$('body').append(jCookie) |
Links: (http://stackoverflow.com/questions/3508627/stop-long-running-sql-query-in-postgresql-when-session-or-requests-no-longer-e) (http://www.postgresql.org/docs/current/static/functions-admin.html#FUNCTIONS-ADMIN-SIGNAL-TABLE)
--- To stop the query:
SELECT pg_cancel_backend(proced_id);
--- To kill the database connection:
class Base | |
@doSomething: (@origin) -> | |
console.log "Base.doSomething called" | |
@showSomething: -> | |
console.log "Showing something", @things | |
@createSomething: (something) -> | |
new @ |
# Will get you past the ssl library linking issue | |
rvm pkg install openssl | |
rvm install --autolibs=packages --with-openssl-dir=$HOME/.rvm/usr 2.0.0 |