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
# 1. install Google Chrome | |
# 2. download latest Google Chrome webdriver from there: http://chromedriver.storage.googleapis.com/index.htm | |
# 3. unzip and copy to /usr/local/bin | |
# 4. setup rights for your user and make it executable | |
# 5. setup Selenium and Capybara | |
Capybara.register_driver :selenium do |app| | |
Capybara::Selenium::Driver.new(app, :browser => :chrome) | |
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
# Ubuntu installation instructions for Google Chrome | |
wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | sudo apt-key add - | |
sudo sh -c 'echo "deb http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google.list' | |
sudo apt-get update | |
sudo apt-get install google-chrome-stable |
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
class Migration < ActiveRecord::Migration | |
def change | |
SchemaPlus.setup do |config| | |
config.foreign_keys.auto_create = false | |
end | |
create_table :period_types, force: true do |t| | |
t.string :name | |
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
package main | |
import "fmt" | |
func main() { | |
for a, b := range map[int]int{ | |
-1: 100, | |
-101: 100, | |
245: 100, |
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
package main | |
import ( | |
"flag" | |
"fmt" | |
"os" | |
) | |
func main() { |
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
#!/usr/bin/env bash | |
RUNNING_CONTAINERS=`docker ps -aq` | |
if [[ $RUNNING_CONTAINERS ]]; then | |
docker stop $RUNNING_CONTAINERS | |
docker rm -f $RUNNING_CONTAINERS | |
fi | |
docker network prune -f |
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
# Export client certificate | |
openssl pkcs12 -in bundle.pfx -clcerts -nokeys -out client.pem | |
# Export client key | |
openssl pkcs12 -in bundle.pfx -nocerts -out client.key -nodes | |
# Export CA certs chain | |
openssl pkcs12 -in bundle.pfx -cacerts -nokeys -out ca.pem |
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
SELECT table_name, | |
pg_relation_size(quote_ident(table_name)) AS size, | |
n_live_tup AS rows | |
FROM information_schema.tables AS it | |
JOIN pg_stat_user_tables AS ut | |
ON it.table_name = ut.relname | |
AND it.table_schema = ut.schemaname | |
WHERE table_schema = 'public' | |
ORDER BY 2 DESC; |