Skip to content

Instantly share code, notes, and snippets.

USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND
staging 1709 0.0 0.0 10772 1404 ? S 10:14 0:00 bash -c cd '/home/staging/public_html/releases/20141013231355/app/Vendor/kamisama/php-resque-ex/'; VERBOSE=true QUEUE='default' PIDFILE='/home/staging/public_html/releases/20141013231355/app/Plugin/CakeResque/t
staging 1710 0.0 0.7 161472 15492 ? S 10:14 0:00 php ./bin/resque
staging 3437 0.0 0.0 10772 1404 ? S 10:17 0:00 bash -c cd '/home/staging/public_html/releases/20141013231718/app/Vendor/kamisama/php-resque-ex/'; VERBOSE=true QUEUE='default' PIDFILE='/home/staging/public_html/releases/20141013231718/app/Plugin/CakeResque/t
staging 3438 0.0 0.7 161496 15468 ? S 10:17 0:00 php ./bin/resque
staging 4803 0.0 0.0 10772 1404 ? S 10:19 0:00 bash -c cd '/home/staging/public_html/releases/20141013231903/app/Vendor/kamisama/php-resque-ex/'; VERBOSE=true QUEUE='default' PIDFILE='/home/staging/p
@joshuapaling
joshuapaling / capistrano log
Last active August 29, 2015 14:08
BIG Vault Capistrano Deployment
joshuapaling: /Applications/MAMP/htdocs/BIG/Employee_Management_Website/www
->cap staging deploy
INFO[516fb1c3] Running /usr/bin/env mkdir -p /tmp/the_big_vault_staging/ on XXX.XXX.XXX.XXX
DEBUG[516fb1c3] Command: /usr/bin/env mkdir -p /tmp/the_big_vault_staging/
INFO[516fb1c3] Finished in 0.501 seconds with exit status 0 (successful).
DEBUGUploading /tmp/the_big_vault_staging/git-ssh.sh 0.0%
INFOUploading /tmp/the_big_vault_staging/git-ssh.sh 100.0%
INFO[7f2c25f1] Running /usr/bin/env chmod +x /tmp/the_big_vault_staging/git-ssh.sh on XXX.XXX.XXX.XXX
DEBUG[7f2c25f1] Command: /usr/bin/env chmod +x /tmp/the_big_vault_staging/git-ssh.sh
INFO[7f2c25f1] Finished in 0.069 seconds with exit status 0 (successful).
@joshuapaling
joshuapaling / rename_css_scss.rake
Created March 31, 2015 23:45
Rake task to rename .css.scss files to just .scss (the long extension is deprecated)
task :rename_css_scss do
files = Rake::FileList["app/assets/stylesheets/**/*.css.scss"]
files.each do |f|
new_name = f.gsub(/\.css\.scss/, '.scss')
sh "mv #{f} #{new_name}"
end
end
<!DOCTYPE html>
<html>
<head>
<title></title>
<style type="text/css">
.box {
width: 300px;
height: 300px;
float: left;
border: 9px solid red;
class Fixnum
def to_roman
# Roman numeral problem described in Sandi Metz's newsletter:
# http://us3.campaign-archive2.com/?u=1090565ccff48ac602d0a84b4&id=24e2bac263&e=6df8a5006fa
# You don't need conditionals, and you don't need two steps either.
# The trick: there's nothing special about the subtractive cases.
# Treat them as a single numeral that just happens to be two
# characters rather than one.
all_numerals = {
'I' => 1,
Answer to https://twitter.com/saronyitbarek/status/760853206205292545
If you code (or learning!), do you use a journal/notebook/todo list for code-related tasks/planning?
I always have scrap paper on my desk. I intentially make it scrap, already printed on one side paper, so I don't feel even a tiny bit bad about using it. I'll write ToDos on it when I want them to physically be right in front of me till they get done. I'll also doodle on it when struggling with a concept, when that can help.
I use digital flash cards. When I come across a term I don't know, but want to, I put it in there. I use http://ankisrs.net/, specifically. I could give a whole talk on digtal flash cards, how good they are, and how to use them effectively. TL;DR: They are SO good. To be effective, go through them every day. Keem them short - a word or two on the front, a short sentence or 2, max, on the back. Be selective about which things you want to commit to memory - you have finite space. Focus on concepts, not language syntax.
"the products actually already live in our point of sale system"
Does "live" in this context rhyme with "div" or "dive"? Let's call the "div" version of it "liv" to clarify.
This makes sense: "the products actually already liv in our point of sale system". It means that there are many products, and the place they live/belong is "in our point of sale system".
This also makes sense: "the product's actually already live in our point of sale system". It means there is one product, and it's already "live" (aka deployed or whatever) in our point of sale system.
The rules are:
- NEVER have an apostrophe for plurals
# Here's the code that's a candidate for refactor, I'm just trying
# to get a sense of if dry monads are a good fit or if this isn't really
# complex or nested-ifs enough to make it really worth it.
# I'm more just checking out dry monads for fun (and potential profit!) rather than
# trying to solve an immediate pain point.
#
# Context is: it's an Employee Relationship Management system.
# Employees earn points for doing things. Periodically, the company holds
# a "flash sale" where they can redeem those points for rewards.
#
@joshuapaling
joshuapaling / upgrade.sh
Created June 5, 2019 10:27
upgrade packages only if your tests pass
declare -a packages=(
"node-sass"
"react-qr-reader"
"moment-timezone"
"qs"
)
for i in "${packages[@]}"
do

For order https://admin.luxuryescapes.com/purchases/8e254fcc-de48-40e8-9e2f-cbeb4919a75d

There's 2 stripe payments:

  1. $5,072 => covers $2323 in flights and $2749 for package
  2. $130 => covers airport lounge add-on

Refund steps taken were:

  1. Through our admin portal, someone refunded the full $2749 for the package.
  2. Payment service looked at the stripe payments and said "ok, we can refund $2749 by refunding the full $130 payment, plus $2619 of the $5072 payment". (This is a bug we can fix - it should have taken the whole $2749 from the $5072 payment!)