One-line server in Ruby
Posted . Visible to the public.
$ ruby -run -ehttpd . -p8000
See the provided link for other languages.
Related cards:
Migrating the Git Repository to another server
Remote Git (only once)
- create Team account on git host
- create PRIVATE repository on git host
$ git fetch
- using
git checkout
create a local copy for every remote branch:$ git checkout branch1
,$ git checkout branch2
etc. (you ma...
Conveniently kill your rails server
#mac
cat tmp/pids/server.pid | xargs -n1 -J pid kill -9 pid
#xfce linux
cat tmp/pids/server.pid | xargs -n1 -I pid kill -9 pid
This will read the file server.pid
and redirect the output as an argument to kill
. That way you don't ha...
Fixing the warning Time#succ is obsolete; use time + 1
Chances are you're seeing the warning repeated a lot of times, maybe thousands of times. Here's how to reproduce the issue:
START OF BAD CODE
(Time.zone.now - 1.hour .. Time.zone.now + 1.hours).include? Time.zone.now
END OF BAD CODE
...
Production Queries
Search Queries last 10 days
output = []; (1..10).each{|i| output.push(Search.where(created_at: ((DateTime.now-i.days)..(DateTime.now-(i-1).days))).count)};output
Create Fares for provider X
-----------------...
better_errors gem setup
Voraussetzung: Die Gems better_errors
und binding_of_caller
sind der development-Gruppe im Gemfile hinzugefügt.
Zuerst: bundle install
ausführen + lokalen Server neustarten
Die Shell im Browser sollte für Jeden funktionieren. Beim Öffnen ü...
Posted by Philipp Antar to Distribusion IT (2014-01-28 10:33)