Skip to content

Instantly share code, notes, and snippets.

View ZogStriP's full-sized avatar

Régis Hanol ZogStriP

View GitHub Profile
@ArhanChaudhary
ArhanChaudhary / _fastest_rubiks_operations
Last active August 14, 2025 14:07
Fastest Rubik's cube composition and inversion operations (see https://godbolt.org/z/eYevrErG7)
NOTE: all instruction counts ignore the initial and final SIMD register load instructions
AVX2 composition: 5 instructions, averaging 700M/sec on an Intel Xeon E5-2667 v3
AVX2 inversion: 26 instructions, averaging 175M/sec on an Intel Xeon E5-2667 v3
ARM64 composition: 19 instructions, averaging 870M/sec on an Apple M4
ARM64 inversion: 48 instructions, averaging 400M/sec on an Apple M4
@jes
jes / index.php
Created June 29, 2025 12:03
Max's Imagebin
<?php
/* ChangeLog:
21-08-2023:
- added password because someone uploaded a topless image
20-11-2020:
- make thumbnails 600px instead of 200px
- use imagemagick to do resizing instead of PHP GD
- change default host from img.jes.xxx to img.incoherency.co.uk
13-12-2018:
- host bootstrap locally instead of using maxcdn
@joeldrapper
joeldrapper / fuzzy_index.rb
Created March 27, 2025 11:20
Simple fuzzy index with left weight
class FuzzyIndex
def initialize
@index = Hash.new { |h, k| h[k] = Set.new }
end
def []=(key, value)
trigrams(key).each { @index[it] << [key, value] }
end
def [](query)
@dhh
dhh / linux-setup.sh
Last active July 31, 2025 19:20
linux-setup.sh
# THIS LINUX SETUP SCRIPT HAS MORPHED INTO A WHOLE PROJECT: HTTPS://OMAKUB.ORG
# PLEASE CHECKOUT THAT PROJECT INSTEAD OF THIS OUTDATED SETUP SCRIPT.
#
#
# Libraries and infrastructure
sudo apt update -y
sudo apt install -y \
docker.io docker-buildx \
build-essential pkg-config autoconf bison rustc cargo clang \
@afedotov
afedotov / gan-mac-faq.md
Last active April 30, 2025 13:49
GAN Smart Cubes MAC address FAQ

Q: What is the cube MAC address?
A: MAC is the Bluetooth device hardware address, each device instance has it unique. It has 48 bits and typically represented as 6 bytes written in hexadecimal and separated by colons or hyphens, for example AB:12:34:5D:34:12.

Q: Why MAC address is ever needed?
A: The GAN smart cube application-layer protocol encrypts all data using AES cypher. Encryption keys are unique for each cube instance, and generated based on cube's MAC address. So to decrypt any data sent by cube it is required for application to know cube MAC address.

Q: But I used another GAN cube with Cubeast, or different smartcubing software, and it does not ever ask me for the MAC address.
A: For some GAN smart cubes range used for MAC addresses was small enough, so Cubeast try to bruteforce address automatically. This can be done in reasonable amount of time. But this is not an option for newer cubes and MAC can't be guessed. Also some software like platform-native applications h

@afedotov
afedotov / gan-timer-protocol.md
Last active May 13, 2025 05:43
GAN Smart Timer bluetooth protocol

GAN Smart Timer bluetooth protocol

BLE service

Main service = 0000fff0-0000-1000-8000-00805f9b34fb
    Timer state characteristic (notify) = 0000fff5-0000-1000-8000-00805f9b34fb
    Stored time characteristic (read) = 0000fff2-0000-1000-8000-00805f9b34fb
@villeheilala
villeheilala / .muttrc
Last active July 1, 2024 14:07
Minimal configuration for Neomutt/Mutt and Gmail/G Suite
# A minimal configuration for Neomutt/Mutt and Gmail/G Suite
# For more information, see:
# https://heilala.medium.com/command-line-email-with-neomutt-and-gmail-d558864ac3c8?source=friends_link&sk=4dbd90b6b7aebca3bce8d94c9a053168
# Decrypts passwords quietly
# see: https://wiki.archlinux.org/index.php/Mutt#Passwords_management
source "gpg -dq $HOME/.my-pwds.gpg |"
# Username and password for your Gmail/G Suite account
set imap_user = "[email protected]"

Strings

String.prototype.*

None of the string methods modify this – they always return fresh strings.

  • charAt(pos: number): string ES1

    Returns the character at index pos, as a string (JavaScript does not have a datatype for characters). str[i] is equivalent to str.charAt(i) and more concise (caveat: may not work on old engines).

@WebReflection
WebReflection / hyper-nitty-gritty.js
Last active May 30, 2023 06:09
hyperHTML, the nitty gritty
// used to retrieve template content
const templates = new WeakMap;
// used to retrieve node updates
const updates = new WeakMap;
// hyperHTML, the nitty gritty
function hyperHTML(chunks, ...interpolations) {
// if the static chunks are unknown
@jessfraz
jessfraz / boxstarter.ps1
Last active June 23, 2025 13:25
Boxstarter Commands for a new Windows box.
# Description: Boxstarter Script
# Author: Jess Frazelle <[email protected]>
# Last Updated: 2017-09-11
#
# Install boxstarter:
# . { iwr -useb http://boxstarter.org/bootstrapper.ps1 } | iex; get-boxstarter -Force
#
# You might need to set: Set-ExecutionPolicy RemoteSigned
#
# Run this boxstarter by calling the following from an **elevated** command-prompt: