Skip to content

Instantly share code, notes, and snippets.

View yurrriq's full-sized avatar
🙈
I may be slow to respond.

Eric Bailey yurrriq

🙈
I may be slow to respond.
View GitHub Profile
@yurrriq
yurrriq / nix.fish
Last active July 11, 2016 16:23 — forked from cartazio/$HOME .nix-profile etc profile.d nix.fish
$HOME .nix-profile etc profile.d nix.fish
#!/usr/bin/env fish
# -*- mode: fish; tab-width: 2; -*-
if test -n "$HOME"
set NIX_LINK "$HOME/.nix-profile"
set NIXPKGS "$HOME/src/NixOS/nixpkgs"
# Set the default profile.
if not test -L "$NIX_LINK"
@yurrriq
yurrriq / debian-xhyve.sh
Created May 4, 2016 07:06 — forked from lloeki/debian-xhyve.sh
Running debian 8.1 in xhyve
#!/bin/bash
# unfortunately debian currently panics in xhyve
tmp=$(mktemp -d)
pushd "$tmp"
iso="$HOME"/Downloads/debian-8.1.0-amd64-netinst.iso
#iso="$HOME"/Downloads/debian-8.1.0-i386-netinst.iso
echo "fixing disk"
dd if=/dev/zero bs=2k count=1 of=tmp.iso
@yurrriq
yurrriq / csv.erl
Created May 26, 2016 22:22 — forked from andytill/csv.erl
Erlang state machine for parsing a CSV file
%% @author atill
%%
%% @doc
%% CSV parsing module. Parsed CSV will be processed and converted
%% into a list containing the separated values, lines are separated
%% by the newline atom.
-module(csv).
-import(lists, [reverse/1]).
@yurrriq
yurrriq / ReaderEx.hs
Created August 27, 2016 09:48 — forked from raichoo/ReaderEx.hs
Example where Reader is helpful.
module Main where
-- ReaderT is a little more useful as an example
-- think of it as Reader that can also do IO using
-- the `lift` function.
import Control.Monad.Reader
import Text.Printf
type Connection = ()
@yurrriq
yurrriq / sourceforge.to.github.impor.markdown
Created January 6, 2017 10:35 — forked from binarytemple/sourceforge.to.github.impor.markdown
import a sourceforge project (with full history) to github

In order to clone the TVN application from sourceforge to github I performed the following steps.

rsync -av rsync://tnv.cvs.sourceforge.net/cvsroot/tnv/* .
svn export --username=guest http://cvs2svn.tigris.org/svn/cvs2svn/trunk cvs2svn-trunk
cp ./cvs2svn-trunk/cvs2git-example.options ./cvs2git.options
vim cvs2git.options
cvs2svn-trunk/cvs2git --options=cvs2git.options --fallback-encoding utf-8
[email protected]:binarytemple/tnv.git tnv-github
git clone [email protected]:binarytemple/tnv.git tnv-github
@yurrriq
yurrriq / text-overlay.sh
Created February 3, 2017 01:08 — forked from wellsie/text-overlay.sh
GraphicsMagick text overlay
#!/bin/bash -eux
gm convert -font helvetica -fill blue -pointsize 36 -draw "text 15,50 'hello'" source.jpg destination.jpg
@yurrriq
yurrriq / eio.el
Created June 4, 2017 18:02 — forked from canweriotnow/eio.el
elisp exercise helper
;;; eio.el --- Support for creating Elisp exercises
;; Author: Jason Lewis
;; Created: 5 June 2015
;; This file is not part of GNU Emacs.
;;; Commentary:
;;
;; Provides utility functions for stubbing elisp exercises
@yurrriq
yurrriq / TicTacToe.hs
Created August 23, 2017 07:35 — forked from ChrisPenner/TicTacToe.hs
Type-safe game of TicTacToe
{-# language TypeFamilies #-}
{-# language TypeOperators #-}
{-# language DeriveFunctor #-}
{-# language TypeInType #-}
{-# language UndecidableInstances #-}
{-# language ViewPatterns #-}
{-# language ConstraintKinds #-}
{-# language GADTs #-}
module TicTacToe where
@yurrriq
yurrriq / IosevkaConfigGen.hs
Created January 8, 2018 07:37 — forked from mrkgnao/IosevkaConfigGen.hs
Render Iosevka ligatures to Private Use Area glyphs, for Emacs
{-# LANGUAGE RecordWildCards, Arrows #-}
import Numeric
import Data.Char
import Control.Monad
import Data.Monoid ((<>))
import Data.List (nub, sort, reverse)
data RepeatBounds = RB
@yurrriq
yurrriq / extract_kubecfg_cert.sh
Created May 7, 2018 20:34 — forked from xueshanf/extract_kubecfg_cert.sh
Extract kubernetes cluster credentials from kubecfg
#!/bin/bash
# Input: ./extract_kubecfg_cert.sh my-cluster-name username
# Output: ./my-cluster-name-ca.crt ./username.crt ./username.key
# Exit on error
abort(){
echo $1 && exit 1
}
# Prerequistes