Skip to content

Instantly share code, notes, and snippets.

@tsiege
tsiege / The Technical Interview Cheat Sheet.md
Last active October 13, 2025 20:38
This is my technical interview cheat sheet. Feel free to fork it or do whatever you want with it. PLEASE let me know if there are any errors or if anything crucial is missing. I will add more links soon.

ANNOUNCEMENT

I have moved this over to the Tech Interview Cheat Sheet Repo and has been expanded and even has code challenges you can run and practice against!






\

@chaitanyagupta
chaitanyagupta / _reader-macros.md
Last active October 11, 2025 13:03
Reader Macros in Common Lisp

Reader Macros in Common Lisp

This post also appears on lisper.in.

Reader macros are perhaps not as famous as ordinary macros. While macros are a great way to create your own DSL, reader macros provide even greater flexibility by allowing you to create entirely new syntax on top of Lisp.

Paul Graham explains them very well in [On Lisp][] (Chapter 17, Read-Macros):

The three big moments in a Lisp expression's life are read-time, compile-time, and runtime. Functions are in control at runtime. Macros give us a chance to perform transformations on programs at compile-time. ...read-macros... do their work at read-time.

@andytill
andytill / bench.erl
Last active August 29, 2015 13:56 — forked from 0xYUANTI/bench.erl
-module(bench).
-compile(export_all).
%% Luke Gorrie's favourite profiling macro.
-define(TIME(Tag, Expr),
(fun() ->
%% NOTE: timer:tc/4 does an annoying 'catch' so we
%% need to wrap the result in 'ok' to be able to
%% detect an unhandled exception.
{__TIME, __RESULT} =
@erobert17
erobert17 / bootstrap-3-vert-offset-shim.css
Last active May 2, 2022 18:36
Adds a vertical offset top and bottom to Bootstrap 3 to be used within columns. Currently no vertical offset is available as standard in Bootstrap 3.
/*
Include this after bootstrap.css. Add class of
vert-offset-top-value or vert-offset-bottom-value
to your Bootstrap 3 default rows to prevent row content
from touching the row content above or below.
*/
/* Vertical Offset Bottom */
.vert-offset-top-12{
margin-top: 12em;
%% @doc
%% Filter module for Zotonic
%% 'foldl' filter, applies foldl to a list
%%
%% Usage:
%% {{ [1,2,3]|foldl:["*", 1] }}
%% {{ [1,2,3]|foldl:["+", 0] }}
%% {{ ["a", "b", "c"]|foldl:["++", ""] }}
%%
%% Pass an attribute to fetch for each item:
@bitemyapp
bitemyapp / gist:8739525
Last active May 7, 2021 23:22
Learning Haskell
@mankyKitty
mankyKitty / SolrQuerySyntaxPrimer.md
Last active July 12, 2024 12:29
The documentation around the basics of the Solr query syntax is terrible, this is an attempt to alleviate the doc-shock associated with trying to learn some fundamentals.

Solr Query Syntax Basics

This is a super basic beginners guide to Solr Lucene query syntax. We're going to cover running a straightforward query, as well as some of the more useful functionality such as filtering and creating facets. We'll point out some things you can't do and generally give you enough instruction so that you can get yourself into trouble.

For testing you need a REST client capable of sending requests to your Solr instance. Either RESTClient for Firefox or Postman for Chrome are good choices.

Misc

Request Specific Fields

To specify a list of fields to return instead of the default Solr response use fl and provide a comma delimited list of fields:

@kourge
kourge / context_manager.php
Last active June 24, 2025 21:36
A simple user-space PHP `with` implementation that mimics Python context managers.
<?php
class Context {
private $args = array();
private $func = NULL;
public function __construct() {
$args = func_get_args();
$func = array_pop($args);
@kaos
kaos / Vagrantfile
Created May 30, 2013 18:58
Vagrant setup for zotonic
# -*- mode: ruby -*-
# vi: set ft=ruby :
Vagrant.configure("2") do |config|
# All Vagrant configuration is done here. The most common configuration
# options are documented and commented below. For a complete reference,
# please see the online documentation at vagrantup.com.
# Every Vagrant virtual environment requires a box to build off of.
config.vm.box = "precise32"