This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
puts "hello world!" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# autocompletion for ruby_test | |
# # works with tu/tf aliases | |
# # see also ~/bin/ruby_test.rb | |
_ruby_tests() { | |
if [[ -n $words[2] ]]; then | |
compadd `ruby_test -l ${words[2]}` | |
fi | |
} | |
compdef _ruby_tests ruby_test | |
alias tu="ruby_test unit" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ heroku console | |
Ruby console for myapp.heroku.com | |
>> var_that_does_not_exist | |
! Internal server error | |
>> | |
$ heroku run bundle exec padrino console -e production | |
Running bundle exec padrino console -e production attached to terminal... up, run.9 | |
=> Loading production console (Padrino v.0.10.1) | |
=> Loading Application MyApp | |
=> Loading Application Admin |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def fib(i) | |
if i == 0 || i == 1 | |
1 | |
else | |
fib(i - 2) + fib(i - 1) | |
end | |
end | |
start = Time.now | |
puts fib(20) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# I'm not sure what's causing this yet. If you'd like, message me via GitHub if you've run into the same issue. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
GNU GENERAL PUBLIC LICENSE | |
Version 2, June 1991 | |
Copyright (C) 1989, 1991 Free Software Foundation, Inc., | |
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA | |
Everyone is permitted to copy and distribute verbatim copies | |
of this license document, but changing it is not allowed. | |
Preamble |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ \curl -L https://get.rvm.io | sudo bash -s stable | |
$ rvm user all | |
$ rvm install ruby-1.9.3-p327 | |
$ rvm use ruby-1.9.3-p327 --default | |
$ gem install passenger | |
$ passenger-install-apache2-module | |
Welcome to the Phusion Passenger Apache 2 module installer, v3.0.19. | |
This installer will guide you through the entire installation process. It | |
shouldn't take more than 3 minutes in total. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"$schema": "http://json-schema.org/draft-04/hyper-schema", | |
"id": "schemata/program", | |
"title": "Program", | |
"description": "An applicant applies to a **program** at an organization.", | |
"definitions": { | |
"href": { | |
"type": "string", | |
"description": "Hypertext reference to this resource.", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
dbname=# SELECT | |
dbname-# relname as "Table", | |
dbname-# pg_size_pretty(pg_total_relation_size(relid)) As "Size", | |
dbname-# pg_size_pretty(pg_total_relation_size(relid) - pg_relation_size(relid)) as "External Size" | |
dbname-# FROM pg_catalog.pg_statio_user_tables ORDER BY pg_total_relation_size(relid) DESC; | |
Table | Size | External Size | |
--------------------------------------------------+------------+--------------- | |
table1 | 19 GB | 1665 MB | |
table2 | 12 GB | 9720 MB | |
table3 | 10 GB | 5903 MB |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Straight from MDN | |
function notifyMe(s) { | |
// Let's check if the browser supports notifications | |
if (!("Notification" in window)) { | |
alert("This browser does not support desktop notification"); | |
} | |
// Let's check whether notification permissions have already been granted | |
else if (Notification.permission === "granted") { | |
// If it's okay let's create a notification |
OlderNewer