Skip to content

Instantly share code, notes, and snippets.

View sferik's full-sized avatar

Erik Berlin sferik

View GitHub Profile
@sferik
sferik / bookmarks.md
Last active December 13, 2015 17:48
Web Programming with Ruby on Rails

Twitter公式クライアントのコンシューマキー

Twitter for iPhone

Consumer key: IQKbtAYlXLripLGPWd0HUA
Consumer secret: GgDYlkSvaPxGxC4X8liwpUoqKwwr3lCADbz8A7ADU

Twitter for Android

Consumer key: 3nVuSoBZnx6U4vzUxf5w
Consumer secret: Bcs59EFbbsdF6Sl9Ng71smgStWEGwXXKSjYvPVt7qys

Twitter for Google TV

Consumer key: iAtYJ4HpUVfIUoNnif1DA

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="description" content="Your description goes here">
<meta name="keywords" content="one, two, three">
<title>Blank Template</title>
<!-- external CSS link -->
/*! normalize.css 2012-07-07T09:50 UTC - http://github.com/necolas/normalize.css */
/* ==========================================================================
HTML5 display definitions
========================================================================== */
/*
* Corrects `block` display not defined in IE6/7/8/9 & FF3.
*/
# API v1.1, HTTPS
# Expected: {\"errors\":[{\"message\":\"Bad Authentication data\",\"code\":215}]}
# Raises: EOFError: end of file reached
require 'net/http'
uri = "https://api.twitter.com/1.1/users/show.json?user_id=33978"
Net::HTTP.get(URI(uri))
# API v1, HTTPS
# Expected: {\"errors\":[{\"message\":\"Bad Authentication data\",\"code\":215}]}
# Raises: EOFError: end of file reached
class Menu
attr_reader :first, :last
def initialize
@first, @last = 2.times.collect{|i| prompt(i + 1)}
end
def prompt(number)
print "Enter number #{number}:\t"
gets.chomp.to_i
@sferik
sferik / homework.md
Last active December 15, 2015 12:09

WDI Homework - March 27, 2013

Tic-Tac-Toe

Create a two-player tic-tac-toe game in Ruby.

Requirements
  • Must define at least two classes
  • Must define at least one exception class
  • Must use at least one Array
  • Must use at least one Hash
class RomanNumeralGenerator
TABLE = {
1000 => "M",
900 => "CM",
500 => "D",
400 => "CD",
100 => "C",
90 => "XC",
50 => "L",
40 => "XL",

WDI Homework - April 1, 2013

SQL

  1. Write a program that converts Roman numerals to Arabic numerals.
  2. Download this SQLite database and write a SQL statement that:
    1. Selects the names of all products that are not on sale.
    2. Selects the names of all products that cost less than $20.
    3. Selects the name and price of the most expensive product.
    4. Selects the name and price of the second most expensive product.
  3. Selects the name and price of the least expensive product.