Skip to content

Instantly share code, notes, and snippets.

@karlcow
karlcow / tracking.md
Last active August 29, 2015 14:06
Tracked by redirections from a simple tweet.

How tracking is working.

Let's start a first request.

→ http HEAD http://t.co/b6O9bSv5XO
@romainl
romainl / deprecation.md
Last active February 24, 2022 02:42
Idiomatic vimrc
@igrigorik
igrigorik / json-bq-schema-generator.rb
Last active November 3, 2022 17:34
BigQuery JSON schema generator
require 'open-uri'
require 'zlib'
require 'yajl'
# References
# - https://developers.google.com/bigquery/preparing-data-for-bigquery#dataformats
# - https://developers.google.com/bigquery/docs/data#nested
#
def type(t)
@rtt
rtt / gist:5a2e0cfa638c938cca59
Created August 14, 2014 09:46
example python tinderbot
# encoding: utf8 1,1 Top# encoding: utf8
import argparse
from datetime import datetime
import json
from random import randint
import requests
import sys
from time import sleep
@john2x
john2x / 00_destructuring.md
Last active May 5, 2025 14:54
Clojure Destructuring Tutorial and Cheat Sheet

Clojure Destructuring Tutorial and Cheat Sheet

(Related blog post)

Simply put, destructuring in Clojure is a way extract values from a datastructure and bind them to symbols, without having to explicitly traverse the datstructure. It allows for elegant and concise Clojure code.

Vectors and Sequences

@danioyuan
danioyuan / pre_render_d3_graph.js
Last active May 9, 2019 03:11
Render d3 force-directed graph on server side. Require Node.js, d3.js, and jsdom.
// Pre-render d3 force-directed graph at server side
// Call node pre_render_d3_graph.js to generate d3_graph.html
// Original idea and framework borrowed from https://gist.github.com/mef/7044786
var d3 = require('d3')
, jsdom = require('jsdom')
, fs = require('fs')
, htmlStub = '<html><head> \
<style>.node { stroke: #fff; fill: #ccc; stroke-width: 1.5px; } \
.link { stroke: #333; stroke-opacity: .5; stroke-width: 1.5px; }</style> \
@Zulko
Zulko / soccer_cuts.py
Last active December 30, 2024 11:15
A python script to automatically summarize soccer videos based on the crowd's reactions
#
# This Python script makes a summary of a football game by cutting
# the video around the 10 % loudest moments, which generally
# include the goals and other important events.
# For more details, see this blog post:
# http://zulko.github.io/blog/2014/07/04/automatic-soccer-highlights-compilations-with-python/
#
# LICENCE: Creative Commons 0 - Public Domain
# I, the author of this script, wave any rights and place this work in the public domain.
#
@mbostock
mbostock / .block
Last active April 22, 2025 01:59
Poisson-Disc II
license: gpl-3.0
@kyledrake
kyledrake / ferengi-plan.txt
Last active January 10, 2025 14:02
How to throttle the FCC to dial up modem speeds on your website using Nginx
# The blog post that started it all: https://neocities.org/blog/the-fcc-is-now-rate-limited
#
# Current known FCC address ranges:
# https://news.ycombinator.com/item?id=7716915
#
# Confirm/locate FCC IP ranges with this: http://whois.arin.net/rest/net/NET-165-135-0-0-1/pft
#
# In your nginx.conf:
location / {
@nicokosi
nicokosi / git-cheat-sheet.sh
Last active February 19, 2024 06:11
My own git cheat sheet
### BRANCHES
git checkout -b <branch name> # Create a branch
git branch -r # List remote branches
git checkout <branch name> # Switch to branch (deprecated)
git switch <branch name> # Switch to branch
git checkout <commit ID> # Locally retrieve an old revision
git fetch # retrieve remote changes (commits) without changing local repo ; can be used to fix sync issue
git branch -D branchName # delete local branch
git branch -m <newname> # rename current local branch
git push origin --delete <branchName> # delete remote branch