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
def reverse(string) | |
return string if string.length <= 1 | |
reverse(string[1..-1]) + string[0] | |
end | |
puts reverse("string") | |
puts reverse("racecar") | |
def palindrome(string) | |
puts string |
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 'mathn' | |
# def time_logger(function) | |
# start = Time.now | |
# function | |
# puts "It took #{(Time.now - start)/60} minutes to run #{function}" | |
# end | |
# PROBLEM 2 | |
# def fibonacci | |
# fib_array = [1,2] |
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
<?xml version="1.0" encoding="utf-8" ?> | |
<!-- SQL XML created by WWW SQL Designer, http://code.google.com/p/wwwsqldesigner/ --> | |
<!-- Active URL: http://socrates.devbootcamp.com/sql.html --> | |
<sql> | |
<datatypes db="mysql"> | |
<group label="Numeric" color="rgb(238,238,170)"> | |
<type label="Integer" length="0" sql="INTEGER" re="INT" quote=""/> | |
<type label="Decimal" length="1" sql="DECIMAL" re="DEC" quote=""/> | |
<type label="Single precision" length="0" sql="FLOAT" quote=""/> | |
<type label="Double precision" length="0" sql="DOUBLE" re="DOUBLE" quote=""/> |
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
$(document).ready(function () { | |
$("form").submit(function(click) { | |
click.preventDefault(); | |
var action = $(this).attr("action") | |
var roll = Math.floor(Math.random()*6)+1; | |
console.log("roll before ajax", roll); | |
// var method = $(this).attr("method") | |
$.post(action,{"value" : roll }, function(rod_name){ | |
var roll_html = $(rod_name).find("#die").html(); |
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
<!doctype html> | |
<html> | |
<head> | |
<link rel="stylesheet" href="http://cdn.jsdelivr.net/normalize/2.1.0/normalize.css"> | |
<link rel="stylesheet" href="main.css"> | |
<link rel="stylesheet" href="http://fonts.googleapis.com/css?family=Open+Sans:300,400,600,700,800"> | |
<link rel="stylesheet" href="http://fonts.googleapis.com/css?family=Lato:100,900"> | |
<link rel="stylesheet" href="http://cdnjs.cloudflare.com/ajax/libs/font-awesome/3.0.2/css/font-awesome.min.css"> | |
</head> |
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
//------------------------------------------------------------------------------------------------------------------ | |
// YOUR CODE: Create your Zoo "object literal" and Animal "constructor" and "prototypes" here. | |
//------------------------------------------------------------------------------------------------------------------ | |
function Animal(name, num_legs){ | |
this.num_legs = num_legs; | |
this.name = name | |
}; | |
var Zoo = { | |
animals: [], |
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 'csv' | |
# ["id", "first_name", "last_name", "email", "phone", "created_at"] | |
class Person | |
attr_reader :first_name, :last_name, :email | |
def initialize(attributes) | |
@id = attributes["id"] | |
@first_name = attributes["first_name"] | |
@last_name = attributes["last_name"] | |
@email = attributes["email"] |
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
The row string is 396240001 | |
The col string is 000003000 | |
The box string is 396240001 | |
The all string is 396240001000003000396240001 | |
The row string is 39624�001 | |
The col string is 003000080 | |
The box string is 39624�001 | |
The all string is 39624�00100300008039624�001 | |
The row string is 39624�501 | |
The col string is 009401530 |
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
#!/bin/sh | |
# Install Homebrew | |
ruby -e "$(curl -fsSL https://raw.github.com/mxcl/homebrew/go)" | |
# Make dotfiles directory | |
# mkdir ~/Documents/dofiles | |
DIRECTORY="/Users/$USER/Documents/dotfiles" | |
if [ ! -d $DIRECTORY ]; then | |
mkdir $DIRECTORY |
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
function refreshFeed(){ | |
var linkToClick= document.getElementsByClassName("new-tweets-bar")[0] | |
if(linkToClick != undefined){ | |
linkToClick.click() | |
} | |
} | |
setInterval(refreshFeed, 500) |
OlderNewer