Skip to content

Instantly share code, notes, and snippets.

View rlee287's full-sized avatar

Ryan Lee rlee287

  • 13:15 (UTC -07:00)
View GitHub Profile
@rlee287
rlee287 / Git_History.sh
Created January 3, 2016 18:47
Useful Git Aliases
git config --global alias.hist log --oneline --graph --date-order --decorate --all
git config --global alias.hist-auth log --branches --pretty=format:'%C(yellow) %h %C(magenta)%<(20)%an %C(green bold)%G? %C(blue nobold)%>>(16)%GK%Creset%<(24,trunc) %aD'
git config --global alias.commit-info log --stat -1
@rlee287
rlee287 / pre-commit.sh
Last active March 29, 2021 16:50
Short git pre-commit hook to remove BOM headers
#!/bin/sh
#
# A hook script to remove BOM headers
echo "Running pre-commit BOM removal"
trap ctrl_c INT
ctrl_c ()
{
@rlee287
rlee287 / instructions.txt
Created April 16, 2016 05:35
Git Gui tools on cygwin
To use git gui and gitk
Get xinit
When want to use, run `startxin &` and `export DISPLAY=:0`
Need to get dejavu fonts to run git gui or gitk
@rlee287
rlee287 / file.rst
Last active May 27, 2016 02:27
Bug report for Github rst parser

Section 1

  • Bullet point 1
  • Bullet point 2
  • Everything seems fine

Section 2

  • Bullet point 3
  • Bullet point 4
@rlee287
rlee287 / Alabaster.html
Last active December 29, 2016 03:22
Alabaster footer vs default footer
{%- block footer %}
<div class="footer">
{% if show_copyright %}&copy;{{ copyright }}.{% endif %}
{% if theme_show_powered_by|lower == 'true' %}
{% if show_copyright %}|{% endif %}
Powered by <a href="http://sphinx-doc.org/">Sphinx {{ sphinx_version }}</a>
&amp; <a href="https://github.com/bitprophet/alabaster">Alabaster {{ alabaster_version }}</a>
{% endif %}
{%- if show_source and has_source and sourcename %}
{% if show_copyright or theme_show_powered_by %}|{% endif %}
@rlee287
rlee287 / nbody.c
Created March 12, 2017 16:59
LLVM bug report
/* The Computer Language Benchmarks Game
* http://benchmarksgame.alioth.debian.org/
*
* contributed by Christoph Bauer
* slightly sped up by Petr Prokhorenkov
*
* Taken from https://github.com/cythonbook/examples (04-nbody 03-pure-c)
*/
#include <math.h>
@rlee287
rlee287 / noiseless.png
Last active April 15, 2017 21:01
The effect of noise on numerical integration
noiseless.png
@rlee287
rlee287 / deploy_tag.sh
Last active March 17, 2018 04:56
FRC Tag Deploy Script
#!/bin/sh
if [ $# -lt 1 ]; then
echo "Usage: $0 <name of tag>"
exit
fi
git add --all
git diff --staged --quiet
hasdiff=$?
if [ $hasdiff -eq 0 ]; then
echo "No changes exist on the index"
@rlee287
rlee287 / feca_hdr.py
Created July 28, 2018 02:43
An updated version of the GIMP Ferenc Kalman (feca) HDR plugin, tested with GIMP 2.10
#!/usr/bin/env python
# Gimp-Python - allows the writing of Gimp plugins in Python.
# Copyright (C) 2007 Kalman, Ferenc <fkalman@index.hu>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
@rlee287
rlee287 / plot_entropy_linux.py
Created September 28, 2018 15:04
A python script to matplotlib plot the estimated entropy of a system
import matplotlib.dates
import pylab as plt
import numpy as np
from datetime import datetime
def get_entropy():
with open("/proc/sys/kernel/random/entropy_avail","r") as fil:
res=fil.read()
return int(res)