Skip to content

Instantly share code, notes, and snippets.

gyzerok /
Created Sep 30, 2020 — forked from amake/
Inno Setup on Linux and macOS

Inno Setup on Linux and macOS

Inno Setup is a popular installer builder for Windows. Of course it is made to run on Windows only, by default. But what if you want to build Windows installers off Windows, i.e. on Linux or macOS?

You’re in luck: It’s possible to run Inno Setup anywhere that Docker runs (including Linux and macOS), and even have a passable experience writing your setup script.

View One Liner to Download the Latest Release from Github
  • Use curl to get the JSON response for the latest release
  • Use grep to find the line containing file URL
  • Use cut and tr to extract the URL
  • Use wget to download it
curl -s \
| grep "browser_download_url.*deb" \
| cut -d : -f 2,3 \
| tr -d \" \

Only have one outgoing port, and only one incoming port

If you have many ports, they could be all over your project, and therefore hard to manage and easy for forget about. Keep track of all of them by representing your outgoing ports in a union type like..

type JsMsg
    = Download
    | Login Login.Payload
    | Logout
    | Track Tracking.Payload
gyzerok /
Created Jan 4, 2018 — forked from evancz/
Cron job to remind myself to stretch

Type crontab -l to see your cron jobs. Type crontab -e to edit them. You have to use Vim apparently.

Add a line like this:

0,30	*	*	*	*	/Users/YOURNAME/Documents/scripts/

That is on every 0th and 30th minute of the hour. Make sure all the separators in there are tabs!


Standardized Ladder of Functional Programming

The LambdaConf Ladder of Functional Programming (LOFP) is a standardized progression of different concepts and skills that developers must master on their journey to becoming expert-level functional programmers. LOFP can be used to rank workshops, talks, presentations, books, and courseware, so that aspiring functional programmers have a better understanding of what material is appropriate for them given their current experience.



  • Immutable Data
  • Second-order Functions
gyzerok /
Last active Aug 14, 2018 — forked from jinjor/
elm-make one by one
# make sure every time only one file is re-compiled
echo "time\t\tlines\timports\tfile"
for f in `find src -name *.elm`
elm-make $f --output=/dev/null > /dev/null
sleep 1
touch $f
a=`wc -l $f | awk '{print $1}'`
View io-ts-reporter.ts
function decode<T>(value: any, type: t.Type<T>): Promise<T> {
const validation = t.validate(value, type);
return validation.fold(
([e, ..._unused]) => {
const actualErr = _.last(e.context);
const errPath = e.context
.map(c => c.key)
.filter(key => key.length)
gyzerok / base64ArrayBuffer.js
Last active Jan 5, 2021 — forked from jonleighton/base64ArrayBuffer.js
Encode an ArrayBuffer as a base64 string
View base64ArrayBuffer.js
// Converts an ArrayBuffer directly to base64, without any intermediate 'convert to string then
// use window.btoa' step. According to my tests, this appears to be a faster approach:
function base64ArrayBuffer(arrayBuffer) {
var base64 = ''
var encodings = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'
var bytes = new Uint8Array(arrayBuffer)
var byteLength = bytes.byteLength
View stylesheet.elm
stylesheet : String -> Html.Html Msg
stylesheet link =
tag =
attrs =
[ Html.Attributes.attribute "rel" "stylesheet"
, Html.Attributes.attribute "property" "stylesheet"
, Html.Attributes.attribute "href" link
View class-methods-to-properties.js
module.exports = function (fileInfo, api) {
const j = api.jscodeshift;
const root = j(fileInfo.source);
return root.find(j.MethodDefinition)
.filter(method => method.value.kind !== 'constructor')
.replaceWith(method => {
const { key, value: { body, params } } = method.value;
return j.classProperty(