Skip to content

Instantly share code, notes, and snippets.

@chengfred
chengfred / S3-Static-Sites.md
Created March 29, 2018 17:39 — forked from bradwestfall/S3-Static-Sites.md
Use S3 and CloudFront to host Static Single Page Apps (SPAs) with HTTPs and www-redirects. Also covers deployments.

S3 Static Sites

What this will cover

  • Host a static website at S3
  • Redirect www.website.com to website.com
  • Website can be an SPA (requiring all requests to return index.html)
  • Free AWS SSL certs
  • Deployment with CDN invalidation

Resources

@chengfred
chengfred / 4sq_categories-emoji.swift
Created October 23, 2017 18:27 — forked from garethpaul/4sq_categories-emoji.swift
Trying to map all the Foursquare categories (https://developer.foursquare.com/categorytree) to emojis ✌️
let categories = [
"56aa371be4b08b9a8d5734db":"🎶", // Amphitheaters
"4fceea171983d5d06c3e9823":"🐠", // Aquariums
"4bf58dd8d48988d1e1931735":"🎮", // Arcades
"4bf58dd8d48988d1e2931735":"🖼", // Art Galleries
"4bf58dd8d48988d1e4931735":"🎳", // Bowling Alleys
"4bf58dd8d48988d17c941735":"🎰", // Casinos
"52e81612bcbc57f1066b79e7":"🎪", // Circuses
"4bf58dd8d48988d18e941735":"😂", // Comedy Clubs
"5032792091d4c4b30a586d5c":"🎶", // Concert Halls
@chengfred
chengfred / CHANGES.md
Last active December 27, 2015 02:49 — forked from beaucollins/SYNCING.md

API Changes

1.1

  • For the cv command, if the supplied parameter is not formatted properly or we cannot return all the changes from that cursor, the response will now be cv:?. Previously, the server responded with c:?

  • If the server determines the supplied connection credentials are no longer valid, previously the server responded with two messages:

    • auth:expired
    • auth:{"msg":"Token invalid","code":401}
  • Now, the server will only respond in the error case with the second message (the JSON error object).

tmux cheatsheet

As configured in my dotfiles.

start new:

tmux

start new with session name:

@chengfred
chengfred / fork.c
Created March 15, 2013 21:58 — forked from nb/fork.c
#include <unistd.h>
#include <stdlib.h>
#include <stdio.h>
#include <errno.h>
/* MB of memory to allocate */
#define MB 100
/* How many processes to spawn */
#define FORKS 50
/* How many random elements to change in the child process */
@chengfred
chengfred / gist:3213536
Created July 31, 2012 04:11 — forked from danparsons/gist:3195652
How to stream the London 2012 Olympics

How to stream the London 2012 Olympics

There have been several HOWTOs posted regarding streaming the 2012 Olympics using HTTP / SOCKS proxies via SSH and other similar methods. None of these actually work using the latest Flash on Mountain Lion (with Firefox, Chrome or Safari). Additionally, the third-party streaming sites don't provide BBC's amazing interface, which lets you quickly skip to individual competitors and events. However, setting up an OpenVPN server does work, with some tweaks. You'll get the exact same UX that people in England receive.