Skip to content

Instantly share code, notes, and snippets.

builds:
- name: shared
dockerfile: shared.Dockerfile
services:
- name: service1
# Equivalent to placing this build config in a top-level build named "services2.init.init1"
build:
@jstotz
jstotz / auto_pause_resume.sh
Last active April 11, 2023 17:55
Auto pause/resume all Release environments
#!/bin/bash
set -euo pipefail
scale_environment() {
app=$1
env=$2
replicas=$3
echo "Setting $app environment $env replicas to $replicas"
@jstotz
jstotz / hanging_request.txt
Last active August 24, 2019 18:09
Request
curl -v https://smarttransactions.net/gateway_springboard.php -H "Content-Type: xml" -d "<Request>
<POS_Entry_Mode>M</POS_Entry_Mode>
<Action_Code>05</Action_Code>
<Terminal_ID>002</Terminal_ID>
<Merchant_Number>712731001001</Merchant_Number>
<Card_Number>715733104888182</Card_Number>
</Request>"
* Trying 65.101.207.105:443...
* TCP_NODELAY set
Sequel.migration do
no_transaction
change do
alter_table :foo do
add_column :bar, String
add_index :bar, concurrently: true
end
end
end

Keybase proof

I hereby claim:

  • I am jstotz on github.
  • I am jstotz (https://keybase.io/jstotz) on keybase.
  • I have a public key ASCVpXFXPpsgEho01EXUTOUbfPGKlZDxEizLjhaTqMCaDwo

To claim this, I am signing this object:

# ...
fetchAll: ->
@fetchTickets().
pipe(=> @fetchTicketLines()).
pipe(=> @fetchInventory()).
pipe(=> @fetchBinLocations())
# ...
# ...
@jstotz
jstotz / gist:4033022
Created November 7, 2012 17:14
Terminal prompt after reading $stdin
puts "Reading lines..."
$stdin.each_line do |line|
puts "IN: #{line}"
end
$stdin.reopen File.open("/dev/tty", "r")
puts "Awaiting user input..."
@jstotz
jstotz / gist:1820315
Created February 13, 2012 20:53
Ruby Enumerable#zip
enum1 = [:a, :b, :c]
enum2 = [1, 2, 3]
enum1.zip(enum2) do |x, y|
puts "#{x} -> #{y}"
end
# Output:
# a -> 1
# b -> 2
# c -> 3
if row[:item_properties]
item_properties = JSON.parse(row[:item_properties])
item_property_array = item_property_columns.map {|c| item_properties[c]}
else
item_property_array = item_property_columns.size.times.map { nil }
end
@jstotz
jstotz / output.png
Created June 27, 2011 16:50
Codebrawl #2
output.png