This file contains hidden or 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
;; Big thanks to Christophe Grand - https://groups.google.com/d/msg/clojure/L1GiqSyQVVg/m-WJogaqU8sJ | |
(defn scaffold [iface] | |
(doseq [[iface methods] (->> iface .getMethods | |
(map #(vector (.getName (.getDeclaringClass %)) | |
(symbol (.getName %)) | |
(count (.getParameterTypes %)))) | |
(group-by first))] | |
(println (str " " iface)) | |
(doseq [[_ name argcount] methods] | |
(println |
This file contains hidden or 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 byte-range.file | |
(:require [ring.util.response :as ring-resp :refer | |
[header status get-header content-type]] | |
[ring.util.time :refer [parse-date format-date]] | |
[ring.util.request :as request] | |
[ring.util.codec :as codec] | |
[pantomime.mime :refer [mime-type-of]] | |
[clojure.string :as str] | |
[clojure.java.io :as io]) | |
(:import [java.io RandomAccessFile] |
This file contains hidden or 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 proc | |
(:import [java.lang ProcessBuilder]) | |
(:use [clojure.java.io :only [reader writer]])) | |
(defn spawn [& args] | |
(let [process (-> (ProcessBuilder. args) | |
(.start))] | |
{:out (-> process | |
(.getInputStream) | |
(reader)) |
This file contains hidden or 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
diff --git a/.gitignore b/.gitignore | |
index 00f42c8..e61feea 100644 | |
--- a/.gitignore | |
+++ b/.gitignore | |
@@ -12,3 +12,4 @@ profiles.clj | |
/.env | |
.nrepl-port | |
/log | |
+/.m2 | |
diff --git a/docker-compose-base.yml b/docker-compose-base.yml |
This file contains hidden or 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
lein update-in :dependencies conj \[org.clojure/tools.nrepl\ \"0.2.13\"\ \:exclusions\ \[org.clojure/clojure\]\] \ | |
-- update-in :plugins conj \[refactor-nrepl\ \"2.4.0-SNAPSHOT\"\] \ | |
-- update-in :plugins conj \[cider/cider-nrepl\ \"0.18.0-SNAPSHOT\"\] \ | |
-- repl :headless :host 0.0.0.0 :port 7000 |
This file contains hidden or 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 erc20-mapper.ex-tutorial) | |
(defn fail [& args] | |
(throw (ex-info "OMG!" {:type ::fail :args args}))) | |
(defn funky-fail [& args] | |
(throw (ex-info "jayyyyy!" {:type ::funky-fail :args args}))) | |
(defn mby [fn] | |
(try |
This file contains hidden or 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
# Stop all containers | |
docker stop `docker ps -qa` | |
# Remove all containers | |
docker rm `docker ps -qa` | |
# Remove all images | |
docker rmi -f `docker images -qa ` | |
# Remove all volumes |
This file contains hidden or 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
Solidity lets you program on Ethereum, a blockchain-based virtual machine that allows the creation and execution of smart contracts, without needing centralized or trusted parties. | |
Solidity is a statically typed, contract programming language that has similarities to Javascript and C. Like objects in OOP, each contract contains state variables, functions, and common data types. Contract-specific features include modifier (guard) clauses, event notifiers for listeners, and custom global variables. | |
Some Ethereum contract examples include crowdfunding, voting, and blind auctions. | |
As Solidity and Ethereum are under active development, experimental or beta features are explicitly marked, and subject to change. Pull requests welcome. | |
// First, a simple Bank contract | |
// Allows deposits, withdrawals, and balance checks | |
// simple_bank.sol (note .sol extension) | |
/* **** START EXAMPLE **** */ |
This file contains hidden or 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
DIR=/tmp/build_scss | |
mkdir $DIR -p | |
cd $DIR | |
git clone https://github.com/sass/libsass.git | |
export SASS_LIBSASS_PATH=$DIR/libsass | |
git clone https://github.com/sass/sassc.git | |
cd $DIR/sassc | |
make -j4 |
This file contains hidden or 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
export const debouncedEvent = ({element, event, handler, useCapture=false}) => { | |
let eventObject = null; | |
let ticking = false; | |
const update = _ => { | |
ticking = false; | |
handler(eventObject); | |
}; |
NewerOlder