Skip to content

Instantly share code, notes, and snippets.

@neilhwatson
neilhwatson / web-servers.md
Created October 31, 2016 20:14 — forked from willurd/web-servers.md
Big list of http static server one-liners

Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.

Discussion on reddit.

Python 2.x

$ python -m SimpleHTTPServer 8000
@bastman
bastman / docker-cleanup-resources.md
Created March 31, 2016 05:55
docker cleanup guide: containers, images, volumes, networks

Docker - How to cleanup (unused) resources

Once in a while, you may need to cleanup resources (containers, volumes, images, networks) ...

delete volumes

// see: https://github.com/chadoe/docker-cleanup-volumes

$ docker volume rm $(docker volume ls -qf dangling=true)

$ docker volume ls -qf dangling=true | xargs -r docker volume rm

@niklasvincent
niklasvincent / validate-cloudformation.sh
Last active October 3, 2018 12:43
Validate CloudFormation during build
#!/bin/bash
# Add this script to your cloudformation directory (we have ours in the project root).
# Then set up a build step in Team City that executes the custom script:
#
# [[ -f ./cloudformation/validate-cloudformation.sh ]] && ./cloudformation/validate-cloudformation.sh
#
# That way branches without the script will still build.
#
# Make sure your CI user has the following policy attached to it for AWS:
@ericelliott
ericelliott / eslint-configs.md
Last active January 20, 2017 08:36
ESLint configs

In search of Idiomatic ESLint

I'm in the process of creating a new web app boilerplate, and I need to give it a lint config. Kyle Simpson convinced me I should look at ESLint instead of JSHint, so now I have to figure out how to configure ESLint to my liking. My liking means as idiomatic as possible.

To that end, I will give an unnamed JavaScript related prize (of real value) to the person who can show me an .eslintrc that most closely matches the idiomatic style I recommend in Appendix A of "Programming JavaScript Applications" (O'Reilly).

Candidates

@staltz
staltz / introrx.md
Last active September 16, 2024 07:18
The introduction to Reactive Programming you've been missing
@henriquemoody
henriquemoody / sublime-text-2.sh
Last active May 22, 2024 16:09
Install Sublime Text on Fedora.
#!/usr/bin/env bash
# Usage: {script} [ OPTIONS ] TARGET VERSION
#
# TARGET Default target is "/usr/local".
# VERSION If not defined tries to get the build into the Sublime Text 2 website.
#
# OPTIONS
#
# -h, --help Displays this help message.
#
@hellerbarde
hellerbarde / latency.markdown
Created May 31, 2012 13:16 — forked from jboner/latency.txt
Latency numbers every programmer should know

Latency numbers every programmer should know

L1 cache reference ......................... 0.5 ns
Branch mispredict ............................ 5 ns
L2 cache reference ........................... 7 ns
Mutex lock/unlock ........................... 25 ns
Main memory reference ...................... 100 ns             
Compress 1K bytes with Zippy ............. 3,000 ns  =   3 µs
Send 2K bytes over 1 Gbps network ....... 20,000 ns  =  20 µs
SSD random read ........................ 150,000 ns  = 150 µs

Read 1 MB sequentially from memory ..... 250,000 ns = 250 µs