This file contains hidden or 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 Metronome(interval, executions, func, context) { | |
if (interval < 1) { | |
throw "Interval must be a integer"; | |
} | |
if (executions == 0) { | |
throw "Number of executions must be a positive integer"; | |
} | |
// Initialize mutable private members. | |
var executionsLeft = executions; |
This file contains hidden or 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
# DATA FRAME OPERATIONS IN R | |
# Create data frame | |
# A dataset is ~ table (list of vectors) | |
id <- c(1,2,3) | |
name <- c("John", "Kirk", "AJ") | |
age <- c(21,27,18) | |
employees <- data.frame(ID=id, Name=name, Age=age) | |
employees |
This file contains hidden or 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
#!/usr/bin/env ruby | |
# Twitter Hashtag Counter | |
# | |
# Script to count a twitter hashtag and save the result and last_tweet_id to | |
# hashtag_counter_result.txt and last_tweet_id.txt | |
# | |
# Requirements: twitter gem. | |
# To install twitter gem: [sudo] gem install twitter | |
require 'rubygems' |