Skip to content

Instantly share code, notes, and snippets.

View jikkujose's full-sized avatar

Jikku Jose jikkujose

View GitHub Profile
{
"language": "Malayalam",
"area": "214",
"population": "745000"
}
" copy all this into a vim buffer, save it, then...
" source the file by typing :so %
" Now the vim buffer acts like a specialized application for mastering vim
" There are two queues, Study and Known. Depending how confident you feel
" about the item you are currently learning, you can move it down several
" positions, all the way to the end of the Study queue, or to the Known
" queue.
" type ,, (that's comma comma)
@jikkujose
jikkujose / beginner_mooc.markdown
Last active August 29, 2015 14:04
A list of beginner level MOOCs

Beginner

Course Name Start Date Length Provider Rating
LFS101x : Introduction to Linux Aug 1 NA EdX NA
Usable Security Aug 18 8 weeks Coursera NA
Programming Foundations with Python: Learn OOP Self paced 4 weeks Udacity 5 (1 review)
CS 101: Building a Search Engine Self paced 7 weeks Udacity 5 (5 reviews)
Intro to Internet working with TCP/IP Self paced 6 weeks openHPI NA
UNSW Computing 1 - The Art of Programming Self paced 12 weeks OpenLearning NA
@jikkujose
jikkujose / print_monkey.rb
Last active August 29, 2015 14:11
What if Objects can print themselves?
class Object
def print
puts self.to_s
end
end
23.times &:print
@jikkujose
jikkujose / history_histogram.txt
Created January 6, 2015 11:19
History histogram
git 765 ############################################################
gc 653 ####################################################
ag 519 #########################################
h 508 ########################################
c 465 #####################################
dv 416 #################################
rm 342 ###########################
mv 319 ##########################
curl 271 ######################
fo 268 ######################
class RainDrops
SOUNDS = { 3 => 'Pling', 5 => 'Plang', 7 => 'Plong' }
def make_sound(number)
result = SOUNDS.each_with_object([]) do |(factor, sound), record|
record << sound if number % factor == 0
end
result.empty? ? number : result.join
end
end
class Theatre
COST = { running: 3, fixed: 180 }
attr_accessor :number_of_audience, :ticket_price
def revenue
@number_of_audience * @ticket_price
end
def total_cost
class Base
def initialize(alphabets)
@alphabets = alphabets
end
def base
@alphabets.length
end
def to_decimal(number)
require 'minitest'
# require 'minitest/reporters'
# Minitest::Reporters.use! [Minitest::Reporters::DefaultReporter.new({color: true})]
class Range
include Comparable
def <=>(other)
self.begin <=> other.begin
end
class SittingDuck
include Robot
def tick events
turn_radar 5 if time == 0
fire 3 unless events['robot_scanned'].empty?
turn_gun 10
@last_hit = time unless events['got_hit'].empty?
if @last_hit && time - @last_hit < 20