Skip to content

Instantly share code, notes, and snippets.

View anonyco's full-sized avatar
🐕
I really like dogs. They are so fun to play with, simple to care for, and cute.

jack anonyco

🐕
I really like dogs. They are so fun to play with, simple to care for, and cute.
  • United States
  • 04:11 (UTC -04:00)
View GitHub Profile
@wilsonpage
wilsonpage / storage.js
Created September 11, 2015 14:25
Simple localStorage like wrapper around indexeddb
function Storage(name) {
this.ready = new Promise((resolve, reject) => {
var request = window.indexedDB.open(location.origin);
request.onupgradeneeded = e => {
this.db = e.target.result;
this.db.createObjectStore('store');
};
request.onsuccess = e => {
@paulirish
paulirish / what-forces-layout.md
Last active August 28, 2025 15:03
What forces layout/reflow. The comprehensive list.

What forces layout / reflow

All of the below properties or methods, when requested/called in JavaScript, will trigger the browser to synchronously calculate the style and layout*. This is also called reflow or layout thrashing, and is common performance bottleneck.

Generally, all APIs that synchronously provide layout metrics will trigger forced reflow / layout. Read on for additional cases and details.

Element APIs

Getting box metrics
  • elem.offsetLeft, elem.offsetTop, elem.offsetWidth, elem.offsetHeight, elem.offsetParent
@yurydelendik
yurydelendik / !wasmllvm.md
Last active December 7, 2024 18:08
Using WebAssembly in LLVM

NOTE: the content is out-of-date. All development is moved to the https://github.com/yurydelendik/wasmception

Using WebAssembly in LLVM

Compiling

# locations, e.g.
export WORKDIR=~/llvmwasm; mkdir -p $WORKDIR
export INSTALLDIR=$WORKDIR
@Efreak
Efreak / Chrome Incognito Handler.reg
Last active June 9, 2021 03:54
Registers Google Chrome with windows (again) as a URL and filetype handler--but in incognito mode. If you choose 'Google Chrome Incognito' as a file/url handler, then your files/urls will open in incognito mode. You may wish to adjust the paths listed below if you don't have chrome installed in the standard location, or if you use dev or canary …
Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\ChromeIncognitoHTML]
@="Chrome Incognito HTML Document"
"AppUserModelId"="ChromeIncognito"
[HKEY_CLASSES_ROOT\ChromeIncognitoHTML\Application]
"AppUserModelId"="ChromeIncognito"
"ApplicationIcon"="C:\\Program Files (x86)\\Google\\Chrome\\Application\\chrome.exe,0"
"ApplicationName"="Google Chrome Incognito"
@Redchards
Redchards / Platform.hxx
Created November 28, 2015 08:23
Simple definition file to ease multi-platform compilation in C++
#ifndef PLATFORM
#define PLATFORM
#define GCC_COMPILER 1
#define MVSC_COMPILER 2
#define ICC_COMPILER 3
#define BORLAND_COMPILER 4
#define LINUX 1
#define WINDOWS 2
@JavaScript-Packer
JavaScript-Packer / lzw.jz
Created January 9, 2016 23:28
JavaScript LZW Compression (encode and decode functions). Lempel–Ziv–Welch (LZW) is a universal lossless data compression algorithm created by Abraham Lempel, Jacob Ziv, and Terry Welch. It was published by Welch in 1984 as an improved implementation of the LZ78 algorithm published by Lempel and Ziv in 1978. The algorithm is simple to implement,…
function en(c) {
var x = "charCodeAt", b, e = {}, f = c.split(""), d = [], a = f[0], g = 256;
for (b = 1; b < f.length; b++) c = f[b], null != e[a + c] ? a += c :(d.push(1 < a.length ? e[a] :a[x](0)),
e[a + c] = g, g++, a = c);
d.push(1 < a.length ? e[a] :a[x](0));
for (b = 0; b < d.length; b++) d[b] = String.fromCharCode(d[b]);
return d.join("");
}
function de(b) {
@tsaarni
tsaarni / openssl-notes.txt
Created October 22, 2016 08:50
Generate self-signed certs with different key types
*** RSA
# Generate self-signed certificate with RSA 4096 key-pair
openssl req -x509 -nodes -days 3650 -newkey rsa:4096 -keyout rsakey.pem -out rsacert.pem
# print private and public key
openssl rsa -in rsakey.pem -text -noout
# print certificate
openssl x509 -in rsacert.pem -text -noout
@FZX
FZX / Commands
Last active December 29, 2022 16:38
Terminal commands. Change Cinnamon theme from terminal. Disable cursor blink from terminal. Disabling recent files history from terminal. Setup proxy file with command.
gsettings set org.cinnamon.desktop.privacy remember-recent-files false
gsettings set org.cinnamon.theme name "Mint-Y-Dark"
gsettings set org.cinnamon.desktop.interface gtk-theme "Mint-Y-Dark"
gsettings set org.cinnamon.desktop.wm.preferences theme "Mint-Y-Dark"
gsettings set org.cinnamon.desktop.interface cursor-blink false
gsettings set org.gnome.system.proxy autoconfig-url "http://mediahint.com/default.pac"
gsettings set org.gnome.system.proxy mode auto
gsettings set org.cinnamon enabled-applets "['panel1:left:0:[email protected]:0', 'panel1:left:2:[email protected]:2', 'panel1:left:3:[email protected]:3', 'panel1:right:0:[email protected]:4', 'panel1:right:1:[email protected]:5', 'panel1:right:2:[email protected]:6', 'panel1:right:3:[email protected]:7', 'panel1:right:11:[email protected]:1', 'panel1:right:5:[email protected]:9', 'panel1:right:6:[email protected]:10', 'panel1:right:7:[email protected]:11', 'panel1:right:8:[email protected]:12', '
@fodra
fodra / javascript-encoding-types.md
Created November 15, 2017 23:45
This is a list of possible encoding type values for everything node/javascript.

Javascript encoding type values

The character encodings currently supported by Node.js include:

  • 'ascii' - For 7-bit ASCII data only. This encoding is fast and will strip the high bit if set.

  • 'utf8' - Multibyte encoded Unicode characters. Many web pages and other document formats use UTF-8.

  • 'utf16le' - 2 or 4 bytes, little-endian encoded Unicode characters. Surrogate pairs (U+10000 to U+10FFFF) are supported.

root@Socat-TLS-Client:~/tls13_new/socat-1.7.3.2# diff -uNp sslcls.c.orig sslcls.c
--- sslcls.c.orig 2018-03-17 10:47:30.239634794 -0400
+++ sslcls.c 2018-03-17 04:40:53.144981137 -0400
@@ -147,6 +147,26 @@ const SSL_METHOD *sycTLSv1_2_server_meth
}
#endif
+#if HAVE_TLSv1_3_client_method
+const SSL_METHOD *sycTLSv1_3_client_method(void) {
+ const SSL_METHOD *result;