Skip to content

Instantly share code, notes, and snippets.

Avatar

Mike Breen hardbap

View GitHub Profile
@hardbap
hardbap / video_hack.js
Created May 3, 2020
Speed up videos on web that don't display controls
View video_hack.js
document.querySelectorAll('video').forEach((video)=>video.playbackRate = 1.75);
@hardbap
hardbap / regex_a.rb
Last active Jun 26, 2018 — forked from JoshCheek/regex.rb
Ruby 1.9 regex, named capture groups to local variables
View regex_a.rb
/(?<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"
View ePalp-cranking-it-out.txt
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
View keybase.md

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 Dec 14, 2016
Upgrading postgresql from 9.4.x to 9.5.x with Hstore
View upgrade_postgres.txt
# 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 Aug 29, 2015
Install emacs24 and git on ubuntu.
View gist:f284901960c55313e306
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
View savings_account.rb
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
View gist:8320251
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 Dec 20, 2015
Is this a Rails bug? JRuby bug? jdbcpostgersql bug? This works fine on MRI.
View migration.rb
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
View routes.rb
resources :sellers, only: [ :index, :show ] do
resources :contracts, shallow: true
end
You can’t perform that action at this time.