Skip to content

Instantly share code, notes, and snippets.

View rustoceans's full-sized avatar

Rust Oceans rustoceans

  • Milano - IT
View GitHub Profile
@developit
developit / *state-machine-component.md
Last active February 6, 2021 00:44
265b lib for building pure functional state machine components. https://github.com/developit/state-machine-component

state-machine-component

A tiny (265 byte) utility to create state machine components using two pure functions.

🔥 JSFiddle Demo

Usage

The API is a single function that accepts 2 pure functions as arguments:

@fbidu
fbidu / mimimi.py
Last active August 10, 2018 02:21
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
@yefim
yefim / Dockerrun.aws.json
Last active July 22, 2025 01:10
Build a Docker image, push it to AWS EC2 Container Registry, then deploy it to AWS Elastic Beanstalk
{
"AWSEBDockerrunVersion": "1",
"Image": {
"Name": "<AWS_ACCOUNT_ID>.dkr.ecr.us-east-1.amazonaws.com/<NAME>:<TAG>",
"Update": "true"
},
"Ports": [
{
"ContainerPort": "443"
}
@rdenadai
rdenadai / torrents.py
Last active August 10, 2022 20:39
A simple python script that downloads a deezer playlist and bam! download magnetic files from pirate bay or monova and put on transmission torrent client... keep in mind that you need transmission to run this, open it and configure the remote option in preferences!
# 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
@PurpleBooth
PurpleBooth / README-Template.md
Last active December 10, 2025 21:19
A template to make good README.md

Project Title

One Paragraph of project description goes here

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.

Prerequisites

@junegunn
junegunn / gist:f4fca918e937e6bf5bad
Last active November 7, 2025 07:33
Browsing git commit history with fzf
# 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 &
}
@Zulko
Zulko / zombie_france.py
Last active May 24, 2024 21:54
Zombie pandemic simulation in France
"""
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
@stephanetimmermans
stephanetimmermans / ubuntu-hipchat
Created July 3, 2014 09:29
Install hipChat on Ubuntu 14.04
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
@mingderwang
mingderwang / gist:8afd52230717b3fb5d7f
Created July 1, 2014 03:38
ERROR: listen(): bind() failed errno:13 Permission denied for socket: /tmp/mongodb-27017.sock
# 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