Create an empty directory, download the code and run it:
$ mkdir /tmp/lj
$ cd /tmp/lj
$ wget https://gist.github.com/benbjohnson/5622779/raw/e53d227ebdbea8d513b62ad076feb3f6ac1c1594/luajit.go
$ go run luajit.go
And you should see:
#!/usr/bin/env ruby -wKU | |
JAVA_HOME="/System/Library/Frameworks/JavaVM.framework/Versions/1.6/Home" | |
JAVA="#{JAVA_HOME}/bin/java" | |
GIT_ROOT=ENV['GIT_ROOT'] | |
CLJ="/opt/clojure" | |
LIB="#{GIT_ROOT}/library" | |
classpath=".:src:test:classes" + | |
":#{GIT_ROOT}/formpluslogic/fpl-clojure-util/fpl-clojure-util.jar" + | |
":#{CLJ}/swank-clojure/src/" |
/* This is when a refactoring really pays off. | |
* | |
* In order to make your code more modular, avoid hard-coding assumptions (or refactor them away). | |
* The most fundamental, anti-modular assumption in Object-Oriented software is the concrete type of objects. | |
* Any time you write "new MyClass" in your code (or in Ruby MyClass.new) you've hardcoded | |
* an assumption about the concrete class of the object you're allocating. These makes it impossible, for example, | |
* for someone to later add logging around method invocations of that object, or timeouts, or whatever. | |
* | |
* In a very dynamic language like Ruby, open classes and method aliasing mitigate this problem, but | |
* they don't solve it. If you manipulate a class to add logging, all instances of that class will have |
# WPF Clock in IronRuby! | |
# <t-edmor@microsoft.com> | |
require 'WindowsBase' | |
require 'PresentationFramework' | |
require 'PresentationCore' | |
require 'System.Core, Version=3.5.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' | |
class Clock |
# NOTE: | |
# This version is out-of-date. | |
# Please access http://github.com/maraigue/devnull for the versions under development. | |
# Ruby implementation of null file (like /dev/null on Un*x, NUL on Windows) | |
# (C) 2010- H.Hiro(Maraigue) main@hhiro.net | |
# | |
# DevNull works like an IO object. For example: | |
# dn = DevNull.new | |
# dn.puts "foo" # => nil (do nothing) |
#!/bin/bash -e | |
# | |
# Since unicorn creates a new pid on restart/reload, it needs a little extra love to | |
# manage with runit. Instead of managing unicorn directly, we simply trap signal calls | |
# to the service and redirect them to unicorn directly. | |
# | |
# To make this work properly with RVM, you should create a wrapper for the app's gemset unicorn. | |
# | |
function is_unicorn_alive { |
logger () | |
{ | |
time=`TZ="Asia/Shanghai" date +"%Y-%m-%d %T"`; | |
echo "[$time] $*" | |
} | |
rm () | |
{ | |
local limit=50; | |
if [ -d $HOME/.local/share/Trash/files ]; then |
def quicksel(l,k): | |
if len(l) <k: | |
raise ValueError | |
else: | |
pivot=l.pop() | |
lg=filter(lambda x:x>pivot,l) | |
ll=filter(lambda x:x<=pivot,l) | |
if len(lg)>=k: | |
return quicksel(lg,k) | |
elif len(lg)+1==k: |
let bytes = input.as_bytes(); | |
let mut raw = Vec::<u8>::with_capacity(input.len()); | |
for (offset, codepoint) in input.char_indices() { | |
let c = codepoint as u32; | |
if (c > 0x40 && c < 0x5b) || (c > 0x60 && c < 0x7b) || | |
(c > 0x29 && c < 0x3a) || c == 0x2b || c == 0x2f { | |
raw.push(bytes[offset]); | |
} else if codepoint.is_whitespace() || c == 0x3d { |
Create an empty directory, download the code and run it:
$ mkdir /tmp/lj
$ cd /tmp/lj
$ wget https://gist.github.com/benbjohnson/5622779/raw/e53d227ebdbea8d513b62ad076feb3f6ac1c1594/luajit.go
$ go run luajit.go
And you should see: