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
;; clj -Sdeps '{:deps {org.clojure/data.csv {:mvn/version "1.1.0"} org.clojure/data.json {:mvn/version "2.5.0"}}}' --main gzipper | |
(ns gzipper | |
(:require [clojure.java.io :as io] | |
[clojure.walk :as walk] | |
[clojure.string :as string] | |
[clojure.data.json :as json] | |
[clojure.data.csv :as csv]) | |
(:import [java.net InetSocketAddress HttpURLConnection] | |
[java.util.zip GZIPOutputStream] |
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
terraform { | |
required_providers { | |
tls = { | |
version = "4.0.5" | |
} | |
local = { | |
version = "2.5.1" | |
} | |
} | |
} |
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
options { | |
port 5000; # Connect to this port. | |
timeout 60; # General timeout | |
# Path to various programs | |
ppp /usr/sbin/pppd; | |
ifconfig /sbin/ifconfig; | |
route /sbin/route; | |
firewall /sbin/ipchains; | |
ip /sbin/ip; |
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
using clojure.lang; | |
using System.Reflection; | |
// start up Clojure runtime including compiler | |
RT.Init(); | |
// make .cljr file resources available from DLL | |
Assembly.Load("clojure.tools.nrepl"); | |
Assembly.Load("clojure.tools.reader"); |
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
// dotnet --version | |
// 7.0.100 | |
// dotnet restore | |
// dotnet run | |
// rlwrap nc localhost 5555 | |
using System; | |
using System.IO; | |
using System.Net; | |
using System.Net.Http; |
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
-- https://stackoverflow.com/a/70312948 | |
WITH | |
extant AS ( | |
SELECT id FROM access_code WHERE ("value") = ('asdf') | |
), | |
inserted AS ( | |
INSERT INTO access_code ("value") | |
SELECT 'asdf' | |
WHERE NOT EXISTS (SELECT FROM extant) |
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
# 12th July 2023 | |
# trying out https://www.daemonology.net/blog/2021-08-12-EC2-boot-time-benchmarking.html | |
cloudshell-user@ip-10-2-80-7 infra]$ history | |
1 git clone https://github.com/cperciva/ec2-boot-bench | |
2 cd ~/ec2-boot-bench/ | |
3 ls | |
4 cat BUILDING | |
5 ./configure |
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
;; org.clojure/clojure {:mvn/version "1.11.1"} | |
;; com.github.librepdf/openpdf {:mvn/version "1.3.30"} | |
(import 'com.lowagie.text.Document) | |
(import 'com.lowagie.text.Image) | |
(import 'com.lowagie.text.PageSize) | |
(import 'com.lowagie.text.pdf.PdfWriter) | |
(def doc (new Document)) | |
(def os (io/output-stream "output.pdf")) |
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
;; clj -Sdeps '{:deps {org.apache.poi/poi {:mvn/version "4.1.1"} org.apache.poi/poi-ooxml {:mvn/version "4.1.1"}}}' | |
;; based on https://stackoverflow.com/questions/59061235/apache-poi-manage-scatter-chart | |
(ns user | |
(:import [org.apache.poi.xssf.usermodel XSSFWorkbook] | |
[org.apache.poi.ss.util CellRangeAddress] | |
[org.apache.poi.xddf.usermodel.chart XDDFDataSourcesFactory ChartTypes AxisCrosses AxisPosition MarkerStyle] | |
[org.apache.poi.ss.usermodel.charts LegendPosition] | |
[java.io FileOutputStream])) |
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
(binding [*ns* (find-ns 'some.other.namespace)] | |
(with-open [config (java.io.PushbackReader. (java.io.FileReader. "config.clj"))] | |
(loop [] | |
(when-let [form (read {:eof nil} config)] | |
(do (eval form) (recur)))))) | |
;; see also https://gist.github.com/vkz/4c32cdff75ba7254ed0c |
NewerOlder