Skip to content

Instantly share code, notes, and snippets.

View nlowe's full-sized avatar
🏠
Working from home

Nathan Lowe nlowe

🏠
Working from home
View GitHub Profile
//Compile With: valac --thread --pkg gtk+-3.0 TestApp.vala
using Gtk;
public class TestBar : Gtk.HeaderBar{
private unowned TestWindow main_window;
public TestBar(TestWindow parent){
get_style_context().add_class("my-bar");
show_close_button = true;
@nlowe
nlowe / Test-Page.md
Created December 5, 2014 17:05
Test Page Source for gollum/gollum#915

#Test Page Here is how to use the Test Pages macro: <<Test("One", "Two", "Three Four Five")>>

And again for your convenience:

<<Test("One", "Two", "Three Four Five")>>
@nlowe
nlowe / pages.rb
Created May 18, 2015 20:37
Potential fix for gollum/gollum#1012
#...
def files_folders
if has_results
folders = {}
page_files = {}
# 1012: Folders and Pages need to be separated
@results.each do |page|
page_path = page.path.sub(/^#{@path}\//, '')
@nlowe
nlowe / Style-Test.md
Last active August 29, 2015 14:24
Gollum Style Errors

Install Prerequisites

  1. Test Inline in List: Add-WindowsFeature Web-Windows-Auth,Web-ISAPI-Ext,Web-Metabase,Web-WMI,BITS,RDC,NET-Framework-Features,Web-Asp-Net,Web-Asp-Net45,NET-HTTP-Activation,NET-Non-HTTP-Activ,Web-Static-Content,Web-Default-Doc,Web-Dir-Browsing,Web-Http-Errors,Web-Http-Redirect,Web-App-Dev,Web-Net-Ext,Web-Net-Ext45,Web-ISAPI-Filter,Web-Health,Web-Http-Logging,Web-Log-Libraries,Web-Request-Monitor,Web-HTTP-Tracing,Web-Security,Web-Filtering,Web-Performance,Web-Stat-Compression,Web-Mgmt-Console,Web-Scripting-Tools,Web-Mgmt-Compat -Restart

Regular inline:

`Add-WindowsFeature Web-Windows-Auth,Web-ISAPI-Ext,Web-Metabase,Web-WMI,BITS,RDC,NET-Framework-Features,Web-Asp-Net,Web-Asp-Net45,NET-HTTP-Activation,NET-Non-HTTP-Activ,Web-Static-Content,Web-Default-Doc,Web-Dir-Browsing,Web-Http-Errors,Web-Http-Redirect,Web-App-Dev,Web-Net-Ext,Web-Net-Ext45,Web-ISAPI-Filter,Web-Health,Web-Http-Logging,Web-Log-Libraries,Web-Request-Monitor,Web-HTTP-Tracing,Web-Security,Web-Filtering,Web-Performance,

@nlowe
nlowe / gollum.lib.tests.log
Created July 31, 2015 19:02
`gollum` and `gollum-lib` unit tests under windows and JRuby
bundle : io/console not supported; tty will not be manipulated
At line:1 char:1
+ bundle exec rake test > gollum.lib.tests.log 2>&1
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (io/console not ... be manipulated:String) [], RemoteException
+ FullyQualifiedErrorId : NativeCommandError
io/console not supported; tty will not be manipulated
@nlowe
nlowe / KivyTest.py
Last active September 5, 2015 20:03
from kivy.app import App
from kivy.lang import Builder
from kivy.properties import ObjectProperty
from kivy.uix.label import Label
from kivy.uix.widget import Widget
UI = """
#:kivy 1.9.0
@nlowe
nlowe / test.vala
Created September 15, 2015 18:14
GTK+ Maximize bugs
// Compile with: valac --pkg gtk+-3.0 test.vala
public class Application : Gtk.Window {
public Application(){
// Uncomment these lines to test with a headerbar
//var hb = new Gtk.HeaderBar();
//hb.show_close_button = true;
//set_titlebar(hb);
title = "Test Window";
@nlowe
nlowe / gencues.py
Created October 12, 2015 01:29 — forked from junefrench/gencues.py
Generate X32 Snippets for Musical Theatre
"""
Instructions for use
Change channel_count and dca_count as appropriate. (Note that this always assumes that you are using the lowest-numbered channels and dcas for cue control)
Change channels to the list of names of channels you want under cue control.
Change cues to your list of cues, following the examples. the comment in cues documents the syntax.
"""
@nlowe
nlowe / pratt.py
Created November 22, 2015 19:29
Pratt sequence generator in python
# Original script by Damian Yerrick
# http://stackoverflow.com/a/25964763
def pratt(max_size):
"""Generate a sorted list of products of powers of 2 and 3 below max_size"""
# for https://stackoverflow.com/q/25964453/2738262
products = []
pow3 = 1 # start with q = 0
while pow3 <= max_size:
# At this point, pow3 = 3**q, so set p = 0
pow2 = pow3
@nlowe
nlowe / AVL.cpp
Last active March 24, 2016 15:03
AVL Insert from Slides
node *root=NULL;
void AVL_Insert(data X)
{
node *Y; // The new node we insert
node *A, *B, *F; // see below...
node *C, *CL, *CR // ... for description
int d; // displacement; Used to adjust BFs
if (root==NULL) // Empty tree? Make root node!
{