This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from 'react' | |
import humanizeDuration from "humanize-duration" | |
const shortEnglishHumanizer = humanizeDuration.humanizer({ | |
language: 'shortEn', | |
spacer: '', | |
delimiter: ' ', | |
languages: { | |
shortEn: { | |
y: function() { return 'y' }, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
echo 83:F4...CD:46 | xxd -r -p | openssl base64 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
This function can be used in `compose` to decide on a key for a given component | |
@example: | |
export default compose( | |
connect(state => ({ | |
a: state.a, | |
b: state.b, | |
})), | |
KeySetter(props => `${props.a}-${props.b}`), // remounts a component if one of `a` or `b` changes. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
tmux list-sessions | awk 'BEGIN{FS=":"}{print $1}' | xargs -n 1 tmux kill-session -t | |
source (https://askubuntu.com/a/1014428) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
https://stackoverflow.com/questions/14371376/how-do-you-make-many-files-public-in-google-cloud-storage |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
docker rmi $(docker images -f dangling=true -q) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
d = {'a':'Apple', 'b':'Banana','c':'Carrot'} | |
a,b,c = [d[k] for k in ('a', 'b','c')] | |
a == 'Apple' | |
b == 'Banana' | |
c == 'Carrot' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
watch --color -n 1 git diff --color |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<form action="" method="post"> | |
{% csrf_token %} | |
{{ form.as_ul }} | |
<button type="submit" name="form_1">Submit</button> | |
</form> | |
<form action="" method="post"> | |
{% csrf_token %} | |
{{ form.as_ul }} | |
<button type="submit" name="form_2">Submit</button> | |
</form> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from itertools import chain | |
list(chain.from_iterable((a, 1) for a in ['a', 'b', 'c']))[:-1] | |
Out: ['a', 1, 'b', 1, 'c'] |