Skip to content

Instantly share code, notes, and snippets.

View adituv's full-sized avatar

Iris Ward adituv

View GitHub Profile
@adituv
adituv / .bash_prompt
Last active August 29, 2016 17:58
.bash_prompt
#!/bin/bash
PS1='\[$clr\](\[$bold$green\]$git_branch\[$clr\]$git_status_short) '
PS1+='\[$bold$blue\]$pwd_short\[$clr\]\$ '
export PS1
clr=$'\e[0m'
bold=$'\e[1m'
green=$'\e[32m'
blue=$'\e[34m'
@adituv
adituv / 000readme.md
Last active June 26, 2016 23:14
GH3 - show title

Show Song Title

The below script is the rough skeleton of a script to draw the song title at the top left.

I attempted to translate it the language used by the Tony Hawk modding community to describe QB scripts, but can't guarantee it's entirely correct. Further, it uses an opcode (0x4B) that wasn't available in at least the early Tony Hawk games (though probably was in THAW and onwards); I have denoted that as * in my scripts as it seems to be vaguely similar to C's pointer dereference.

@adituv
adituv / aditubot.py
Created May 26, 2016 20:12
Twitch chatbot prototype with Sopel
from sopel.module import commands, rule, rate
import queue
import threading
import time
###############################################################################
## SECTION: chat commands ##
###############################################################################
@commands('help')
@adituv
adituv / keybase.md
Created September 13, 2015 22:34
keybase.md

Keybase proof

I hereby claim:

  • I am adituv on github.
  • I am adituv (https://keybase.io/adituv) on keybase.
  • I have a public key whose fingerprint is 798A 393A 8BE6 7A6C 060D 8D06 86D6 0E51 3A2B 000F

To claim this, I am signing this object:

@adituv
adituv / denki.lua
Last active October 17, 2015 15:33
Denki Blocks Lua
--[[
Denki Blocks - BizHawk Lua Overlay
Version 1.0.0
Contributions by AdituV
You may use, edit, and redistribute this file under the
condition that this notice is left intact, and attribution
is provided for all contributions as above.
]]
@adituv
adituv / AutoVersion.md
Last active August 29, 2015 14:27
Visual Studio 2012 - Automatically incrementing version for C#

This requires Microsoft Visual Studio 2012 SDK and Microsoft Visual Studio 2012 Visualization & Modeling SDK, which come separately from Visual Studio 2012. Other version combinations are probably possible, and maybe compatible, but untested. The core of the method is this:

  • Add AssemblyInfo.tt to MyProject\Properties, filling out the "Your xxxxxx" sections.
  • Open up the project file (e.g. MyProject.csproj) in a text editor (e.g. Notepad++), and locate the line that defines the build targets for the language ("import project... microsoft.csharp.targets")
  • Insert the contents of MyProject.csproj there
  • Finally, if you build the AssemblyInfo.tt template within Visual Studio, make sure to set AssemblyInfo1.cs to Build Action: None in the File Properties window. This will fix any errors about duplicate definitions.
@adituv
adituv / CList.hs
Created June 22, 2015 04:48
Constrained heterogeneous list
{-# LANGUAGE ConstraintKinds, GADTs, RankNTypes #-}
module CList where
infixr 5 :>
data CList c where
Nil :: CList c
(:>) :: forall c t. (c t) => t -> CList c -> CList c
-- "Monomorphic map instance" (ish) for CList. Converts to normal list.
@adituv
adituv / Main.hs
Last active August 29, 2015 14:15
Qualified Record Pun
{-# LANGUAGE NamedFieldPuns #-}
module Main where
import qualified MyRecord as M
someFunction :: M.MyRecordType -> Int
someFunction (MyRecordType { M.someVal }) = M.someVal * M.someVal
main :: IO ()
main = print . someFunction . MyRecordType $ 3
@adituv
adituv / .vimrc
Created November 5, 2014 01:01
I had to recreate my vimrc. Based heavily on http://statico.github.io/vim.html
"BEGIN Vundle stuff
set nocompatible
filetype off
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
Plugin 'gmarik/Vundle.vim'
Plugin 'kien/ctrlp.vim'
@adituv
adituv / input.cc
Last active August 29, 2015 13:56
C++ space-delimited inputs
#include <iostream>
#include <fstream>
#include <limits>
using namespace std;
int main() {
float val1, val2;
int line = 0;
ifstream file("temp.txt", ifstream::in);