Skip to content

Instantly share code, notes, and snippets.

View bradleyg's full-sized avatar
💭
send busy

Bradley Griffiths bradleyg

💭
send busy
View GitHub Profile
@wilsonpage
wilsonpage / swr.ts
Last active April 22, 2024 08:58
An implementation of stale-while-revalidate for Cloudflare Workers
export const CACHE_STALE_AT_HEADER = 'x-edge-cache-stale-at';
export const CACHE_STATUS_HEADER = 'x-edge-cache-status';
export const CACHE_CONTROL_HEADER = 'Cache-Control';
export const CLIENT_CACHE_CONTROL_HEADER = 'x-client-cache-control';
export const ORIGIN_CACHE_CONTROL_HEADER = 'x-edge-origin-cache-control';
enum CacheStatus {
HIT = 'HIT',
MISS = 'MISS',
REVALIDATING = 'REVALIDATING',
@mburakerman
mburakerman / package.json
Last active September 26, 2022 17:32
Webpack 4 config.js (SCSS to CSS and Babel) 👌 The Simplest Usage 👌
{
"name": "webpack-sass",
"version": "1.0.0",
"scripts": {
"start": "webpack-dev-server --open --mode development",
"build": "webpack -p"
},
"devDependencies": {
"babel-core": "^6.26.0",
"babel-loader": "^7.1.4",
@MohamedAlaa
MohamedAlaa / tmux-cheatsheet.markdown
Last active April 25, 2024 06:23
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
@smith
smith / install-node-mac.sh
Created June 15, 2011 15:08
Install Node.js
#!/bin/sh
# Install Node.js on a Mac
# Requires xCode tools to be installed
# Install Homebrew
/usr/bin/ruby -e "$(curl -fsSL https://raw.github.com/gist/323731)"
# Install node
brew install node
@hunterloftis
hunterloftis / gist:1025903
Created June 14, 2011 21:14
prepare linode server
# This should be run on a new Linode Ubuntu 32-bit image to prepare it for hosting GTG
# To start, something like this works:
# scp prepare_server.sh root@123.456.789.10:/root
# First, install basic linux utilities (compilers, git, libssl)
cd /root
apt-get update
@stefanfoulis
stefanfoulis / osx_developer_installation.rst
Last active December 23, 2019 02:32
Instructions on how to setup an OSX developer machine for (python/django) development

OSX Developer System installation

This guide assumes a fresh install of Mac OSX 10.7 Lion.

Brew User

@robu
robu / linode_setup.sh
Created February 1, 2009 19:37
Script generating a script setting up a clean Ubuntu VPS (at linode.com, but anywhere should work, really).
#!/bin/bash
function yesno {
local yesno_response="yes"
echo -n "$1 ($yesno_response): "
read yesno_response_in
if test -n "${yesno_response_in}" ; then let yesno_response=yesno_response_in ; fi
YESNO_RESPONSE="N"
case $yesno_response in
[Yy]*) YESNO_RESPONSE="Y";;