Skip to content

Instantly share code, notes, and snippets.

_ this document is in public domain _
--------------------------------------------------------------------------------
Hello Foo,
As you are aware, we are looking to hire smart and enthusiastic front-end
programmers who can learn new technologies and adapt fast. You have made the
short-list and we would like you to undertake a coding challenge that we have
devised to help us assess your coding skills.
@jaseemabid
jaseemabid / pubsub.js
Created January 24, 2014 22:13
Tiniest, simplest pubsub ever
/*jslint nomen: true*/
'use strict';
var Pubsub = function () {
this._events = {};
};
Pubsub.prototype.on = function (type, handler) {
if (this._events[type] === undefined) {
this._events[type] = [];
# Solve http://letsrevolutionizetesting.com/challenge
# Author: Jaseem Abid <jaseemabid#gmail.com>
request = require 'request'
url = require 'url'
root = 'http://letsrevolutionizetesting.com/challenge.json'
follow = (id) ->
path = "#{root}?id=#{id}"
request path, (error, response, body) ->
@jaseemabid
jaseemabid / fizzbuzz.coffee
Created June 27, 2013 19:53
Write a program that prints the numbers from 1 to 100. But for multiples of three print "Fizz" instead of the number and for the multiples of five print "Buzz". For numbers which are multiples of both three and five print "FizzBuzz".
# FizzBuzz :)
for i in [1 .. 100]
out = ""
out = out + "Fizz" if i%3 == 0
out = out + "Buzz" if i%5 == 0
console.log out || i
@jaseemabid
jaseemabid / wvdial.conf
Created May 28, 2013 05:03
wvdial config for MTS India
[Dialer mts]
Stupid Mode = 1
Password = mts
Username = internet@internet.mtsindia.in
Phone = #777
Init1 = ATZ
Init2 = ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0
SetVolume = 0
Modem = /dev/ttyUSB0
Modem Type = Analog Modem
#!/usr/bin/env ruby
require "nokogiri"
require "open-uri"
def download(url, output_file)
exit unless system("wget -c #{url} --load-cookies=cookies.txt -O #{output_file}")
end
def download_pages
@jaseemabid
jaseemabid / gist:3901559
Created October 16, 2012 19:50
jsfoo hacknight

On hacking, JavaScript, hacknights and side-ends

Released under WTFPL license

JsFoo hacknight 2012 was really a memorable event because of the people, talks and atmosphere there. The event was at CIS Bangalore from Sat, Oct 13 noon to Oct 14 morning. After searching around for more than an hour and going around Domlur bridge twice, I reached there by 1 PM with 2 of my friends @rampr and @akinza.

# Author: Jaseem Abid
# There are 50 seats in a movie theater, 5 seats in every row. One person can
# reserve seats for a group. While reserving seat we should try to give them
# maximum seats together. If seats are not available in a row then the
# arrangement should be such that person group get nearby seats. Write a program
# which will take number of seats as input and will return seat numbers.
def findSeats(seats, count):
(function () {
"use strict";
var i = 0;
for (i = 0; i <= 100; i += 1) {
if (i % 15 === 0) {
console.log("FizzBuzz");
} else if (i % 3 === 0) {
console.log("Fizz");