Skip to content

Instantly share code, notes, and snippets.

View arjunvenkat's full-sized avatar

Arjun Venkataswamy arjunvenkat

View GitHub Profile
@arjunvenkat
arjunvenkat / gist:4954307
Created February 14, 2013 17:05
challenge so far
class DrawShape
def line(user_num=9)
"*" * user_num
end
def number_line(input)
input.times do |number|
print number unless number == 0
end
end
@arjunvenkat
arjunvenkat / gist:4954644
Created February 14, 2013 17:50
Draw shape challenges
class DrawShape
def line(user_num=9)
"*" * user_num
end
def number_line(input)
input.times do |number|
print number unless number == 0
end
end
@arjunvenkat
arjunvenkat / reddit_scraper.rb
Last active December 14, 2015 06:28
first and second part of the scraper lab. We scraped data from craigslist and saved it into a csv file
require 'open-uri'
require 'nokogiri'
require 'mechanize'
agent = Mechanize.new
page = agent.get('http://www.reddit.com/')
count = 0
# prints out the first link for the first five pages
@arjunvenkat
arjunvenkat / gist:5222129
Created March 22, 2013 15:25
KeyRemap4Macbook private.xml content
<?xml version="1.0"?>
<root>
<item>
<name>Remap Right Option to Hyper</name>
<appendix>OS X doesn't have a Hyper. This maps Right Option to Control + Shift + Option + Command.</appendix>
<identifier>space_cadet.right_option_to_hyper</identifier>
<autogen>
--KeyToKey--
@arjunvenkat
arjunvenkat / .slate
Last active December 15, 2015 07:19
Content for .slate config file and associated shortcuts
config nudgePercentOf screenSize
config resizePercentOf screenSize
# Shows app icons and background apps, spreads icons in the same place.
config windowHintsShowIcons true
config windowHintsIgnoreHiddenWindows false
config windowHintsSpread true
bind e:cmd hint ASDFGHJKLQWERTYUIOPCVBN # use whatever keys you want
@arjunvenkat
arjunvenkat / 0_reuse_code.js
Created September 30, 2013 18:38
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
@arjunvenkat
arjunvenkat / gist:6771204
Last active December 24, 2015 08:29
1-broken-code
<html>
<body>
<p "I like things.">
<h1>My favorite things:<h1>
<ul>
<li><h3>Evernote</h3><img src="http://evernote.com/media/img/products/hero_evernote.png"></li>
<ul>
<h3>Louis C.K.</h2>
@arjunvenkat
arjunvenkat / gist:6980604
Created October 14, 2013 19:20
sublime package manager installation
import urllib2,os; pf='Package Control.sublime-package'; ipp=sublime.installed_packages_path(); os.makedirs(ipp) if not os.path.exists(ipp) else None; urllib2.install_opener(urllib2.build_opener(urllib2.ProxyHandler())); open(os.path.join(ipp,pf),'wb').write(urllib2.urlopen('http://sublime.wbond.net/'+pf.replace(' ','%20')).read()); print 'Please restart Sublime Text to finish installation'
@arjunvenkat
arjunvenkat / gist:6980815
Created October 14, 2013 19:31
Front-end Sublime Preferences
{
"auto_complete_commit_on_tab": true,
"auto_complete_with_fields": true,
"caret_style": "smooth",
"color_scheme": "Packages/Color Scheme - Default/Dawn.tmTheme",
"create_window_at_startup": false,
"detect_indentation": false,
"ensure_newline_at_eof_on_save": true,
"file_exclude_patterns":
[
@arjunvenkat
arjunvenkat / gist:089711002874018232b6
Created March 25, 2015 20:12
issues setting up repl.it API

One thing I was confused about was what hostname meant in

ReplitClient(hostname, port, language, token)

I assumed it meant the host of my development/production server. I'm using Rails, which is hosted by default in development at localhost:3000. However, when I tried initializing a new client with:

var token = {