Skip to content

Instantly share code, notes, and snippets.

@nebhead
nebhead / CustomUSBName.md
Last active May 5, 2024 22:29
Instructions for Adding Custom Naming for Arduino USB Device

The following is capturing instructions on how to add custom naming for an Arduino Leonardo (or generic pro-micro) for my Arcade Controller device. I wanted to have a simple record so that when I inevitably come back to this someday I can recall how I accomplished this. Reference was taken from the following YouTube video (https://youtu.be/hoCOq9Ngp44?t=1156) at approximately 19m16s.

WINDOWS Instructions:

Create a new set of folders: ~\Documents\Arduino\hardware\daemonbite\avr

Copy everything from C:\Program Files (x86)\Arduino\hardware\arduino\avr to this new folder.

@raspi
raspi / enable-all-advanced-power-settings.ps1
Last active May 5, 2024 22:24
Enable all advanced power settings in Windows.
# List all possible power config GUIDs in Windows
# Run: this-script.ps1 | Out-File powercfg.ps1
# Then edit and run powercfg.ps1
# (c) Pekka "raspi" Järvinen 2017
$powerSettingTable = Get-WmiObject -Namespace root\cimv2\power -Class Win32_PowerSetting
$powerSettingInSubgroubTable = Get-WmiObject -Namespace root\cimv2\power -Class Win32_PowerSettingInSubgroup
Get-WmiObject -Namespace root\cimv2\power -Class Win32_PowerSettingCapabilities | ForEach-Object {
$tmp = $_.ManagedElement
@josemamira
josemamira / cv_municipios.geojson
Last active May 5, 2024 22:23
Geojson de los municipios de la Comunidad Valenciana
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@un1tz3r0
un1tz3r0 / refusal_demo.ipynb
Last active May 5, 2024 22:22
refusal_demo.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@wojteklu
wojteklu / clean_code.md
Last active May 5, 2024 22:20
Summary of 'Clean code' by Robert C. Martin

Code is clean if it can be understood easily – by everyone on the team. Clean code can be read and enhanced by a developer other than its original author. With understandability comes readability, changeability, extensibility and maintainability.


General rules

  1. Follow standard conventions.
  2. Keep it simple stupid. Simpler is always better. Reduce complexity as much as possible.
  3. Boy scout rule. Leave the campground cleaner than you found it.
  4. Always find root cause. Always look for the root cause of a problem.

Design rules

@sparveencmu
sparveencmu / latency.txt
Created August 20, 2023 16:29 — forked from jboner/latency.txt
Latency Numbers Every Programmer Should Know
Latency Comparison Numbers (~2012)
----------------------------------
L1 cache reference 0.5 ns
Branch mispredict 5 ns
L2 cache reference 7 ns 14x L1 cache
Mutex lock/unlock 25 ns
Main memory reference 100 ns 20x L2 cache, 200x L1 cache
Compress 1K bytes with Zippy 3,000 ns 3 us
Send 1K bytes over 1 Gbps network 10,000 ns 10 us
Read 4K randomly from SSD* 150,000 ns 150 us ~1GB/sec SSD
@rvrsh3ll
rvrsh3ll / windows-keys.md
Created February 18, 2024 22:44
Windows Product Keys

NOTE

These are NOT product / license keys that are valid for Windows activation.
These keys only select the edition of Windows to install during setup, but they do not activate or license the installation.

Index

@bag-man
bag-man / cpu.js
Last active May 5, 2024 22:16
How to calculate the current CPU load with Node.js; without using any external modules or OS specific calls.
var os = require("os");
//Create function to get CPU information
function cpuAverage() {
//Initialise sum of idle and time of cores and fetch CPU info
var totalIdle = 0, totalTick = 0;
var cpus = os.cpus();
//Loop through CPU cores
@bgeneto
bgeneto / numpy-eigen-bench.md
Last active May 5, 2024 22:15
numpy eigen benchmark

Purpose

To benchmark Python (Numpy) default procedure to find all eigenvalues and eigenvectors of a complex (hermitian) matrix and compare the results with Fortran using either MKL and OpenBLAS libraries.

Python code

import time
import numpy as np