Skip to content

Instantly share code, notes, and snippets.

View biggest-file-channels.go
package main
import (
"fmt"
"io/ioutil"
"os"
"path"
)
func BiggestFile(directory string) (string, error) {
View err.go
package main
import (
"encoding/json"
"io/ioutil"
"os"
"path"
"testing"
"reflect"
"time"
View continuation.md

https://twitter.com/davecheney/status/447523678561898496

Why do I think Go is more 'distributed' than other languages, and why do I think that is a good thing ?

  1. Go does not have a BDFL, there is no Guido Van Rossem, no Theo De Ralt, etc. We have our spiritual leaders like Rob Pike and Ken Thompson, but their influence is much less immediate.

  2. The very nature of the development of the Go standard library discourages adding new stuff to the standard library.

2a. I believe this is a good thing

View inspect_parse_spec.rb
require 'spec_helper'
INPUT = <<-EOF
#<PayPal::SDK::Merchant::DataTypes::DoExpressCheckoutPaymentResponseType:0x007fe08b4ff4e8 @Timestamp=Thu, 27 Mar 2014 06:34:56 +0000, @Ack="PartialSuccess", @CorrelationID="XXXXX", @Version="98.0", @Build="10277387", @DoExpressCheckoutPaymentResponseDetails=#<PayPal::SDK::Merchant::DataTypes::DoExpressCheckoutPaymentResponseDetailsType:0x007fe08b4fee30 @Token="XXX", @PaymentInfo=[#<PayPal::SDK::Merchant::DataTypes::PaymentInfoType:0x007fe08b4feca0 @TransactionID=nil, @ParentTransactionID=nil, @ReceiptID=nil, @TransactionType="none", @PaymentType="none", @ExchangeRate=nil, @PaymentStatus="Failed", @PendingReason="none", @ReasonCode="none", @SellerDetails=#<PayPal::SDK::Merchant::DataTypes::SellerDetailsType:0x007fe08b4fe7c8 @PayPalAccountID="XXXXX", @SecureMerchantAccountID="XXXXX">, @PaymentRequestID="4444", @PaymentError=#<PayPal::SDK::Merchant::DataTypes::ErrorType:0x007fe08b4fe570 @ShortMessage="Transaction cannot complete.", @LongMessage="Instruct the customer to retr
View crontab
* * * * 1 black || true
* * * * 2,3 heart_attack
* * * * 4 rm ~/.bash_history
* * * * 5 cd love
View job_2014_07.md

Hi!

We're looking for a junior to mid level Javascript and/or Ruby developer to join our team at The Exchange Group.

The Exchange Group is best known for online bike marketplace, bikeexchange.com.au, which in the last couple of years has expanded to New Zealand and Germany. We've also added tinitrader.com.au, renoexchange.com.au and furnitureexchange.com.au to the mix.

The application is primarily Ruby on Rails 3.2, which we're planning on upgrading to 4.0 in the near future. We've brought in AngularJS to several sections of the site already: our new search is entirely Angular. As our application grows, we'll be reducing our reliance on a monolithic Rails application and splitting things into UI & API implementations; this is where you'll come in.

The successful applicant will:

View replay_es_index.rb
#!/usr/bin/env ruby
# Throwaway script to dump an index's contents to disk, delete the index, then
# re-upload it. Used for testing index templates in Logstash.
#
# Installing the yajl gem is highly recommended for fast JSON, but not required.
require 'rubygems'
require 'yajl/json_gem' rescue require 'json'
require 'elasticsearch'
View rails_4_find_by.rb
# Add this to your Rails 3.2 project to add in approximations of the Rails 4
# finders and disable Rails 2/3 'dynamic' finders.
module ActiveRecord
# Approximations of the new Rails 4 finders
class Relation
def take
first
end
@mipearson
mipearson / dev_op_job_ad.md
Created Sep 12, 2014
TEG Developer / Operator position
View dev_op_job_ad.md

The Exchange Group are hiring a mid-level systems administrator / developer to help us secure, scale, and strengthen our existing Ruby on Rails infrastructure.

We're looking for somebody who has:

  • a strong operations background, preferably experience with bare metal / co-located hosting
  • understanding & experience with configuration management (eg Puppet, Chef, Ansible, Babushka)
  • a basic understanding of Ruby, or sufficient experience with a similar language (eg Python) that they could cross-skill easily

You'll get bonus points for an interest in or experience with:

View benches
# serve is via a simple net.HTTP go server
# cmd is running the binary and piping stdin/out
# serve maxes out at 3000/s, cmd at 130/s regardless of input
# npm.sh.raw is 5000 lines of coloured npm install output and is
# more representative of the sorts of inputs buildbox would be dealing with
➜ terminal git:(GoRewrite) ✗ ./script/benchmark spec/fixtures/npm.sh.raw
2014/11/08 13:44:47 Listening on port 1337
Calculating -------------------------------------