Skip to content

Instantly share code, notes, and snippets.

@aaronmu
aaronmu / gist:fef24eace20ca345c980
Last active August 29, 2015 14:08
The Little Schemer
#lang racket
(define atom?
(lambda (x)
(and (not (pair? x)) (not (null? x)))))
;; Is each element in list l an atom?
(define lat?
(lambda (l)
(cond
((null? l) #t)
@aaronmu
aaronmu / .vimrc
Last active October 14, 2015 01:47
_vimrc
set nocompatible " be iMproved
filetype off " required!
set rtp+=~/.vim/bundle/vundle/
call vundle#rc()
" Bundles
" let Vundle manage Vundle
" required!
Bundle 'gmarik/vundle'
foldr + 0 [1..3]: (1 + (2 + (3 + 0)))
foldl + 0 [1..3]: (((0 + 1) + 2) + 3)
public class PrimeWebDefaultRequestShould
{
private readonly TestServer _server;
private readonly HttpClient _client;
public PrimeWebDefaultRequestShould()
{
// Arrange
_server = new TestServer(new WebHostBuilder()
.UseStartup<Startup>());
_client = _server.CreateClient();
@aaronmu
aaronmu / foo.php
Last active August 28, 2017 12:36
// F is a doctrine entity.
class F {
private $foo, $bar; // all strings \o/
}
// I have a native query that returns the following resultset:
$rs = [
['foo' => 'hello', 'bar' => 'world', 'trueOrFalse' => true],
//..
];
@aaronmu
aaronmu / FunWithBaskets.cs
Created June 8, 2018 11:10 — forked from yreynhout/FunWithBaskets.cs
How can I use child entities?
public class Basket : EventSource
{
private int Id;
private List<Item> Items = new List<Item>();
public Basket()
{
On<ItemAddedToBasket>(e => {
var item = new Item(@event =>
af724c8c-16c3-4889-98d0-bc72b3f98542
1d76283e-fa3a-4591-8cd9-8215df662446
6678be79-4cdd-4381-ad95-63c61b702dde
f38b26b5-df17-474b-bc36-71925bc96e88
@aaronmu
aaronmu / Deploy.md
Created August 14, 2018 22:17 — forked from alfonsogarciacaro/Deploy.md
Deploying an F# ASP.NET Core app (Giraffe) to Azure

Deploying an F# ASP.NET Core app to Azure

Last week I spent a lot of time trying to deploy an F# ASP.NET Core app (a Giraffe app, specifically) to Azure because the information to complete all the steps was scattered in several places. So I'm writing this hopefully it will save the pain to others :)

Preparation

The following steps are mostly taken from this guide and it's only necessary to do them once:

  1. Create an account in Azure (or use an existing one)
  2. Create a resource group (or use an existing one)
@aaronmu
aaronmu / log.txt
Last active November 30, 2018 21:24
foo@bar:~$ sudo apt-get install openvpn
Reading package lists... Done
Building dependency tree
Reading state information... Done
openvpn is already the newest version (2.4.6-1ubuntu2).
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
1 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
Do you want to continue? [Y/n] Y
Setting up gcc (4:8.2.0-1ubuntu1) ...