Skip to content

Instantly share code, notes, and snippets.

View patrickelectric's full-sized avatar
🏡
Working from home

Patrick José Pereira patrickelectric

🏡
Working from home
View GitHub Profile
@kellpossible
kellpossible / capture_slides.sh
Last active March 20, 2024 01:05
Capture the output of https://github.com/maaslalani/slides and produce a beamer PDF presentation
#!/bin/bash
# Copyright 2023 Luke Frisken
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the “Software”), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
@joocer
joocer / color-gradient.js
Last active January 26, 2022 17:43 — forked from gskema/color-gradient.js
Generate gradient color from an arbitrary number of colors
function colorGradient(colors, fadeFraction) {
if (fadeFraction >= 1) {
return colors[colors.length - 1]
} else if (fadeFraction <= 0) {
return colors[0]
}
let fade = fadeFraction * (colors.length - 1);
let interval = Math.trunc(fade);
fade = fade - interval
@wasimosmanhome
wasimosmanhome / router_restart.py
Last active August 26, 2020 13:14
Router restart selenium script
from selenium import webdriver
import time
USERNAME = 'cusadmin'
PASSWORD = 'password'
driver = webdriver.Chrome()
driver.get('http://192.168.2.1/login.html#admin_devreboot/m/4/s/6')
#!/bin/sh -exu
dev=$1
cd $(mktemp -d)
function umountboot {
umount boot || true
umount root || true
}
# RPi1/Zero (armv6h):
@Williangalvani
Williangalvani / findPing360.py
Last active October 2, 2019 23:11
script to find
#!/usr/bin/env python3
"""
Scan with ./findPing360.py [current IP of the interface to scan]
"""
import socket
import time
import argparse
parser = argparse.ArgumentParser(description='Process some integers.')
@petetnt
petetnt / stale.md
Last active April 23, 2019 15:21
On the issue of staleness

On the issue of staleness

@sindresorhus posted this tweet today about a thing I remember writing about beforehand too (or at least have thought about it a lot): staleness

Controversial opinion: Stale issues in open source projects are fine. Auto-closing issues based on staleness is an annoyance to users and can drive potential contributors away. There must be a better way of handling issue overload.

@sindresorhus (https://twitter.com/sindresorhus/status/1082145283285250048)

Here's a couple of short thoughts I have on the issue of staleness after maintaining things like brackets and our own projects for years.

@fgsahoward
fgsahoward / Dockerfile
Created June 1, 2018 13:43
Qt WebAsm Arch Linux Dockerfile
FROM base/archlinux:latest AS base
RUN pacman -Sy --noconfirm binutils perl python libxcb clang emscripten git make cmake qbs
ENV PATH="/usr/lib/emscripten:${PATH}"
FROM base AS repos-configured
COPY ./configure-qt5-repos.sh ./
RUN ./configure-qt5-repos.sh
FROM repos-configured AS repos-built
@monabf
monabf / bluerov2_ardusub_sitl_tutorial.txt
Last active January 26, 2024 11:12
Tutorial on how to set up Gazebo simulations of the BlueROV2 (model provided by BlueElectrics), using SITL and ArduSub, and a package provided by kdkalvik for use with mavros.
This folder provides simulation of the BlueROV2 using Gazebo for the dynamics and ArduPilot SITL for the communication and ground control.
Source: https://gist.github.com/patrickelectric/60a1d300e0afadf85066cc5d8e3d51ff
http://discuss.bluerobotics.com/t/ardusub-simulation-sitl/481/30
-------------------------------------------------------------------------------------------------------------------------
@larsch
larsch / install-arch-linux-rpi-zero-w.sh
Created July 6, 2017 06:05
Install Arch Linux ARM for Raspberry Pi Zero W on SD Card (with commands to configure WiFi before first boot).
#!/bin/sh -exu
dev=$1
cd $(mktemp -d)
function umountboot {
umount boot || true
umount root || true
}
# RPi1/Zero (armv6h):