Skip to content

Instantly share code, notes, and snippets.

@bridgpal
bridgpal / geochart.html
Created December 31, 2012 17:47
Simple Google geochart example
<html>
<head>
<script type='text/javascript' src='https://www.google.com/jsapi'></script>
<script type='text/javascript'>
google.load('visualization', '1', {'packages': ['geochart']});
google.setOnLoadCallback(drawMarkersMap);
function drawMarkersMap() {
var data = new google.visualization.DataTable();
data.addColumn('string', 'Country');

WDI Lab - April 8, 2013

Movies

You will be creating a movies app using Sinatra and the OMDB API.

Requirements

  • Ability to search for a movie by title
  • Ability to click on a search result to see detailed information about a movie including:
    • Title
  • Year
@bridgpal
bridgpal / statebird.rb
Last active December 17, 2015 14:09
Check for reservation on urbanspoon
require 'nokogiri'
require 'open-uri'
url = "http://rez.urbanspoon.com/reservation/start/2086"
while true
d = Nokogiri::HTML(open(url))
text = d.css("div p").first.text.gsub("this restaurant", "State Bird Provisions")

#Homework for June 18, 2013

##Calculator 1 Create a command line calculator. It should have a basic and advanced mode.

basic calculator (+, -, *, /) advanced calculator (exponents, square root)

For a basic calculator, press 1.

{
"bold_folder_labels": true,
"caret_style": "phase",
"cross_width": 12,
"fade_fold_buttons": false,
"font_size": 19.0,
"highlight_active_indent_guide": true,
"highlight_line": true,
"highlight_modified_tabs": true,
"hot_exit": false,
require 'rubygems'
require 'mechanize'
FIRST_NAME = 'FIRST_NAME'
LAST_NAME = 'LAST_NAME'
PHONE = 'PHONE'
EMAIL = 'EMAIL@provider.com'
PARTY_SIZE = 2
SCHEDULE_RANGE = { :start_time => '19:00', :end_time => '20:30' }
class Show < ActiveRecord::Base
attr_accessible :bands, :date, :venue, :misc
end
require 'nokogiri'
require 'open-uri'
class Extractor
def initialize
var net = require('net');
var clients = [];
var server = net.createServer(function(socket) {
//add any incoming socket to a clients array
clients.push(socket);
socket.on('data', function (data) {
//iterate over a list of clients and send data
require "Rumoji" # See; https://github.com/mwunsch/rumoji
# Customize grid space and player icons as emoji charcters from: http://www.emoji-cheat-sheet.com/
require "Rainbow"
class Grid
attr_accessor :production_run, :player_x_moves, :player_o_moves
def initialize(production_run, player_x_moves, player_o_moves)
@is_debug_mode = false # set to true to invoke debugging statements if needed...

#Debugging (Use The Duck… )

Find the errors in the following

1.)