Skip to content

Instantly share code, notes, and snippets.

Tadas Tamošauskas tadast

Block or report user

Report or block tadast

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View thanks_ruby.rb
[94] pry(main)> WHATEVER = {a: [{x: :boom1, z: :boom2}]}.freeze
=> {:a=>[{:x=>:boom1, :z=>:boom2}]}
[95] pry(main)> WHATEVER.clone[:a].first[:x] = :wtf
=> :wtf
[96] pry(main)> WHATEVER[:a].first[:x]
=> :wtf
View without_delayed_job.rb
def without_delayed_job &block
@old_behaviour = Delayed::Worker.delay_jobs
Delayed::Worker.delay_jobs = false
yield
Delayed::Worker.delay_jobs = @old_behaviour
end
### Usage
describe 'stuff' do
without_delayed_job do
View dispatcher.coffee
# As per https://github.com/alphasights/guides/pull/14
# Instead of
$ ->
if $('.js_money_index').length
# all your page-specific logic
# Use a [dispatcher](https://coderwall.com/p/mhvucw) with
# controllers/money_controller.js.coffee
@tadast
tadast / activesupport_offsets.rb
Created Jun 17, 2014
ActiveSupport::Timezone offsets
View activesupport_offsets.rb
{
"American Samoa" => -11,
"International Date Line West" => -11,
"Midway Island" => -11,
"Hawaii" => -10,
"Alaska" => -9,
"Pacific Time (US & Canada)" => -8,
"Tijuana" => -8,
"Arizona" => -7,
"Chihuahua" => -7,
@tadast
tadast / quotes_scrum_xp.md
Created May 27, 2014
Quotes from Scrum and XP from the Trenches by Henrik Kniberg
View quotes_scrum_xp.md

Scrum and XP from the Trenches by Henrik Kniberg

Disclaimer: exported by readmill in no particular order :(

If the product owner has a technical background he might add stories such as “Add indexes to the Events table”. Why does he wa nt this? The real underlying goal is probably something like “speed u p the search event form in the back office

The distinction is quite simple. Stories are deliver able stuff that the product owner cares about. Tasks are non-deliverable stuff, or stuff that the product owner doesn’t care about.

Normally the product owner starts the meeting by summarizing his goal for the sprint and the most important stories. Next , the team goes through and time-estimates each story, starting with the most important one. As they do this, they will come up with important scope questions – “does this ‘delete user’ story include going through each pending transaction for that user and canceling it?’” In some cases the answers will be surprising to the team, prompting them to change

@tadast
tadast / hash_wat.rb
Last active Aug 29, 2015
ruby **options inconsistency
View hash_wat.rb
def foo(a, *b, **c)
[a, b, c]
end
=> :foo
[16] » foo 10, {d: 40, e: 50}
=> [
[0] 10,
[1] [],
[2] {
@tadast
tadast / ssl_puma.sh
Last active May 22, 2020 — forked from trcarden/gist:3295935
localhost SSL with puma
View ssl_puma.sh
# 1) Create your private key (any password will do, we remove it below)
$ cd ~/.ssh
$ openssl genrsa -des3 -out server.orig.key 2048
# 2) Remove the password
$ openssl rsa -in server.orig.key -out server.key
@tadast
tadast / arsample.rb
Created Mar 20, 2014
ActiveRecord#sample for postgres
View arsample.rb
class ActiveRecord::Base
def self.sample
order('random()').first
end
end
@tadast
tadast / countries_codes_and_coordinates.csv
Last active May 22, 2020
Countries with their (ISO 3166-1) Alpha-2 code, Alpha-3 code, UN M49, average latitude and longitude
View countries_codes_and_coordinates.csv
Country Alpha-2 code Alpha-3 code Numeric code Latitude (average) Longitude (average)
Afghanistan AF AFG 4 33 65
Albania AL ALB 8 41 20
Algeria DZ DZA 12 28 3
American Samoa AS ASM 16 -14.3333 -170
Andorra AD AND 20 42.5 1.6
Angola AO AGO 24 -12.5 18.5
Anguilla AI AIA 660 18.25 -63.1667
Antarctica AQ ATA 10 -90 0
Antigua and Barbuda AG ATG 28 17.05 -61.8
@tadast
tadast / gist:6038585
Last active Dec 19, 2015
turbolinks sparkles
View gist:6038585
☆。★。☆。★
。☆ 。☆。☆
★。\|/。★
turbolinks
★。/|\。★
。☆。 。☆。
☆。 ★。 ☆
You can’t perform that action at this time.