Skip to content

Instantly share code, notes, and snippets.

@afolarin
afolarin / docker-log-gist.md
Last active March 16, 2023 13:02
docker-logs
@ryanwersal
ryanwersal / example.clj
Created October 21, 2014 04:18
msgpack based websocket communication between clojure and python
(ns example.core
(:gen-class)
(:require [immutant.web :as web]
[immutant.web.websocket :as ws]
[ring.middleware.resource :refer [wrap-resource]]
[ring.util.response :refer [redirect]]
[msgpack.core :as msgpack]))
(defn -main
[& args]
@arctouch-shadowroldan
arctouch-shadowroldan / brew
Last active July 27, 2020 21:28
Brew install all the apps
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
brew doctor
brew update
brew install wget
brew install watch
brew install mobile-shell
brew install mysql --client-only
brew install git
brew install gnu-sed
brew install graphicsmagick
@stackia
stackia / homebrew.mxcl.aria2.plist
Last active October 13, 2023 04:50
aria2c daemon start at boot. Put this file into /Library/LaunchDaemons, them 'chmod 600' and 'chown root'. Remember to fill placeholders below.
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>KeepAlive</key>
<true/>
<key>RunAtLoad</key>
<true/>
<key>Label</key>
<string>homebrew.mxcl.aria2</string>
@runexec
runexec / Clojure Does Objects Better.clj.md
Last active June 17, 2020 03:47
Clojure Does Objects Better

Clojure does Objects Better

A hopefully short and concise explanation as to how Clojure deals with Objects. If you already write Clojure, this isn't for you.

You know what an Interface is if you write/read Java or PHP 5+. In Clojure it might be called defprotocol.

user> (defprotocol IABC
        (also-oo [this])
        (another-fn [this x]))

IABC

@pixelhandler
pixelhandler / slides.js
Created January 14, 2015 17:59
Ember CLI http-mock backed by RethinkDB
/*
Add `nouns` as http mocks and use in a local db, available via API in develoment
* Install the adapter `npm install rethinkdb_adapter --save-dev`
* Install RethinkDB, see https://github.com/pixelhandler/ember-slide-deck/blob/master/bin/install_rethinkdb.sh
* Start db `rethinkdb`
* Setup Db and Table, see https://github.com/pixelhandler/ember-slide-deck/blob/master/bin/setup_db.js
* Generate a mock `ember g http-mock nouns` and edit your mock to use the db, see code below for 'slides'
* Set your application adapter to use `namespace: 'api'`
* In our routes use Ember Data in your model hook
(ns path.to.services.env
(:require
[clojure.tools.logging :as log]
[puppetlabs.trapperkeeper.core :as tk]
[puppetlabs.trapperkeeper.services :as s]))
(defprotocol EnvironmentConfigService
(get-config [this]
"Returns a map containing all of the configuration values (enviornmentally aware). Any string value that is
prefixed by ENV_, will be considered an environmental variable.")

2011.03.10

Recursive Interfaces for Reactive Objects by Travers

Talks briefly about Kay's Vivarium Project... TODO: find out more

Frames

(ns datascript-to-datomic-util
(:require [datascript :as d]))
;;;; a utility to help with a datomic-datascript roundtrip process involving:
;;; 1. export some data from a datomic database and transact into a datascript instance.
;;; 2. perform one or more transactions against datascript.
;;; 3. transact the sum of all changes made against datascript back into datomic in a single tx
;;; this namespace contains two public functions:
;;; listen-for-changes: listen to datascript transactions and build up a record of changes