Skip to content

Instantly share code, notes, and snippets.

@corroded
corroded / original_spec.rb
Created February 26, 2018 18:47
Sample Rspec to convert to JS
context 'street name is also a street type' do
let(:street) { 'Gap Road' }
let(:expected_hash) { { street_name: 'Gap', street_type: 'Road' } }
it { is_expected.to eq expected_hash }
end
@corroded
corroded / expected.spec.js
Last active February 26, 2018 18:46
Sample Rspec to JS
describe('street name is also a street type (Gap Road)', () => {
it('splits the street name/type properly', () => {
const result = streetTypeExtractor('Gap Road')
const expectedObject = {
streetName: 'Gap',
streetType: 'Road',
}
expect(result).to.deep.eq(expectedObject)
})
require 'benchmark'
def it_fibonacci(n)
fib_arr = [0,1]
(2..(n.to_i) - 1).each do |x|
fib_arr << fib_arr[x-1] + fib_arr[x-2]
end
return fib_arr
end
@corroded
corroded / gist:83930dc472c755bb358634d05373238a
Created July 31, 2017 10:34 — forked from giannisp/gist:b53a76047b07751ed3ade3c1db1d2c51
Upgrade PostgreSQL 9.5.5 to 9.6.1 using Homebrew (macOS)
After automatically updating Postgres to 9.6.1 via Homebrew, the pg_ctl start command didn't work.
The error was something like "database files are incompatible with server".
Database files have to be updated before starting the server, here are the steps that had to be followed:
# need to have both 9.6.1 and latest 9.5.x installed, and keep 9.6.1 as default
brew unlink postgresql
brew install postgresql95
brew unlink postgresql95
brew link postgresql

Keybase proof

I hereby claim:

  • I am corroded on github.
  • I am corroded (https://keybase.io/corroded) on keybase.
  • I have a public key ASBV-4Vu69-J6TcPbsxMxm8qpvvBaPUoQ0PHfE8Op-lQkwo

To claim this, I am signing this object:

Day 1

Sweating the Details - Holger Bartel

  • slides
  • Collaboration (between designers and developers is VERY IMPORTANT)
  • Set expectations right
    • choose right process for the right job
  • people
  • try to push them a bit further, but stay in the comfort zones
Process: launchd [32577]
Path: /Applications/Zonebox.app/Contents/MacOS/Zonebox
Identifier: rinik.Zonebox
Version: ??? (???)
Code Type: X86-64 (Native)
Parent Process: launchd [349]
Date/Time: 2013-01-17 10:29:03.111 +0800
OS Version: Mac OS X 10.7.5 (11G63)
Report Version: 9
@corroded
corroded / class_var_ex.rb
Created October 19, 2012 00:50 — forked from sumanmukherjee03/class_var_ex.rb
Messing with class variables in ruby
# Execute this file as follows and compare the results in ruby 1.8.*:
#
# ruby class_var_ex.rb
# ruby class_var_ex.rb "include module"
# ruby class_var_ex.rb "include module" "include global"
# ruby "include global"
@@test = 9 if ARGV.last == "include global"
module X
@corroded
corroded / class_var_ex.rb
Created October 19, 2012 00:50 — forked from sumanmukherjee03/class_var_ex.rb
Messing with class variables in ruby
# Execute this file as follows and compare the results in ruby 1.8.*:
#
# ruby class_var_ex.rb
# ruby class_var_ex.rb "include module"
# ruby class_var_ex.rb "include module" "include global"
# ruby "include global"
@@test = 9 if ARGV.last == "include global"
module X
@corroded
corroded / rake_features_trace
Created September 10, 2012 02:14
Errors when tryign to run Compass tests
~/Projects/compass feature/add_documentation_and_tests_for_selection_mixin ✔ ➤ rake features --trace ruby-1.9.2-p320@compass [6s]
WARNING: no such file to load -- rcov/rcovtask
** Invoke features (first_time)
** Execute features
/Users/eumir/.rvm/rubies/ruby-1.9.2-p320/bin/ruby -S bundle exec cucumber features --format progress
...................................................................................................................................
Dear developers making use of FSSM in your projects,
FSSM is essentially dead at this point. Further development will
be taking place in the new shared guard/listen project. Please