Skip to content

Instantly share code, notes, and snippets.

View tobozo's full-sized avatar

tobozo tobozo

View GitHub Profile
@OrionReed
OrionReed / dom3d.js
Last active May 7, 2024 08:58
3D DOM viewer, copy-paste this into your console to visualise the DOM topographically.
// 3D Dom viewer, copy-paste this into your console to visualise the DOM as a stack of solid blocks.
// You can also minify and save it as a bookmarklet (https://www.freecodecamp.org/news/what-are-bookmarklets/)
(() => {
const SHOW_SIDES = false; // color sides of DOM nodes?
const COLOR_SURFACE = true; // color tops of DOM nodes?
const COLOR_RANDOM = false; // randomise color?
const COLOR_HUE = 190; // hue in HSL (https://hslpicker.com)
const MAX_ROTATION = 180; // set to 360 to rotate all the way round
const THICKNESS = 20; // thickness of layers
const DISTANCE = 10000; // ¯\\_(ツ)_/¯
@v3l0c1r4pt0r
v3l0c1r4pt0r / txt2pcap.py
Created August 1, 2022 17:08
Convert DSView TXT dump of USB packet fields into valid PCAP file
#!/usr/bin/env python3
# convert DSView TXT dump of USB packet fields into valid PCAP file
import re
import sys
import struct
import os
from enum import IntEnum
class PCAP_Header():
@lovyan03
lovyan03 / M5Stack_ButtonCommand.ino
Last active June 13, 2022 04:43
M5Stack/M5StickCでボタンの短押し・長押し・二回押し・同時押し・コマンド入力などの状態取得するサンプル
#if defined( ARDUINO_M5Stack_Core_ESP32 ) || defined( ARDUINO_M5STACK_FIRE ) // M5Stack
#include <M5Stack.h>
#elif defined( ARDUINO_M5Stick_C ) // M5Stick C
#include <M5StickC.h>
#endif
/*
FSWebServer - Example WebServer with SPIFFS backend for esp8266
Copyright (c) 2015 Hristo Gochkov. All rights reserved.
This file is part of the ESP8266WebServer library for Arduino environment.
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
@IanColdwater
IanColdwater / twittermute.txt
Last active April 22, 2024 17:26
Here are some terms to mute on Twitter to clean your timeline up a bit.
Mute these words in your settings here: https://twitter.com/settings/muted_keywords
ActivityTweet
generic_activity_highlights
generic_activity_momentsbreaking
RankedOrganicTweet
suggest_activity
suggest_activity_feed
suggest_activity_highlights
suggest_activity_tweet
@captnlarzuk
captnlarzuk / createCosCArray.sh
Created December 31, 2019 18:53
Bash script which generates C code array of unsigned trigonometry
#!/bin/bash
# This script generates a C code wchich creates
# an unsigned int array of pre calculated cos/sin...
# It's crappy, but you can tweak it.
export LC_NUMERIC="en_US.UTF-8" # use . instead of ,
# Increments between 0 ans 2pi
RESOLUTION=0.01
# Max value
MAX=1024
@lhorie
lhorie / longest-keyword-sequence.md
Last active November 14, 2022 23:21
What's the longest keyword sequence in Javascript?
@gojimmypi
gojimmypi / TinyFPGA_WSL_Toolchain.sh
Last active March 25, 2019 12:06
TinyFPGA Verilog icestorm toolchain installer
#!/bin/bash
WORKSPACE=~/workspace
export TinyFPGA_COM=/dev/ttyS8
sudo ls # pause if copy/paste password prompt
# This WSL Ubuntu bash script will update the system, fetch all dependencies, and git clone
# all of the libraries for creating a picosoc RISC-V on the TinyFPGA with riscv-gnu-toolchain-rv32i toolchain,
# including icestorm, nextpnr (or arachne-pnr), yosys
#
@dominictarr
dominictarr / readme.md
Created November 26, 2018 22:39
statement on event-stream compromise

Hey everyone - this is not just a one off thing, there are likely to be many other modules in your dependency trees that are now a burden to their authors. I didn't create this code for altruistic motivations, I created it for fun. I was learning, and learning is fun. I gave it away because it was easy to do so, and because sharing helps learning too. I think most of the small modules on npm were created for reasons like this. However, that was a long time ago. I've since moved on from this module and moved on from that thing too and in the process of moving on from that as well. I've written way better modules than this, the internet just hasn't fully caught up.

@broros

otherwise why would he hand over a popular package to a stranger?

If it's not fun anymore, you get literally nothing from maintaining a popular package.

One time, I was working as a dishwasher in a restu

@cnlohr
cnlohr / esp32_aes_example.c
Created November 7, 2018 19:50
Example of using hardware AES 256 Crypto in CBC mode on the ESP32 using ESP-IDF
#include <string.h>
#include <stdio.h>
#include <hwcrypto/aes.h>
/*
For Encryption time: 1802.40us (9.09 MB/s) at 16kB blocks.
*/
static inline int32_t _getCycleCount(void) {
int32_t ccount;