Skip to content

Instantly share code, notes, and snippets.

View vizanto's full-sized avatar

Danny Wilson vizanto

View GitHub Profile
;; I would suggest that we use either 'datopia' or 'datopia.db' as the namespace
;; for the schemas, rather than 'db'. For users, I suspect 'db' will seem arbitrary
;; and incongruous (as it does to me, in this context).
#:datopia {:attribute :datopia.ednt/balance
:schema #:db {:cardinality :db.cardinality/one
:valueType :db.type/bigdec}
:invariant <inline query graph as map of keyword -> query,
or maybe just inline query, initially. having
{:deps
{org.clojure/clojure {:mvn/version "1.9.0"}
com.datomic/datomic-free {:mvn/version "0.9.5697"}}}
@whilo
whilo / trans_stm.clj
Created April 5, 2018 00:16
Clojure STM example
(def accounts
(into {} (for [i (range 1000001)]
[i (ref 1000)])))
(time
(let [fs (dotimes [offset 10]
(future
(doseq [i (shuffle (range (* offset 100000)
(* (inc offset) 100000)))]
(dosync
@cryppadotta
cryppadotta / 001-Tradingview-Watchlist.md
Last active January 13, 2024 07:16
Tradingview Watchlist Import Files for Crypto Exchanges

Tradingview Watchlist Import Files for Crypto Exchanges

Below you'll find Tradingview import files for Bittrex and Binance BTC-base markets

Ordered by CMC's Market Cap

I use Tradingview and I like to quickly click through all coins on a particular exchange. The files below can be imported into a Tradingview watchlist.

★ ★ ★ If you use these, leave a comment or a star above ★ ★ ★

@pjeby
pjeby / shelldown-demo
Last active June 15, 2024 19:20
"You got your markdown in my shell script!" "No, you got your shell script in my markdown!"

Mixed Markdown and Shell Scripting

: By the power of this magic string: ex: set ft=markdown ;:<<'```shell' #, this file is now both a markdown document and an executable shell script. chmod +x it and try running it!

The above line does just what it says. More specifically, when placed within in the first 5 lines and preceded only by blank lines or #-prefixed markdown headers:

  1. The first part of the magic string makes github and various editors (e.g. atom with the vim-modeline packge) treat the file as having markdown syntax (even if the file doesn't have an extension)
  2. The second part (if run in a shell), makes the shell skip execution until it encounters the next ```shell block.

(The line also has to start with a : so that it's valid shell code.)

@HyperBrain
HyperBrain / lifecycle-cheat-sheet.md
Last active July 15, 2024 19:52
Serverless Lifecycle Cheat Sheet

Serverless plugin author's cheat sheet

This cheat sheet provides a detailed overview of the exposed lifecycle events and available commands (and entrypoints) of the Serverless framework, that can be hooked by plugins (internal and external ones). The document is structured by the commands invoked by the user.

Lifecycle events are shown as the globally available outer events (all providers) and sub lifecycle events that are provider specific in the called order. Currently only the AWS provider is shown. If you have information about the other provider,

@codedot
codedot / ics2tc.awk
Last active September 12, 2021 21:20
Awk script that converts iCalendar .ics files to Time Clock "timelog" format by John Wiegley
function parse(dt)
{
Y = substr(dt, 1, 4);
M = substr(dt, 5, 2);
D = substr(dt, 7, 2);
h = substr(dt, 10, 2);
m = substr(dt, 12, 2);
s = substr(dt, 14, 2);
return Y "/" M "/" D " " h ":" m ":" s;
@techhazard
techhazard / Readme.md
Last active November 6, 2017 12:39
Nixos with ZFS on encrypted LUKS as root filesystem
@reborg
reborg / rich-already-answered-that.md
Last active July 11, 2024 09:54
A curated collection of answers that Rich gave throughout the history of Clojure

Rich Already Answered That!

A list of commonly asked questions, design decisions, reasons why Clojure is the way it is as they were answered directly by Rich (even when from many years ago, those answers are pretty much valid today!). Feel free to point friends and colleagues here next time they ask (again). Answers are pasted verbatim (I've made small adjustments for readibility, but never changed a sentence) from mailing lists, articles, chats.

How to use:

  • The link in the table of content jumps at the copy of the answer on this page.
  • The link on the answer itself points back at the original post.

Table of Content

@unode
unode / nix-tunnel-daemon
Created July 7, 2016 16:29
nix-tunnel-daemon
#!/bin/bash
# Any error is fatal
set -e
# Server running the actual nix-daemon
REMOTE_NIXDAEMON="mega"
# Where to find the socket in the destination server
NIX_DAEMON_SOCKET="/local/nix/var/nix/daemon-socket/socket"