Skip to content

Instantly share code, notes, and snippets.


Sam Ritchie sritchie

View GitHub Profile
View appdelegate.m
* Copyright (c) 2015-present, Facebook, Inc.
* All rights reserved.
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
#import "AppDelegate.h"
View circle.yml
- source /etc/lsb-release && echo "deb $DISTRIB_CODENAME main" | sudo tee /etc/apt/sources.list.d/rethinkdb.list
- wget -qO- | sudo apt-key add -
- sudo apt-get update
- sudo apt-get install rethinkdb=1.16.3~0precise
- sudo cp /etc/rethinkdb/default.conf.sample /etc/rethinkdb/instances.d/instance1.conf
- sudo /etc/init.d/rethinkdb restart
View org.patch
diff --git a/ob-core.el b/ob-core-old.el
index ba82d88..a6ffcc4 100644
--- a/ob-core.el
+++ b/ob-core-old.el
@@ -1368,14 +1368,7 @@ specified in the properties of the current outline entry."
(or body "")))))
(preserve-indentation (or org-src-preserve-indentation
- (string-match "-i\\>" switches))))
- (header-args (apply #'org-babel-merge-params
sritchie / distinctg.hs
Created Apr 9, 2015
State Transformer over Optional Transformer over Logger...
View distinctg.hs
-- | Remove all duplicate integers from a list. Produce a log as you go.
-- If there is an element above 100, then abort the entire computation and produce no result.
-- However, always keep a log. If you abort the computation, produce a log with the value,
-- "aborting > 100: " followed by the value that caused it.
-- If you see an even number, produce a log message, "even number: " followed by the even number.
-- Other numbers produce no log message.
-- /Tip:/ Use `filtering` and `StateT over (`OptionalT` over `Logger` with a @Data.Set#Set@).
-- >>> distinctG $ listh [1,2,3,2,6]
sritchie / emacs.el
Created Apr 9, 2015
add this to your .emacs to get nice indenting for Om methods (as defined by om-tools).
View emacs.el
(defvar om-methods
(list 'render
View test.clj
(defn cljs-env?
"Take the &env from a macro, and tell whether we are expanding into
(boolean (:ns env)))
(defmacro if-cljs
"Return then if we are generating cljs code and else for Clojure code."
[then else]
View error.scm
Result: #1=((name . #4="course") (current-response-cursor . 0) (current-response . #5="") (command-queue [cl-struct-haskell-command (#1#) #2=(lambda (state) (if (eq system-type (quote windows-nt)) (haskell-process-send-string (car state) (format ":!powershell -Command \"& { cd %s ; hasktags -e -x (ls -fi *.hs *.lhs *.hsc -exclude \\\"#*#\\\" -name -r) ; exit }\"" (haskell-session-cabal-dir (haskell-process-session (car state))))) (haskell-process-send-string (car state) (format ":!cd %s && %s | %s" (haskell-session-cabal-dir (haskell-process-session (car state))) "find . -name '*.hs' -print0 -or -name '*.lhs' -print0 -or -name '*.hsc' -print0" "xargs -0 hasktags -e -x")))) nil #3=(lambda (state response) (if (cdr state) (progn (let ((tags-file-name (haskell-session-tags-filename (haskell-process-session (car state))))) (find-tag (cdr state))))) (haskell-mode-message-line "Tags generated."))] [cl-struct-haskell-command (#1#) #2# nil #3#] [cl-struct-haskell-command (#6=((name . #4#) (next-error-region #<marker
View err
src/Course/Apply.hs:197:16-22: The first argument of ‘Apply’ should have kind ‘* -> *’, …
but ‘P.Monad’ has kind ‘(* -> *) -> Constraint’
In the instance declaration for ‘Apply P.Monad’
Compilation failed.
View test.hs
data Wrapper
= WrappedInt Integer
| WrappedFloat Float
unpack :: Num a => Wrapper -> a
unpack (WrappedInt x) = x
unpack (WrappedFloat x) = x
View macros.cljx
;; ## State Methods
(defmulti initial-state
"Multimethod that returns the initial state for the supplied
page." :name)
(s/defmethod initial-state :default [r :- Route s :- (s/maybe AppState)] {})
(defmulti page-title
"Returns the current page title for the supplied route." :name)
You can’t perform that action at this time.