(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
| (ns defclass.test-framework) | |
| (def all-test (atom {})) | |
| (def ^:dynamic *test* true) | |
| (defmacro is [expr] | |
| `(let [result# ~expr] | |
| (when-not result# | |
| (set! *test* false) | |
| (printf "FAILED: %s%n" '~expr)))) |
| #!/bin/bash | |
| ## Tested on macOS big sur 11.2.1 | |
| ## Usage: | |
| ## git-auto ;; use current script dir as git dir, and auto commit, not push. | |
| ## git-auto -d /path/to/your/note's/dir ;; set git dir | |
| ## git-auto -p ;; auto commit and push | |
| ## git-auto -s origin -p ;; set remote server | |
| ## git-auto -b main -p ;; set git branch | |
| ## git-auto -i 30 -p ;; set interval seconds |
(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
| # Transparent SOCKS proxy | |
| # See: http://darkk.net.ru/redsocks/ | |
| *nat | |
| :PREROUTING ACCEPT [0:0] | |
| :INPUT ACCEPT [0:0] | |
| :OUTPUT ACCEPT [0:0] | |
| :POSTROUTING ACCEPT [0:0] | |
| :REDSOCKS - [0:0] |
| (defn sha1-str [s] | |
| (->> (-> "sha1" | |
| java.security.MessageDigest/getInstance | |
| (.digest (.getBytes s))) | |
| (map #(.substring | |
| (Integer/toString | |
| (+ (bit-and % 0xff) 0x100) 16) 1)) | |
| (apply str))) |
| ###################### | |
| ## shadowsocks-libev | |
| ###################### | |
| # install dependencies | |
| yum install epel-release -y | |
| yum install gcc gettext autoconf libtool automake make pcre-devel asciidoc xmlto udns-devel libev-devel -y | |
| # install shadowsocks-libev | |
| cd /etc/yum.repos.d/ |
| (ns x.y | |
| (:use [plumbing.core]) ;; Just for the map-vals | |
| (:require [clojure.walk :refer [postwalk prewalk prewalk-demo postwalk-demo]] | |
| [clojure.core.match :refer [match]] | |
| [schema.utils :refer [named-error-explain validation-error-explain]] | |
| [schema.core :as s]) | |
| (:import (schema.utils NamedError ValidationError))) | |
| ;; Partially FROM: | |
| ;; https://github.com/puppetlabs/clj-schema-tools |
| #!/usr/bin/env python | |
| # Reflects the requests from HTTP methods GET, POST, PUT, and DELETE | |
| # Written by Nathan Hamiel (2010) | |
| from BaseHTTPServer import HTTPServer, BaseHTTPRequestHandler | |
| from optparse import OptionParser | |
| class RequestHandler(BaseHTTPRequestHandler): | |
| def do_GET(self): |