Skip to content

Instantly share code, notes, and snippets.

View aeden's full-sized avatar

Anthony Eden aeden

View GitHub Profile
@aeden
aeden / travel-challenge-2013.txt
Created October 21, 2012 12:25
The 2013 Travel Challenge
MPL -> NYC 27 Jun 2013
NYC -> SFO 05 Jul 2013
SFO -> HNL 09 Jul 2013
HNL -> MQT 15 Aug 2013
MQT -> MPL 22 Aug 2013
-- Example of using Ratchet to resolve DNS queries
-- Inspect function to print the results:
function inspect(prefix, t)
for k,v in pairs(t) do
if (type(v) == "table") then
inspect(string.format("%s (%s):", prefix, k), v)
else
print(prefix, string.format("%s: %s", k, v))
end
end
@aeden
aeden / running.md
Created May 8, 2012 13:26
Set up for Rails and non-Rails specs playing nicely

You can then execute all specs with:

bundle exec rspec spec

And only run your decoupled tests with:

bundle exec rspec spec --tag ~rails

curl -H "X-DNSimple-Token: EMAIL:API-TOKEN" -H "Content-Type: application/json" -H "Accept: application/json" https://dnsimple.com/domains

To install a JAR into a local maven repo for use in lein:

mkdir maven_repository
mvn install:install-file -Dfile=dnsjava-2.1.3.jar -DartifactId=dnsjava -Dversion=2.1.3 -DgroupId=dnsjava -Dpackaging=jar -DlocalRepositoryPath=maven_repository

Add to project.clj:

:repositories {"local" ~(str (.toURI (java.io.File. "maven_repository")))}

Get dependencies:

nnoremap .c :!CLASSPATH=lib/* java clojure.main <CR>
/**
* This is example code that shows how you might use the payment form from within
* your application. I've annotated it with comments throughout to clarify its usage.
*/
$(document).ready(function() {
// Construct the payments object, passing in the element that will hold the payment
// form. Here I use a <div> but you could use any type of element.
var credit_card_form = LivingSocial.Payments.CreditCardForm($("#payment-interface"));
// Render the payment form.

Currently the RubyGems index is stored as a Gzip file that is a marshalled array. Whenever Bundler needs to install a gem that is not yet installed it downloads the index, gunzips it and unmarshals it. It then looks for dependencies that are described in another file that is also a gzipped and marshalled file. There are several issues that arise from this setup:

  • The full index must be downloaded and parsed, but does not contain dependency data, which must then be downloaded and parsed. This is a relatively time consuming process.
  • The index must be centralized.

Additionally the gems themselves are currently centralized since there is nothing in the meta data that indicates where the gem should be downloaded from. However in order to allow this it is important to find ways of keeping the index from being poisoned (is this an issue in the centralized system?)

Dependency Resolution

Currently the RubyGems index is stored as a Gzip file that is a marshalled array. Whenever Bundler needs to install a gem that is not yet installed it downloads the index, gunzips it and unmarshals it. It then looks for dependencies that are described in another file that is also a gzipped and marshalled file. There are several issues that arise from this setup:

  • The full index must be downloaded and parsed, but does not contain dependency data, which must then be downloaded and parsed. This is a relatively time consuming process.
  • The index must be centralized.

Additionally the gems themselves are currently centralized since there is nothing in the meta data that indicates where the gem should be downloaded from. However in order to allow this it is important to find ways of keeping the index from being poisoned (is this an issue in the centralized system?)

Dependency Resolution

Installed RVM HEAD version:
rvm 1.6.18 by Wayne E. Seguin (wayneeseguin@gmail.com) [https://rvm.beginrescueend.com/]
/Users/aeden/.rvm/scripts/get: line 125: syntax error near unexpected token `)'
/Users/aeden/.rvm/scripts/get: line 125: `rvm ; rvm --version )'
~ [ruby-1.9.2-p0]$ rvm list
/Users/aeden/.rvm/scripts/list: line 5: /base: No such file or directory
/Users/aeden/.rvm/scripts/list: line 262: __rvm_environment_identifier: command not found