I hereby claim:
- I am madlep on github.
- I am madlep (https://keybase.io/madlep) on keybase.
- I have a public key whose fingerprint is 6A92 159D 5E40 7094 FABE B73A 0B4D 44BE 816C C67C
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
| defmodule Foobar do | |
| defstruct :my_field, :another_field | |
| def do_a_thing_destructure(%Foobar{my_field: mf, another_field: af}) do | |
| something_else(mf, af) | |
| end | |
| def do_a_thing_struct_access(foobar = %Foobar{}) do | |
| something_else(foobar.my_field, foobar.another_field) | |
| end |
| # stolen from http://effectif.com/ruby/update-your-project-for-ruby-19-hash-syntax | |
| find . -name \*.rb -exec perl -p -i -e 's/([^:]):(\w+)\s*=>/\1\2:/g' {} \; |
| # xs & ys are arrays of results in order of rank | |
| def spearman(xs, ys) | |
| # remove items that aren't common to both result sets | |
| # these are mostly outliers anyway which we want to ignore | |
| xs_common = xs.select{|i| ys.include? i } | |
| ys_common = ys.select{|i| xs.include? i } | |
| # calculate the mean of each set of ranks (simple sum/length calculation) | |
| # as both are just the sum of ranks [1,2,3,4...] and have same length, | |
| # we can figure it out based on an arithmetic sum |
| SELECT | |
| TABLE_NAME, | |
| table_rows, | |
| AVG_ROW_LENGTH, | |
| data_length / 1024 /1024 / 1024 AS data_length_gb, | |
| index_length / 1024 /1024 / 1024 AS index_length_gb, | |
| (data_length / 1024 /1024 / 1024 + index_length / 1024 /1024 / 1024) AS total_length_gb | |
| FROM information_schema.tables | |
| ORDER BY table_schema, total_length_gb DESC; |
| Thu 11:54:32 madlep@elastic1 ~ | |
| $ curl -XPUT 'http://localhost:9200/foo/bar/1' -d '{"foo":{"bar":"boz"}}' | |
| {"ok":true,"_index":"foo","_type":"bar","_id":"1","_version":1} | |
| Thu 11:56:21 madlep@elastic1 ~ | |
| $ curl -v "http://localhost:9200/foo/bar/1" | |
| * About to connect() to localhost port 9200 (#0) | |
| * Trying ::1... connected | |
| * Connected to localhost (::1) port 9200 (#0) | |
| > GET /foo/bar/1 HTTP/1.1 |
| #!/usr/bin/env bash | |
| set -e | |
| if [ "$#" == "0" ]; then | |
| echo "Usage mysqldbimport MYSQLGZIPPEDBACKUPFILE [args to pass to mysql]" | |
| echo "e.g. mysqldbimport mybackup.sql.gz -u root my_database_name" | |
| fi | |
| BACKUP_FILE="$1" | |
| shift |
| #!/usr/bin/env bash | |
| set -e | |
| launchctl unload ~/Library/LaunchAgents/homebrew.mxcl.mysql.plist | |
| rm /usr/local/var/mysql/ib_logfile* | |
| cp /usr/local/Cellar/mysql/5.5.19/support-files/my-innodb-heavy-4G.cnf /usr/local/etc/my.cnf | |
| sed -i -e 's/innodb_buffer_pool_size.*/innodb_buffer_pool_size = 4G/' /usr/local/etc/my.cnf | |
| launchctl load ~/Library/LaunchAgents/homebrew.mxcl.mysql.plist |
| 192.168.1.102 GET https://chronos.jimbolos.com.au/v1/journey-planner/o/%5B-37.809002,144.895660%5D%7CSeddon%20Station/d/%5B-37.818310,144.966965%5D%7CFlinders%20Street%20Station?departFrom=true&transferMethod=walk&transferMaxTime=10&inclTrain=true&inclTram=true&inclBus=true&inclVline=true&inclRegCoach=true&inclSkybus=true&token=97A431C0AD983ACF6A31DCDAD9AEAD845239FD77 | |
| Host: chronos.jimbolos.com.au | |
| User-Agent: PTV 1.0 rv:23032012 (iPhone; iPhone OS 5.1; en_AU) | |
| Accept-Encoding: gzip | |
| Connection: keep-alive | |
| Proxy-Connection: keep-alive | |
| << 200 OK 977B | |
| Cache-Control: private |
| require 'spec_helper' | |
| def version_of *args | |
| Babushka::VersionOf::Helpers.VersionOf *args | |
| end | |
| describe "creation" do | |
| it "should store name" do | |
| version_of('ruby').name.should == 'ruby' | |
| end |