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
(defun set-exec-path-from-shell-PATH () | |
"Set up Emacs' `exec-path' and PATH environment variable to match that used by the user's shell. | |
This is particularly useful under Mac OSX, where GUI apps are not started from a shell." | |
(interactive) | |
(let ((path-from-shell (replace-regexp-in-string "[ \t\n]*$" "" (shell-command-to-string "$SHELL --login -i -c 'echo $PATH'")))) | |
(setenv "PATH" path-from-shell) | |
(setq exec-path (split-string path-from-shell path-separator)))) | |
(set-exec-path-from-shell-PATH) |
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 noti.notify | |
(:require [noti.notification :as n] | |
[io.pedestal.service.log :as log])) | |
(defprotocol Notifiable | |
(notify! [_ x])) | |
(defmacro notifiable [body] | |
`(reify Notifiable | |
(notify! [_ notification] |
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 listen [el type] | |
(let [out (chan)] | |
(events/listen el type | |
(fn [e] (put! out e))) | |
out)) | |
... | |
... | |
(defn init [] |
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
#lang racket | |
;; Named let (Section '4.6.4 Named let' of | |
;; http://docs.racket-lang.org/guide/let.html) | |
(define (duplicate-shorthand pos lst) | |
(let dup ([i 0] | |
[lst lst]) | |
(cond | |
[(= i pos) (cons (car lst) lst)] |
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
#lang racket | |
(module foo racket | |
(module bar typed/racket ;;submodules can leverage different languages | |
(provide baz three) | |
(define: three : Number 3) | |
(define (baz) '(foo bar baz)) | |
(define (bit) '(this is private)))) |
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 fetch-col [] (range 100)) | |
(defn less-than-30? [x] | |
(> 30 x)) | |
(defn filter-col [a] | |
(filter #(every? true? ((juxt less-than-30? odd?) %)) a)) | |
(defn report-results [col] | |
(println col) |
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
#lang racket | |
(require racket/trace) | |
;; Recursive implementation of list length | |
(define (list-length l) | |
(if (empty? l) | |
0 |
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
# | |
# A simple theme that displays relevant, contextual information. | |
# | |
# Authors: | |
# Sorin Ionescu <[email protected]> | |
# | |
# Screenshots: | |
# http://i.imgur.com/nBEEZ.png | |
# |
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
[Unit] | |
Description=subgun | |
[Service] | |
ExecStartPre=-/usr/bin/docker kill subgun-%i | |
ExecStartPre=-/usr/bin/docker rm subgun-%i | |
ExecStart=/usr/bin/docker run -rm -name subgun-%i -e SUBGUN_LISTEN=127.0.0.1:8080 -e [email protected] -e SUBGUN_API_KEY=key-779ru4cibbnhfa1qp7a3apyvwkls7ny7 -p 8080:8080 coreos/subgun | |
ExecStop=/usr/bin/docker kill subgun-%i | |
[X-Fleet] |
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 routing.core | |
(:require [bidi.bidi :as b] | |
[bidi.ring :as r] | |
[ring.mock.request :refer [request] :rename {request mock-request}])) | |
(defn index-handler | |
[req] | |
{:status 200 :body "Index"}) | |
(def handler-map |