This helper has finally been moved into a gem called nav_lynx!
https://github.com/vigetlabs/nav_lynx
http://rubygems.org/gems/nav_lynx
Thanks to @brianjlandau and @reagent for getting that set up and tested!
alias server='open http://localhost:8000 && python -m SimpleHTTPServer' |
class Hash | |
# options: | |
# :exclude => [keys] - keys need to be symbols | |
def to_ostruct_recursive(options = {}) | |
convert_to_ostruct_recursive(self, options) | |
end | |
private | |
def convert_to_ostruct_recursive(obj, options) | |
result = obj |
This helper has finally been moved into a gem called nav_lynx!
https://github.com/vigetlabs/nav_lynx
http://rubygems.org/gems/nav_lynx
Thanks to @brianjlandau and @reagent for getting that set up and tested!
-- show running queries (pre 9.2) | |
SELECT procpid, age(clock_timestamp(), query_start), usename, current_query | |
FROM pg_stat_activity | |
WHERE current_query != '<IDLE>' AND current_query NOT ILIKE '%pg_stat_activity%' | |
ORDER BY query_start desc; | |
-- show running queries (9.2) | |
SELECT pid, age(clock_timestamp(), query_start), usename, query | |
FROM pg_stat_activity | |
WHERE query != '<IDLE>' AND query NOT ILIKE '%pg_stat_activity%' |
grep -r --color --exclude-dir={custom,lib,scripts} --exclude={*.xml,error_log} "beta" . |
package t | |
import ( | |
"time" | |
) | |
type NowFunc func() time.Time | |
var Now = func() time.Time { return time.Now() } | |
func NowForce(unix int) { |
package main | |
import ( | |
"log" | |
"math" | |
) | |
func Round(val float64, roundOn float64, places int ) (newVal float64) { | |
var round float64 | |
pow := math.Pow(10, float64(places)) |
/** | |
* the HTML5 autofocus property can be finicky when it comes to dynamically loaded | |
* templates and such with AngularJS. Use this simple directive to | |
* tame this beast once and for all. | |
* | |
* Usage: | |
* <input type="text" autofocus> | |
* | |
* License: MIT | |
*/ |