Skip to content

Instantly share code, notes, and snippets.

@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 / 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 / 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 / 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.

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname

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

@alcedo
alcedo / devise token auth notes
Created October 25, 2014 23:44
A list of Token authentication tutorials on rails using devise
https://gist.github.com/josevalim/fb706b1e933ef01e4fb6
https://gist.github.com/gonzalo-bulnes/7659739
https://github.com/plataformatec/devise/issues/2739
https://gist.github.com/danielgatis/5666941
http://stackoverflow.com/questions/20319961/restful-login-with-devise-rails-4
http://chasseurmic.github.io/chasseurmic/blog/2013/02/13/restful-api-authentication/
http://lucatironi.github.io/tutorial/2013/05/05/ruby_rails_rubymotion_ios_app_authentication_devise_tutorial_part_one/
http://blog.codebykat.com/2012/07/23/remote-api-authentication-with-rails-3-using-activeresource-and-devise/
http://codedecoder.wordpress.com/2013/01/08/devise-login-with-authentication_token/
//
// PhotoTableViewCell.swift
// codepath_wk1e1
//
// Created by Victor Liew on 5/3/15.
// Copyright (c) 2015 alcedo. All rights reserved.
//
import UIKit
@alcedo
alcedo / Rt.json
Created May 6, 2015 06:56
Rotten tomato API
{
"movies": [
{
"id": "771313962",
"title": "Avengers: Age of Ultron",
"year": 2015,
"mpaa_rating": "PG-13",
"runtime": 141,
"critics_consensus": "",
"release_dates": {