Skip to content

Instantly share code, notes, and snippets.

View SeanTAllen's full-sized avatar
🐴
Seriouspony

Sean T Allen SeanTAllen

🐴
Seriouspony
View GitHub Profile
@SeanTAllen
SeanTAllen / column issue
Created October 19, 2010 03:36
With column:
/* line 4, ../../../../../../../.gem/ruby/1.8/gems/compass-0.10.5/frameworks/blueprint/stylesheets/blueprint/reset/_utilities.scss */
html, body {
margin: 0;
padding: 0;
border: 0;
font-weight: inherit;
font-style: inherit;
font-size: 100%;
font-family: inherit;
vertical-align: baseline;
require 'rubygems'
require 'nokogiri'
page = <<EOS
<head>
<title>Test</title>
</head>
EOS
puts Nokogiri::HTML.fragment( page ).inspect
require 'rubygems'
require 'nokogiri'
frag = Nokogiri::XML.fragment( '<p id="content">hi</p>' )
path = './/p'
ns = {}
handler = nil
ctx = Nokogiri::XML::XPathContext.new(frag.children.first)
@SeanTAllen
SeanTAllen / Who does this?
Created January 22, 2011 17:52
from schwab.com wherein they delete the password field and recreate it... why the first one is considered a 'dummy'... eh? messes with password savers, autofill etc.
// replace password dummy with real field on focus:
function pwFocus(id) {
var elm = document.getElementById(id);
if (elm.value == "Password") {
var newElm = document.createElement("input");
var elmWrapper = document.getElementById("pwBox");
newElm.setAttribute("type", "password");
newElm.setAttribute("name", id);
newElm.setAttribute("id", id);
newElm.setAttribute("onblur", "pwBlur(this.id);");
@SeanTAllen
SeanTAllen / gist:952748
Created May 3, 2011 02:57
Ugly pharo dumping to redline format
class := TestCase.
aStream := String new writeStream .
class superclass == nil
ifTrue: [aStream nextPutAll: 'ProtoObject']
ifFalse: [aStream nextPutAll: class superclass name].
aStream
nextPutAll: class kindOfSubclass;
store: class name;
crlf.
@SeanTAllen
SeanTAllen / gist:1021722
Created June 12, 2011 16:23
Collection style fizz buzz
fbz := (1 to: 100) asOrderedCollection.
3 to: 100 by: 3 do: [:i | fbz at: i put: 'Fizz'].
5 to: 100 by: 5 do: [:i | fbz at: i put: 'Buzz'].
15 to: 100 by: 15 do: [:i | fbz at: i put: 'FizzBuzz'].
fbz do: [:i | Transcript show: i; cr]
@SeanTAllen
SeanTAllen / gist:1306461
Created October 22, 2011 20:27
Help me build a better site for Redline Smalltalk
Hi,
I'm working on making the experience with redline.st much better. To do that, I need your input.
If you could either comment on this gist with your answers to the questions below or drop me
an email at sean@monkeysnatchbanana.com, I'd really appreciate it.
* When you arrive at the website for a programming language that you don't currently use
what do you immediately want to know? What are the questions you wanted answered before
you do any digging through the site?
> javac -version
javac 1.6.0_24
> mvn -v
Apache Maven 3.0.3 (r1075438; 2011-03-01 04:31:09+1100)
> git --version
git version 1.7.5.4
> git clone https://github.com/redline-smalltalk/redline-smalltalk
@SeanTAllen
SeanTAllen / gist:1515445
Created December 23, 2011 21:46
New Assertion.st
" Redline Smalltalk, Copyright (c) James C. Ladd. All rights reserved. See LICENSE in the root of this distribution "
Object < #Assertion
+ assert: anObject equals: expectedObject withMessage: aString
anObject = expectedObject ifFalse: [ Object error: aString ].
+ assert: anObject notEqualTo: unexpectedObject withMessage: aString
anObject = unexpectedObject ifFalse: [ Object error: aString ].