Skip to content

Instantly share code, notes, and snippets.

View dchest's full-sized avatar
☮️

Dmitry Chestnykh dchest

☮️
View GitHub Profile
@Rich-Harris
Rich-Harris / README.md
Created November 24, 2017 16:44
how svelte/store could work

Bear with me while I think aloud about this (please comment there, not here!). Goals:

  • Minimal boilerplate
  • Familiar API
  • Preserve Svelte's built-in optimisations
  • Support use cases like hot-reloading and custom devtools

Let's start with a single store that is external to the component tree. Our top-level <App> component connects to it:

@azet
azet / random_part.c
Created August 6, 2017 13:13
Splevin ARX
static void fast_mix(struct fast_pool *f)
{
__u32 a = f->pool[0], b = f->pool[1];
__u32 c = f->pool[2], d = f->pool[3];
a += b; c += d;
b = rol32(b, 6); d = rol32(d, 27);
d ^= a; b ^= c;
a += b; c += d;
@hadifarnoud
hadifarnoud / cloudflare.json
Last active April 30, 2017 10:01 — forked from fouad/cloudflare.json
Purge CloudFlare cache on deploy
{
"email": "me@email.com",
"zone": "CLOUDFLARE_ZONE",
"token": "CLOUDFLARE_TOKEN"
}
@kennwhite
kennwhite / https.go
Last active December 24, 2023 22:06
Simple https http/2 static web server with HSTS & CSP (A+ SSLLabs & securityheaders.io rating) in Go using LetsEncrypt acme autocert
package main
import (
"crypto/tls"
"golang.org/x/crypto/acme/autocert"
"log"
"net"
"net/http"
)

Nvidia GTX 1080 Ti Hashcat Benchmarks

Software: Hashcat v3.40-49-g20057d8, Nvidia driver 378.13

Accelerator: 1x Nvidia GTX 1080 Ti FE

Highlights

  1. This card is clock-for-clock identical to the Titan X Pascal, so the numbers should not be new or surprising to anyone.
@tvlooy
tvlooy / errordocs.patch
Last active November 30, 2018 19:47
OpenBSD httpd errordocs patch
Index: httpd.conf.5
===================================================================
RCS file: /cvs/src/usr.sbin/httpd/httpd.conf.5,v
retrieving revision 1.76
diff -u -p -u -r1.76 httpd.conf.5
--- httpd.conf.5 14 Nov 2016 10:28:31 -0000 1.76
+++ httpd.conf.5 21 Nov 2016 19:12:34 -0000
@@ -128,6 +128,9 @@ If not specified, it defaults to
within the
.Xr chroot 2
@prash-wghats
prash-wghats / Readme_VSCODE_FreeBSD
Last active June 4, 2021 08:21
Notes for Building Electron and VSCode in FreeBSD11
Copy all the files to the build directory.
Copy icudtl.dat to the build directory. (you can find it in the vscode downloads ex for linux).
chromium version in port is 52.0.2743.116.
This was built with FreeBSD 11.0-RELEASE-p1. If building with other versions probably need to change
the freebsd versions in diff files (ex. freebsd11 => freebsd10)
Installed
node => v6.9.1
npm => 3.9.2
>chmod 755 vscode_build.sh
@sultanqasim
sultanqasim / zram.sh
Created June 21, 2016 02:41
ZRAM config for Raspberry Pi 3
#!/bin/bash
# Raspberry Pi ZRAM script
# Tuned for quad core, 1 GB RAM models
# put me in /etc/init.d/zram.sh and make me executable
# then run "sudo update-rc.d zram.sh defaults"
modprobe zram
echo 3 >/sys/devices/virtual/block/zram0/max_comp_streams
echo lz4 >/sys/devices/virtual/block/zram0/comp_algorithm
@totoCZ
totoCZ / setcap.sh
Created May 17, 2016 20:14
setcap 'cap_net_bind_service=+ep' for FreeBSD
# ref.
# https://www.freebsd.org/cgi/man.cgi?query=mac_portacl&sektion=4
# https://www.freebsd.org/doc/handbook/mac-policies.html
# load the kernel module
kldload mac_portacl
# set the new security rules
sysctl security.mac.portacl.rules=uid:80:tcp:80,uid:80:tcp:443
@rgrove
rgrove / README.md
Created February 8, 2016 19:01
Cake's approach to React Router server rendering w/code splitting and Redux

Can't share the complete code because the app's closed source and still in stealth mode, but here's how I'm using React Router and Redux in a large app with server rendering and code splitting on routes.

Server

  1. Wildcard Express route configures a Redux store for each request and makes an addReducers() callback available to the getComponents() method of each React Router route. Each route is responsible for adding any Redux reducers it needs when it's loaded. (This isn't really necessary on the