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
var int = self.setInterval(function(){clock()},1000); | |
function clock() | |
{ | |
var d = new Date(); | |
var t = d.toLocaleTimeString(); | |
document.getElementById("clock").value = t; | |
} |
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
rvm gemset empty | |
rvm gemset create mike_dev | |
rvm use 1.9.3@mike_dev | |
bundle install | |
(also had to run bundle update first on macbook, but not iMac. -- this was due to addressable-2.3.1 not being found.) |
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
module InWords | |
def in_words | |
return "n/a" if self > 999 | |
num = [] | |
h_num = self - (self%100) | |
t_num = self - h_num - (self%10) | |
o_num = self - h_num - t_num - (self%1) | |
h_words = ["one", "two", "three", "four", "five", "six", "seven", "eight", "nine"] | |
t_words = ["twenty", "thirty", "forty", "fifty", "sixty", "seventy", "eighty", "ninety"] |
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
MICHAELs-MacBook-Pro:rails_projects mike$ pwd | |
#=> this is where I'm starting the example | |
/Users/mike/rails_projects | |
MICHAELs-MacBook-Pro:rails_projects mike$ touch example.txt | |
#=> I'm creating a blank text file called example.txt | |
MICHAELs-MacBook-Pro:rails_projects mike$ mkdir newfolder1 | |
#=> I'm creating a new directory called newfolder1 |
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
# install Foreman | |
gem install foreman | |
#bash | |
export CONSTANT_NAME='name' | |
export CONSTANT_SOMETHING_ELSE='something_else' | |
#in app root directory create Procfile, .env and .gitignore | |
#Procfile | |
web: bundle exec rails s -p $PORT |
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
https://devcenter.heroku.com/articles/multiple-environments | |
#=> just create a new git remote for ps-staging and then push to it | |
# PS local constants | |
store in config/initializers | |
add to gitignore | |
commit something.yml.sample to show the contents that the file should have, so other devs can run their own local instance |
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
new-host-2:ltp mike$ brew remove postgresql | |
Uninstalling /usr/local/Cellar/postgresql/9.1.4... | |
new-host-2:ltp mike$ brew install postgresql | |
==> Downloading http://ftp.postgresql.org/pub/source/v9.1.4/postgresql-9.1.4.tar.bz2 | |
Already downloaded: /Library/Caches/Homebrew/postgresql-9.1.4.tar.bz2 | |
==> Patching | |
patching file src/pl/plpython/Makefile | |
patching file contrib/uuid-ossp/uuid-ossp.c | |
==> ./configure --disable-debug --prefix=/usr/local/Cellar/postgresql/9.1.4 --datadir=/usr/local/Cellar/postgresql | |
==> make install-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
meeting_comments POST /meetings/:meeting_id/comments(.:format) comments#create | |
meeting_comment DELETE /meetings/:meeting_id/comments/:id(.:format) comments#destroy | |
meeting_meeting_users POST /meetings/:meeting_id/meeting_users(.:format) meeting_users#create | |
meeting_meeting_user PUT /meetings/:meeting_id/meeting_users/:id(.:format) meeting_users#update | |
DELETE /meetings/:meeting_id/meeting_users/:id(.:format) meeting_users#destroy | |
meetings GET /meetings(.:format) meetings#index | |
POST /meetings(.:format) meetings#create | |
new_meeting GET /meetings/new(.:format) meetings#new | |
edit_meeting GET /meetings/:id/edit(.:format) meetings#edit | |
meeting GET /meetings/:id(.:format) meetings#show |
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
rails new <name of app> -d postgresql | |
rails g scaffold User name:string | |
rake db:migrate | |
Install Postgres.app | |
brew install postgresql | |
Problem: FATAL: role "<name of app/db here>" does not exist | |
Solution: | |
cd /usr/lib |
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
<div class="row"> | |
<div class="span6"> | |
<% if @meeting.started && [email protected]? %> | |
<%= content_for :javascripts do %> | |
<script> | |
var count = <%= @meeting.before_time %>; | |
var cost = <%= @meeting.cost %>; | |
</script> | |
<% end %> | |
<div class="live_input"> |
OlderNewer