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 / 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 / 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)"""
@fmnoise
fmnoise / submit.md
Created September 14, 2018 10:40 — forked from tanaikech/submit.md
Downloading Shared Files on Google Drive Using Curl

Downloading Shared Files on Google Drive Using Curl

When the shared files on Google Drive is downloaded, it is necessary to change the download method by the file size. The boundary of file size when the method is changed is about 40MB.

File size < 40MB

CURL

filename="### filename ###"
fileid="### file ID ###"
curl -L -o ${filename} "https://drive.google.com/uc?export=download&amp;id=${fileid}"
@fmnoise
fmnoise / README.md
Created August 21, 2018 08:41 — forked from mfikes/README.md
Seeing the inferred type of a ClojureScript expression

If you are curious about the types inferred by ClojureScript, it is easy to get some insight using a macro:

(defmacro inferred-type [form]
  `'~(cljs.analyzer/infer-tag &env
       (cljs.analyzer/no-warn (cljs.analyzer/analyze &env form))))

This is the kind of dev-time macro you could refer using the new user.cljs feature.

@fmnoise
fmnoise / datomic-reset-attributes.clj
Created August 9, 2018 20:18 — forked from favila/datomic-reset-attributes.clj
Datomic transaction functions to "reset" attributes: i.e. make them have a post-transaction value you specify without having to enumerate the retractions.
(def tx-fns
[{:db/ident :db.fn/reset-attribute-values
:db/doc "Transaction function which accepts an entity identifier, attribute identifier
and set of values and expands to any additions and retractions necessary to
make the final post-transaction value of the attribute match the provided
values. Attribute values must be scalars.
If multiple values are provided on a cardinality-one attribute you will get a
datom conflict exception at transaction time."
:db/fn (d/function
@fmnoise
fmnoise / cljs-graaljs.md
Created July 19, 2018 08:53 — forked from mfikes/cljs-graaljs.md
Try ClojureScript Graal.js

First, you need to install GraalVM and set things up so that the java installed with GraalVM is picked up in your path. See http://www.graalvm.org for more details.

With that in place, you can manage the Truffle languages installed.

Here you can see that I've already installed Python and Ruby:

$ gu list
ComponentId              Version             Component name