Skip to content

Instantly share code, notes, and snippets.

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
ryantm@home1 ~/p/nixpkgs-channels (nixos-unstable)$ nix-env -f . -iA opencc
installing ‘opencc-1.0.3’
these derivations will be built:
/nix/store/r8wz0kfj5k999cy09p0spwh4sqili730-opencc-1.0.3.drv
building path(s) ‘/nix/store/h8iicppcd1i9jcww2iw81gmdk98dxrka-opencc-1.0.3’
unpacking sources
unpacking source archive /nix/store/9066ds73yqsa7lgfllgxmx1aclyk4grl-ver.1.0.3.tar.gz
source root is OpenCC-ver.1.0.3
patching sources
configuring
(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 January 2, 2016 06:19
Macro for maintaining backward compatibility with functions declared obsolete without byte-compilation warnings
(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 January 5, 2014 18:55
Emacs safe Local variables
(let ((vars nil)) (mapatoms (lambda (atom) (when (get atom 'safe-local-variable) (push atom vars)))) vars)
a = 1
puts local_variables.inspect #=> [:a]
proc { |;a|
puts local_variables.inspect #=> [:a,:a,:a]
}.call
{-# LANGUAGE FunctionalDepedencies #-}
data Account
= Account {accountId :: !Int,
productCd :: !String,
custId :: !Int,
openDate :: !Day,
closeDate :: !(Maybe Day),
lastActivityDate :: !(Maybe Day),
status :: !String,
~/nixfiles (master)$ NIX_PATH=nixpkgs=https://nixos.org/channels/nixpkgs-unstable/nixexprs.tar.xz nix-build '<nixpkgs>' -A chromium                                                                   
downloading ‘https://nixos.org/channels/nixpkgs-unstable/nixexprs.tar.xz’... ^[[1D [0/0 KiB, 0.0 KiB/s]^[[21D [0/7517 KiB, 0.0 KiB/s]^[[24D [464/7517 KiB, 213.4 KiB/s]^[[28D [4592/7517 KiB, 1446.4 KiB/s]        
unpacking ‘https://nixos.org/channels/nixpkgs-unstable/nixexprs.tar.xz’...      |                                                                                                                                  
these derivations will be built:                                                |                                                                                                                                  
  /nix/store/l9z7lw7a9kfy1535x36cqpg5ki63sijc-chromium-52.0.2743.116.drv        |                                                                                                        
{-# LANGUAGE DataKinds, KindSignatures, MultiParamTypeClasses,
FunctionalDependencies, FlexibleInstances,
OverloadedLabels, ScopedTypeVariables,
TemplateHaskell #-}
import Test2
--instance Has Point "x" Int where from (Point x _) _ = x
deriveI "x"
example = #x (Point 1 2)
@ryantm
ryantm / error.txt
Last active February 10, 2017 05:00
g.hs:13:1: error:
• Could not deduce (Show a1) arising from a use of ‘showsPrec’
from the context: Show a
bound by the instance declaration at g.hs:13:1-41
or from: a ~ (a1, a1)
bound by a pattern with constructor:
Pair :: forall a. Term a -> Term a -> Term (a, a),
in an equation for ‘showsPrec’
at g.hs:13:1-41
Possible fix: