Skip to content

Instantly share code, notes, and snippets.

@finevine
finevine / regexCheatsheet.js
Created December 6, 2019 19:54 — forked from sarthology/regexCheatsheet.js
A regex cheatsheet 👩🏻‍💻 (by Catherine)
let regex;
/* matching a specific string */
regex = /hello/; // looks for the string between the forward slashes (case-sensitive)... matches "hello", "hello123", "123hello123", "123hello"; doesn't match for "hell0", "Hello"
regex = /hello/i; // looks for the string between the forward slashes (case-insensitive)... matches "hello", "HelLo", "123HelLO"
regex = /hello/g; // looks for multiple occurrences of string between the forward slashes...
/* wildcards */
regex = /h.llo/; // the "." matches any one character other than a new line character... matches "hello", "hallo" but not "h\nllo"
regex = /h.*llo/; // the "*" matches any character(s) zero or more times... matches "hello", "heeeeeello", "hllo", "hwarwareallo"
@finevine
finevine / index.html
Created February 16, 2020 21:55
Typing speed test
<link href='https://fonts.googleapis.com/css?family=Cutive+Mono|Roboto:400,900,700' rel='stylesheet' type='text/css'/>
<p id="focus">Click this window to give it focus (Start typing with a capital S!)</p>
<h1 id="output"></h1>
<div class="target mono" id="target"></div>
<div id="your-attempt" class="mono your-attempt" placeholder="Your text will appear here"></div>
<p class="twitter">Tweet your highest words per minute @ us! <a href="https://twitter.com/EightArmsHQ" target="_blank">https://twitter.com/EightArmsHQ</a></p>
<div class="results">
<ul class="stats">
<li>Words per minute <span id="wpm">0</span></li>
<li>Wordcount <span id="wordcount">0</span></li>
#!/bin/sh
branch="$(git rev-parse --abbrev-ref HEAD)"
if [ "$branch" = "master" ]; then
echo "You can't commit directly to master branch"
exit 1
fi
# chmod +x .git/hooks/pre-commit
"""Compute with pike-pdf color."""
import os
from PIL import Image
from pikepdf import Pdf, PdfImage, Name
import zlib
# input_file_path = "108.pdf"
output_file_path = "_pike_pdf.pdf"
resize_factor = 0.5