Skip to content

Instantly share code, notes, and snippets.

Multi-window, multi-terminal split

Two terminal windows open, one with a bunch of long running watch tasks, the other with an editor. Each of the terminals is a view into one of two windows in a tmux session. Useful for having a vertically split screen with editor on right, and switching between a browser and other command windows on the left.

In first terminal:

  • tmux new-session -s first
  • tmux rename-window editor
  • emacs or whatever

In second terminal:

  • tmux new-session -t first -s second
@samn
samn / media_dog.clj
Last active October 16, 2019 22:11
Using the Twitter API with Clojure
(ns media-dog
(:require [twitter.oauth :as oauth]
[twitter.callbacks.handlers :as handlers]
[twitter.api.streaming :as streaming]
[cheshire.core :as json])
(:import (twitter.callbacks.protocols AsyncStreamingCallback)))
(def creds (oauth/make-oauth-creds
; consumer key
"CDdirssorFxBYmWWQmM1xw"
#EXTM3U
#EXTINF:-1,BBC - Radio 1
http://bbcmedia.ic.llnwd.net/stream/bbcmedia_radio1_mf_p
#EXTINF:-1,BBC - Radio 2
http://bbcmedia.ic.llnwd.net/stream/bbcmedia_radio2_mf_p
#EXTINF:-1,BBC - Radio 3
http://open.live.bbc.co.uk/mediaselector/5/select/version/2.0/mediaset/http-icy-aac-lc-a/format/pls/vpid/bbc_radio_three.pls
#EXTINF:-1,BBC - Radio 4
http://bbcmedia.ic.llnwd.net/stream/bbcmedia_radio4fm_mf_p
#EXTINF:-1,BBC - Radio 5 live
@seabre
seabre / three.cljs
Last active September 13, 2021 06:19 — forked from michiakig/three.cljs
Three.js demo with ClojureScript. Actually works.
(ns three.demo)
(def THREE js/THREE)
(def camera (THREE.PerspectiveCamera. 75 (/ (.-innerWidth js/window)
(.-innerHeight js/window)) 1 10000))
(set! (.-z (.-position camera)) 1000)
(def scene (THREE.Scene.))
(def geometry (THREE.CubeGeometry. 200 200 200))
(def obj (js/Object.))
(set! (.-color obj) 0xff0000)
(set! (.-wireframe obj) true)
@iantruslove
iantruslove / README.md
Created February 16, 2014 19:34
Building a simple ClojureScript single page web application [Den of Clojure Feb 2014]

Beyond hello world: building a simple ClojureScript single page web application

Shown at Feb '14 Den of Clojure

Intro

So you've read the blogs and thought how fun it would be to write web front ends with your favorite lisp. Perhaps you've even fired up the repl and done a little playing. But how do you get from there to a

anonymous
anonymous / upload.cljs
Created April 29, 2015 07:47
(defn upload! [owner]
(let [form (om/get-node owner "upload-form")
io (goog.net.IframeIo.)]
(goog.events.listen
io goog.net.EventType.COMPLETE #(js/console.log "COMPLETE"))
(goog.events.listen
io goog.net.EventType.SUCCESS (fn [_]
(put!
(om/get-state owner :reset-file-drop)
true)
@Deraen
Deraen / 00_notes.md
Last active October 1, 2019 08:40
Compojure-api and Buddy
  • (:identity req) is auth backend independent way to access user data
  • login and logout implementation depends on auth backend
  • :current-user doesn't imply that authentication is required, route should also have :auth-rules if authentication is required
@iantruslove
iantruslove / Den-of-Clojure-intro-1-talk.md
Last active April 9, 2021 01:37
Den of Clojure - Intro to Clojure part 1

A gentle introduction to Clojure

Lisp Cycles (XKCD 297 / https://xkcd.com/297/)

Ian Truslove

Den of Clojure

2016-04-21


(set-env! :dependencies '[[clj-http "2.2.0"]])
(require '[clj-http.client :as http])
(def ^:private ^:const
retryable-http-status-codes
#{408; Request Timeout
409; Conflict
410; Gone
500; Internal Server Error
@paultopia
paultopia / upload.cljs
Created December 21, 2016 21:50
clojurescript read uploaded text file in browser (derived from https://mrmcc3.github.io/post/csv-with-clojurescript/ )
(ns upload-file.core
(:require [reagent.core :refer [render atom]]
[cljs.core.async :refer [put! chan <! >!]])
(:require-macros [cljs.core.async.macros :refer [go go-loop]]))
;; derived from https://mrmcc3.github.io/post/csv-with-clojurescript/
;; and based on reagent-frontend template.
;; dependencies from project.clj in addition to clojure, clojurescript, and reagent:
;; [org.clojure/core.async "0.2.395"]