Skip to content

Instantly share code, notes, and snippets.

View adituv's full-sized avatar

Iris Ward adituv

View GitHub Profile
@adituv
adituv / approx.dat
Created November 14, 2013 01:50
Pendulum results with and without sin(x) ~ x. Initial conditions: timestep = 0.1s pendulum length = 1m pendulum mass = 0.25kg gravitational acceleration = 9.81 damping = 0.5 initial angle = 1 initial angular velocity: -0.8
# Assumed that sin(x) ~ x
0.837900
0.626022
0.395107
0.171615
-0.024014
-0.178162
-0.284002
-0.340814
-0.352829
@adituv
adituv / conditions.txt
Last active December 28, 2015 06:49
More comparison data for pendulum.
Please enter the following parameters:
Timestep /s: 0.1
Simulation length /timesteps: 100
Pendulum length /m: 1
Pendulum mass /kg: 0.25
Gravitational acceleration /m s^-2: 9.81
Damping constant /?: 0
Initial pendulum angle /rad: 1
Initial pendulum angular velocity /rad s^-1: -0.8
@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 / 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 / .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 / .zshrc
Created September 8, 2016 18:23
oh-my-zsh zshrc
# Path to your oh-my-zsh installation.
export ZSH=/home/aditu/.oh-my-zsh
# Configuration for Powerline theme
# Hide context when in this user's context
DEFAULT_USER="aditu"
POWERLEVEL9K_MODE='awesome-fontconfig'
POWERLEVEL9K_STATUS_VERBOSE=false
@adituv
adituv / tmp_generate_dbg_pak.cs
Last active October 16, 2016 09:36
tmp_generate_dbg_pak
using System;
using System.Collections.Generic;
using System.IO;
namespace tmp_generate_dbg_pak
{
class Program
{
// Generates a stub "dbg.pak.xen" file from a filename checksum listing
// One entry per line in the listing, tab separated. Checksum (no 0x), then the path
@adituv
adituv / main.idr
Created October 23, 2016 22:05
Idris attempt?
module Main
import Data.Vect
toVect : List a -> ( n:Nat ** Vect n a )
toVect Nil = ( 0 ** Nil )
toVect (x :: xs) with (toVect xs)
| (n ** ys) = ( S n ** x :: ys )
listFromString : String -> List Int
@adituv
adituv / demoteNat.hs
Created December 4, 2017 03:22
No proxies thanks to -XTypeApplications!
{-# LANGUAGE AllowAmbiguousTypes #-}
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE FunctionalDependencies #-}
{-# LANGUAGE KindSignatures #-}
{-# LANGUAGE MultiParamTypeClasses #-}
{-# LANGUAGE PolyKinds #-}
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE TypeApplications #-}
@adituv
adituv / Text.hs
Created January 4, 2018 07:24
Text to Foundation's String
{-# LANGUAGE BangPatterns #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# LANGUAGE TypeFamilies #-}
module Foundation.Interop.Text where
import Foundation
import Foundation.Array
import Foundation.Bits
import Foundation.Collection