Skip to content

Instantly share code, notes, and snippets.

@bripc
bripc / lisp_ast.py
Created December 14, 2018 07:53
The Recurse Center Pair Programming Code - Lisp parser
'''
Lisp parser
Write code that takes some Lisp code and returns an abstract syntax tree. The AST should represent the structure of the
code and the meaning of each token. For example, if your code is given "(first (list 1 (+ 2 3) 9))", it could return a
nested array like ["first", ["list", 1, ["+", 2, 3], 9]].
During your interview, you will pair on writing an interpreter to run the AST. You can start by implementing a single
built-in function (for example, +) and add more if you have time.
'''
@bripc
bripc / offline.interceptor.js
Created June 20, 2017 22:05
Workaround for OfflineJS and AngularJS offline compatibility. Interceptor that handles creating a queue of requests to resend upon connection being reestablished.
(function () {
'use strict';
angular
.module('app')
.factory('OfflineInterceptor', ["$q", function ($q) {
// queue for saving requests to be sent to the server when connection is down
var queue = [];
return {