This file contains hidden or 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
https://github.com/makandra/cucumber_factory | |
Create records from Cucumber features without writing step definitions. http://makandra.com/ | |
https://github.com/jayzes/cucumber-api-steps | |
Cucumber steps to easily test REST-based XML and JSON APIs | |
https://github.com/collectiveidea/json_spec | |
Easily handle JSON in RSpec and Cucumber http://rubygems.org/gems/json_spec | |
https://github.com/napcs/cucumber_watir |
This file contains hidden or 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
require 'aws-sdk' | |
require 'fog' | |
# -------------- | |
# before running this, set the required environment variables: | |
# AWS_ACCESS_KEY_ID | |
# AWS_SECRET_ACCESS_KEY | |
# AWS_REGION | |
# -------------- |
This file contains hidden or 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
# Create a firefox driver that can be passed to HeadlessBrowser.new | |
def start_driver | |
profile = Selenium::WebDriver::Firefox::Profile.new | |
profile["browser.download.folderList"] = 2 # This allows downloads to be sent to a custom location | |
profile["browser.download.manager.showWhenStarting"] = false | |
profile["browser.download.dir"] = `/home/max/Downloads` # download to this custom path | |
# FILES WILL NOT DOWNLOAD UNLESS THEIR MIME TYPE IS INCLUDED IN THIS LIST! | |
profile["browser.helperApps.neverAsk.saveToDisk"] = accepted_mime_types_for_download | |
This file contains hidden or 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
echo 'export PATH=$HOME/local/bin:$PATH' >> ~/.bashrc | |
. ~/.bashrc | |
mkdir ~/local | |
mkdir ~/node-latest-install | |
cd ~/node-latest-install | |
curl http://nodejs.org/dist/node-latest.tar.gz | tar xz --strip-components=1 | |
./configure --prefix=~/local | |
make install # ok, fine, this step probably takes more than 30 seconds... | |
curl https://www.npmjs.org/install.sh | sh |
This file contains hidden or 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
Template.map.onCreated(function(){ | |
var self = this | |
GoogleMaps.ready('map', function(map) { | |
self.autorun(function(){ | |
self.map = map | |
plotAllUsers.bind(self)() | |
var user = Meteor.user() | |
if (user) { | |
setupReactiveVarsAndGetCoords(user).then(function(coords){ |
This file contains hidden or 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
comments = RedditKit::Client.new(REDDIT_USERNAME, REDDIT_PASSWORD).messages.results | |
puts comments.first(5).map(&:attributes).map do |obj| | |
<<-TXT | |
#{obj[:link_title]} (#{obj[:subreddit]}) | |
#{obj[:body]} - #{obj[:author]} | |
http://reddit.com#{obj[:context]} | |
TXT | |
end.join("\n\n") |
This file contains hidden or 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
class Rhythm | |
attr_reader :num_beats | |
def initialize(num_beats) | |
@num_beats = num_beats | |
end | |
def to_s | |
"1 " + (num_beats - 1).times.map { "x" }.join(" ") | |
end | |
end |
This file contains hidden or 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
# credit http://stackoverflow.com/a/16950202/2949493 | |
def with_stdin | |
stdin = $stdin # remember $stdin | |
$stdin, write = IO.pipe # create pipe assigning its "read end" to $stdin | |
yield write # pass pipe's "write end" to block | |
ensure | |
write.close # close pipe | |
$stdin = stdin # restore $stdin |
This file contains hidden or 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
<!doctype html> | |
<html> | |
<head> | |
<script src="https://rawgit.com/jaysalvat/buzz/master/dist/buzz.js"></script> | |
<script src="https://code.jquery.com/jquery-git2.min.js"></script> | |
<style> | |
.playing { | |
border: 1px solid red; | |
} | |
</style> |
This file contains hidden or 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
$ echo -e "function alia { \n echo -e \"\n function \$1 { \n \$2 \n }\" >> ~/.bashrc \n }" >> ~/.bashrc | |
# restart shell to use | |
# usage: $ alia "name" "cmd" | |
# e.g.: $ alia "gac" "git add -A; git commit -m \"\$1\" " | |
# $ bash | |
# $ gac "my commit message" | |
# | |
# $1 refers to a variable | |
# note that $ and " characters are escaped in the alias content |