A tiny (265 byte) utility to create state machine components using two pure functions.
The API is a single function that accepts 2 pure functions as arguments:
A tiny (265 byte) utility to create state machine components using two pure functions.
The API is a single function that accepts 2 pure functions as arguments:
| def mimimi(frase): | |
| """ | |
| Função que mimimiza frases | |
| >>> mimimi('Por que você não tá estudando pra sua prova de amanhã?') | |
| 'Pir qii vici nii ti istidindi pri sii privi di iminhi?' | |
| """ | |
| n = ('ã', 'a', 'e', 'o', 'u', 'á', 'é', 'ê', 'í', 'ó') | |
| for letra in n: | |
| frase = frase.replace(letra, 'i') | |
| return frase |
| { | |
| "AWSEBDockerrunVersion": "1", | |
| "Image": { | |
| "Name": "<AWS_ACCOUNT_ID>.dkr.ecr.us-east-1.amazonaws.com/<NAME>:<TAG>", | |
| "Update": "true" | |
| }, | |
| "Ports": [ | |
| { | |
| "ContainerPort": "443" | |
| } |
| # DEPENDENCIES | |
| # LINUX INSTALLS! | |
| # apt-get install transmission firefox python-dev python-pip | |
| # PYTHON LIBS NEED IT! | |
| # pip install requests beautifulsoup4 transmissionrpc pyopenssl ndg-httpsclient pyasn1 selenium | |
| import requests as req | |
| import transmissionrpc |
| # fshow - git commit browser (enter for show, ctrl-d for diff, ` toggles sort) | |
| fshow() { | |
| local out shas sha q k | |
| while out=$( | |
| git log --graph --color=always \ | |
| --format="%C(auto)%h%d %s %C(black)%C(bold)%cr" "$@" | | |
| fzf --ansi --multi --no-sort --reverse --query="$q" \ | |
| --print-query --expect=ctrl-d --toggle-sort=\`); do | |
| q=$(head -1 <<< "$out") | |
| k=$(head -2 <<< "$out" | tail -1) |
| #!/bin/bash | |
| # Delay before starting | |
| DELAY=5 | |
| # Sound notification to let one know when recording is about to start (and ends) | |
| beep() { | |
| paplay /usr/share/sounds/ubuntu/stereo/message-new-instant.ogg & | |
| } |
| """ | |
| Model of a Zombie outbreak in France, starting in Grenoble | |
| This is a rewrite from this blog post by Max Berrgren: | |
| http://maxberggren.github.io/2014/11/27/model-of-a-zombie-outbreak/ | |
| with a different country, a slightly different model, and different | |
| libraries. The map of population density is taken from Wikimedia Commons |
| sudo su | |
| echo "deb http://downloads.hipchat.com/linux/apt stable main" > \ /etc/apt/sources.list.d/atlassian-hipchat.list | |
| wget -O - https://www.hipchat.com/keys/hipchat-linux.key | apt-key add - | |
| apt-get update | |
| apt-get install hipchat |
| # chown root:root /tmp | |
| # chmod 1777 /tmp | |
| to fix | |
| 2014-07-01T11:34:16.802+0800 ***** SERVER RESTARTED ***** | |
| 2014-07-01T11:34:16.814+0800 [initandlisten] MongoDB starting : pid=27528 port=27017 dbpath=/diskZ/mongodb/data/db 64-bit host=95ad9659-ada0-40df-ade9-af531e81e9e4 | |
| 2014-07-01T11:34:16.814+0800 [initandlisten] db version v2.6.3 | |
| 2014-07-01T11:34:16.814+0800 [initandlisten] git version: 255f67a66f9603c59380b2a389e386910bbb52cb | |
| 2014-07-01T11:34:16.814+0800 [initandlisten] build info: Linux build12.nj1.10gen.cc 2.6.32-431.3.1.el6.x86_64 #1 SMP Fri Jan 3 21:39:27 UTC 2014 x86_64 BOOST_LIB_VERSION=1_49 |