Skip to content

Instantly share code, notes, and snippets.

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

Rodrigo Ratan rodrigoratan

🏠
Working from home
View GitHub Profile
@davidfowl
davidfowl / MinimalAPIs.md
Last active June 28, 2026 14:13
Minimal APIs at a glance
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@aryamanpuri
aryamanpuri / SpeechRecognition.js
Last active June 5, 2024 15:17
Speech Recognition using Web Speech API
import React, { Component } from "react"
//------------------------SPEECH RECOGNITION-----------------------------
const SpeechRecognition = SpeechRecognition || webkitSpeechRecognition
const recognition = new SpeechRecognition()
recognition.continous = true
recognition.interimResults = true
recognition.lang = 'en-US'
@carlashley
carlashley / recovery_boot.txt
Created February 6, 2020 00:00
macOS Recovery Boot Mode Commands
# Local
sudo /usr/sbin/nvram recovery-boot-mode=unused # Boot to local recovery partition.
# Internet
sudo /usr/sbin/nvram internet-recovery-mode=RecoveryModeNetwork # Internet Recovery (same as SHIFT+OPT+CMD+R)
sudo /usr/sbin/nvram internet-recovery-mode=RecoveryModeDisk # Local Recovery Partition (Same as CMD+R)
sudo /usr/sbin/nvram internet-recovery-mode=DiagsModeDisk # Local Hardware Diagnostics (Same as D)
sudo /usr/sbin/nvram internet-recovery-mode=DiagsModeNetwork # Internet Hardware Diagnostics (Same as OPT+D)
# Sourced from
@bandaangosta
bandaangosta / pzem_004t.py
Last active May 10, 2026 21:30
Reading PZEM-004t power sensor (new version v3.0) through Modbus-RTU protocol over TTL UART
# Reading PZEM-004t power sensor (new version v3.0) through Modbus-RTU protocol over TTL UART
# Run as:
# python3 pzem_004t.py
# To install dependencies:
# pip install modbus-tk
# pip install pyserial
import serial
import modbus_tk.defines as cst

Install dlib and face_recognition on a Raspberry Pi

Instructions tested with a Raspberry Pi 2 with an 8GB memory card. Probably also works fine on a Raspberry Pi 3.

Steps

Download the latest Raspbian Jessie Light image. Earlier versions of Raspbian won't work.

Write it to a memory card using Etcher, put the memory card in the RPi and boot it up.

@whatsmate
whatsmate / send-whatsapp-group.cs
Last active March 5, 2026 14:38
Sending a message to a WhatsApp group in C#
using System;
using System.Net;
using System.Web.Script.Serialization; // requires the reference 'System.Web.Extensions'
using System.IO;
using System.Text;
class WaMessageSender
{
// TODO: Replace the following with your gateway instance ID, Forever Green client ID and secret:
private static string INSTANCE_ID = "YOUR_INSTANCE_ID_HERE";
@JoanM
JoanM / BynderCurl.cs
Created December 9, 2016 14:55
Async Curl to Bynder
public async Task<string> DoCurlAsync()
{
using (var httpClient = new HttpClient())
using (var httpResonse = await httpClient.GetAsync("https://www.bynder.com"))
{
return await httpResonse.Content.ReadAsStringAsync();
}
}
@alfeugds
alfeugds / CurrencyConverter.cs
Last active July 13, 2023 06:01
Xamarin Forms Currency Mask for Entry fields
using System;
using System.Globalization;
using System.Text.RegularExpressions;
using Xamarin.Forms;
namespace MyProject.Util
{
/// <summary>
/// Converter for using in Entry fields for masked input of currency.
/// <para>The binded property must be of type decimal, and must invoke the PropertyChangedEventArgs event whenever the value is changed, so that the desired mask behavior is kept.</para>
@ech01
ech01 / DnnScheduleExample.cs
Last active September 13, 2021 18:41
DNN Scheduler Example
using System;
using System.Data;
using System.Data.Sql;
using System.Data.SqlClient;
using System.Configuration;
using DotNetNuke.Services.Mail;
using DotNetNuke.Entities.Portals;
using DotNetNuke.Common.Utilities;
using DotNetNuke.Entities.Portals;