This file contains 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
(defmacro defprotocol+ [name & funcs] | |
(let [vararg-sym (symbol "&") | |
normalized-func-specs (map #(let [[n a] %] | |
(if (.contains a vararg-sym) | |
[(symbol (str n "*")) | |
(vec (remove (fn [_a] | |
(= _a vararg-sym)) a)) | |
[n a]] | |
[n a])) | |
funcs) |
This file contains 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
import math | |
@coprocessor( | |
returns=["lon", "lat"], | |
) | |
def simplify(**params) -> (vector[f64], vector[f64]): | |
from greptime import query | |
results = query().sql(params["sql"]) | |
lon = results[0] |
This file contains 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
///usr/bin/env jbang "$0" "$@" ; exit $? | |
//DEPS org.eclipse.jetty:jetty-server:11.0.15 | |
//DEPS org.eclipse.jetty:jetty-servlet:11.0.15 | |
import static java.lang.System.*; | |
import java.io.IOException; | |
import org.eclipse.jetty.server.Server; |
This file contains 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
(defn invoke-private-method [obj fn-name-string & args] | |
(let [m (first (filter (fn [x] (.. x getName (equals fn-name-string))) | |
(.. obj getClass getDeclaredMethods)))] | |
(. m (setAccessible true)) | |
(. m (invoke obj args)))) | |
(defn private-field [obj fn-name-string] | |
(let [m (.. obj getClass (getDeclaredField fn-name-string))] | |
(. m (setAccessible true)) | |
(. m (get obj)))) |
This file contains 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
(require 'package) | |
;; (dolist (source '(("marmalade" . "http://marmalade-repo.org/packages/") | |
;; ("elpa" . "http://tromey.com/elpa/") | |
;; ("melpa" . "http://melpa.milkbox.net/packages/") | |
;; ("org" . "http://orgmode.org/elpa/"))) | |
;; (add-to-list 'package-archives source t)) | |
;; | |
;; ("marmalade" . "http://elpa.emacs-china.org/marmalade/") | |
;; ("org" . "http://elpa.emacs-china.org/org/") | |
;; ("elpa" . "http://elpa.emacs-china.org/gnu/") |
This file contains 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
server.document-root="/your/path/to/share" | |
server.port = 8099 | |
#server.bind = "192.168.1.100" | |
dir-listing.activate = "enable" |
This file contains 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
#!/usr/bin/bash | |
TEMP_KEY=/tmp/tmpkey | |
openssl pkcs12 -in $1 -nodes -out $TEMP_KEY | |
openssl s_client -connect gateway.push.apple.com:2195 -cert $TEMP_KEY -key $TEMP_KEY |
This file contains 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
;;; init.el --- Where all the magic begins | |
;; | |
;; Part of the Emacs Starter Kit | |
;; | |
;; This is the first thing to get loaded. | |
;; | |
;; "Emacs outshines all other editing software in approximately the | |
;; same way that the noonday sun does the stars. It is not just bigger | |
;; and brighter; it simply makes everything else vanish." | |
;; -Neal Stephenson, "In the Beginning was the Command Line" |
This file contains 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
"(tomcat|jetty)":\s*"((\\"|[^"])*)",? |
NewerOlder