Skip to content

Instantly share code, notes, and snippets.

View marcinwyszynski's full-sized avatar

Marcin Wyszynski marcinwyszynski

View GitHub Profile
@kuntoaji
kuntoaji / hashtag_counter.rb
Created September 21, 2010 07:15
Ruby script to count a twitter hashtag and save the result and last_tweet_id to hashtag_counter_result.txt and last_tweet_id.tx
#!/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'
@prasoonsharma
prasoonsharma / gist:717903
Created November 27, 2010 13:42
Data Frame operations in R
# 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
@marcinwyszynski
marcinwyszynski / metronome.js
Last active December 24, 2015 16:09
Timer for JavaScript.
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;