Skip to content

Instantly share code, notes, and snippets.

View jasongraham's full-sized avatar

Jason jasongraham

  • Schweitzer Engineering Laboratories
  • Washington State, USA
View GitHub Profile
@jasongraham
jasongraham / less_converter.rb
Created October 22, 2010 04:14
A Jekyll plugin to convert a .less file to .css
module Jekyll
# Compiled LESS CSS into CSS. You must specify an empty YAML front matter
# at the beginning of the file.
# .less -> .css
class LessConverter < Converter
safe true
priority :low
pygments_prefix "\n"
pygments_suffix "\n"
@jasongraham
jasongraham / textilize_cgit.py
Created January 9, 2011 23:43
Used by the cgit 'about-filter' to parse a textile file.
#!/usr/bin/env python
#
# Uses python-textile to convert a textile document to the body
# of an HTML document to display with cgit (http://hjemli.net/git/cgit/).
#
# Install:
#
# 1- Install python-textile ( sudo apt-get install python-textile )
# 2- Copy this script to /usr/local/bin/textilize_cgit.py (with exec rights)
# 3- Add this statement into the your cgit configuration:
@jasongraham
jasongraham / markdownize_cgit.py
Created January 9, 2011 23:55
Used by the cgit 'about-filter' to parse a markdown file.
#!/usr/bin/env python
#
# Copyright 2011, Jason Graham
#
# Uses python-markdown to convert a markdown document to the body
# of an HTML document to display with cgit (http://hjemli.net/git/cgit/).
#
# Install:
#
# 1- Install python-markdown ( sudo apt-get install python-markdown )
@jasongraham
jasongraham / example.py
Created March 11, 2011 05:44
An example of declaring/using/calling functions, and passing data to and from them. Written as a reference for students in one of my classes.
#!/usr/bin/python3.1
#
import random
# single_roll: A function which rolls a single 6 sided die, and returns
# the result back to the calling function
def single_roll():
# returns a random value between 1 and 6
return random.randint(1,6)
@jasongraham
jasongraham / KSP.log
Created June 9, 2013 17:28
Tail end of KSP.log and Player log recorded for bug report. Both Start from the when the VAB was opened.
[LOG 10:07:16.250] ------------------- initializing editor mode... ------------------
[LOG 10:07:16.250] editor started
[LOG 10:07:16.296] Untitled Space Craft - Untitled Space Craft
[LOG 10:07:38.632] kethane.highGain(Clone) added to ship - part count: 2
[LOG 10:07:38.635] stage count is: 0
[LOG 10:08:39.441] Launching vessel from LaunchPad. Craft file: /extra/games/KSP_linux_0.20_test/KSP_Data/../saves/default/Ships/VAB/Auto-Saved Ship.craft
[WRN 10:08:45.953] Cannot find preset 'Default' for pqs 'Eeloo'
[WRN 10:08:45.991] Cannot find preset 'Default' for pqs 'Pol'
[WRN 10:08:46.011] Cannot find preset 'Default' for pqs 'Dres'
[LOG 10:08:46.237] ------------------- initializing flight mode... ------------------
$ xxd -s +0x7cebc7 -l 1 KSP.x86_64
07cebc7: 01
$ echo "7cebc7: 00" | xxd -r - KSP.x86_64
$ xxd -s +0x7cebc7 -l 1 KSP.x86_64
07cebc7: 00
$ xxd -s +0x7cebcc -l 1 KSP.x86_64
07cebcc: 01
$ echo "7cebcc: 00" | xxd -r - KSP.x86_64
$ xxd -s +0x7cebcc -l 1 KSP.x86_64