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
container_commands: | |
01_fix_static_cors: | |
command: "/tmp/fix_static_cors.sh" | |
files: | |
"/tmp/fix_static_cors.sh": | |
mode: "000755" | |
owner: root | |
group: root | |
content: | | |
#!/bin/bash |
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
# do it once | |
seq 1 | parallel -n0 "curl http://localhost:3000" | |
# do it twice | |
seq 2 | parallel -n0 "curl --header 'Connection: keep-alive' http://localhost:3000" | |
# do it 4 times, but at 2 a time | |
seq 10000 | parallel -n0 -j10 "curl --header 'Connection: keep-alive' https://prelive.tripl.de" | |
``` |
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
namespace :db do | |
desc "Populate database" | |
task :populate => :environment do | |
[Brand].each(&:delete_all) | |
filename = File.join Rails.root, "databases/brands.csv" | |
counter = 0 | |
CSV.foreach(filename, headers: true) do |row| | |
p row |
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 PdfMerger | |
def merge(pdf_paths, destination) | |
first_pdf_path = pdf_paths.delete_at(0) | |
Prawn::Document.generate(destination, :template => first_pdf_path) do |pdf| | |
pdf_paths.each do |pdf_path| | |
pdf.go_to_page(pdf.page_count) |