{{stuff}}
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
> siege http://memphis.technology/ | |
** SIEGE 3.0.1 | |
** Preparing 15 concurrent users for battle. | |
The server is now under siege...^C | |
Lifting the server siege... done. | |
Transactions: 374 hits | |
Availability: 100.00 % | |
Elapsed time: 18.41 secs | |
Data transferred: 0.73 MB |
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
require 'heroku-api' | |
require "dotenv" | |
Dotenv.load | |
APP_NAME = ENV.fetch("HEROKU_APP_NAME") # tubedepot-staging | |
API_KEY = ENV.fetch("HEROKU_API_KEY") # get one from https://dashboard.heroku.com/account | |
# connect | |
heroku = Heroku::API.new(api_key: API_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
#!/usr/bin/env ruby | |
cmd = "ack-grep \"binding\.pry\" | grep -v DEBUG" | |
pries = `#{cmd} | wc -l` | |
unless pries.to_i.zero? | |
puts system(cmd) | |
raise "Found binding.pry" | |
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
Spree::Core::Engine.load_seed if defined?(Spree::Core) && Spree::Country.count.zero? | |
if Spree::User.admin.none? && !Rails.env.production? | |
Spree::Role.find_or_create_by_name!("user") | |
user = Spree::User.find_or_initialize_by(email: "redacted@coroutine.com") | |
user.password = "redacted" | |
user.spree_roles << Spree::Role.find_or_create_by_name!("admin") | |
user.save! | |
puts "Created admin user." |
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 | |
# | |
# Counts added and deleted lines per committer in a git repo | |
# | |
# borrowed from porges https://news.ycombinator.com/item?id=7518503 | |
git --no-pager log --numstat --no-merges --pretty=format:%an \ | |
| awk ' | |
author == "" { author = $0; next } | |
/^$/ { author = ""; next } |
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
[Environment]::CurrentDirectory=(Get-Location -PSProvider FileSystem).ProviderPath | |
$rss = (new-object net.webclient) | |
$a = ([xml]$rss.downloadstring("http://channel9.msdn.com/Events/Build/2014/RSS/mp4high")) | |
$a.rss.channel.item | foreach{ | |
$url = New-Object System.Uri($_.enclosure.url) | |
$file = $_.title.Replace(":", "-").Replace("?", "").Replace("/", "-") + "-" + $_.creator + ".mp4" | |
if (!(test-path $file)) | |
{ | |
$file | |
$wc = (New-Object System.Net.WebClient) |
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
source 'https://rubygems.org' | |
# Heroku uses latest patch level and blows up if you specify it explicitly | |
ruby '2.1.1' | |
gem 'rails', '4.0.4' | |
# app server | |
gem 'puma', '~> 2.7.1' |
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
EXPLAIN for: SELECT DISTINCT "spree_orders".* FROM "spree_orders" WHERE ("spree_orders"."completed_at" IS NOT NULL) ORDER BY "spree_orders"."completed_at" DESC LIMIT 15 OFFSET 0 | |
QUERY PLAN | |
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | |
Limit (cost=325091.86..325092.87 rows=15 width=1066) | |
-> Unique (cost=325091.86..338274.88 rows=195304 width=1066) | |
-> Sort (cost=325091.86..325580.12 rows=195304 width=1066) | |
Sort Key: completed_at, id, number, item_total, total, state, adjustment_total, |
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
2014-04-24T17:17:44.416542+00:00 heroku[web.1]: source=web.1 dyno=heroku.20458897.4ae1b3c0-997d-4cba-a81f-a38e0cd90619 sample#memory_total=359.91MB sample#memory_rss=355.61MB sample#memory_cache=1.25MB sample#memory_swap=3.05MB sample#memory_pgpgin=105101pages sample#memory_pgpgout=13746pages | |
2014-04-24T17:17:46.431055+00:00 heroku[web.3]: source=web.3 dyno=heroku.20458897.626fb820-dd08-4e97-9ec1-b944f85d72b0 sample#memory_total=366.76MB sample#memory_rss=353.90MB sample#memory_cache=6.17MB sample#memory_swap=6.69MB sample#memory_pgpgin=116397pages sample#memory_pgpgout=24219pages | |
2014-04-24T17:17:48.789199+00:00 heroku[web.7]: source=web.7 dyno=heroku.20458897.55c86ebf-1e17-49a6-ad00-dcaf23be7042 sample#memory_total=381.83MB sample#memory_rss=372.18MB sample#memory_cache=3.72MB sample#memory_swap=5.93MB sample#memory_pgpgin=122312pages sample#memory_pgpgout=26083pages | |
2014-04-24T17:17:51.594813+00:00 heroku[web.8]: source=web.8 dyno=heroku.20458897.ccd5c5a4-0397-4fc3-9fb1-82e3e3ed3077 sample#memory_total=349 |