Skip to content

Instantly share code, notes, and snippets.

@DracoLi
DracoLi / Rackfile
Created March 14, 2012 04:47
Rackfile for compiling less and coffeescript for your project
CONFIG = {
less: {
input: File.join('.', 'app', 'assets', 'less'),
output: File.join('.', 'public', 'css'),
input_ext: '.less',
output_ext: '.css'
},
coffee: {
input: File.join('.', 'app'),
output: File.join('.', 'public', 'js')
@DracoLi
DracoLi / beauty.java
Created April 6, 2012 15:37
A algorithm questions I couldn't solve
import java.util.ArrayList;
import java.util.LinkedList;
import java.util.Scanner;
public class beauty {
public static String solve(String input) {
int n = input.length();
@DracoLi
DracoLi / gist:2987114
Created June 25, 2012 07:08
Moving balls
canvasApp();
function canvasApp() {
// Grab the canvas and set the context to 2d
var theCanvas = document.getElementById('canvasOne');
var context = theCanvas.getContext("2d");
// Variables
var numBalls = 200; // number of balls
var maxSize = 15;
@DracoLi
DracoLi / .gitattributes
Created June 28, 2012 17:27 — forked from krisalyssa/.gitattributes
.gitignore and .gitattributes for Xcode 4.3
# treats your Xcode project file as a binary; prevents Git from trying to fix newlines, show in diffs, and excludes from merges
*.pbxproj -crlf -diff -merge
@DracoLi
DracoLi / NSString+SplitOnCapital.h
Created August 5, 2012 08:32
Split a camelcase string into separate words
//
// NSString+SplitOnCapital.h
//
// Created by Draco Li on 2012-08-04.
// Copyright (c) 2012 Draco Li. All rights reserved.
//
#import <Foundation/Foundation.h>
@interface NSString (SplitOnCapital)
@DracoLi
DracoLi / new_bashrc.sh
Created August 11, 2012 08:03 — forked from josephwecker/new_bashrc.sh
Replace .bashrc, .bash_profile, .profile, etc. with something much more clean, consistent, and meaningful.
#!/bin/bash
# License: Public Domain.
# Author: Joseph Wecker, 2012
#
# Are you tired of trying to remember what .bashrc does vs .bash_profile vs .profile?
# Are you tired of trying to remember how darwin/mac-osx treat them differently from linux?
# Are you tired of not having your ~/.bash* stuff work the way you expect?
#
# Symlink all of the following to this file:
# * ~/.bashrc
@DracoLi
DracoLi / project-retail.md
Created November 9, 2012 18:00
Product Development Overview [Project Retail]

Product Development Overview [Project Retail]

Fulfillment integration

Description

@DracoLi
DracoLi / gist:5811044
Last active December 18, 2015 16:19 — forked from pithyless/gist:1208841

Install Python

$ brew install readline sqlite gdbm --universal
$ brew install python --universal --framework
$ python --version
Python 2.7

Symlinks...

@DracoLi
DracoLi / ranges.js
Last active March 7, 2019 18:25
range.js
// Task: Implement a 'Range Collection' class.
// A pair of integers define a range, for example: [1, 5). This range includes integers: 1, 2, 3, and 4.
// A range collection is an aggregate of these ranges: [1, 5), [10, 11), [100, 201)
//
/**
* RangeCollection class
* NOTE: Feel free to add any extra member variables/functions you like.
*/
/**