Skip to content

Instantly share code, notes, and snippets.

class BinaryReverse
def reverse(n)
res = 0
while n > 1 do
res = res * 2 + n % 2
n = n / 2
end
res * 2 + 1
end
end
vi:
devise:
confirmations:
confirmed: Xác nhận tài khoản thành công! Bạn hiện đang đăng nhập.
send_instructions: Bạn sẽ nhận được email hướng dẫn xác nhận tài khoản trong vài phút nữa.
send_paranoid_instructions: Nếu email của bạn có trong hệ thống, bạn sẽ nhận được email hướng dẫn xác nhận tài khoản trong một vài phút nữa.
failure:
already_authenticated: Bạn đã đăng nhập.
inactive: Tài khoản của bạn chưa được kích hoạt.
invalid: Email hoặc mật khẩu không chính xác.
@anhkind
anhkind / gist:5523900
Created May 6, 2013 08:01
Fix: (ActiveRecord::StatementInvalid) "Mysql::Error: Lock wait timeout exceeded; try restarting transaction: UPDATE some_table.....
sudo vi /etc/my.cnf
Add/ Uncomment this: innodb_lock_wait_timeout=120
launchctl unload /usr/local/Cellar/mysql/5.5.28/homebrew.mxcl.mysql.plist
launchctl load /usr/local/Cellar/mysql/5.5.28/homebrew.mxcl.mysql.plist
#!/bin/bash
libs=( "/usr/local/lib/libmacfuse_i32.2.dylib" \
"/usr/local/lib/libosxfuse_i32.2.dylib" \
"/usr/local/lib/libosxfuse_i64.2.dylib" \
"/usr/local/lib/libmacfuse_i64.2.dylib" \
"/usr/local/lib/libosxfuse_i32.la" \
"/usr/local/lib/libosxfuse_i64.la" \
"/usr/local/lib/pkgconfig/osxfuse.pc" )