Skip to content

Instantly share code, notes, and snippets.

@marabesi
marabesi / withRouter.tsx
Created November 26, 2021 22:31 — forked from sibelius/withRouter.tsx
withRouter for react-router-dom v6
import { useNavigate } from 'react-router-dom';
export const withRouter = Component => {
const Wrapper = (props) => {
const history = useNavigate();
return (
<Component
history={history}
{...props}
@marabesi
marabesi / curl_post_json.md
Created July 17, 2020 20:47 — forked from ungoldman/curl_post_json.md
post a JSON file with curl

How do you POST a JSON file with curl??

You can post a json file with curl like so:

curl -X POST -H "Content-Type: application/json" -d @FILENAME DESTINATION

so for example:

@marabesi
marabesi / References
Created April 15, 2020 08:27 — forked from jpcaparas/References
Limit docker CPU and memory resource usage
Inspired by: https://stackoverflow.com/questions/46408673/docker-17-06-ce-default-container-memory-limit-on-shared-host-resources/46557336#46557336
@marabesi
marabesi / gist:e341caf8c263104ec471972ee23a8f70
Created October 20, 2018 21:04 — forked from danielestevez/gist:2044589
GIT Commit to an existing Tag
1) Create a branch with the tag
git branch {tagname}-branch {tagname}
git checkout {tagname}-branch
2) Include the fix manually if it's just a change ....
git add .
git ci -m "Fix included"
or cherry-pick the commit, whatever is easier
git cherry-pick {num_commit}
/**
* http://tutorial45.com/mpu6050-arduino-project/
*/
#include <Wire.h>
#include <MPU6050.h>
MPU6050 mpu;
void setup()
{
@marabesi
marabesi / stopwords.txt
Last active March 16, 2018 00:44 — forked from alopes/stopwords.txt
Portuguese stop words
de,a,o,que,e,do,da,em,um,para,é,com,não,uma,os,no,se,na,por,mais,as,dos,como,mas,foi,ao,ele,das,tem,à,seu,sua,o,u,ser,quando,muito,há,nos,já,está,eu,também,só,pelo,pela,até,isso,ela,entre,era,depois,sem,mesmo,aos,ter,seus,quem,nas,me,esse,eles,estão,você,tinha,foram,essa,num,nem,suas,meu,às,minha,têm,numa,pelos,elas,havia,seja,qual,será,nós,tenho,lhe,deles,essas,esses,pelas,este,fosse,dele,tu,te,vocês,vos,lhes,meus,minhas,teu,tua,teus,tuas,nosso,nossa,nossos,nossas,dela,delas,esta,estes,estas,aquele,aquela,aqueles,aquelas,isto,aquilo,estou,está,estamos,estão,estive,esteve,estivemos,estiveram,estava,estávamos,estavam,estivera,estivéramos,esteja,estejamos,estejam,estivesse,estivéssemos,estivessem,estiver,estivermos,estiverem,hei,há,havemos,hão,houve,houvemos,houveram,houvera,houvéramos,haja,hajamos,hajam,houvesse,houvéssemos,houvessem,houver,houvermos,houverem,houverei,houverá,houveremos,houverão,houveria,houveríamos,houveriam,sou,somos,são,era,éramos,eram,fui,foi,fomos,foram,fora,fôramos,seja,sejamos,sejam,fos
@marabesi
marabesi / tmux-cheatsheet.markdown
Created February 6, 2018 20:09 — forked from MohamedAlaa/tmux-cheatsheet.markdown
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
@marabesi
marabesi / gps_demo.py
Last active February 6, 2018 15:31 — forked from wolfg1969/README.md
python-gps sample codes
import os
from gps import *
from time import *
g = gps(mode=WATCH_ENABLE)
while 1:
os.system('clear')
g.poll()
if PACKET_SET:
g.stream()
@marabesi
marabesi / locale.sh
Created December 31, 2017 15:56
Fix raspberry pi PERL warning locale
#!/bin/bash
# The issue explained: http://daker.me/2014/10/how-to-fix-perl-warning-setting-locale-failed-in-raspbian.html
export LANGUAGE=en_US.UTF-8
export LANG=en_US.UTF-8
export LC_ALL=en_US.UTF-8
locale-gen en_US.UTF-8
dpkg-reconfigure locales
@marabesi
marabesi / Sizes.md
Created October 30, 2017 11:41 — forked from jperl/Sizes.md
Meteor App Icon and Launch Screen Size Guide

Icons

Name Size
iphone_2x 120x120
iphone_3x 180x180
ipad 76x76
ipad_2x 152x152
android_ldpi 36x36
android_mdpi 48x48