Skip to content

Instantly share code, notes, and snippets.

@foodforarabbit
foodforarabbit / extract.js
Created May 5, 2018 15:41
heroku extract vars
$(".config-vars-list-table").find("tr").toArray().map((t) => { return {key: $(t).find('td').eq(0).find('input').val(), value: $(t).find('td').eq(1).find('textarea').val()}})
btoa(JSON.stringify({
e: localStorage.getItem('entitiesObject'),
g: localStorage.getItem('gameState'),
t: localStorage.getItem('timeStamp'),
}))
var gameData = JSON.parse(atob(gameStr))
localStorage.setItem("entitiesObject", gameData.e)
localStorage.setItem("gameState", gameData.g)
localStorage.setItem("timeStamp", gameData.t)
This file has been truncated, but you can view the full file.
"eyJlIjoie1wicGxheWVyXCI6e1wiZnVuY3Rpb24gKGNhcGFjaXR5KSB7XFxuICAgICAgICAgICAgdGhpcy5yZXNvdXJjZXMgPSBuZXcgUmVzb3VyY2VzVk8oKTtcXG4gICAgICAgICAgICB0aGlzLnN0b3JhZ2VDYXBhY2l0eSA9IGNhcGFjaXR5O1xcbiAgICAgICAgICAgIHRoaXMucmVzZXRTdG9yYWdlKCk7XFxuICAgICAgICB9XCI6e1wicmVzb3VyY2VzXCI6e1wid2F0ZXJcIjowLFwiZm9vZFwiOjAsXCJtZXRhbFwiOjAsXCJyb3BlXCI6MCxcImhlcmJzXCI6MCxcImZ1ZWxcIjowLFwidG9vbHNcIjowLFwibWVkaWNpbmVcIjowLFwiY29uY3JldGVcIjowfSxcInN0b3JhZ2VDYXBhY2l0eVwiOjQwfSxcImZ1bmN0aW9uIChjdXJyZW5jeSkge1xcbiAgICAgICAgICAgIHRoaXMuY3VycmVuY3kgPSBjdXJyZW5jeSA/IGN1cnJlbmN5IDogMDtcXG4gICAgICAgIH1cIjp7XCJjdXJyZW5jeVwiOjB9LFwiZnVuY3Rpb24gKGluaXRpYWxWYWx1ZSkge1xcbiAgICAgICAgICAgIHRoaXMudmFsdWUgPSBpbml0aWFsVmFsdWU7XFxuICAgICAgICAgICAgdGhpcy5tYXhpbXVtID0gMDtcXG4gICAgICAgICAgICB0aGlzLmFjY3VtdWxhdGlvbiA9IDA7XFxuICAgICAgICAgICAgdGhpcy5hY2NTb3VyY2VzID0gW107XFxuICAgICAgICB9XCI6e1widmFsdWVcIjoxNTAsXCJtYXhpbXVtXCI6MTUwLFwiYWNjdW11bGF0aW9uXCI6MC41LFwiYWNjU291cmNlc1wiOlt7XCJzb3VyY2VcIjpcIkJhc2VcIixcImFtb3VudFwiOjAuMX0se1wic291cmNlXCI6XCJDYW1wZmlyZVw
This is a common problem, especially for the many who under-value themselves at first and learn fast what our time is really worth. Been there! Here's something similar to what I've sent in the past, and now the expectations for rate increases are included in my long term contracts.
_________________________
Dear [client],
[Something about how you value them and like working for them]. Thank you for providing such a good working relationship.
The value that I provide in return is attracting new customers willing to pay a premium. In response, all my new clients are paying rates of at least [$x].
@foodforarabbit
foodforarabbit / bash_arguments.txt
Created April 4, 2017 15:32
bash script parse argument flags
while test $# -gt 0; do
case "$1" in
-h|--help)
echo "$package - attempt to capture frames"
echo " "
echo "$package [options] application [arguments]"
echo " "
echo "options:"
echo "-h, --help show brief help"
echo "-a, --action=ACTION specify an action to use"
# brightcove via brightcove-api to s3 via carrierwave / fog
total = Model.count
Model.all.each_with_index do |model, idx|
puts model.id
puts idx.to_f / total
if model.brightcove_id
puts model.brightcove_id
brightcove_service = BrightcoveService.new({:brightcove_video_id => model.brightcove_id})
result = brightcove_service.search_brightcove_for_video_renditions
rendition = result["renditions"].select{|x| x["videoContainer"] == "MP4"}.sort_by{|x| x["encodingRate"]}.last
Just as a rule of thumb so you don't run into these future dilemmas... for regular potential:
emblem: %att/pdr > %dmg > % stat, unless you're at super end game with 250%+ bossing, then %stat > %dmg
secondary/weapon: %boss/pdr > %att/pdr > recube any other line don't even think about it
whether you want to keep pdr is very dependent on how much total pdr you have (that number on your stats screen). >60% for regular bosses, >80% if you're doing the high tier bosses like hmag/empress/CRA, >90% if you're doing end game bosses like chaos vellum.
**house rules:**
carcassonne - draw tile at end of turn
betrayal of house on the hill - have peek functionality. You can peek into a doorway, only you get to draw the card and place it face-down where you peeked
catan - robber swaps the number.
Road placement occurs after everyone has chosen their starting locations, in the same order. This prevents being blocked before you start.
2 and 12 activate each other, making them equal to the 3 and 11 spaces in terms of probability.
No robbers for the first round. 7s are rerolled.
I play with an interesting house rule for Catan. Roll three dice, choose which two actually apply. It changes probabilities, and gives the player some agency over what resources get generated. Plus, you can usually choose to screw someone over with the robber or not. I think it makes it a bit more cutthroat and less random.
@foodforarabbit
foodforarabbit / gist:1ead4f4dbb95af9dc7e6
Created December 16, 2014 17:32
Set up rails server with capistrano
set up unicorn
config/unicorn.rb
set up foreman
Procfile.*
set up database
config/database.yml
@foodforarabbit
foodforarabbit / gist:1fbe4335914c21a12013
Created November 23, 2014 16:20
Disable osx mouse acceleration
defaults write .GlobalPreferences com.apple.mouse.scaling -1