Skip to content

Instantly share code, notes, and snippets.

View deiga's full-sized avatar

Timo Sand deiga

View GitHub Profile
@deiga
deiga / functions.sh
Last active June 2, 2019 22:04
docker-fzf
# MIT License
#
# Copyright (c) 2019 Carlos Castaño
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
@deiga
deiga / .editorconfig
Created January 11, 2019 10:20
Editorconfig-example
# EditorConfig is awesome: http://EditorConfig.org
# top-most EditorConfig file
root = true
# Unix-style newlines with a newline ending every file
[*]
end_of_line = lf
insert_final_newline = true
@deiga
deiga / mac_games.txt
Last active April 14, 2018 20:51
MP Games playable on my mac
Civ V
Civ VI
Crusader Kings II
Diablo III
Don't Starve Together
Door Kickers
Dungeon of the Endless
Divinity: Original Sin
Endless Legends
Endless Space
@deiga
deiga / migrate_autojump_fasd.sh
Last active February 26, 2020 00:07
Migrate from autojump to fasd on macOS
cat ~/Library/autojump/autojump.txt | awk -v date="$(date +%s)" '{ print $2 "|" $1 "|" date }' > ~/.fasd
Books:
Star Wars: Kloonien Hyökkäys - Kuvitettu opas
Star Wars: Kloonien Hyökkäys - Rakenteiden salaisuudet
Kim Harrison - A Fistful of Charms
Michael Moorcock - Blood
Dan Brown - Deception Point
P.C. Cast - Betrayed (House of Night 2)
P.C. Cast - Chosen (House of Night 3)
P.C. Cast - Untamed (House of Night 4)
@deiga
deiga / unfoldr.kt
Created October 22, 2017 12:42
Kotlin unfoldr
fun <T,R> unfoldRight(f: (T) -> Pair<R, T>?, b: T): List<R> {
val maybePair: Pair<R, T>? = f(b)
return if ( maybePair == null) {
listOf()
} else {
listOf(maybePair.first) + unfoldRight(f, maybePair.second)
}
}
@deiga
deiga / .stCommitMsg
Last active June 21, 2018 10:56
git config --global commit.template ~/.stCommitMsg
# 50-character subject line
#
# 72-character wrapped longer description.
# Why is this change necessary?
Why:
*
{"userAgent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/62.0.3198.0 Safari/537.36","lighthouseVersion":"2.4.0","generatedTime":"2017-08-28T12:04:29.937Z","initialUrl":"https://www.uusimuste.fi","url":"https://www.uusimuste.fi/","audits":{"is-on-https":{"score":true,"displayValue":"","rawValue":true,"extendedInfo":{"value":[]},"scoringMode":"binary","name":"is-on-https","category":"Security","description":"Uses HTTPS","helpText":"All sites should be protected with HTTPS, even ones that don't handle sensitive data. HTTPS prevents intruders from tampering with or passively listening in on the communications between your app and your users, and is a prerequisite for HTTP/2 and many new web platform APIs. [Learn more](https://developers.google.com/web/tools/lighthouse/audits/https).","details":{"type":"list","header":{"type":"text","text":"Insecure URLs:"},"items":[]}},"redirects-http":{"score":true,"displayValue":"","rawValue":true,"scoringMode":"binary","name":
{"lighthouseVersion":"1.6.5","generatedTime":"2017-05-19T07:52:08.040Z","initialUrl":"https://www.uusimuste.fi","url":"https://www.uusimuste.fi/","audits":{"is-on-https":{"score":true,"displayValue":"","rawValue":true,"extendedInfo":{"formatter":"urllist","value":[]},"name":"is-on-https","category":"Security","description":"Uses HTTPS","helpText":"All sites should be protected with HTTPS, even ones that don't handle sensitive data. HTTPS prevents intruders from tampering with or passively listening in on the communications between your app and your users, and is a prerequisite for HTTP/2 and many new web platform APIs. [Learn more](https://developers.google.com/web/tools/lighthouse/audits/https)."},"redirects-http":{"score":true,"displayValue":"","rawValue":true,"name":"redirects-http","category":"Security","description":"Redirects HTTP traffic to HTTPS","helpText":"If you've already set up HTTPS, make sure that you redirect all HTTP traffic to HTTPS. [Learn more](https://developers.google.com/web/tools/light
@deiga
deiga / install_node.sh
Created March 27, 2017 15:30
Node installation script with bash
function install_node() {
local REQUIRED_MAJOR_NODE_VERSION=${REQUIRED_NODEJS_VERSION:0:1}
echo "${BLUE}Which version manager do you want to install node.js with? If you don't know, choose 'brew'${NORMAL}:"
select NODE_VERSION_MANAGER in 'brew' 'nvm' 'nodenv' 'other';
do
case $NODE_VERSION_MANAGER in
'nvm'|'nodenv')
verify_command $NODE_VERSION_MANAGER
set +x
$NODE_VERSION_MANAGER install $REQUIRED_MAJOR_NODE_VERSION