Skip to content

Instantly share code, notes, and snippets.

View popthestack's full-sized avatar
🍩
Eating Donuts

Ryan Martinsen popthestack

🍩
Eating Donuts
View GitHub Profile

Ten seconds to ponder if a thread is worth it

recording

A userstyle that makes you wait ten seconds before entering a Hacker News thread. I use stylus to manage mine.

.subtext {
  display: inline-block;
 background: linear-gradient(to left, transparent 50%, #f60 50%) right;
@pjmartorell
pjmartorell / vimeo_download_subtitles.md
Last active September 23, 2023 07:56
How to download subtitles/text tracks of a On Demand Vimeo video

Download subtitles/text tracks of an On-Demand Vimeo video

It works with on-demand videos that have the subtitles/captions included (CC symbol). You need to be registered in Vimeo in order to retrieve subtitles.

Steps

  1. Open Chrome Developer Tools
  2. Start playing the Vimeo video
  3. Look for any request named segment-XX.m4s (where XX is a number)
  4. Select the request and inspect the request payload, which is something in the form:

Introduction

Sometimes you may want to use a DNS server for specific domain requests and another DNS server for all other requests. This is helpful, for instance, when connected to a VPN. For hosts behind that VPN you want to use the VPN's DNS server but all other hosts you want to use Google's public DNS. This is called "DNS splitting."

Here, we run dnsmasq as a background service on macOS. The dnsmasq configuration described below implements DNS splitting.

Install

brew install dnsmasq
@vasanthk
vasanthk / System Design.md
Last active July 2, 2024 18:53
System Design Cheatsheet

System Design Cheatsheet

Picking the right architecture = Picking the right battles + Managing trade-offs

Basic Steps

  1. Clarify and agree on the scope of the system
  • User cases (description of sequences of events that, taken together, lead to a system doing something useful)
    • Who is going to use it?
    • How are they going to use it?
@bobthecow
bobthecow / reflection.php
Created October 29, 2014 17:37
PHP is the best at reflection.
<?php //\\ dɥd¿>
;namespace ǝɔɐdsǝɯɐu;
class ssɐlɔ
{ //\\ }
function uoıʇɔunɟ
( )
{ //\\ }
;echo oɥɔǝ;
@cliss
cliss / TackyLights.html
Created December 9, 2013 20:10
Tacky Lights Navigator. This small bit of HTML & Javascript takes a series of addresses, and converts that into an ordered list. Each item in the list is an Apple Maps navigation link from [Your Current Location] to [That House]. This file is designed to be hosted in Dropbox and then added to your home screen on your iPhone.
<html>
<head>
<title>Tacky Lights</title>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
<meta name="viewport" content="width=device-width" />
<!--<link rel="apple-touch-icon-precomposed" sizes="120x120" href="put-your-holiday-icon-here" />-->
</head>
<body>
<ol id="list"></ol>
<script type="text/javascript">
@lyrixx
lyrixx / post-checkout
Created June 26, 2013 13:37
Git post checkout
#!/bin/bash
# Put this file at: .git/hooks/post-checkout
# and make it executable
# You can install it system wide too, see http://stackoverflow.com/a/2293578/685587
PREV_COMMIT=$1
POST_COMMIT=$2
NOCOLOR='\e[0m'
@andreyvit
andreyvit / tmux.md
Created June 13, 2012 03:41
tmux cheatsheet

tmux cheat sheet

(C-x means ctrl+x, M-x means alt+x)

Prefix key

The default prefix is C-b. If you (or your muscle memory) prefer C-a, you need to add this to ~/.tmux.conf:

remap prefix to Control + a

@jboner
jboner / latency.txt
Last active July 2, 2024 06:27
Latency Numbers Every Programmer Should Know
Latency Comparison Numbers (~2012)
----------------------------------
L1 cache reference 0.5 ns
Branch mispredict 5 ns
L2 cache reference 7 ns 14x L1 cache
Mutex lock/unlock 25 ns
Main memory reference 100 ns 20x L2 cache, 200x L1 cache
Compress 1K bytes with Zippy 3,000 ns 3 us
Send 1K bytes over 1 Gbps network 10,000 ns 10 us
Read 4K randomly from SSD* 150,000 ns 150 us ~1GB/sec SSD