"Clojure running on Raspberry Pi" sounded so cool that I just had to give it a try.
- Download ARM JDK from Oracle and instlal on Raspberry Pi
- Change visudo to contain the following
A checklist for designing and developing internet scale services, inspired by James Hamilton's 2007 paper "On Desgining and Deploying Internet-Scale Services."
| ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; | |
| ;;; Connection | |
| (defprotocol DatomicConnection | |
| (as-conn [_])) | |
| (extend-protocol DatomicConnection | |
| datomic.Connection | |
| (as-conn [c] c) | |
| datomic.db.Db |
Magic words:
psql -U postgresSome interesting flags (to see all, use -h or --help depending on your psql version):
-E: will describe the underlaying queries of the \ commands (cool for learning!)-l: psql will list all databases and then exit (useful if the user you connect with doesn't has a default database, like at AWS RDS)| var BVT = function(width, depth, init, elems) { | |
| this._width = width; | |
| this._depth = depth; | |
| this._leaf = depth === 1; | |
| this._shift = (this._depth - 1) * Math.round(Math.log(width) / Math.log(2)); | |
| this._himask = this._width - 1; | |
| this._lomask = Math.pow(2, this._shift) - 1; | |
| this._elems = elems; | |
| (ns reagent-test.core | |
| (:require [reagent.core :as reagent :refer [atom]] | |
| [datascript :as d] | |
| [cljs-uuid-utils :as uuid])) | |
| (enable-console-print!) | |
| (defn bind | |
| ([conn q] | |
| (bind conn q (atom nil))) |
| (ns react-cljs.core | |
| (:require-macros [reactjs.macros :refer [pure]]) | |
| (:require React [reactjs.core :as r])) | |
| (enable-console-print!) | |
| (declare render-ui) | |
| (defn render-counter [id state cb] | |
| (pure state |
| (ns space-age) | |
| (defn on-earth [seconds] | |
| (/ seconds 31557600.0)) | |
| (def orbital-periods | |
| {:mercury 0.2408467 | |
| :venus 0.61519726 | |
| :mars 1.8808158 | |
| :jupiter 11.862615 |
| require 'fog' | |
| bucket = 'bucket-name' | |
| credentials = { | |
| :provider => 'AWS', | |
| :aws_access_key_id => 'access_key_id', | |
| :aws_secret_access_key => 'secret_key', | |
| } | |
| fog = Fog::Storage.new(credentials) |
| ;; list comprehensions are often used as a poor man's Prolog | |
| ;; consider the following, it has only one solution | |
| ;; [1 1 1 1 1 1 1 1 1 1] yet we actually consider 10^10 possibilities | |
| (for [a (range 1 11) | |
| b (range 1 11) | |
| c (range 1 11) | |
| d (range 1 11) | |
| e (range 1 11) | |
| f (range 1 11) |