Skip to content

Instantly share code, notes, and snippets.

{-# LANGUAGE OverloadedStrings #-}
import Control.Monad.Trans.Resource
import Data.Conduit
import Data.Conduit.Binary
import Data.Conduit.Blaze
import Data.Text as T
import Data.XML.Pickle
import Data.XML.Types as X
import Text.XML
" vundle
set nocompatible
filetype off
set rtp+=~/.vim/bundle/Vundle.vim/
call vundle#rc()
Plugin 'gmarik/vundle'
@AndrewRademacher
AndrewRademacher / WhenToDropIt.hs
Last active August 29, 2015 14:05
A purely functional lookup to help you determine what to do when it's hot, based on your sitch. Based on esteemed work from Coty Beasley and Chad Elliot.
module WhenToDropIt
( Sitch (..)
, whatDoIDo
) where
data Sitch = Pigs | Pimps | NgAttitude
suffix :: String
suffix = " like it's hot." ++
"\nI got the rolly on my arm and I'm puring Chandon."
{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE DeriveGeneric #-}
import Control.Lens
import Control.Monad
import Data.Data
import Data.Text (Text)
import Data.Word
import GHC.Generics
import System.Console.CmdLib
.section __TEXT,__text,regular,pure_instructions
.macosx_version_min 10, 10
.globl __Z8sumArrayPii
.align 4, 0x90
__Z8sumArrayPii: ## @_Z8sumArrayPii
.cfi_startproc
## BB#0:
push rbp
Ltmp0:
.cfi_def_cfa_offset 16
#include <iostream>
#include <stdio.h>
using namespace std;
int sumArray(int inputArray[], int arrayCount) {
if (arrayCount == 1) {
return inputArray[0];
}

Keybase proof

I hereby claim:

  • I am AndrewRademacher on github.
  • I am andrewrademacher (https://keybase.io/andrewrademacher) on keybase.
  • I have a public key whose fingerprint is CCD0 5E6C F24A 9427 918F A0A5 2347 5621 352E C82B

To claim this, I am signing this object:

Keybase proof

I hereby claim:

  • I am AndrewRademacher on github.
  • I am andrewrademacher (https://keybase.io/andrewrademacher) on keybase.
  • I have a public key whose fingerprint is 9EEC 1A26 D1B2 07DD C6FA 09E2 024C E77E B451 BB0E

To claim this, I am signing this object:

@AndrewRademacher
AndrewRademacher / main.cpp
Created May 5, 2019 17:40
testing for proximity to the end of an iterator.
#include <string>
#include <iostream>
#include <vector>
int main() {
std::vector<uint64_t> elems{1, 2, 3, 4, 5, 6};
// print
std::cout << "[ ";
for (auto itr = elems.begin(); itr != elems.end(); ++itr) {
@AndrewRademacher
AndrewRademacher / main.cpp
Created May 5, 2019 17:46
testing generically for proximity to the end of a structure.
#include <string>
#include <iostream>
#include <vector>
#include <array>
template<typename T>
void printElemes(T elems) {
std::cout << "[ ";
for (auto itr = elems.begin(); itr != elems.end(); ++itr) {
std::cout << *itr;