Skip to content

Instantly share code, notes, and snippets.

View trptcolin's full-sized avatar

Colin Jones trptcolin

View GitHub Profile
@trptcolin
trptcolin / readme.txt
Created September 22, 2018 20:38
Zombie Invasion (PuzzleScript Script)
Play this game by pasting the script in http://www.puzzlescript.net/editor.html

For all exercises, let’s make sure we’re collaborating, not just submitting as quick as possible. We are a community of professionals - let’s learn from each other!

While we need working software, we also want well-crafted software. So once we’ve got a working solution, let’s see how we can improve it for flexibility and maintainability, rather than jumping right to the next one.

  • Driver: Lean on your team! Talk through your reasoning! Pass the keyboard in 5 minutes or less!
  • Navigators: Ask questions! Suggest improvements empathetically!
  • Narrator: Nudge folks as needed! Stick with the Easy difficulty setting!

Example Exercises, with extra credit ideas/prompts

Keybase proof

I hereby claim:

  • I am trptcolin on github.
  • I am trptcolin (https://keybase.io/trptcolin) on keybase.
  • I have a public key whose fingerprint is 67E5 7A31 E9E0 2368 EEAC 5CCF BB1D BD36 16F1 DDB9

To claim this, I am signing this object:

@trptcolin
trptcolin / mavericks_upgrade
Created October 23, 2013 04:37
mavericks upgrade journal
√ Zephyros (window manager) needs universal access:
http://www.tekrevue.com/2013/06/25/how-to-enable-access-for-assistive-devices-in-os-x-mavericks/
√ gcc can’t find stdio.h (& similar) - /usr/include got blown away
xcode-select --install
see https://github.com/mxcl/homebrew/issues/20427
√ java install got blown away & replaced with a stub that says to download java
http://www.oracle.com/technetwork/java/javase/downloads/jdk7-downloads-1880260.html
$ ./hello_world
Hello World!
$ ./hello_world > output && cat output
Hello World!
$ ./hello_world >> output && cat output
Hello World!
Hello World!
$ ./hello_world >> output && cat output
Hello World!
Hello World!
(require '[backtick :refer [template syntax-quote]])
;=> nil
(let [x 2] (template (foo ~x)))
;=> (foo 2)
(let [x 2] (syntax-quote (foo ~x)))
;=> (user/foo 2)
# General comment: I assume here that I'm just doing it wrong as I haven't been using Arel that long.
# If I knew for sure this was broken I'd just file a bug instead.
# Note that these specific ActiveRelations are just a trimmed-down example; the actual use case would
# really be better with a UNION, I promise.
1.9.3-p448 :301 > users = User.where(:email => "one@two.com").union(User.where(:email => "foo@bar.com"))
# => #<Arel::Nodes::Union:0x8d1e608 @left=#<Arel::Nodes::SelectStatement:0x8d1eb58 @cores=[#<Arel::Nodes::SelectCore:0x8d1eb44 @source=#<Arel::Nodes::JoinSource:0x8d1eb30 @left=#<Arel::Table:0x9b6d628 @name="users", @engine=User(id: integer, email: string, encrypted_password: string, reset_password_token: string, reset_password_sent_at: datetime, remember_created_at: datetime, sign_in_count: integer, current_sign_in_at: datetime, last_sign_in_at: datetime, current_sign_in_ip: string, last_sign_in_ip: string, created_at: datetime, updated_at: datetime, company_id: integer, locale: string, au
git filter-branch -f --prune-empty --index-filter 'git rm -rf --cached --ignore-unmatch vendor' --tag-name-filter cat -- --all
git filter-branch -f --prune-empty --index-filter 'git rm -rf --cached --ignore-unmatch vendor' --tag-name-filter cat -- --all
git -c gc.reflogExpire=0 -c gc.reflogExpireUnreachable=0 -c gc.rerereresolved=0 \
-c gc.rerereunresolved=0 -c gc.pruneExpire=now gc --aggressive --prune=now
@trptcolin
trptcolin / gist:3470744
Created August 25, 2012 20:39
Why naming conventions are important
colin:level08-code/ (master✗) $ gem install restclient
ERROR: Could not find a valid gem 'restclient' (>= 0) in any repository
^CERROR: Interrupted
colin:level08-code/ (master✗) $ gem install rest_client
ERROR: Could not find a valid gem 'rest_client' (>= 0) in any repository
^CERROR: Interrupted
colin:level08-code/ (master✗) $ gem install RestClient
ERROR: Could not find a valid gem 'RestClient' (>= 0) in any repository
^CERROR: Interrupted
colin:level08-code/ (master✗) $ gem install rest-client
colin:/tmp/ $ cat ~/.lein/profiles.clj
{
:1.2 { :dependencies [[org.clojure/clojure "1.2.0"]] }
:1.3 { :dependencies [[org.clojure/clojure "1.3.0"]] }
:1.4 { :dependencies [[org.clojure/clojure "1.4.0"]] }
}
colin:/tmp/ $ lein with-profile 1.3 repl
Performing task 'repl' with profile(s): '1.3'
nREPL server started on port 50952