Skip to content

Instantly share code, notes, and snippets.

View coderek's full-sized avatar
👽

Derek Zeng coderek

👽
View GitHub Profile
# download at https://github.com/nex3/sass/archive/stable.zip
# command to compile
# `jrubyc sass.rb`
# command to run
# `java -cp .:/path/to/jruby-complete-1.7.4.jar sass`
$:.unshift "D:\\sass-stable\\lib" # replace with your lib path
require "sass"
# HAML is a language that can be compiled to HTML
# it's syntax is easy to write and read, thus it's very popular among web developers
# grab zipped gem from https://github.com/haml/haml/archive/master.zip
# also the dependency https://github.com/rtomayko/tilt/archive/master.zip
# command to compile
# `jrubyc haml.rb`
# command to run
@coderek
coderek / ap.rb
Last active December 24, 2015 06:48
# awesome print
# Awesome Print is a Ruby library that pretty prints Ruby objects in full color exposing their internal structure with proper indentation. Rails ActiveRecord objects and usage within Rails templates are supported via included mixins.
# grab zipped gem from https://github.com/michaeldv/awesome_print/archive/master.zip
# command to compile
# `jrubyc ap.rb`
# command to run
# `java -cp .:/path/to/jruby-complete-1.7.4.jar ap`
@coderek
coderek / json.rb
Last active December 24, 2015 06:39
jruby -S gem install json-jruby
## install json-jruby library
# jruby -S gem install json-jruby
## create json.rb file which contains code below
## generate json.class file
# jrubyc json.rb
## run
# java -cp .:/path/to/jruby-complete-1.7.4.jar json
## should see some output
commit c503be473c95fc5a0f3634bf4a1557e5dd1357ed
Author: Derek Zeng <[email protected]>
Date: Fri May 10 15:45:54 2013 +0800
save
diff --git a/sass/base/_theme.scss b/sass/base/_theme.scss
index 1a43a03..9765d08 100644
--- a/sass/base/_theme.scss
+++ b/sass/base/_theme.scss
# 1B problem B 2013 Google Code Jam
# adapted answer from 'dolphinigle'
gets.to_i.times do |ca|
my, n = gets.split(" ").map(&:to_i)
motes = gets.split(" ").map(&:to_i).sort
best = motes.length # all delete
if my == 1
puts "Case ##{ca+1}: #{best}"