Skip to content

Instantly share code, notes, and snippets.

View kitallis's full-sized avatar
🍣

Akshay Gupta kitallis

🍣
View GitHub Profile
#There are 87 images, use as ruby ragetiem.rb [START] [END]
require 'net/http'
if !test ?d, "ragetiem" : Dir.mkdir("ragetiem"); Dir.chdir("ragetiem") else Dir.chdir("ragetiem") end
(ARGV[0] || 1).upto(ARGV[1] || 87) { |i| puts "Processing #{i}"
Net::HTTP.start("www.supercamel.id.au") { |http| img = http.get("/ragetiem/images/" + i.to_s + ".jpg"); open(i.to_s + ".jpg", "wb") { |f| f.write(img.body) } } }
@kitallis
kitallis / .vimrc
Created August 10, 2009 15:24
old, badly done vimrc, useless
set nocompatible
syntax on
filetype plugin indent on
set encoding=utf-8
set mouse=a
set ruler
set number
set tabstop=2
set shiftwidth=2
set softtabstop=2
# Creates a little histogram of the frequency of words occuring in your string
# Usage : ruby word_histogram.rb "Test string, string"
a=(ARGV[0].split(/[^\w]/).inject(Hash.new(0)){|h,x|h[x.downcase]+=1;h;}.delete_if{|k,v|k==""}.sort_by{|k,v| k.length}.reverse);a.map{|k,v|puts "=> #{k} ".ljust(a.first[0].size+4)+'*'*v+"\n"}
###
#
# Let us define a string sequence as :
# S[i] for i > 1 = {
# i = 1 : ()
# i > 1 : (S[1]S[2]S[3]S[4]...S[i-1])
# }
#
# So, S[1] = (), S[2] = (()) , S[3] = (()(())) ...
# In this problem, given I, k and m , you are to find the characters in S[I]
Window {
"Rectangle": [
{ "Top": "200" },
{ "Bottom": "200" },
{ "Right": "100" },
{ "Left": "100" }
]
"Title": "About Raiku",
"Flags": [
{ "name": "B_NOT_RESIZABLE" },
@kitallis
kitallis / pratulkalia.rb
Created December 14, 2010 14:11
PratulKalia can do a lot of things.
class PratulKalia
class << self
def should(&sblk)
self.new.instance_eval(&sblk)
end
end
end
class Blabber
def things(arg)
@kitallis
kitallis / README
Created February 16, 2011 10:14 — forked from vangberg/README
# Deploying a Sinatra app to Heroku
## Database
The location of the database Heroku provides can be found in the environment
variable DATABASE_URL. Check the configure-block of toodeloo.rb for an example
on how to use this.
## Server
Heroku is serving your apps with thin, with means you have all your thin goodness available,
such as EventMachine.
⨀_⨀
⨂_⨂
(/◔ ◡ ◔)/
°ﺑ°
(¬_¬)
(´・ω・`)
(ʘ_ʘ)
(ʘ‿ʘ)
(๏̯͡๏ )
(◕_◕)
@kitallis
kitallis / gsoc2011_proposal.md
Created April 3, 2011 16:10
Document and Activity awareness in Gnome-Shell

Document and Activity awareness in Gnome-Shell

Goals

The major goal of this project is to allow the user to have a full blown journal of an intelligently mapped activity history, beautifully integrated within Gnome-Shell. It aims to bring most of the discussed [design principles][1] and tasks mentioned [here][2].

Deliverables

=> What components will it have? => How do you plan to achieve completion of your project?

Milestones

=> It really helps to see a schedule with dates and important milestones/deliveries.

Motivations

File.open("words.txt") { |f|
f.each { |word|
word = word.to_s.chomp.downcase
p word
word.each_char { |l| # extracting letters
puts "\t Current letter: #{l}"
num = case l
when 'a'..'c' then 2
when 'd'..'f' then 3
when 'g'..'i' then 4