Skip to content

Instantly share code, notes, and snippets.

View tomelam's full-sized avatar
💭
Still alive!

Tom Elam tomelam

💭
Still alive!
View GitHub Profile
@ast-hugger
ast-hugger / dc.rkt
Last active October 7, 2022 22:59
Delimited continuations in terms of call/cc
;; Delimited continuations
#lang racket ; but will work in any Scheme (without this line)
;; There are other implementations along the same lines floating around.
;; Here we are trying to paint a more comprehensible (or at least a less
;; incomprehensible) picture by structuring the implementation as three
;; distinct layers:
;; Layer 1
@hallettj
hallettj / Makefile
Last active December 10, 2023 13:32
Makefile for transpiling with Babel & Flow in a Node app, or in a client- or server-side shared library
# Makefile for transpiling with Babel in a Node app, or in a client- or
# server-side shared library.
.PHONY: all clean
# Install `babel-cli` in a project to get the transpiler.
babel := node_modules/.bin/babel
# Identify modules to be transpiled by recursively searching the `src/`
# directory.
@matijs
matijs / makefile
Last active October 1, 2021 12:10
Minimalist makefile using PostCSS
# some variables
POSTCSS = ./node_modules/.bin/postcss
POSTCSS_FLAGS = --use autoprefixer autoprefixer.browsers "> 2%"
# wildcard expansion is performed only in targets and in prerequisites so here we need $(wildcard)
SOURCES = $(wildcard src/css/*.css)
# use $(SOURCES) to determine what we actually need using a bit of pattern substitution
TARGETS = $(patsubst src%, build%, $(SOURCES))
# our default target (see below)
all: $(TARGETS)
@soheilhy
soheilhy / nginxproxy.md
Last active October 23, 2024 08:19
How to proxy web apps using nginx?

Virtual Hosts on nginx (CSC309)

When hosting our web applications, we often have one public IP address (i.e., an IP address visible to the outside world) using which we want to host multiple web apps. For example, one may wants to host three different web apps respectively for example1.com, example2.com, and example1.com/images on the same machine using a single IP address.

How can we do that? Well, the good news is Internet browsers

@dglazkov
dglazkov / gist:efd2deec54f65aa86f2e
Last active April 29, 2023 14:54
The Shadow DOM Diaries

#The Shadow DOM Diaries

Feature design is hard, and takes time. With time, it doesn't matter how public and consistent you are with communication during design process. In the end, it all will look like a jumbled mess of emails and bug comments. That seems bad. To make things less bad, I decided to start writing these little docs. Here they are. I may add more. Or not. Whatevs.

Sometimes You Need to Build a Larger Thing First looks back at the road we've traveled.

Shadow DOM Evolution outlines the path forward.

Why Do We Only Allow Children in Insertion Points provides a glimpse into the reasoning behind current insertion point design.

@ianlewis
ianlewis / csv_import_magic.js
Last active February 3, 2023 13:16
A Google Apps Script for importing CSV data into a Google Spreadsheet.
// vim: ft=javascript:
/*jslint sloppy: true, vars: true, white: true, nomen: true, browser: true */
/*global SpreadsheetApp, UiApp, UrlFetchApp, Utilities */
/*
* A script to automate requesting data from an external url that outputs CSV data.
*
* Adapted from the Google Analytics Report Automation (magic) script.
* @author [email protected] (Nick Mihailovski)
* @author [email protected] (Ian Lewis)
*/
  • You will need a VPS/Unix Shell account on a remote machine sitting in a country with some sane laws.

  • from your local machine, do:

    $ ssh -D 1080 user@host

On your browser (or other applications), go to the network connection settings, select the option to use a proxy and leave everything blank except the SOCKS option, where you fill in hostname as localhost or 127.0.0.1 and port number as 1080 (or whatever you filled in above). That is all!

@erikhazzard
erikhazzard / gist:2963791
Created June 21, 2012 04:09
less makefile example
CHECK=\033[32m✔\033[39m
HR= ==================================================
LESS_FILES = static/less/less_variables.less \
static/less/base.less \
static/less/layout.less \
@davidcelis
davidcelis / ruby-on-ales.markdown
Created March 1, 2012 17:51
Overview of talks given at Ruby on Ales

Ruby on Ales

Outgrowing the Cloud (Mike Moore)

  • Requests hitting the same load balancer can't handle HTTP and HTTPS at the same time because of SSL issues
  • If you are trying to access an outside resource behind a firewall, you have to tell them every time you get a new webserver so they can whitelist the new IP
  • If you know the IPs of your web servers and database servers, you can have requests hit these directly and bypass the load balancers.
  • Could buy your own data center, but then you have to buy a load balancing router. Those are fucking expensive (tens or hundreds of thousands of dollars)
@jasonmelgoza
jasonmelgoza / Makefile
Created January 4, 2012 21:47 — forked from ecarter/Makefile
Makefile - stylus
# Output Directory
OUTPUT = ../lib
all: css
css:
@echo "stylus => css"
@stylus \
-c \
-u nib \