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
@tomelam
tomelam / dc.rkt
Created August 18, 2022 10:08 — forked from ast-hugger/dc.rkt
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
@tomelam
tomelam / makefile
Created October 1, 2021 12:10 — forked from matijs/makefile
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)
@tomelam
tomelam / Makefile
Created October 1, 2021 12:06 — forked from ecarter/Makefile
Makefile - coffee/jade/stylus
# Output Directory
OUTPUT = ../lib
all: css html js
css:
@echo "stylus => css"
@stylus \
-c \
@tomelam
tomelam / Makefile
Created October 1, 2021 12:04 — forked from jasonmelgoza/Makefile
Makefile - stylus
# Output Directory
OUTPUT = ../lib
all: css
css:
@echo "stylus => css"
@stylus \
-c \
-u nib \
@tomelam
tomelam / Makefile
Created October 1, 2021 11:28 — forked from hallettj/Makefile
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.
@tomelam
tomelam / nginxproxy.md
Created December 17, 2020 08:40 — forked from soheilhy/nginxproxy.md
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

@tomelam
tomelam / elementsfrompoint.js
Created March 17, 2020 12:26 — forked from iddan/elementsfrompoint.js
document.elementsFromPoint Polyfill
'use strict';
if (!document.elementsFromPoint) {
document.elementsFromPoint = elementsFromPoint;
}
function elementsFromPoint(x, y) {
var parents = [];
var parent = void 0;
do {
@tomelam
tomelam / csv_import_magic.js
Created July 3, 2018 19:49 — forked from ianlewis/csv_import_magic.js
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 nickski15@gmail.com (Nick Mihailovski)
* @author ianmlewis@gmail.com (Ian Lewis)
*/
@tomelam
tomelam / frontendDevlopmentBookmarks.md
Created May 19, 2016 20:22 — forked from dypsilon/frontendDevlopmentBookmarks.md
A badass list of frontend development resources I collected over time.
  • 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!