Skip to content

Instantly share code, notes, and snippets.

Avatar

Eli Mellen eli-oat

View GitHub Profile
@eli-oat
eli-oat / bashprompt
Created Oct 31, 2019
The bash prompt I like to use
View bashprompt
# get current branch in git repo
function parse_git_branch() {
BRANCH=`git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/\1/'`
if [ ! "${BRANCH}" == "" ]
then
STAT=`parse_git_dirty`
echo "[${BRANCH}${STAT}] "
else
echo ""
fi
@eli-oat
eli-oat / archives.mustache
Created Mar 10, 2019
blot archives page w/posts broken out by month
View archives.mustache
<!DOCTYPE html>
<html>
{{> head}}
<body>
<header>
<h4><a href="/"{{title}}</a></h4>
</header>
<main>
<h1 class="rainbow">Archives</h1>
<div style="padding: 0 1em;">
@eli-oat
eli-oat / generate.c
Created Mar 4, 2019 — forked from munificent/generate.c
A random dungeon generator that fits on a business card
View generate.c
#include <time.h> // Robert Nystrom
#include <stdio.h> // @munificentbob
#include <stdlib.h> // for Ginny
#define r return // 2008-2019
#define l(a, b, c, d) for (i y=a;y\
<b; y++) for (int x = c; x < d; x++)
typedef int i;const i H=40;const i W
=80;i m[40][80];i g(i x){r rand()%x;
}void cave(i s){i w=g(10)+5;i h=g(6)
+3;i t=g(W-w-2)+1;i u=g(H-h-2)+1;l(u
@eli-oat
eli-oat / tag.mustache
Last active Mar 1, 2019
blot.im tag.rss mustache template
View tag.mustache
{{#tagged}}
<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0">
<channel>
<title><![CDATA[ {{{title}}} | Entries tagged "{{{tag}}}"]]></title>
<link>{{{blogURL}}}</link>
<atom:link href="{{{blogURL}}}/tag.rss?name={{{tag}}}" rel="self" type="application/rss+xml"/>
<description><![CDATA[ Feed for all entries tagged "{{{tag}}}" ]]></description>
{{#entries}}
<item>
@eli-oat
eli-oat / webmention.js
Created Jan 22, 2019 — forked from am1t/webmention.js
Javascript snippet to fetch Webmentions
View webmention.js
var post_url = window.location.href;
$(document).ready(function(){
$("ul#mentions-list").empty();
$.getJSON("https://webmention.io/api/mentions?per-page=50&page=0&jsonp=?", {
target: post_url
}, function(data){
var social_media_likes = "";
var social_media_repost = "";
var social_media_post = "";
View tmux-cheatsheet.markdown

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
@eli-oat
eli-oat / accio-react-app.sh
Created Sep 9, 2018
A quick and dirty way to start a simple React project
View accio-react-app.sh
#!/bin/bash
# ACCIO REACT APP!
# A quick and dirty way to start a simple React project
# NOTE! This script assumes you are using Yarn
# Author: Eli (https://eli.li)
# License: unlicense (https://unlicense.org/)
read -p 'What is the name of your new project? ' PROJECTNAME
You can’t perform that action at this time.