Skip to content

Instantly share code, notes, and snippets.

View justinian's full-sized avatar
🦇
What a horrible night to have a curse.

Justin Miller justinian

🦇
What a horrible night to have a curse.
View GitHub Profile
@justinian
justinian / pyrunner.c
Created May 14, 2014 19:53
Simple C app to run a python file
#include <stdio.h>
#include <stdlib.h>
#include <Python.h>
#ifndef PYTHON_FILE
#error "Please define PYTHON_FILE."
#endif
int main(int argc, char **argv)
{
@justinian
justinian / profile.ps1
Last active November 17, 2022 23:44
Powershell init script to include vcvarsall.bat and set the window title.
# Load posh-git example profile
. '~\Documents\WindowsPowerShell\Modules\posh-git\profile.example.ps1'
$GitPromptSettings.EnableFileStatus = $false
$global:CurrentUser = [System.Security.Principal.WindowsIdentity]::GetCurrent()
function Prompt() {
Write-Host ("PS " + $(get-location) ) -nonewline -foregroundcolor Magenta
Write-VcsStatus
#!/bin/sh
# Quick start-stop-daemon example, derived from Debian /etc/init.d/ssh
set -e
# Must be a valid filename
NAME=foo
PIDFILE=/var/run/$NAME.pid
#This is the command to be run, give the full pathname
DAEMON=/usr/local/bin/bar
@justinian
justinian / goggles.ino
Created June 22, 2014 18:54
Janice's Goggles
#include <Adafruit_NeoPixel.h>
#define PIN 1
Adafruit_NeoPixel pixels = Adafruit_NeoPixel(32, PIN);
uint32_t colors[] = {
0xdf151a,
0xfd8603,
0xf4f328,
@justinian
justinian / keybase.md
Created October 25, 2014 20:50
Keybase Identity

Keybase proof

I hereby claim:

  • I am justinian on github.
  • I am justinian (https://keybase.io/justinian) on keybase.
  • I have a public key whose fingerprint is 3E24 8983 8CD6 6D05 1725 C3F4 3FDD DA41 FF70 ADE1

To claim this, I am signing this object:

@justinian
justinian / moinimport.py
Created March 9, 2015 02:09
Import MoinMoin data to a Hugo site
#!/usr/bin/env python
import os
import os.path
import re
import string
import time
PAGES = "import/data/pages"
@justinian
justinian / backup_my_repos.sh
Last active September 3, 2020 20:14
GitHub & Bitbucket backup scripts
#!/bin/bash
BACKUP_DIR="/home/justin/backups/git"
cd "$BACKUP_DIR"
for repo_url in `list_my_repos.sh`; do
repo_dir=`echo $repo_url | sed 's/^....//' | tr ':/@' '___'`
git clone --mirror "$repo_url" "/tmp/$repo_dir" > /dev/null 2>&1
git --git-dir "/tmp/$repo_dir" bundle create "$repo_dir.bundle.new" --all > /dev/null 2>&1
if [ -f "$repo_dir.bundle" ]; then rm "$repo_dir.bundle"; fi
@justinian
justinian / mac_build.sh
Last active August 29, 2015 14:23
Personal Mac build script
#!/bin/sh
ruby -e "$(curl -fsSL 'https://raw.githubusercontent.com/Homebrew/install/master/install')"
brew tap caskroom/cask
brew install caskroom/cask/brew-cask
brew install \
ctags \
git \
go \
#!/usr/bin/env bash
# SEE YOU SPACE COWBOY by DANIEL REHN (danielrehn.com)
# Displays a timeless message in your terminal with cosmic color effects
# Usage: add "sh ~/seeyouspacecowboy.sh; sleep 2" to .bash_logout (or similar) in your home directory
# (adjust the sleep variable to display the message for more seconds)
# Cosmic color sequence
@justinian
justinian / marquee.py
Created July 1, 2015 23:51
Python rainbow marquee
#!/usr/bin/env python
import sys
colors = [160, 196, 202, 208, 214, 220, 226, 190, 154, 118, 46, 47, 48, 49, 51, 39, 27, 21, 57, 93]
ncolors = len(colors)
def reset():
sys.stdout.write("\033[?25h")
sys.stdout.write("\033[m")