Skip to content

Instantly share code, notes, and snippets.

@cdolek
cdolek / SanFrancisco.Neighborhoods.json
Last active November 12, 2023 01:14
San Francisco Neighborhoods GeoJson with Zipcodes
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@cdolek
cdolek / gist:198adb54ca7885d481144dfe51eec028
Created August 15, 2022 22:57
Percentage to hex map for 8 digit hex color alpha values
100% — FF
99% — FC
98% — FA
97% — F7
96% — F5
95% — F2
94% — F0
93% — ED
92% — EB
91% — E8
@cdolek
cdolek / gist:b87af01c94dd49d780806d7f07e460a5
Created August 15, 2022 19:45
Monaco editor theme colors
{
"foreground": {
"type": "string",
"description": "Overall foreground color. This color is only used if not overridden by a component.",
"format": "color-hex",
"defaultSnippets": [
{
"body": "${1:#ff0000}"
}
]
{
"orange": {
"hex": "#E69F00",
"hue": 41,
"hsl": "hsl(41, 100%, 45%)"
},
"sky blue": {
"hex": "#56B4E9",
"hue": 202,
"hsl": "hsl(202, 77%, 63%)"
@cdolek
cdolek / Tiny JavaScript tokenizer.js
Created January 22, 2021 06:13 — forked from borgar/Tiny JavaScript tokenizer.js
A compact tokenizer written in JavaScript.
/*
* Tiny tokenizer
*
* - Accepts a subject string and an object of regular expressions for parsing
* - Returns an array of token objects
*
* tokenize('this is text.', { word:/\w+/, whitespace:/\s+/, punctuation:/[^\w\s]/ }, 'invalid');
* result => [{ token="this", type="word" },{ token=" ", type="whitespace" }, Object { token="is", type="word" }, ... ]
*
*/
@cdolek
cdolek / gist:372fc6421feffcd39860
Last active March 11, 2020 19:26
Utility for wordpress: Find missing attachment files, non writable upload directories and meta errors
<?php
/**
* Template Name: Attachment Fixing Utility
*/
?>
<html>
<head>
<title>Wordpress Attachments Fixing Utility</title>
<style>
@cdolek
cdolek / ddos
Created July 14, 2015 03:42
DDOS check
netstat -anp | grep 'tcp\|udp' | awk '{print $5}' | cut -d: -f1 | sort | uniq -c | sort -n
@cdolek
cdolek / example.com.conf
Last active November 15, 2019 00:25
nginx config example for memcached, php fpm and wordpress
http {
# memcached servers, generated according to wp-ffpc config
upstream memcached-servers {
server 127.0.0.1:11211;
}
# PHP-FPM upstream; change it accordingly to your local config!
upstream php-fpm {

Oh my zsh.

Install with curl

sh -c "$(curl -fsSL https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"

Enabling Plugins (zsh-autosuggestions & zsh-syntax-highlighting)

  • Download zsh-autosuggestions by