Skip to content

Instantly share code, notes, and snippets.

@MnifR
MnifR / docker-user-remap.sh
Last active November 2, 2022 22:48
docker’s userns-remap feature allows us to use a default dockremap user. In this scenario, docker engine creates the user dockremap on the host and maps the root user inside a container to this user. For this user, docker also needs to have entries on the host’s /etc/subuid and /etc/subgid files.
#!/bin/bash
###############################################################
# Docker userns-remap and system users on Linux
###############################################################
groupadd -g 500000 dockremap &&
groupadd -g 501000 dockremap-user &&
useradd -u 500000 -g dockremap -s /bin/false dockremap &&
@JoeyBurzynski
JoeyBurzynski / 55-bytes-of-css.md
Last active July 28, 2024 18:43
58 bytes of css to look great nearly everywhere

58 bytes of CSS to look great nearly everywhere

When making this website, i wanted a simple, reasonable way to make it look good on most displays. Not counting any minimization techniques, the following 58 bytes worked well for me:

main {
  max-width: 38rem;
  padding: 2rem;
  margin: auto;
}
@nathanpitman
nathanpitman / parse-hls-url.php
Created December 8, 2015 14:12
Used to parse Vimeo HLS URLs to negate issues with redirects and JW Player
/**
* Parse Vimeo M3U8 URLs to negate relative redirect issues with JW Player (See issue #1510)
*
* @return string
*/
public function parseHLSUrl($url)
{
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url); //set url
@debasishg
debasishg / gist:8172796
Last active July 5, 2024 11:53
A collection of links for streaming algorithms and data structures

General Background and Overview

  1. Probabilistic Data Structures for Web Analytics and Data Mining : A great overview of the space of probabilistic data structures and how they are used in approximation algorithm implementation.
  2. Models and Issues in Data Stream Systems
  3. Philippe Flajolet’s contribution to streaming algorithms : A presentation by Jérémie Lumbroso that visits some of the hostorical perspectives and how it all began with Flajolet
  4. Approximate Frequency Counts over Data Streams by Gurmeet Singh Manku & Rajeev Motwani : One of the early papers on the subject.
  5. [Methods for Finding Frequent Items in Data Streams](http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.187.9800&rep=rep1&t
@Zirak
Zirak / usage.md
Last active December 12, 2015 01:28
XTRACT ZE FILES!

xzf, XTRACT ZE FILES!, is a utility for file extraction, as you may have guessed. Inspired by xkcd and general boredom. Works on both python v2.7 and v3.3.

Usage:

$ python xzf.py file [extra_tar_flags]

Or, programatically: