Skip to content

Instantly share code, notes, and snippets.

@tessafallon
tessafallon / data.js
Last active August 29, 2015 14:16 — forked from NathanEpstein/data.js
// Data Source: http://vincentarelbundock.github.io/Rdatasets/csv/cluster/votes.repub.csv
var data = {
'Alabama':{'X1968': '14', 'X1856': 'NA', 'X1876': '40.02', 'X1872': '53.19', 'X1912': '8.26', 'X1916': '21.97', 'X1964': '69.5', 'X1976': '43.48', 'X1896': '28.13', 'X1972': '72.4', 'X1892': '3.95', 'X1932': '14.15', 'X1956': '39.39', 'X1936': '12.82', 'X1952': '35.02', 'X1868': '51.44', 'X1860': 'NA', 'X1864': 'NA', 'X1904': '20.65', 'X1900': '34.67', 'X1908': '24.38', 'X1928': '48.49', 'X1884': '38.44', 'X1940': '14.34', 'X1960': '41.75', 'X1880': '36.98', 'X1944': '18.2', 'X1920': '30.98', 'X1948': '19.04', 'X1924': '27.01', 'X1888': '32.28'}
,
'Alaska': {'X1968': '45.3', 'X1856': 'NA', 'X1876': 'NA', 'X1872': 'NA', 'X1912': 'NA', 'X1916': 'NA', 'X1964': '34.1', 'X1976': '62.91', 'X1896': 'NA', 'X1972': '58.1', 'X1892': 'NA', 'X1932': 'NA', 'X1956': 'NA', 'X1936': 'NA', 'X1952': 'NA', 'X1868': 'NA', 'X1860': 'NA', 'X1864': 'NA', 'X1904': 'NA', 'X1900': 'NA', 'X1908': 'NA', 'X1928': 'NA', 'X1884': 'NA', '
#!/bin/bash
yum install -y gcc libpng libjpeg libpng-devel libjpeg-devel ghostscript libtiff libtiff-devel freetype freetype-devel
wget ftp://ftp.graphicsmagick.org/pub/GraphicsMagick/1.3/GraphicsMagick-1.3.9.tar.gz
tar zxvf GraphicsMagick-1.3.9.tar.gz
cd GraphicsMagick-1.3.9
./configure --enable-shared
make
@tessafallon
tessafallon / js_funky
Created January 23, 2014 18:26
Who wants theFunc?
function thatFunc(name){
this.name = name;
}
thatFunc.prototype.theFunc = function(){
console.log(this.name + " want the funk!");
}
var whoWants = new thatFunc("We");
@tessafallon
tessafallon / ja_quiz4
Last active January 4, 2016 04:19
JS quiz 4
1. var person = {
name: "Joe Camel",
age: 42,
status: "dead"
}
console.log(typeof person);
ANSWER: Object
2. var hat = {
@tessafallon
tessafallon / js_quizzes_3
Created January 22, 2014 06:02
Js quizzes 3
1. bob
2. 5
3. var = full_name function(first_name, last_name){
return (first_name+ " " +last_name);
}
4. 25
5. 8
6. my_fun()
7. function
8. 1 [wrong]
@tessafallon
tessafallon / todo41
Last active January 4, 2016 00:19
Todo 41: JS fizzbuzz/kickpunch
var i;
for (var i=1;i<101;i++){
if (i % 15 === 0) {
console.log('Kickpunch!');
}
else if (i % 5 === 0) {
console.log('Punch!');
}
else if (i % 3 === 0) {
@tessafallon
tessafallon / js_exercises_20140120
Last active January 3, 2016 22:29
JS exercises
My Score: 20/25
1. 5
2. number
3. true
4. 0 WRONG: returns infinity
5. NaN or undefined?
6. true WRONG: false
7. NaN WRONG: has a number type
8. true
@tessafallon
tessafallon / dog.rb
Created December 17, 2013 17:17 — forked from blake41/dog.rb
require 'mysql2'
class Dog
@@db = Mysql2::Client.new(:host => "localhost", :username => "root", :database => "dogs")
end
dog = Dog.find(10)
debugger
@tessafallon
tessafallon / unique.rb
Created December 17, 2013 14:20 — forked from blake41/unique.rb
# instructions: implement Array.uniq
class Array
def uniq
# code goes here
end
end
require_relative "fibonacci_solution"
describe "fibo finder" do
it "it should return the nth number of the fibonacci sequence" do
fibo_finder(0).should eq(0)
end
it "it should return the nth number of the fibonacci sequence" do
fibo_finder(1).should eq(1)