This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package mustachelet; | |
import com.google.common.base.Function; | |
import com.sampullara.mustache.Mustache; | |
import com.sampullara.mustache.Scope; | |
import scala.collection.JavaConversions; | |
import scala.runtime.AbstractFunction1; | |
/** | |
* Scala iterables and functions in mustache. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class User | |
has_attached_file :photo, | |
:processors => [:watermark], | |
:styles => { | |
:medium => { | |
:geometry => "300x300>", | |
:watermark_path => "#{Rails.root}/public/images/watermark.png" | |
}, | |
:thumb => "100x100>", | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'test_helper' | |
require 'minitest/autorun' | |
class MiniTest::Spec | |
include ActiveSupport::Testing::SetupAndTeardown | |
include ActiveRecord::TestFixtures | |
alias :method_name :__name__ if defined? :__name__ | |
self.fixture_path = File.join(Rails.root, 'test', 'fixtures') | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'rubygems' | |
require 'socket' | |
include Socket::Constants | |
class ChatServer | |
def initialize | |
@reading = Array.new | |
@writing = Array.new | |
@clients = Hash.new |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require File.dirname(__FILE__) + '/config/environment' | |
run ActionController::Dispatcher.new |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/ruby | |
binwidth = ARGV[0].to_f | |
filename = ARGV[1] | |
rand_file_name = "rand_file-#{(rand*1000000).to_i}.data" | |
nums = File.open(filename, "r") {|f| f.readlines}.collect {|n| n.to_f } | |
binned_data = {} | |
nums.each do |n| |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
0 km, Vcirc = 2425.56 m/s, Tcirc = 25.90 min, Vesc = 3430.27 m/s | |
5 km, Vcirc = 2415.52 m/s, Tcirc = 26.23 min, Vesc = 3416.06 m/s | |
10 km, Vcirc = 2405.60 m/s, Tcirc = 26.55 min, Vesc = 3402.03 m/s | |
15 km, Vcirc = 2395.80 m/s, Tcirc = 26.88 min, Vesc = 3388.18 m/s | |
20 km, Vcirc = 2386.12 m/s, Tcirc = 27.21 min, Vesc = 3374.49 m/s | |
25 km, Vcirc = 2376.56 m/s, Tcirc = 27.54 min, Vesc = 3360.96 m/s | |
30 km, Vcirc = 2367.11 m/s, Tcirc = 27.87 min, Vesc = 3347.60 m/s | |
35 km, Vcirc = 2357.77 m/s, Tcirc = 28.20 min, Vesc = 3334.39 m/s | |
40 km, Vcirc = 2348.54 m/s, Tcirc = 28.54 min, Vesc = 3321.34 m/s | |
45 km, Vcirc = 2339.42 m/s, Tcirc = 28.87 min, Vesc = 3308.44 m/s |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
layout: default | |
--- | |
<div class="blog-index"> | |
{% assign post = site.posts.first %} | |
{% assign content = post.content %} | |
{% include post_detail.html %} | |
</div> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/ruby | |
# Github-flavored markdown to HTML, in a command-line util. | |
# | |
# $ cat README.md | ./ghmarkdown.rb | |
# | |
# Notes: | |
# | |
# You will need to install Pygments for syntax coloring | |
# | |
# $ pip install pygments |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
wget http://pyyaml.org/download/libyaml/yaml-0.1.4.tar.gz | |
tar xzvf yaml-0.1.4.tar.gz | |
cd yaml-0.1.4 | |
./configure --prefix=/usr/local | |
make | |
make install | |
cd | |
wget http://ftp.ruby-lang.org/pub/ruby/1.9/ruby-1.9.3-p392.tar.gz | |
tar xzvf ruby-1.9.3-p392.tar.gz |
OlderNewer