Install Node.js from http://nodejs.org/
Create a folder for your project
mkdir weather
cd weather
Install require modules
@roll = [] | |
@pass_line_wins = 0 | |
@pass_line_losses = 0 | |
def roll_finished | |
puts @roll.inspect | |
puts "Pass line wins #{@pass_line_wins}, pass line losses #{@pass_line_losses}" | |
@roll = [] | |
end |
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>Bootstrap Me</title> | |
<meta charset="UTF-8"> | |
<link rel="stylesheet" href="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css"> | |
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script> | |
<script src="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script> | |
</head> | |
<body> |
Install Node.js from http://nodejs.org/
Create a folder for your project
mkdir weather
cd weather
Install require modules
There are just a couple of things you'll have to do in advance, in order to get your environment ready to be able to follow along. This takes about 30 minutes (of mostly waiting) so be sure to carve out some time to do this.
VirtualBox and Vagrant are two tools that we'll be using to emulate a production environment on your local machine. Install the latest version of VirtualBox from https://www.virtualbox.org/wiki/Downloads. Install Vagrant from http://www.vagrantup.com/downloads.html.
Once VirtualBox and Vagrant are installed, issue the following commands from Terminal:
vagrant box add precise32 http://files.vagrantup.com/precise32.box
#!/bin/sh | |
# Security | |
sudo adduser deploy --ingroup sudo | |
su deploy | |
cd ~ | |
# Exit immediately upon error | |
set -e | |
set -x |
namespace :deploy do | |
namespace :assets do | |
task :precompile, :roles => :web, :except => { :no_release => true } do | |
from = source.next_revision(current_revision) | |
if capture("cd #{latest_release} && #{source.local.log(from)} vendor/assets/ app/assets/ | wc -l").to_i > 0 | |
run %Q{cd #{latest_release} && #{rake} RAILS_ENV=#{rails_env} #{asset_env} assets:precompile} | |
else | |
logger.info "Skipping asset pre-compilation because there were no asset changes" | |
end | |
end |
require 'rubygems' | |
require 'sequel' | |
require 'fileutils' | |
require 'yaml' | |
require 'redcloth' | |
require 'rdiscount' | |
class Mephisto | |
QUERY = "SELECT id, permalink, body, published_at, title, filter \ | |
FROM contents \ |
function parse_git_dirty { | |
[[ $(git status 2> /dev/null | tail -n1) != "nothing to commit (working directory clean)" ]] && echo " ⚡" | |
} | |
function parse_git_branch { | |
git branch --no-color 2> /dev/null | sed -e '/^[^*]/d' -e "s/* \(.*\)/ → \1$(parse_git_dirty)/" | |
} | |
rvm_current() { | |
if [ "$(~/.rvm/bin/rvm-prompt v g)" != "" ]; then echo " → $(~/.rvm/bin/rvm-prompt v g)"; fi |
require 'rubygems' | |
require 'open-uri' | |
require 'mechanize' | |
require 'pp' | |
site_dashboard_url = 'http://www.tumblr.com/dashboard' | |
email = 'YOUR EMAIL' | |
password = 'YOUR PASSWORD' | |
agent = Mechanize.new |
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" | |
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> | |
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> | |
<head> | |
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/> | |
<title>The Greatest Flash Message Ever</title> | |
<style type="text/css" media="screen"> | |
html, body { | |
margin: 0; | |
padding: 0; |