Skip to content

Instantly share code, notes, and snippets.

View outlace's full-sized avatar

Brandon B outlace

View GitHub Profile
@digama0
digama0 / findLeast.lean
Created April 10, 2021 03:45
Proving correctness of do notation programs
import Lean.Elab.Tactic
def findLeast (a : Array Nat) : Nat := do
let mut smallest := a[0]
for i in [1:a.size] do
if a[i] ≤ smallest then
smallest := a[i]
return smallest
#eval findLeast #[8, 3, 10, 4, 6]
@vankesteren
vankesteren / Adamopt.jl
Last active February 25, 2023 05:35
Julia implementation of Adam optimizer
module Adamopt
# This is a module implementing vanilla Adam (https://arxiv.org/abs/1412.6980).
export Adam, step!
# Struct containing all necessary info
mutable struct Adam
theta::AbstractArray{Float64} # Parameter array
loss::Function # Loss function
grad::Function # Gradient function
@azai91
azai91 / getting_started.md
Last active March 29, 2017 04:36
Getting Started with Spot Instance

Request Spot Instance

aws ec2 request-spot-instances --spot-price "0.20" --instance-count 1 --type "one-time" --launch-specification file://spot_instance.json

{
  "ImageId": "ami-16db8576",
  "KeyName": "aws-eb",
  "SecurityGroupIds": ["sg-d1e78ab6"],
  "InstanceType": "g2.2xlarge",
 "Placement": {
@DrDub
DrDub / selectfile.py
Created January 3, 2016 11:44
A file selection class build for ipywidgets without any extra dependencies.
import os
import ipywidgets as widgets
class FileBrowser(object):
def __init__(self):
self.path = os.getcwd()
self._update_files()
@iamatypeofwalrus
iamatypeofwalrus / roll_ipython_in_aws.md
Last active January 22, 2024 11:18
Create an iPython HTML Notebook on Amazon's AWS Free Tier from scratch.

What

Roll your own iPython Notebook server with Amazon Web Services (EC2) using their Free Tier.

What are we using? What do you need?

  • An active AWS account. First time sign-ups are eligible for the free tier for a year
  • One Micro Tier EC2 Instance
  • With AWS we will use the stock Ubuntu Server AMI and customize it.
  • Anaconda for Python.
  • Coffee/Beer/Time
@mikehaertl
mikehaertl / gist:3258427
Created August 4, 2012 15:40
Learn you a Haskell - In a nutshell

Learn you a Haskell - In a nutshell

This is a summary of the "Learn You A Haskell" online book under http://learnyouahaskell.com/chapters.


1. Introduction

  • Haskell is a functional programming language.