Skip to content

Instantly share code, notes, and snippets.

View kvirani's full-sized avatar

Khurram Virani kvirani

View GitHub Profile
<!DOCTYPE HTML>
<html>
<head>
<style>
body {
margin: 0px;
padding: 0px;
}
</style>
</head>
@kvirani
kvirani / average.js
Created December 16, 2016 18:05 — forked from davejellicoe/average.js
javascript samples from week 1
function average(list) {
var sum = 0;
for (var num in list) {
sum += list[num];
}
return sum / list.length;
}
console.log(average([20, 21, 220, 54]));
@kvirani
kvirani / Sinatra.run
Created October 28, 2015 13:50
Sinatra Shotgun - Cloud9 Runner
{
"cmd" : ["bash", "--login", "-c", "bundle exec shotgun -p $port -o $ip $args"],
"info" : "Sinatra started. App running at $url",
"env" : {},
"working_dir" : "$project_path",
"selector" : "source.rb"
}
@kvirani
kvirani / oss-licenses.md
Last active April 8, 2018 02:22
Lunch n Learn - OSS Licenses (WIP)

OSS Licenses

Open Source Software

  • We use it all the time
  • I've been curious about it
  • Good excuse to look into it

DISCLAIMERS:

@kvirani
kvirani / 0_reuse_code.js
Last active April 8, 2018 02:22
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@kvirani
kvirani / w1d4-hw.md
Last active September 7, 2019 22:00
W1D4 Homework Questions

On the road to being a Power User

Take control of your development environment by using more of the keyboard and less of the mouse/trackpad. As you write your code, use (Mac and Sublime) keyboard commands/shortcuts to, well... kill it!

Mastering your text editor and Operating System (OS) will make you a more efficient and impressive developer.

Power User Commands

Don't just read about these. If any of these are foreign / unfamiliar to you, be sure to practice them and make a mental note to use them when possible.

@kvirani
kvirani / keybase.md
Created April 14, 2014 07:12
keybase.md

Keybase proof

I hereby claim:

  • I am kvirani on github.
  • I am kvirani (https://keybase.io/kvirani) on keybase.
  • I have a public key whose fingerprint is D4FE 1025 DFAA 2640 4D7A FAB9 F1CA A5A7 B0A0 BAF8

To claim this, I am signing this object:

-- Modified version of http://www.commandprompt.com/ppbook/booktown.sql
-- For learning SQL on Heroku Postgres
-- Editted by Khurram Virani (@viranik) @lighthouse_labs
CREATE TABLE "books" (
"id" integer NOT NULL,
"title" text NOT NULL,
"author_id" integer,
"subject_id" integer,
Constraint "books_id_pkey" Primary Key ("id")
@kvirani
kvirani / hangmanbot.rb
Created June 7, 2013 17:06
Hangman Bot that we covered in class5. Note: Assumes hangman class is in a subfolder
require "socket"
require_relative 'hangman/hangman'
@channel = "#bitmaker"
@greeting_prefix = "privmsg #bitmaker :"
@guess_prefix = "guess"
def connect_to_server
server = "chat.freenode.net"
port = "6667"
@kvirani
kvirani / hellobot.rb
Created June 7, 2013 17:04
Hellobot IRC Bot that we covered in class5
require "socket"
@channel = "#bitmaker"
@greeting_prefix = "privmsg #bitmaker :"
@greeting = "hello"
def connect_to_server
server = "chat.freenode.net"
port = "6667"
nick = "HelloBot"