Skip to content

Instantly share code, notes, and snippets.

View russplaysguitar's full-sized avatar

Russ russplaysguitar

View GitHub Profile
#!/bin/bash
root=$(pwd)
prefix="$root/vendor/git"
# build into $prefix
cd git-*
make NO_OPENSSL=YesPlease NO_CURL=YesPlease configure
./configure --prefix="${prefix}"
make -i
@russplaysguitar
russplaysguitar / getValidEmails.cfm
Last active December 17, 2015 01:39
Select only records with valid e-mail addresses from a table using UnderscoreCF
<cfscript>
// setup QofQ
myQuery = QueryNew("Name, Email, Time, Advanced", "VarChar, VarChar, Time, Bit");
QueryAddRow(myQuery, 2);
QuerySetCell(myQuery, "Name", "Rich", 1);
QuerySetCell(myQuery, "Email", "rich@rich.com", 1);
QuerySetCell(myQuery, "Time", "9:15 AM", 1);
QuerySetCell(myQuery, "Advanced", False, 1);
QuerySetCell(myQuery, "Name", "Bob", 2);
QuerySetCell(myQuery, "Email", "bob.rich.com", 2);
/* Friday Puzzler: Sort Type
http://www.raymondcamden.com/index.cfm/2013/3/29/Friday-Puzzler-Sort-Type
This solution should be appropriate for large data-sets. Time complexity is O(n).
It utilizes short-circuiting logic to stop testing a list for sortability as soon as a pair of items that break the sort are found.
It also stops testing different sort functions once a suitable match has been found.
Requirements: Underscore.js
@russplaysguitar
russplaysguitar / gist:5027683
Created February 25, 2013 04:06
Shoes button that works
Shoes.app width: 600, height: 400 do
parent = Shoes::Flow.new app, app: app
Shoes::Button.new(parent, "text", {:width => 131, :height => 137, :margin => 143}, Proc.new {})
end
@russplaysguitar
russplaysguitar / gist:3944326
Created October 24, 2012 06:15
Islands - The Arm (part)
GAt9th: (5:9 4:11 3:11)
BAt9th: (4:9 3:11 2:12)
EAt9th: (3:9 2:12 1:12)
AAt7th: (4:7 3:9 2:10)
DAt7th: (3:7 2:10 1:10)
CAt9th: (5:9 4:11 3:11)
EAt7th: (5:7 4:9 3:9)
GFlat: (6:2 5:4 4:4)
DAt5th: (5:5 4:7 3:7)
@russplaysguitar
russplaysguitar / islands-sea_ghost.marktab
Created October 23, 2012 06:33
Islands - Sea Ghost
Amaj: (6:5 5:7 4:7 3:6 2:5 1:5)
Emaj: (5:7 4:9 3:9 2:9 1:7)
Bmaj: (6:7 5:9 4:9 3:8 2:7 1:7)
OpnEmaj: (6:0 5:2 4:2 3:1 2:0 1:0)
AfltMin: (6:4 5:6 4:6 3:4 2:4 1:4)
Esomething: (5:7 4:9 3:8 2:9 1:7)
3:9 2:9 1:7 1:9 1:7 3:9 2:9 3:9 2:9
3:9 2:9 1:7 1:9 1:7 3:9 2:9 3:9 2:9
3:9 2:9 1:7 1:9 1:7 3:9 2:9 3:9 2:9
@russplaysguitar
russplaysguitar / gist:3259915
Created August 4, 2012 21:03
Turn a Coldfusion Struct into an "object" using _.bindAll()
/*
This is an example of one way to use _.bindAll from the Underscore.cfc library: http://russplaysguitar.github.com/UnderscoreCF/#bindAll
Normally, you wouldn't be able to access other keys in the same struct using "this", but _.bindAll() lets us!
*/
_ = new Underscore();
exampleStruct = {
greeting: 'Hello, World!',
@russplaysguitar
russplaysguitar / Application.cfc
Created January 5, 2012 08:23
A generalized "pass-through" from cfscript to any cf tag
<cfcomponent
output="false"
hint="I define the application settings and event handlers.">
<!--- Define the application. --->
<cfset this.name = hash( getCurrentTemplatePath() ) />
<cfset this.applicationTimeout = createTimeSpan( 0, 0, 0, 30 ) />
<!---
Create a mapping to the virtual file system so that we
@russplaysguitar
russplaysguitar / pyrunner_code_bit.py
Created July 19, 2011 05:57
A bit of code from PyRunner
class block(scroller):
def __init__(self, y):
scroller.__init__(self)
self.side1 = random.randint(20,100)
self.side2 = 20
self.dimensions = random.choice([(self.side1,self.side2),(self.side2,self.side1)])
self.image = pygame.Surface(self.dimensions)
self.rect = self.image.get_rect()
self.y = y
pygame.draw.rect(self.image, (28,55,183), self.rect)
@russplaysguitar
russplaysguitar / 1.level
Created June 15, 2011 03:14
First attempt at file reading for lovely-snake
|
|
|
+ |
+ |
+ |
+ |
|
|
|