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
aws ec2 describe-instances \ | |
--filters Name=dns-name,Values=ec2-12-345-678-90.myregion.compute.amazonaws.com \ | |
| jq '.Reservations [] .Instances [] .InstanceId' \ | |
| xargs -n1 aws ec2 get-console-output --instance-id \ | |
| jq '.Output' |
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
aws ec2 describe-instances \ | |
--filters Name=dns-name,Values=ec2-12-345-678-90.myregion.compute.amazonaws.com \ | |
| jq '.Reservations [] .Instances [] .InstanceId' |
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
ALTER TABLE "public"."foo" ADD COLUMN "id" INTEGER; | |
CREATE SEQUENCE "public"."foo_id_seq"; | |
UPDATE foo SET id = nextval('"public"."foo_id_seq"'); | |
ALTER TABLE "public"."foo" ALTER COLUMN "id" SET DEFAULT nextval('"public"."foo_id_seq"'); | |
ALTER TABLE "public"."foo" ALTER COLUMN "id" SET NOT NULL; | |
ALTER TABLE "public"."foo" ADD UNIQUE ("id"); | |
ALTER TABLE "public"."foo" DROP CONSTRAINT "foo_id_key" RESTRICT; | |
ALTER TABLE "public"."foo" ADD PRIMARY KEY ("id"); |
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
#!/bin/bash | |
current=`find /Applications/Google\ Chrome.app/Contents/Versions -maxdepth 1 -type d -name "*.*.*.*" | sort | tail -1 | xargs -I% basename %` | |
echo Deleting old Chrome versions and keep $current | |
find /Applications/Google\ Chrome.app/Contents/Versions -maxdepth 1 -type d -name "*.*.*.*" -not -iname "$current" -exec rm -rf {} + |
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
<?php | |
class Factory | |
{ | |
// ... | |
/** | |
* Helper to instantiate objects with dynamic constructors. | |
* |
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
#!/bin/bash | |
# Base Repository URL | |
SVN_URL=http://svn-repo-url | |
# Atlassian Jira URL | |
JIRA_URL=https://jira-url | |
# Jira Project Key | |
PROJECT=project-key |
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
@mixin all-retina-sprites($map, $map2x) { | |
@media (min--moz-device-pixel-ratio: 1.5), | |
(-o-min-device-pixel-ratio: 3/2), | |
(-webkit-min-device-pixel-ratio: 1.5), | |
(min-device-pixel-ratio: 1.5), | |
(min-resolution: 1.5dppx) { | |
$base-class: sprite-map-name($map); | |
.#{$base-class}-all-retina-sprites { |
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
# TODO: Can be removed after updating to rack 1.3.0 | |
module Rack | |
module Utils | |
def escape(s) | |
CGI.escape(s.to_s) | |
end | |
def unescape(s) | |
CGI.unescape(s) | |
end | |
end |
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 ENV.key?('SELENIUM_REMOTE') | |
Capybara.register_driver :selenium do |app| | |
require 'selenium-webdriver' | |
profile = Selenium::WebDriver::Firefox::Profile.from_name 'default' | |
capabilities = Selenium::WebDriver::Remote::Capabilities.firefox(:firefox_profile => profile) | |
Capybara::Selenium::Driver.new(app, { :browser => :remote, :desired_capabilities => capabilities }) | |
end | |
end |
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
# Install and run xvfb | |
apt-get install xvfb | |
Xvfb -ac :99 | |
# Get Firefox | |
wget -O firefox-5.0.tar.bz2 "http://download.mozilla.org/?product=firefox-5.0&os=linux&lang=en-US" | |
tar xfj firefox-5.0.tar.bz2 | |
mv firefox firefox-5.0 | |
# Get Selenium Server |