Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View s2k's full-sized avatar
🤩

Stephan Kämper s2k

🤩
View GitHub Profile
<!DOCTYPE html >
<html lang="en">
<head>
<title>Demo</title>
</head>
<body>
<h1>Whatever</h1>
<p>
<ol>
<li>
@s2k
s2k / keynote.scpt
Created October 19, 2019 15:31 — forked from lambdamusic/keynote.scpt
Apple Keynote: export presenter notes
-- HOWTO:
-- after saving it, open with Script Editor (default) and run it
-- PREREQUISITES:
-- make sure your Keynote presentation is open in the background
-- AFTER EXPORT:
-- if you can't open the file due to encoding errors, open with Sublime (or another a text editor) and then "File / Save with encoding / UTF8"
tell application "Keynote"

Make it real

Ideas are cheap. Make a prototype, sketch a CLI session, draw a wireframe. Discuss around concrete examples, not hand-waving abstractions. Don't say you did something, provide a URL that proves it.

Ship it

Nothing is real until it's being used by a real user. This doesn't mean you make a prototype in the morning and blog about it in the evening. It means you find one person you believe your product will help and try to get them to use it.

Do it with style

@s2k
s2k / gist:5375367
Created April 12, 2013 21:42
A way to chain class methods
class X
def self.m1
puts "m1 called"
self
end
def self.m2
puts "m2 called"
self
end
end
@s2k
s2k / output_to_stdout
Created March 6, 2012 10:44
Watir and a defined constant CONFIG - a failing test case
Loaded suite C:/temp/test_watir_config_constant
Started
F
Finished in 1.156279 seconds.
1) Failure:
test_defined_global_constant_CONFIG_does_not_prevent_creating_a_browser_object(TestConfigConstant) [C:/temp/test_watir_config_constant.rb:9]:
Exception raised:
<#<NoMethodError: undefined method `split' for nil:NilClass>>.
@s2k
s2k / gist:1984945
Created March 6, 2012 08:37
Requiring 'rbconfig' doesn't seem to create a constant CONFIG (Windows)
C:\>irb
irb(main):001:0> CONFIG
NameError: uninitialized constant Object::CONFIG
from (irb):1
from C:/Ruby192/bin/irb:12:in `<main>'
irb(main):002:0> require 'rbconfig'
=> true
irb(main):003:0> CONFIG
NameError: uninitialized constant Object::CONFIG
from (irb):3
@s2k
s2k / gist:1984737
Created March 6, 2012 07:41
Requiring 'rbconfig' doesn't seem to create a constant CONFIG
[5] ... ~ #ruby -e "puts CONFIG"
-e:1:in `<main>': uninitialized constant Object::CONFIG (NameError)
[6] ... ~ #ruby -e "puts require 'rbconfig'; puts CONFIG"
true
-e:1:in `<main>': uninitialized constant Object::CONFIG (NameError)
@s2k
s2k / gist:1978920
Created March 5, 2012 15:47
Watir (2.0.4) creates a constant CONFIG upon calling Browser.new
C:\>irb -r watir
irb(main):001:0> CONFIG
NameError: uninitialized constant Object::CONFIG
from (irb):1
from C:/Ruby192/bin/irb:12:in `<main>'
irb(main):002:0> Watir::Browser.new.close
=> nil
irb(main):003:0> CONFIG.keys
=> ["DESTDIR", "MAJOR", "MINOR", "TEENY", "PATCHLEVEL", "INSTALL", "EXEEXT", "prefix", "ruby_install_name", "RUBY_INSTALL_NAME", "RUBY_SO_NAME", "PACKAGE", "BUI
LTIN_TRANSSRCS", "MANTYPE", "NROFF", "vendorhdrdir", "sitehdrdir", "rubyhdrdir", "UNIVERSAL_INTS", "UNIVERSAL_ARCHNAMES", "configure_args", "vendordir", "sitedi
@s2k
s2k / cucumber_textmate_rails_error_message.txt
Created November 21, 2010 16:03
The TextMate error message displayed after using CMG-R on a feature file in a Rails project.
:29:in `require': no such file to load -- spec (LoadError) from
:29:in `require' from /Users/stephan/Library/Application Support/TextMate/Bundles/Cucumber.tmbundle/Support/lib/cucumber/mate.rb:23:in `' from
:29:in `require' from
:29:in `require' from /Users/stephan/Library/Application Support/TextMate/Bundles/Cucumber.tmbundle/Support/lib/cucumber/mate/feature_helper.rb:1:in `' from
:29:in `require' from
:29:in `require' from /tmp/cucumber-7380.rb:2:in `'
@s2k
s2k / list_stepdefinitions.rb
Created November 8, 2010 10:14
Find and list the Cucumber step definitions in a project
path = File.join( File.dirname( __FILE__), 'features', 'step_definitions', '**', '*.rb' )
Dir[ path ].each{ | sdf |
puts "In #{ sdf }:"
lines = File.read( sdf )
puts lines
puts "STEPS"
lines.scan( /^\s*(Given|When|Then|And|But)\s+(.+)\s+(do|\{)(\s+\|.+\|)?$/ ).map{ | m |
# pp match
puts "#{ m[0] }: #{ m[ 1 ] }"