Skip to content

Instantly share code, notes, and snippets.

View leifg's full-sized avatar
🏄‍♂️

Leif Gensert leifg

🏄‍♂️
View GitHub Profile
@leifg
leifg / array_check.rb
Created November 7, 2013 18:23
Correctly check for empty/filled array
arr = []
# You probably know this one:
#http://ruby-doc.org/core-2.0.0/Array.html#method-i-empty-3F
if arr.empty?
# do something
end
# But do you also know the opposite?

Keybase proof

I hereby claim:

  • I am leifg on github.
  • I am leifg (https://keybase.io/leifg) on keybase.
  • I have a public key whose fingerprint is 9598 366D C247 B2A3 1769 B664 FF97 E8EA DFBA A7C0

To claim this, I am signing this object:

@leifg
leifg / minimal.json
Last active August 29, 2015 14:09
packer digitalocean for github issue: https://github.com/mitchellh/packer/issues/1670
{
"builders": [
{
"type": "digitalocean",
"client_id": "...",
"api_key": "..."
}
]
}
@leifg
leifg / test
Created October 15, 2015 07:28
test

Keybase proof

I hereby claim:

  • I am leifg on github.
  • I am leifg (https://keybase.io/leifg) on keybase.
  • I have a public key ASBtVKBPqalH0Nfq2683WNaQJB7fgOb0abYl9aoiTsWKggo

To claim this, I am signing this object:

Wed Jun 8 14:29:54 UTC 2016
Verifying that +leifio is my blockchain ID. https://onename.com/leifio
list = Enum.to_list(1..100_000)
Benchee.run(%{
"List.last" => fn -> list |> List.last end,
"Enum.reverse |> hd" => fn -> list |> Enum.reverse |> hd end
}, time: 20)
{
"status": "complete",
"session_key": "9ca35955414f431ba1ce655b6e0faf29_rrsqbjcb_06a13f0a788e803fcc56e78802891a26",
"segments": {
"0": {
"OriginStation": 14385,
"OperatingCarrier": 1175,
"JourneyMode": "Flight",
"FlightNumber": "7620",
"Duration": 115,