Skip to content

Instantly share code, notes, and snippets.

View pipex's full-sized avatar
🏠
Working from home

Felipe Lalanne pipex

🏠
Working from home
View GitHub Profile
@font-face {
font-family: "Source Code Pro";
font-style: normal;
font-weight: normal;
src: url(https://github.com/ryanoasis/nerd-fonts/blob/master/patched-fonts/SourceCodePro/SauceCodeProNerdFont-Regular.ttf?raw=true);
}
@font-face {
font-family: "Source Code Pro";
font-weight: bold;
src: url(https://github.com/ryanoasis/nerd-fonts/blob/master/patched-fonts/SourceCodePro/SauceCodeProNerdFontMono-Bold.ttf?raw=true);
@pipex
pipex / release-invalidate.sh
Last active August 2, 2021 19:12
Invalidate a release on balenaCloud
#!/bin/bash -e
if [[ $# -lt 1 ]]; then
echo "USAGE:"
echo " $0 COMMIT [INVALIDATE default true]"
exit 1;
fi
COMMIT=$1
BALENARC_BALENA_URL=${BALENARC_BALENA_URL:-"balena-cloud.com"}
@pipex
pipex / Dockerfile
Last active April 17, 2021 00:14
Container Stresser
FROM balenalib/amd64-debian:buster
RUN apt-get update && apt-get install -y stress
CMD /usr/bin/stress -c 4 -t 120
@pipex
pipex / machine.js
Last active September 1, 2020 19:45
Generated by XState Viz: https://xstate.js.org/viz
const ponger = Machine({
id: 'ponger',
initial: 'ready',
context: {
pongs: 0,
},
states: {
ready: {
on: {
PING: {
@pipex
pipex / machine.js
Last active June 19, 2020 17:15
Generated by XState Viz: https://xstate.js.org/viz
const pong = Machine({
id: 'pong',
initial: 'started',
states: {
started: {
on: {
ping: { actions: sendParent('pong', { delay: 1000}) },
},
},
},
@pipex
pipex / machine.js
Created June 5, 2020 15:31
Generated by XState Viz: https://xstate.js.org/viz
// Function that returns a promise
// This promise might resolve with, e.g.,
// { name: 'David', location: 'Florida' }
const doApiAction = deviceId =>
fetch(`url/to/device/${deviceId}`).then(response => response.json());
const machine = Machine({
id: 'device',
initial: 'current',
context: {
@pipex
pipex / wsgichunked.py
Last active September 19, 2021 18:08
Support Chunked Transfer Encoding in Flask
from flask import Flask
MAX_CONTENT_LENGTH = 16 * 1024 * 1024
app = Flask(__name__)
app.config['MAX_CONTENT_LENGTH'] = MAX_CONTENT_LENGTH
class WSGITransferEncodingChunked:
"""Support HTTP Transfer-Encoding: chunked transfers"""
def __init__(self, app):
@pipex
pipex / bottlepy-server.py
Created August 20, 2013 00:46
Basic server for static files with bottlepy
import bottle
from bottle import Bottle, static_file
app = Bottle()
@app.route('')
@app.route('/')
def index():
return static_file('index.html', root='web')
@pipex
pipex / clean-mendeley-bibtex
Created February 21, 2013 10:35
SED command to clean Mendeley output of URLs and '&'
sed -e '/^\s*\(file\|url\)\s*=\s*.*$/d' -e 's/\([^\\]\)\&/\1\\\&/g'
@pipex
pipex / sig-alternate-conference.sublime-snippet
Created February 5, 2013 00:00
Sublime Text 2 snippet for ACM (sig-alternate) conferences with my personal configuration preferences
<snippet>
<content><![CDATA[
% Don't forget to include sig-alternate.cls
\documentclass{sig-alternate}
\pdfpagewidth=8.5truein
\pdfpageheight=11truein
% AMS Packages
\usepackage{amsmath}
\usepackage{amsfonts}