Skip to content

Instantly share code, notes, and snippets.

@schmee
schmee / assembly.log
Created August 6, 2019 18:53
Vector API in Clojure!
vector_clj/core$i256_add.invoke(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object; [0x000000011f8acdc0, 0x000000011f8ad058] 664 bytes
[Entry Point]
[Constants]
# {method} {0x000000013253d3b8} 'invoke' '(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;' in 'vector_clj/core$i256_add'
# this: rsi:rsi = 'vector_clj/core$i256_add'
# parm0: rdx:rdx = 'java/lang/Object'
# parm1: rcx:rcx = 'java/lang/Object'
# [sp+0x30] (sp of caller)
.....
0x000000011f8acec3: prefetchw BYTE PTR [r10+0x180]
@yang-wei
yang-wei / fixed-data-table.cljs
Created May 4, 2016 15:02
Porting FixedDataTable to Reagent
(ns gannet.components.result-table
(:require [reagent.core :as r]
[gannet.style :as style]
[cljsjs.fixed-data-table]))
(enable-console-print!)
(def Table(r/adapt-react-class js/FixedDataTable.Table))
(def Column (r/adapt-react-class js/FixedDataTable.Column))
(def Cell (r/adapt-react-class js/FixedDataTable.Cell))
node 'puppet.example.com' {
contain site::roles::puppet_server
}
@rauhs
rauhs / humanize-schema-errors.clj
Last active May 27, 2023 05:29
Translate prismatic's schema.core errors to a human readable form. Use this for presenting validation errors to users. Don't use this for programming errors like a missing map key etc.
(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
@yjh0502
yjh0502 / main.go
Created December 30, 2014 12:59
OpenVPN TCP-to-UDP proxy
package main
import (
"flag"
"fmt"
"io"
"log"
"net"
)
@phobos182
phobos182 / haproxy.conf
Created July 17, 2012 23:19
LogStash Configuration for HAProxy
input {
syslog {
type => "haproxy-access"
port => 514
}
}
filter {
grok {
type => "haproxy-access"
@ejackson
ejackson / database.clj
Created August 28, 2011 18:53
Basic Clojure interaction with SQL
(ns bookkeeper.database
(:require [clojure.java.jdbc :as sql]
[clj-time.format :as f]))
(def db {:classname "com.mysql.jdbc.Driver"
:subprotocol "mysql"
:subname "//database-server:3306/database"
:user "user"
:password "password"})