-
Indent with two spaces. This is very nearly universally accepted among Rubyists.
-
Never rescue
Exception
. (See http://technomancy.us/114 for details.) Don't rescueStandardError
(without conditionally re-raising it) unless you have a really good reason. Doing this
This file contains 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
root@arm:~/prometheus# erl -pa deps/exmpp/ebin -pa ebin | |
Erlang R15B01 (erts-5.9.1) [source] [async-threads:0] [kernel-poll:false] | |
Eshell V5.9.1 (abort with ^G) | |
1> application:start(crypto), application:start(exmpp), application:start(prometheus). | |
{error,{shutdown,{prometheus_app,start,[normal,[]]}}} | |
=INFO REPORT==== 21-Feb-2014::23:14:30 === | |
application: prometheus | |
exited: {shutdown,{prometheus_app,start,[normal,[]]}} |
This file contains 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
phil@enigma ~/music $ racket | |
Welcome to Racket v5.2.1. | |
> read-line | |
#<procedure:read-line> | |
> pp | |
reference to undefined identifier: pp | |
=== context === | |
/usr/share/racket/collects/racket/private/misc.rkt:87:7 |
This file contains 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 2htdp/universe ) | |
(require htdp/image) | |
(define sun (circle 99 "solid" "yellow")) | |
(define p1 (circle 50 "solid" "green")) | |
(define p2 (circle 49 "solid" "red")) | |
(define p3 (circle 15 "solid" "blue")) | |
(define (too-big? xy) |
This file contains 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
Type d2x-rebirth -help' for a list of command-line options. | |
PHYSFS: Listing contents of Search Path. | |
PHYSFS: [/home/phil/.d2x-rebirth/] is in the Search Path. | |
PHYSFS: [/home/phil/.d2x-rebirth/data] is in the Search Path. | |
PHYSFS: * We've got [ALIEN1.PIG]. | |
PHYSFS: * We've got [ALIEN2.PIG]. | |
PHYSFS: * We've got [DESCENT.CFG]. | |
PHYSFS: * We've got [DESCENT2.EXE]. | |
PHYSFS: * We've got [DESCENT2.HAM]. |
This file contains 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
-- web.lua | |
local xavante = require "xavante" | |
port = ... | |
local function pp(t, level) | |
local level = level or "" | |
for k,v in pairs(t) do | |
print(level .. k .. ": " .. tostring(v)) | |
if(type(v) == "table") then |
This file contains 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
(defn take-thing [thing] | |
(dosync | |
(if (room-contains? @*current-room* thing) | |
(do (commute *inventory* conj (keyword thing)) | |
(alter (:items @*current-room*) | |
(partial remove #(= % (keyword thing)))) | |
(str "You picked up the " thing ".")) | |
(str "There isn't any " thing " here.")))) |
This file contains 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
(ns clojure.contrib.test-contrib.chrono | |
(:use clojure.contrib.test-is | |
clojure.contrib.chrono)) | |
(def christmas (date 2007 12 25, 3 00 02)) | |
(def new-years (date 2008 1 1)) | |
(def day-one (date 2008 11 21, 11 21 48)) | |
(deftest test-date-creation | |
;; TODO: Not sure about the interface here. We may not be able to |
This file contains 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
;;; clojure-test-mode --- Minor mode for Clojure tests | |
;; Copyright (C) 2009 Phil Hagelberg | |
;; Author: Phil Hagelberg <technomancy@gmail.com> | |
;; URL: http://emacswiki.org/cgi-bin/wiki/ClojureTestMode | |
;; Version: 0.1 | |
;; Keywords: languages, lisp | |
;; This file is not part of GNU Emacs. |
This file contains 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
;;; clojure-test-mode --- Minor mode for Clojure tests | |
;; Copyright (C) 2009 Phil Hagelberg | |
;; Author: Phil Hagelberg <technomancy@gmail.com> | |
;; URL: http://emacswiki.org/cgi-bin/wiki/ClojureTestMode | |
;; Version: 0.1 | |
;; Keywords: languages, lisp | |
;; This file is not part of GNU Emacs. |
OlderNewer