Skip to content

Instantly share code, notes, and snippets.

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

Leif Gensert leifg

🏄‍♂️
View GitHub Profile
@leifg
leifg / Vagrantfile
Last active November 12, 2023 08:31
Add a second disk to system using vagrant
file_to_disk = './tmp/large_disk.vdi'
Vagrant::Config.run do |config|
config.vm.box = 'base'
config.vm.customize ['createhd', '--filename', file_to_disk, '--size', 500 * 1024]
config.vm.customize ['storageattach', :id, '--storagectl', 'SATA Controller', '--port', 1, '--device', 0, '--type', 'hdd', '--medium', file_to_disk]
end
@leifg
leifg / simple_delegator.rb
Created December 13, 2019 01:45
Weird behaviour with Simple Delegator
d = SimpleDelegator.new(nil)
d.nil?
# false
d == nil
# true
@leifg
leifg / README.md
Created December 6, 2012 15:48
Jenkins Dashboard using dashing

This is an example of adding Jenkins build status to a [dashing-dashboard](https://github.com/Shopify/dashing

If a job is running, the widget will have a grey background. If a job succeeded at its last run, it will have a green background. If a job failed at its last run, it will have a red background.

Requirements:

This file has been truncated, but you can view the full file.
{
"SessionKey": "bdd83606fc9347da96ecda2b8105ad2e_rrsqbjcb_06a13f0a788e803fcc56e78802891a26",
"Query": {
"Country": "DE",
"Currency": "EUR",
"Locale": "de-de",
"Adults": 1,
"Children": 0,
"Infants": 0,
"OriginPlace": "5363",
{
"status": "complete",
"session_key": "9ca35955414f431ba1ce655b6e0faf29_rrsqbjcb_06a13f0a788e803fcc56e78802891a26",
"segments": {
"0": {
"OriginStation": 14385,
"OperatingCarrier": 1175,
"JourneyMode": "Flight",
"FlightNumber": "7620",
"Duration": 115,
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)
Verifying that +leifio is my blockchain ID. https://onename.com/leifio
Wed Jun 8 14:29:54 UTC 2016

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:

@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?