Skip to content

Instantly share code, notes, and snippets.

Setup Mac OS X Mountain Lion or Mavericks

Edit: I few months ago I got a new laptop and did the same thing on Mavericks.

I just replaced the hard drive of my mbp and decided to do a clean install of Mountain Lion (10.8.5) since I was still using Snow Leopard (10.6.8).

I kinda regret for not using Boxen to automate the

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
@alcedo
alcedo / TopCoder.txt
Created May 16, 2014 03:39
Top coder notes
Top coder is abit hard to navigate, but in general, these 2 links would do:
http://apps.topcoder.com/forums/?module=Category&categoryID=14
http://apps.topcoder.com/wiki/display/tc/Algorithm+Problem+Set+Analysis
Look for match editorials for solutions to various problems and commentary.
@alcedo
alcedo / example1.rb
Last active August 29, 2015 14:00
Rails with page specific JS compiled from various sites
<% # app/views/page/contact.html.erb %>
<h1>Contact</h1>
<p>This is the contact page</p>
<%= javascript_tag do %>
alert("My example alert box.");
<% end %>
@alcedo
alcedo / q1_1.py
Last active April 16, 2022 10:34
Cracking the coding interview
#Q 1.1, implement an algo to determine if a string has all unique chars. What if you cannot use additional DS?
http://repl.it/N28/1
def is_unique_chars(my_string):
my_string_list = sorted(my_string)
seen = set()
for c in my_string_list:
if c in seen:
@alcedo
alcedo / Problem_123.java
Created October 24, 2013 06:21
UVA Problem Sets
import java.io.BufferedOutputStream;
import java.io.BufferedWriter;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.io.OutputStreamWriter;
import java.io.PrintWriter;
import java.io.Writer;
import java.util.ArrayList;
@alcedo
alcedo / 0_reuse_code.js
Created October 10, 2013 08:59
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
@alcedo
alcedo / Unix_unix_notes.sh
Created October 10, 2013 08:58
Unix notes
### How to change permissions of all files in a dir using XARGS
[root@abc installers]# ls | xargs -Ifile chmod 777 file
[root@abc installers]# ls -rlt
total 446676
-rwxrwxrwx 1 abc abc 30537780 Oct 8 08:18 hcatalog-0.11.0.1.3.2.0-111.tar.gz
-rwxrwxrwx 1 abc abc 14492759 Oct 8 08:20 Python-2.7.5.tgz
[root@abc installers]# ls | xargs -I{} chmod 777 {}
@alcedo
alcedo / yahoo_finance_downloader.py
Created October 7, 2013 08:52
Yahoo python downloader wrapper. Refer to documentations: http://victorliew.quora.com/3-Ways-to-programatically-download-stuff-from-Yahoo-Financials (YQL, Yahoo Finance)
import sys
import os
import time
from datetime import datetime
import urllib2
"""
Use this function to allow applications to communicate via HTTP to the internet
"""
def setProxy():
@alcedo
alcedo / mailer.py
Created October 3, 2013 07:45
simple python file that reads an input file and sends out email via unix mail / sendmail command. demonstrates many of the core python functions and features.
#!/usr/bin/python
import sys
import os
import datetime
from subprocess import Popen, PIPE, call
from datetime import date, datetime, date, time
"""
Sends out an email via the unix mail command,