Skip to content

Instantly share code, notes, and snippets.

View surjikal's full-sized avatar
👁️‍🗨️

Nick Porter surjikal

👁️‍🗨️
  • CTO @ 42
  • Oakland
View GitHub Profile
@betafcc
betafcc / record.py
Last active September 14, 2024 22:54
Extensible typed records in python (pyright)
from __future__ import annotations
from dataclasses import dataclass
from typing import Any, ClassVar, Generic, Literal, NoReturn, Type, TypeAlias, TypeVar
from typing_extensions import LiteralString
K = TypeVar("K", bound=LiteralString)
V = TypeVar("V", covariant=True)
AnyPair: TypeAlias = tuple[LiteralString, Any]
@nico
nico / blocks.txt
Last active April 27, 2024 01:13
unicode blocks for terminal UI drawing; lots new in unicode 13
General Punctuation
U+201x ‐ ‒ – — ― ‖ ‗ ‘ ’ ‚ ‛ “ ” „ ‟
U+202x † ‡ • ‣ ․ ‥ … ‧
U+203x ‰ ‱ ′ ″ ‴ ‵ ‶ ‷ ‸ ‹ › ※ ‼ ‽ ‾ ‿
U+204x ⁀ ⁁ ⁂ ⁃ ⁄ ⁅ ⁆ ⁇ ⁈ ⁉ ⁊ ⁋ ⁌ ⁍ ⁎ ⁏
U+205x ⁐ ⁑ ⁒ ⁓ ⁔ ⁕ ⁖ ⁗ ⁘ ⁙ ⁚ ⁛ ⁜ ⁝ ⁞
Arrows
U+219x ← ↑ → ↓ ↔ ↕ ↖ ↗ ↘ ↙ ↚ ↛ ↜ ↝ ↞ ↟
U+21Ax ↠ ↡ ↢ ↣ ↤ ↥ ↦ ↧ ↨ ↩ ↪ ↫ ↬ ↭ ↮ ↯
#!/bin/bash
export MAKEFLAGS="-j 3"
set -e
VERSION="1.16.0"
LIBNICE_VERSION="0.1.16" # libnice (v>=0.1.14) needed for webrtcbin
LIBSRTP_VERSION="2.2.0" # libsrtp (v>=2.2.0) required for srtp plugin
WEBRTCAUDIO_VERSION="0.3.1" # webrtc-audio-processing required for webrtcdsp
[ -n "$1" ] && VERSION=$1
@joshmfrankel
joshmfrankel / .zshrc
Last active August 20, 2023 23:04
Oh-my-zsh + powerlevel9k + powerline fonts + awesome-terminal-fonts + syntax highlighting
# References
# OhMyZsh: https://github.com/robbyrussell/oh-my-zsh
# Powerlevel9k: https://github.com/bhilburn/powerlevel9k
# Powerline fonts: https://github.com/powerline/fonts
# Awesome Terminal Fonts: https://github.com/gabrielelana/awesome-terminal-fonts
# ZSH Syntax Highlighting: https://github.com/zsh-users/zsh-syntax-highlighting
#
# For more plugins search this repo: https://github.com/unixorn/awesome-zsh-plugins
# 256 color mode
/* require XLSX */
var XLSX = require('XLSX')
function datenum(v, date1904) {
if(date1904) v+=1462;
var epoch = Date.parse(v);
return (epoch - new Date(Date.UTC(1899, 11, 30))) / (24 * 60 * 60 * 1000);
}
function sheet_from_array_of_arrays(data, opts) {
@tomsaffell
tomsaffell / safari_upload_workaround.md
Last active December 31, 2015 12:27
Safari has an upload problem, we found a work around

#Safari Upload Issue

tldr: Safari on OSX has an issue that causes uploads to silently fail. We implemented a workaround in EvaporateJS.

###The Issue At videopixie we use EvaporateJS to upload a lot large files (20GB+) directly to AWS S3, and we do lots of logging to make sure it's all running smooth.

We started to see an increase in failed uploads. The logs revealed a few interesting things:

  1. The failures were occurring when the progress of an XMLHttpRequest (xhr) was silently stalling.
@tinabeans
tinabeans / template.html
Last active February 13, 2024 09:18
A super-barebones single-column responsive email template, assuming a max-width of 540px. Read about it on the Fog Creek blog.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Single-Column Responsive Email Template</title>
<style>
@media only screen and (min-device-width: 541px) {
.content {

Build your own private, encrypted, open-source Dropbox-esque sync folder

Prerequisites:

  • One or more clients running a UNIX-like OS. Examples are given for Ubuntu 12.04 LTS, although all software components are available for other platforms as well (e.g. OS X). YMMV
  • A cheap Ubuntu 12.04 VPS with storage. I recommend Backupsy, they offer 250GB storage for $5/month. Ask Google for coupon codes.

Software components used:

  • Unison for file synchronization
  • EncFS for folder encryption