Skip to content

Instantly share code, notes, and snippets.

@hardbap
hardbap / video_hack.js
Created May 3, 2020 14:09
Speed up videos on web that don't display controls
document.querySelectorAll('video').forEach((video)=>video.playbackRate = 1.75);
@hardbap
hardbap / regex_a.rb
Last active June 26, 2018 17:26 — forked from JoshCheek/regex.rb
Ruby 1.9 regex, named capture groups to local variables
/(?<area_code>\d{3}) (?<local_number>\d{3}-\d{4})/ =~ "123 456-7890"
local_variables # => [:area_code, :local_number]
area_code # => "123"
local_number # => "456-7890"
This assumes that you start with 5 cards, 1 being Holocron another is Force Lightning. You also need to start with 2 resources.
I don't know the statistical probabilites behind this but it *is* in the realm of possibility. :)
This tutorial is going to just run it from one side. Of course your opponent may have die manipulation, etc. Let's just assume everything
goes swimmingly and if you need to discard one of your four cards to make it happens it just works. ;)
1. play Holocron on Palp. (4 cards in hand, 2 resources)
2. roll out Palp, *, 3R, 3R
3. resolve 3R, 3R for 10 including Palps ability
4. resolve * to play Force Lightning, pay 1 to roll it out (4 cards, 1 resource) hit 4R1

Keybase proof

I hereby claim:

  • I am hardbap on github.
  • I am hardbap (https://keybase.io/hardbap) on keybase.
  • I have a public key ASAjRU2fWZt-euiaLPE0s0B0sUPSICrEKbU07DJQiTpiPQo

To claim this, I am signing this object:

@hardbap
hardbap / upgrade_postgres.txt
Last active December 14, 2016 01:28
Upgrading postgresql from 9.4.x to 9.5.x with Hstore
# Orignal instructions here: https://kkob.us/2016/01/09/homebrew-and-postgresql-9-5/
1. Stop postgresql
$ launchctl unload ~/Library/LaunchAgents/homebrew.mxcl.postgresql.plist
2. Install postgresql 9.5
$ brew update && brew upgrade postgresql
3. Make a new 9.5 database
$ initdb /usr/local/var/postgres9.5 -E utf8
@hardbap
hardbap / gist:f284901960c55313e306
Last active August 29, 2015 14:03
Install emacs24 and git on ubuntu.
sudo apt-get install python-software-properties ; add-apt-repository command
sudo add-apt-repository ppa:cassou/emacs
sudo apt-get update
sudo apt-get install emacs24
sudo add-apt-repository ppa:git-core/ppa
sudo apt-get update
sudo apt-get install git
class Account
attr_reader :account_id, :initial_balance
initialize(account_id, initial_balance)
@account_id = account_id
@initial_balance = initial_balance
end
end
class SavingsAccount < Account
export LANGUAGE="en_US.UTF-8"
export LANG="en_US.UTF-8"
export LC_ALL="en_US.UTF-8"
sudo su postgres
psql
update pg_database set datistemplate=false where datname='template1';
drop database Template1;
@hardbap
hardbap / migration.rb
Last active December 20, 2015 20:08
Is this a Rails bug? JRuby bug? jdbcpostgersql bug? This works fine on MRI.
jruby 1.7.4
rails (4.0.0)
jdbc-postgres (9.2.1002.1)
activerecord-jdbc-adapter (1.2.9.1)
activerecord-jdbcpostgresql-adapter (1.2.9)
undefined method `enable_extension' for #<CreatePosts:0x30186092>org/jruby/RubyBasicObject.java:1696
@hardbap
hardbap / routes.rb
Last active December 17, 2015 12:09
resources :sellers, only: [ :index, :show ] do
resources :contracts, shallow: true
end