This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if (!navigator.geolocation) { | |
navigator.geolocation = (function (window) { | |
function reloadGeoIP(callback) { | |
// NOTE: for some reason, chaging the url is *allowed* with this service. Useful, but random | |
var geourl = 'http://j.maxmind.com/app/geoip.js_' + Math.random(), | |
iframe = document.createElement('iframe'), | |
doc, win; | |
iframe.style.display = 'none'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Scenario: Create valid User | |
Given I have no users | |
And I am on the users page | |
When I follow "New User" | |
And I fill in "First Name" with "Paul" | |
And I fill in "Last Name" with "Ketelle" | |
And I fill in "Username" with "ketellep" | |
And I fill in "Email" with "paul@white-agency.co.uk" | |
And I fill in "Password" with "pk1" | |
And I fill in "Password Confirmation" with "pk1" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
And I unselect "Evolution" from "Tags" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Scenario: Ordering | |
And I follow "Archive" | |
Then I should see the following div with id archive results: | |
|Article Evolution and Biology Title TAGGED: BIOLOGY, EVOLUTION| | |
|Article Biology Only Title TAGGED: BIOLOGY | | |
|Article Evolution Only Title TAGGED: EVOLUTION | | |
When I follow "Article Biology Only Title" | |
And I fill in "Content" with "This comment should be long enough!" | |
And I press "Create Comment" | |
And I follow "Archive" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module Rack | |
class UDPLoggerThingy | |
def initialize app, options = { } | |
@app = app | |
end | |
def call env | |
status, headers, body = @app.call(env) | |
#Do shit here | |
#http://rack.rubyforge.org/doc/classes/Rack/Request.html |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
validates_format_of :email, :with => /^[A-Z0-9._%-]+@[A-Z0-9.-]+\.[A-Z]{2,4}/i | |
validates_format_of :website, :with => /^http:\/\// |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
rails testing_deployed_app | |
cd testing_deployed_app | |
ruby script/generate cucumber --rspec --capybara | |
#In features/support/env.rb add | |
Capybara.current_driver = :selenium | |
Capybara.app_host = 'http://news.bbc.o.uk' | |
rake db:migrate |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function htmlToMarkdown($container) { | |
var $clone = $container.clone(); | |
$("*",$clone).removeAttr("name").removeAttr("title").removeAttr("id") | |
var html = $clone.html(); | |
html = standardiseHTML(html); | |
html = html.replace(/<a [^h]*href=["']([^"']*)["'][^>]*>([^<]*)<\/a>/gi, " [$2]($1)"); | |
html = html.replace(/<em[^>]*>([^<]*)<\/em>/gi,"*$1*"); | |
html = html.replace(/<strong[^>]*>([^<]*)<\/strong>/gi,"**$1**"); | |
html = html.replace(/<i[^>]*>([^<]*)<\/i>/gi,"*$1*"); | |
html = html.replace(/<b[^>]*>([^<]*)<\/b>/gi,"**$1**"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Have a UIImage *image | |
NSDictionary *detectorOptions = [[NSDictionary alloc] initWithObjectsAndKeys:CIDetectorAccuracyHigh, CIDetectorAccuracy, nil]; | |
CIDetector *faceDetector = [CIDetector detectorOfType:CIDetectorTypeFace context:nil options:detectorOptions]; | |
CIImage *ciImage = [CIImage imageWithCGImage:[image CGImage]]; | |
NSArray *features = [faceDetector featuresInImage:ciImage]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <DigitalPin.h> | |
DigitalPin forward(13); | |
DigitalPin backward(12); | |
void setup(){ | |
} | |
void loop() { | |
backward.off(); |
OlderNewer