Skip to content

Instantly share code, notes, and snippets.

View krsmurata's full-sized avatar

Kristopher Murata krsmurata

View GitHub Profile
@krsmurata
krsmurata / gist:4573586
Last active December 11, 2015 08:29
/etc/init.d/nginx
#! /bin/sh
### BEGIN INIT INFO
# Provides: nginx
# Required-Start: $all
# Required-Stop: $all
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: starts the nginx web server
# Description: starts nginx using start-stop-daemon
@krsmurata
krsmurata / gist:3915681
Created October 19, 2012 01:06
Bundler-API test
210507 ~/dev
~> mkdir test
210509 ~/dev
~> cd test/
210512 ~/dev/test
~> vim Gemfile
210517 ~/dev/test
@krsmurata
krsmurata / rails_admin.pt-BR.yml
Created February 16, 2012 13:09 — forked from lribeiro/rails_admin.pt-PT.yml
Portuguese (pt-BR) translation for RailsAdmin 3.2
pt-BR:
views:
admin:
home:
name: Home
pagination:
previous: "« Anterior"
next: "Próximo »"
truncate: "…"
misc:
@krsmurata
krsmurata / clear_logs.rb
Created February 15, 2012 14:36
Clear development logs
if Rails.env.development?
MAX_LOG_SIZE = 10.megabytes
logs = [ File.join(Rails.root, 'log', 'development.log'), File.join(Rails.root, 'log', 'test.log') ]
logs.each do |log|
log_size = File.size?(log).to_i
if log_size > MAX_LOG_SIZE
$stdout.puts "Removing Log: #{log}"
`rm #{log}`
tell application "Skype"
send command "SET USERSTATUS DND" script name "pomodoro"
end tell
tell application "Mail" to quit
tell application "Tweetie" to quit
root@dev:~# ls -la /usr/local/bin/
total 28
drwxr-xr-x 2 root root 4096 2010-11-15 11:55 .
drwxr-xr-x 11 root root 4096 2010-11-15 11:55 ..
-rwxr-xr-x 1 root root 1263 2010-11-15 11:55 rvm
-rwxr-xr-x 1 root root 589 2010-11-15 11:55 rvm-auto-ruby
-rwxr-xr-x 1 root root 3327 2010-11-15 11:55 rvm-prompt
-rwxr-xr-x 1 root root 992 2010-11-15 11:55 rvm-shell
-rwxr-xr-x 1 root root 438 2010-11-15 11:55 rvmsudo
root@dev:~# ls -la /usr/local/rvm/bin/
# usage: rails new APP_NAME -m http://gist.github.com/629240.txt -TJ
# the -T drops test-unit and the -J drops prototype
gem "mysql2"
gem "haml"
gem "sass"
gem "compass"
gem "rspec-rails", "2.0.1"
~> ruby jn-parser.rb
Thu, 01 Jul 2010 01:45:14 -0400 # WordPress 3.0 rodando e probleminhas de feed
Wed, 30 Jun 2010 20:44:14 -0400 # Concurso da Blizzard vai dar edição de colecionador de Starcraft II!
Wed, 30 Jun 2010 20:03:35 -0400 # LOST: Como deveria ter acabado [SPOILERS]
Wed, 30 Jun 2010 18:47:14 -0400 # Jerry Bruckheimer considerando sequencia de Top Gun
Tue, 29 Jun 2010 17:47:27 -0400 # Capcom diz que novos consoles devem surgir até 2012
Tue, 29 Nov -1 20:21:32 -0338 # Assista AGORA ao trailer de Tropa de Elite 2!
Tue, 29 Jun 2010 16:29:57 -0400 # Vídeo de Portal 2 apresenta novo personagem
Tue, 29 Nov -1 20:21:32 -0338 # Nova animação da DC anunciada
Tue, 29 Jun 2010 00:42:44 -0400 # Caverna do Jedi – 16
~> ruby jn-parser.rb
Tue, 29 Nov -1 20:21:32 -0338 # Nerdcast 215 – Profissão: Autor
Tue, 29 Nov -1 20:21:32 -0338 # Nerdcast 214 – Copa 2010 – Cala Boca, Galvão!
Tue, 29 Nov -1 20:21:32 -0338 # Nerdcast 213 – Especial Dia dos Namorados 2010
Tue, 29 Nov -1 20:21:32 -0338 # Nerdcast 212 – Seinfeld: Tudo sobre o nada
Tue, 29 Nov -1 20:21:32 -0338 # Nerdcast 211 – Profissão: Programador
Tue, 29 Nov -1 20:21:32 -0338 # Nerdcast 210 – LOST: 5 teorias antes do fim
Tue, 29 Nov -1 20:21:32 -0338 # Nerdcast 209 – Douglas Adams – A Vida, o Universo e Tudo Mais
Tue, 29 Nov -1 20:21:32 -0338 # Nerdcast 208 – World of MMORPG FL
Tue, 29 Nov -1 20:21:32 -0338 # Nerdcast 207 – Bêbado e na Mão do Palhaço 2
# see it in action: http://www.flickr.com/photos/krsmurata/4733844609/sizes/l/
# with timestamp
minimal_prompt_command() {
if [ $? -eq 0 ]; then
local ARROW_COLOR="\[\e[1;32m\]"
else
local ARROW_COLOR="\[\e[1;31m\]"
fi
local CWD_GIT_BRANCH="`git branch 2> /dev/null | grep '^*' | sed -E 's/^\* (.+)$/\1/'`"