Skip to content

Instantly share code, notes, and snippets.

View modrails.txt
/home/cag/cag/current/public/dispatch.cgi:10ndor/rails/railties/lib/dispatcher.rb:41:in `dispatch'0:in `process'4:in `sass_old_process'gement_support'
We couldn’t find that file to show.
View instructions
Installation steps (untested, sorry no CentOS machine)
install file at /etc/init.d/marmalade
change PATH TO NODE BINARY
change PATH TO MARMALADE
change user if desired
#add script to rc.d
sudo chkconfig --add marmalade
View core.clj
(defn doc-from-ns-form
"Extract the docstring from a given ns form without evaluating the form. The docstring returned should be the return value of (:doc (meta namespace-symbol)) if the ns-form were to be evaluated."
[ns-form]
(let [meta-docstring (:doc (meta (second ns-form)))
references (next (next ns-form))
docstring (when (string? (first references)) (first references))
references (if docstring (next references) references)
attribute-docstring (:doc (when (map? (first references)) (first references)))]
(or attribute-docstring docstring meta-docstring)))
@ryantm
ryantm / test-obsolete.el
Last active Jan 2, 2016
Macro for maintaining backward compatibility with functions declared obsolete without byte-compilation warnings
View test-obsolete.el
(defun <-running-version (version)
(let* ((split-version (split-string version "\\."))
(major-version (string-to-number (first split-version)))
(minor-version (string-to-number (second split-version))))
(or (< major-version emacs-major-version)
(and (eq major-version emacs-major-version)
(< minor-version emacs-minor-version)))))
(defmacro call-obsolete-function (name new-name when &rest rest)
(let ((function-name (if (<-running-version when)
@ryantm
ryantm / gist:8272318
Created Jan 5, 2014
Emacs safe Local variables
View gist:8272318
(let ((vars nil)) (mapatoms (lambda (atom) (when (get atom 'safe-local-variable) (push atom vars)))) vars)
View gist:8682783
a = 1
puts local_variables.inspect #=> [:a]
proc { |;a|
puts local_variables.inspect #=> [:a,:a,:a]
}.call
View gist:9232314
tlbounce.core=> (defrecord A [a b c])
tlbounce.core.A
tlbounce.core=> (clojure.tools.reader.edn/read-string "#tlbounce.core.A{:a 1 :b 2 :c 3}")
ExceptionInfo No reader function for tag tlbounce.core.A clojure.core/ex-info (core.clj:4327)
View gist:974f1c6f7d69df6b8e32
extern crate num;
use num::bigint::BigInt;
use std::from_str::FromStr;
fn main () {
println!("{}", BigInt::from_str("1"));
}
View gist:e0a94ebcc2e89bbc4add
import Control.Arrow
main = return ()
printFile = readFile >>> print