Never been to DZone Snippets before?

Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world

« Newer Snippets
Older Snippets »
Showing 1-3 of 3 total  RSS 

Really Kill Rails (as well as Restart)

More lovely alias commands... this time to kill/restart Rail's script/server from any Terminal session or login on your box... (as long as your the same user).

alias dierails='ps -a|grep "/usr/local/bin/ruby script/server"|grep -v "grep /usr"|cut -d " " -f1|xargs -n 1 kill -KILL $1'
alias resetrails='ps -a|grep "/usr/local/bin/ruby script/server"|grep -v "grep /usr"|cut -d " " -f1|xargs -n 1 kill -HUP $1'

Alias to a Nice Default Gitk

Just a really quick and easy shell alias for my preferred defaults for Git's repository and branch viewer, Gitk.

This runs "gitk"...
...including all branches,
...outputting errors to the black hole,
...and any extra command-line arguments.

# Run like this
# gitk --since="2 days ago" &

alias gitk="gitk --all $1 2>/dev/null"

Localizing a dialect with ALIAS

; Localizing a dialect; obviously just a basic idea.

alias 'who   "welche"
alias 'where "wo"
alias 'when  "wann"

rule: [
    some [
        'who   set persons [word! | block!] |
        'where set place string! |
        'when  set time time!
    ]
    to end
]

time: place: persons: none
parse [
    who   Fred
    where "Your house"
    when  9:30
] rule
print [time place persons]

time: place: persons: none
parse [
    welche Karl
    wo     "Euer Haus"
    wann   11:30
] rule
print [time place persons]
« Newer Snippets
Older Snippets »
Showing 1-3 of 3 total  RSS