Skip to content

Instantly share code, notes, and snippets.

rogersguedes /
Created November 18, 2021 12:28 — forked from JamesMGreene/
A comparison of using `git flow` commands versus raw `git` commands.


gitflow git
git flow init git init
  git commit --allow-empty -m "Initial commit"
  git checkout -b develop master

Connect to the remote repository

rogersguedes / CMakeLists.txt
Created October 16, 2021 20:05 — forked from squeek502/CMakeLists.txt
Lua 5.1.x Windows CMake build script
View CMakeLists.txt
project ( lua C )
cmake_minimum_required ( VERSION 2.8 )
include_directories ( src ${CMAKE_CURRENT_BINARY_DIR} )
set ( SRC_CORE src/lapi.c src/lcode.c src/ldebug.c src/ldo.c src/ldump.c src/lfunc.c src/lgc.c src/llex.c
src/lmem.c src/lobject.c src/lopcodes.c src/lparser.c src/lstate.c src/lstring.c src/ltable.c
src/ltm.c src/lundump.c src/lvm.c src/lzio.c )
set ( SRC_LIB src/lauxlib.c src/lbaselib.c src/ldblib.c src/liolib.c
src/lmathlib.c src/loslib.c src/lstrlib.c src/ltablib.c src/loadlib.c src/linit.c )
rogersguedes /
Created December 14, 2020 20:01
STM32 G.P. Timer Prescaler and Period Calc
#!/usr/bin/env python
#counts = (prescaler + 1)*(period + 1)
source ${HOME}/.bashrc_rogers
echo "Initial IP: ${LAST_IP}"
rogersguedes /
Created September 10, 2020 20:52 — forked from WiBla/
Add YouTube videos to without having to search them.

What is this?

It's a script (think of it as mod) for which will allow you to add YT (YouTube) videos to your playlists with one button.

Why is this necessary? is having some trouble with their YT API Key (the thing that allows you to make YT related actions throughout the site, like searching for a song and adding the results to your playlists). Using this script, you will be able to add YT videos to your playlists again, even while is dealing with YouTube's support to get this issue fixed.

How to use

rogersguedes /
Created August 12, 2020 13:20
check if each protobuf definition file contains only one definition and its name is same on file name.
find src/ -type f -name *.proto |
while read filePath; do
# do something with the file
fileName=`basename ${filePath}`
echo -n "### checking ${fileName}: "
foundDefs=`grep "message\s\+[a-zA-Z0-9\-\_]\+.*" ${filePath} | sed "s/\s*message\s\+\([a-zA-Z0-9\-\_]\+\).*/\1/"`
if [ -n "${foundDefs}" ]; then
rogersguedes /
Created June 22, 2020 00:14 — forked from spalladino/
Backup and restore a mysql database from a running Docker mysql container
# Backup
docker exec CONTAINER /usr/bin/mysqldump -u root --password=root DATABASE > backup.sql
# Restore
cat backup.sql | docker exec -i CONTAINER /usr/bin/mysql -u root --password=root DATABASE
View usbreset.c
/* usbreset -- send a USB port reset to a USB device */
* usage `./usbreset /dev/bus/usb/<bus-number>/<device-number>`
* use `lsusb` to get <bus-number> and <device-number>.
#include <stdio.h>
#include <unistd.h>
#include <fcntl.h>
#include <errno.h>
#include <sys/ioctl.h>
View ACS712-example.ino
float watt_average = 0;
float measuredvalue = 0;
float measuredvalue1 = 0;
float measuredvalue2 = 0;
float digstepV = 0.0080566; // IS MULTIPLIED BY 10
float voltage = 230; // the net voltage
int tel = 1;
char var;
float longaverage = 0;
rogersguedes /
Created May 7, 2020 20:50
sample script that shows how to use `inotifywait` result in a shell script.
# Thanks to
inotifywait -m . -e create -e moved_to |
while read dir action file; do
echo "The file '$file' appeared in directory '$dir' via '$action'"
# do something with the file