Moved this article to my blog!
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
require 'sinatra' | |
require 'sinatra/reloader' if development? | |
helpers do | |
def protected! | |
return if authorized? | |
headers['WWW-Authenticate'] = 'Basic realm="Restricted Area"' | |
halt 401, "Not authorized\n" | |
end |
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
# Git: Because it's time to learn how to team code like the pros | |
## Contents | |
1. Why learn git - The Programmers' Dropbox Dilemma | |
2. Getting started - Download and setup git | |
3. Sample project and scenario - A sample website, 3 programmers in a team | |
4. git init, add, commit - Your first commit | |
5. git status, diff, log - Second commit | |
6. git checkout, branch, merge, rebase - Let's get experimental | |
7. GitHub - Social Coding Platform |
- http://tryruby.org
- http://try.github.com
- https://www.codeschool.com/courses/rails-for-zombies-redux
- http://www.railstutorial.org/book
You may have hard time doing it on windows, I suggest at Step 4, use Linux or Mac. Install VirtualMachine to allow you to run Linux parallely with Windows.
Also study UNIX commands to be used in Git Bash, find out commands like:
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
require 'nfc' | |
# Read | |
c = NFC::Context.new | |
d = c.open nil | |
puts "Put your card..." | |
e = d.select | |
# UID |
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
create database store; | |
connect to store; | |
-- create tables | |
create table sales_representatives | |
( | |
id int primary key not null, | |
name varchar(255), |
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
# Refer http://literacy.kent.edu/Minigrants/Cinci/romanchart.htm | |
require 'rspec/given' | |
require 'roman_numeral_converter' | |
describe RomanNumeralConverter do | |
Given(:converter) { RomanNumeralConverter.new } | |
Then { converter.convert(1) == 'I' } | |
Then { converter.convert(2) == 'II' } |
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
# Make sure you have coreutils, install it like this: | |
# brew install coreutils | |
# Paste this in ~/.bash_profiles | |
function howbig() { du -hs ./*/ | gsort -h; } |
OlderNewer