Skip to content

Instantly share code, notes, and snippets.

View bwbaugh's full-sized avatar

Wesley Baugh bwbaugh

View GitHub Profile
@queertypes
queertypes / Record.hs
Created February 18, 2015 20:41
Record partial application in Haskell
> data Thing = Thing {a :: Int, b :: Int, c :: Int} deriving Show
> :t
Thing :: Int -> Int -> Int -> Thing
> Thing {a = 10}
<interactive>:13:1: Warning:
Fields of ‘Thing’ not initialised: b, c
In the expression: Thing {a = 10}
In an equation for ‘it’: it = Thing {a = 10}
@bwbaugh
bwbaugh / server-setup-guide.md
Last active November 26, 2023 07:44
Guide to set up a new VPS

Guide to set up a new VPS

This guide was written while setting up an Unbuntu VPS. There may be some differences when setting up a different distro.

Initial steps as root

Do some basic setup as the root user, which should mainly consist of

@gbraad
gbraad / README.md
Last active May 16, 2022 17:42
Import SSH-keys from GitHub

Import SSH-keys from GitHub

vagrant up
vagrant ssh -c "curl -L https://github.com/{your-username}.keys >> /home/vagrant/.ssh/authorized_keys"
@stefansundin
stefansundin / install-pre-push.sh
Last active June 9, 2024 13:02
Git pre-push hook to prevent force pushing the master/main branch.
#!/bin/bash
# This script will install a Git pre-push hook that prevents force pushing the master/main branch.
# There are three variants that I have built:
# - pre-push: prevents force-pushing to master/main.
# - pre-push-2: prevents force-pushing to master/main depending on the remote (you need to edit the file!).
# - pre-push-3: prevents any type of pushing to master/main.
# Set the desired version like this before proceeding:
# FILE=pre-push
# Single repo installation:
@adamnew123456
adamnew123456 / evilscan.py
Created April 16, 2014 00:22
Scans Images From HP 3050... Using Lambdas
# So, this is a port of a fairly simple script from "normal Python" to "pure-lambda
# Python". This code contains no Python statements, and is a proof-of-concept to show
# what you can do without statements, and how powerful Python's lambdas are despite
# that they are crippled.
#
# A few notes on how to read this:
# 1. Almost everything happens in the arguments. Practially nothing happens
# inside function bodies, since the function bodies are usually just other
# functions. Go down to the bottom of the expression (using your editor's
# paren matching) to see what the arguments are.
@rdegges
rdegges / stormpath-seed.py
Last active February 20, 2017 02:43
Automatically seed a Stormpath application with user accounts for testing!
"""
stormpath-seed.py
~~~~~~~~~~~~~~~~~
A simple utility which creates a new Stormpath application named 'test' (or
uses one already named 'test', if it exists), and creates a number of user
accounts in this application.
This is useful for various testing scenarios.
@benknight
benknight / SassMeister-input.scss
Last active August 29, 2015 13:56
ReviewBoard CSS rewrites
// ----
// Sass (v3.3.4)
// Compass (v1.0.0.alpha.18)
// ----
@import "compass/css3/transition";
/** Stuff from normalize.css */
@blitzcode
blitzcode / gist:8123168
Last active September 10, 2023 17:39
Haskell Hoogle Local Version Setup Steps
# Install a local copy of Hoogle (OS X 10.10, GHC 7.10.1)
# Download
cd
cabal unpack hoogle
cd hoogle-4.2.40/
# Use a sandbox
cabal sandbox init
#! /bin/bash
# streaming on Ubuntu via ffmpeg.
# see http://ubuntuguide.org/wiki/Screencasts for full documentation
# see http://www.thegameengine.org/miscellaneous/streaming-twitch-tv-ubuntu/
# for instructions on how to use this gist
if [ ! -f ~/.twitch_key ]; then
echo "Error: Could not find file: ~/.twitch_key"
echo "Please create this file and copy past your stream key into it. Open this script for more details."
@erikhazzard
erikhazzard / _.md
Created October 8, 2013 21:36
bart salary groupings