Skip to content

Instantly share code, notes, and snippets.

View varl's full-sized avatar

Viktor Varland varl

View GitHub Profile
@varl
varl / dhis2-slack-theme.md
Created August 28, 2019 14:22
DHIS2 colours for Slack

#393D4D,#393D4D,#43CBCB,#232323,#393D4D,#ffffff,#D8F7F7,#000000

>>> def test():
... return (1<2)==(1<2)
...
>>> dis.dis(test)
2 0 LOAD_CONST 1 (1)
2 LOAD_CONST 2 (2)
4 COMPARE_OP 0 (<)
6 LOAD_CONST 1 (1)
8 LOAD_CONST 2 (2)
10 COMPARE_OP 0 (<)
#
## custom commands
#
[DEFAULT]
nuke = if [ -d ./node_modules ]; then rm -rf ./node_modules; else echo "Skipping ... No node_modules/"; fi
report =
yarn
GENERATE_SOURCEMAP=true yarn build

Keybase proof

I hereby claim:

  • I am varl on github.
  • I am varl (https://keybase.io/varl) on keybase.
  • I have a public key ASAME4XrWyrY5GIq7W9wCiyvP66yE5JgYSiE9Dwmnf0HQwo

To claim this, I am signing this object:

<div><p>Hello</p></div>
<style>
p { color: purple; }
</style>
<script>
export default {
oncreate () {
console.log('created component')
@varl
varl / depstat.sh
Created May 31, 2018 14:20
webpack bundle analyser monorepo
#!/usr/bin/env bash
WBA=./node_modules/.bin/webpack-bundle-analyzer
STATS_FILE=stats.json
for pkg in ./packages/*; do
file="${pkg}/${STATS_FILE}"
name="$(basename $pkg)"
$WBA "$file" "${pkg}/build" --mode static --report "reports/${name}.html" --no-open
done
@varl
varl / introrx.md
Created April 25, 2018 04:36 — forked from staltz/introrx.md
The introduction to Reactive Programming you've been missing

FWIW: I didn't produce the content presented here (the outline from Edmond Lau's book). I've just copy-pasted it from somewhere over the Internet, but I cannot remember what exactly the original source is. I was also not able to find the author's name, so I cannot give him/her the proper credits.


Effective Engineer - Notes

What's an Effective Engineer?

@varl
varl / split-dir-to-new-repo
Created December 1, 2016 09:41
Git: Split a directory into a new repository
old-repo$ git subtree split -P dir -b only-dir
new-repo$ git init
new-repo$ git pull /path/to/old-repo only-dir
new-repo$ git remote add origin <url>
new-repo$ git push origin -u master
old-repo$ git rm -rf dir
function Indexer (object, separator) {
this.separator = separator || /\|/;
this.list = typeof object === "string" ? object.split('\n') : [];
}
/***
* Returns true if the given key is found.
*/
Indexer.prototype.containsKey = function (key) {
this.key = key;