Skip to content

Instantly share code, notes, and snippets.

View fmnoise's full-sized avatar
🇺🇦

fmnoise

🇺🇦
  • Yellowpay Inc
  • Norway
View GitHub Profile
@fmnoise
fmnoise / semantic-commit-messages.md
Last active January 25, 2023 21:22 — forked from joshbuchea/semantic-commit-messages.md
Semantic Commit Messages

Semantic Commit Messages

Format: <type>(<scope>): <subject>

<scope> is optional

Example

feat: add hat wobble
@fmnoise
fmnoise / renew-gpgkey.md
Last active May 21, 2022 09:38 — forked from krisleech/renew-gpgkey.md
Renew Expired GPG key

Renew GPG key

Given that your key has expired.

$ gpg --list-keys
$ gpg --edit-key KEYID

Use the expire command to set a new expire date:

@fmnoise
fmnoise / .gitattributes
Created June 22, 2021 08:42 — forked from amalloy/.gitattributes
Clojure-aware git-diff hunk headers
*.clj diff=clojure
*.cljs diff=clojure
*.cljx diff=clojure
@fmnoise
fmnoise / spec-meta.clj
Created May 12, 2020 10:39
Spec metadata
(defn form-spec [spec err-format]
(with-meta (s/spec spec) {:err-format err-format}))
(s/def ::number (form-spec int? (fn [k v] (str (name k) " is not a valid number: " v))))
(s/def :address/apt (form-spec ::number (fn [_ v] (str "wrong apartment number: " v))))
(s/def :address/strno ::number)
(s/def :address/street string?)
(s/def ::addr (s/keys :req-un [:address/apt :address/street :address/strno]))
@fmnoise
fmnoise / heap-dump.clj
Created April 26, 2020 13:05
Making heap dump from repl
;; https://matthewdowney.github.io/forcing-jvm-heap-dump-programmatically-clojure.html
(import 'java.lang.management.ManagementFactory)
(import 'com.sun.management.HotSpotDiagnosticMXBean)
(let [server (ManagementFactory/getPlatformMBeanServer)
bean-name "com.sun.management:type=HotSpotDiagnostic"
bean (ManagementFactory/newPlatformMXBeanProxy server bean-name HotSpotDiagnosticMXBean)
live-objects-only? false]
(.dumpHeap bean "dump.hprof" live-objects-only?))
@fmnoise
fmnoise / nginxproxy.md
Created May 24, 2019 15:14 — forked from soheilhy/nginxproxy.md
How to proxy web apps using nginx?

Virtual Hosts on nginx (CSC309)

When hosting our web applications, we often have one public IP address (i.e., an IP address visible to the outside world) using which we want to host multiple web apps. For example, one may wants to host three different web apps respectively for example1.com, example2.com, and example1.com/images on the same machine using a single IP address.

How can we do that? Well, the good news is Internet browsers

@fmnoise
fmnoise / cider-lein
Last active April 10, 2019 11:38
lein wrapper for VSCode
lein update-in :dependencies conj \[nrepl/nrepl\ \"0.6.0\"\ \:exclusions\ \[org.clojure/clojure\]\] \
-- update-in :plugins conj \[cider/cider-nrepl\ \"0.21.1\"\] \
-- update-in :plugins conj \[refactor-nrepl\ \"2.4.0\"\] \
-- "$@"
@fmnoise
fmnoise / github.css
Last active May 29, 2019 13:14
Github Stylus
.blob-num,
.blob-code-inner {
font-size: 17px;
font-family: "CamingoCode";
-webkit-font-smoothing: subpixel-antialiased;
line-height: 25px;
}
.blob-num,
.blob-code-inner,
@fmnoise
fmnoise / Makefile
Created March 20, 2019 19:59 — forked from isaacs/Makefile
# Hello, and welcome to makefile basics.
#
# You will learn why `make` is so great, and why, despite its "weird" syntax,
# it is actually a highly expressive, efficient, and powerful way to build
# programs.
#
# Once you're done here, go to
# http://www.gnu.org/software/make/manual/make.html
# to learn SOOOO much more.
@fmnoise
fmnoise / heredoc.clj
Created January 26, 2019 16:13 — forked from cgrand/heredoc.clj
An ugly hacky heredoc for Clojure
(defn heredoc []
(let [delim (.readLine *in*)]
(->> (repeatedly #(.readLine *in*))
(take-while #(not= delim %))
(interpose \newline)
(apply str))))
; The following lines are read (by the reader) as:
; "Look )(\"\\T\na here doc!\n"
#=(heredoc)"""