Skip to content

Instantly share code, notes, and snippets.

View andris9's full-sized avatar
🇪🇪

Andris Reinman andris9

🇪🇪
View GitHub Profile
@khanzadimahdi
khanzadimahdi / data-uri-regex-rfc2397.md
Last active February 22, 2024 08:51
regex pattern base64 data uri according to RFC 2397

pattern:

^data:((?:\w+\/(?:(?!;).)+)?)((?:;[\w\W]*?[^;])*),(.+)$

test this pattern on regexr: https://regexr.com/4inht

regex pattern to match RFC 2397 data URL

@antirais
antirais / screenshot.py
Created March 2, 2018 11:05
Selenium and Geckodriver browser screenshot
import threading
import traceback
import subprocess
import os
import datetime
from pyvirtualdisplay.smartdisplay import SmartDisplay
from selenium import webdriver
from PIL import Image, ImageDraw, ImageFont
@stared
stared / aspie_traits.md
Last active January 29, 2022 08:16
Interpersonal Traits of Aspies Placed in Context

Interpersonal Traits of Aspies Placed in Context

a chapter from A Mind-Body Look at the Concept of Asperger's Syndrome (pdf) by Michael Samsel, LMHC

A Hacker News discussion (2021) on this list

Uncommunicative Eye Contact

In humans, eye contact is the center of the attachment system. In Asperger's Syndrome there is either an avoidance of eye contact (most common) or an unvarying, relative unblinking, staring, constant eye contact (less common). Avoidant eye contact gives an impression of 'having something to hide', and also eliminates a big channel of communication and trust. Staring eye contact, because of its unchanging nature, is also uncommunicative, and is generally experienced as disturbing on the receiving end.

@yossorion
yossorion / what-i-wish-id-known-about-equity-before-joining-a-unicorn.md
Last active April 7, 2024 22:55
What I Wish I'd Known About Equity Before Joining A Unicorn

What I Wish I'd Known About Equity Before Joining A Unicorn

Disclaimer: This piece is written anonymously. The names of a few particular companies are mentioned, but as common examples only.

This is a short write-up on things that I wish I'd known and considered before joining a private company (aka startup, aka unicorn in some cases). I'm not trying to make the case that you should never join a private company, but the power imbalance between founder and employee is extreme, and that potential candidates would

@atoponce
atoponce / gist:07d8d4c833873be2f68c34f9afc5a78a
Last active March 19, 2024 17:24 — forked from tqbf/gist:be58d2d39690c3b366ad
Cryptographic Best Practices

Cryptographic Best Practices

Putting cryptographic primitives together is a lot like putting a jigsaw puzzle together, where all the pieces are cut exactly the same way, but there is only one correct solution. Thankfully, there are some projects out there that are working hard to make sure developers are getting it right.

The following advice comes from years of research from leading security researchers, developers, and cryptographers. This Gist was [forked from Thomas Ptacek's Gist][1] to be more readable. Additions have been added from

@novemberborn
novemberborn / setup.md
Created January 7, 2016 15:05
OS X Redirect ports 80 and 443 to 8080 and 8443 respectively

Changes with .dev domains in mind.

Create /etc/pf.anchors/dev, containing:

rdr pass inet proto tcp from any to any port 80 -> 127.0.0.1 port 8080
rdr pass inet proto tcp from any to any port 443 -> 127.0.0.1 port 8443

@peteroupc
peteroupc / utf7.js
Last active August 29, 2015 14:02
UTF-7 decoder in JavaScript
/*
Written by Peter O. in 2014.
Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/
If you like this, you should donate to Peter O.
at: http://upokecenter.com/d/
*/
var CodeUnitAppender = function() {
this.surrogate = -1;
this.lastByte = -1;
@mbadolato
mbadolato / WilsonConfidenceIntervalCalculator.php
Last active May 4, 2023 04:14
PHP translation of the Wilson ConfidenceInterval Calculator. Ported from Ruby and uses a hardcoded (pre-calculated) confidence (z value) instead of a dynamic calculation with a translation of Ruby's Statistics2.pnormaldist method. Since z doesn't change once it's computed, nor is the computation dependant on the passed-in values, calculating it …
<?php
/*
* (c) Mark Badolato <mbadolato@gmail.com>
*
* This content is released under the {@link http://www.opensource.org/licenses/MIT MIT License.}
*/
namespace Bado;
@jbenet
jbenet / simple-git-branching-model.md
Last active April 9, 2024 03:31
a simple git branching model

a simple git branching model (written in 2013)

This is a very simple git workflow. It (and variants) is in use by many people. I settled on it after using it very effectively at Athena. GitHub does something similar; Zach Holman mentioned it in this talk.

Update: Woah, thanks for all the attention. Didn't expect this simple rant to get popular.