Skip to content

Instantly share code, notes, and snippets.

@uhop
uhop / nginx-webp-sample.conf
Last active May 25, 2024 17:02
Serving WEBP with nginx conditionally.
user www-data;
http {
##
# Basic Settings
##
sendfile on;
tcp_nopush on;
@uhop
uhop / static-server.mjs
Last active May 11, 2024 01:05
No-dependency ES6 drop-in modular static development HTTP server.
// https://gist.github.com/uhop/fbb7fc3606cbb2fa54e0ce4f9a200037
// License: BSD-3
// (c) 2023 Eugene Lazutkin
import http from 'node:http';
import fs from 'node:fs';
import path from 'node:path';
const fsp = fs.promises;
@uhop
uhop / LC_COLORS.md
Created March 23, 2024 05:28 — forked from thomd/LC_COLORS.md
LSCOLORS & LS_COLORS

alternatively use: http://geoff.greer.fm/lscolors/

LSCOLORS

The value of this variable describes what color to use for which attribute when colors are enabled with CLICOLOR. This string is a concatenation of pairs of the format fb, where f is the foreground color and b is the background color.

The color designators are as follows:

a black

@uhop
uhop / 0.README.md
Created March 22, 2024 18:22 — forked from izabera/0.README.md
tput codes

This is the table from man 5 terminfo.

Do NOT hardcode terminal escape sequences. Use tput with the cap-names from the table below to get the right code for your terminal.

(P) indicates that padding may be specified
@uhop
uhop / .bash_aliases
Created July 3, 2016 20:19
My bash setup
# commands from http://www.askapache.com/linux/bash_profile-functions-advanced-shell.html
#alias chmod='command chmod -c'
alias cpr='command cp -rpv'
alias df='command df -kh'
alias df1='command df -ia'
alias diff='diff -up'
alias dsiz='du -sk * | sort -n --'
alias du='command du -kh'
alias du1='echo *|tr " " "n" |xargs -iFF command du -hs FF|sort'
@uhop
uhop / Evolution of a Python programmer.py
Created November 21, 2010 20:13
Evolution of a Python programmer
#Newbie programmer
def factorial(x):
if x == 0:
return 1
else:
return x * factorial(x - 1)
print factorial(6)
#First year programmer, studied Pascal
@uhop
uhop / gist:3259255
Created August 4, 2012 18:41
Bezier Shaders & Vector openGL rendering
@uhop
uhop / ANSI.md
Created July 3, 2023 19:01 — forked from fnky/ANSI.md
ANSI Escape Codes

ANSI Escape Sequences

Standard escape codes are prefixed with Escape:

  • Ctrl-Key: ^[
  • Octal: \033
  • Unicode: \u001b
  • Hexadecimal: \x1B
  • Decimal: 27
@uhop
uhop / README
Created May 29, 2023 06:35 — forked from radfish/README
Route only Transmission through a VPN connection using your own VPN server
# The approach is to mark packets from a specific user,
# create a dedicated routing table with a default route
# through the VPN, and force all marked packets to be
# routed using that table.
#
# Sources:
# https://www.niftiestsoftware.com/2011/08/28/making-all-network-traffic-for-a-linux-user-use-a-specific-network-interface/
# http://freeaqingme.tweakblogs.net/blog/9340/netflix-using-a-vpn-for-just-one-application.html
# In this guide
// Copied from https://github.com/heya/dom under BSD-3 and slightly modified.
// create.js
// Dojo-inspired set of DOM utilities
export const namespaces = {
svg: 'http://www.w3.org/2000/svg',
xlink: 'http://www.w3.org/1999/xlink',
ev: 'http://www.w3.org/2001/xml-events',
xml: 'http://www.w3.org/XML/1998/namespace'