Skip to content

Instantly share code, notes, and snippets.

NFT Thoughts, Essays, Writings

I'm collecting here a few essays on the net about tokenization in the art world. This list is likely biased and by no means exhaustive.

@li0nel
li0nel / certbot
Created July 12, 2018 08:03
Execute Certbot
# Use Let's Encrypt certbot to order a free certificate
certbot certonly --non-interactive --manual \
--manual-auth-hook "./auth-hook.sh UPSERT your_domain.com" \
--manual-cleanup-hook "./auth-hook.sh DELETE your_domain.com" \
--preferred-challenge dns \
--config-dir "./letsencrypt" \
--work-dir "./letsencrypt" \
--logs-dir "./letsencrypt" \
--agree-tos \
--manual-public-ip-logging-ok \
@kourge
kourge / enum.ts
Last active March 23, 2017 00:05
String enums in TypeScript
export enum Event1 {
SIGN_IN_WALL = 'Sign In Wall' as any,
SIGN_UP = 'Sign Up' as any,
}
{
const x = Event1.SIGN_UP; // type = Event1
const y: number = x;
// Verdict: approach is succint, but incorrectly allows type widening to number.
}
@DrBoolean
DrBoolean / falg.js
Created December 15, 2015 18:19
F-algebra es2015
const daggy = require('daggy')
const {compose, curry, map, prop, identity, intersection, union} = require('ramda');
const inspect = (x) => { if(!x) return x; return x.inspect ? x.inspect() : x; }
// F-algebras
// Fix
// ============
// Fx is a simple wrapper that does almost nothing. It's much more useful in typed languages to check that we have a recursive f (Fix f)
function id(a) {
return a
}
function compose(f, g){ return function(x) {
return f(g(x))
}}
function partial(f, x) {
return function(y) {
@jlongster
jlongster / forms-with-react.js
Last active May 8, 2017 14:15
higher-order form components w/react
// Simple wrapper to use bootstrap's grid system to position elements side-by-side
var VerticalFieldsElement = React.createClass({
render: function() {
return dom.div(
{ className: 'clearfix' },
React.Children.map(this.props.children, function(child) {
if(!child) {
return child;
}
@jackrusher
jackrusher / stylometry.clj
Last active May 24, 2017 11:14
A bit of poor man's stylometry using Etymological Wordnet
;; Some fun with the etymological wordnet database
;; <http://www1.icsi.berkeley.edu/~demelo/etymwn/>
;; you'll need the database from that link and this table
;; <https://gist.github.com/jackrusher/b42152c40cb56b466085>
;; to eval the code in this gist within your own environment.
(defn fixup-name [name]
(-> name
clojure.string/lower-case
(clojure.string/replace #": " "-")
@timrwood
timrwood / moment-immutable.js
Created September 16, 2014 17:16
Immutable Moments
(function (root, factory) {
"use strict";
if (typeof define === 'function' && define.amd) {
define(['moment'], factory);
} else if (typeof exports === 'object') {
module.exports = factory(require('moment'));
} else {
factory(root.moment);
}
}(this, function (moment) {
@hiredman
hiredman / bench.clj
Created June 2, 2014 18:07
core.logic for joinery
#!/usr/bin/java -jar clojure-1.7.0-master-SNAPSHOT.jar
(let [pom-uber-jar
(str "http://thelibraryofcongress.s3.amazonaws.com/"
"pomegranate-0.0.13-SNAPSHOT-jar-with-dependencies.jar")
cl (java.net.URLClassLoader. (into-array [(java.net.URL. pom-uber-jar)]))
cx (.getContextClassLoader (Thread/currentThread))]
(push-thread-bindings {clojure.lang.Compiler/LOADER cl})
(def date-parsers [nil (java.text.SimpleDateFormat. "yyyy") (java.text.SimpleDateFormat. "yyyy-M") (java.text.SimpleDateFormat. "yyyy-M-dd")])
(def grains [:decade :year :month :day]) ;; what's decade doing?
(map #(let [[_ year month day] (re-find #"(\d{2,4})[-_]([\dx]{2})[-_]([\dx]{2})" %)
date (first (split-with (partial not= "xx") [(if (= (count year) 2) (str "19" year) year) month day]))]
[(.parse (parsers (count date)) (clojure.string/join "-" date)) (grains (count date))])
["thefilehasaname__1939-xx-01.mp3"
"thefilehasaname__39_01_01.mp3"
"thefilehasaname__39-01-01.mp3"