Skip to content

Instantly share code, notes, and snippets.


Tadas Tamošauskas tadast

View GitHub Profile
tadast / countries_codes_and_coordinates.csv
Last active Feb 25, 2021
Countries with their (ISO 3166-1) Alpha-2 code, Alpha-3 code, UN M49, average latitude and longitude coordinates
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 / .irbrc
Created May 6, 2013
easy rails route scanning in Rails console
View .irbrc
# Put this in your ~/.irbrc for easy rails route scanning
# Usage:
# > routes
# => prints all routes
# > routes /GET.*user/i
# => prints routes matching a given regex
# > routes "user"
# => matches strings as well
tadast /
Last active Jan 19, 2021
A technical challenge we give to our Ruby on Rails applicants in order to evaluate their coding proficiency.Job description: or

Update: I no longer work for the company and this challenge is no longer used, but I'll leave the gist here in case people want to practice.

Alphasights Technical Challenge

Using Ruby on Rails we would like you to create a simple expert search tool. The application should fulfill the requirements below. The source code must be placed in a public repo on GitHub. The application should be deployable on Heroku.

  • I enter a name and a personal website address and a member is created.
  • When a member is created, all the heading (h1-h3) values are pulled in from the website to that members profile.
  • The website url is shortened (e.g. using
  • After the member has been added, I can define their friendships with other existing members. Friendships are bi-directional i.e. If Sasha is a friend of Ash, Ash is always a friend of Sasha as well.
tadast / Paint slack
Last active Dec 21, 2020
Update the Mac Desktop slack CSS
View Paint slack

In the console

open /Applications/

In slack UI

right-click on anything -> inspect element

tadast /
Last active Dec 8, 2020 — forked from trcarden/gist:3295935
localhost SSL with puma
# 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 / ruby.yml
Created Apr 26, 2020
Example github actions config for Rails with postgres using DATABASE_URL
View ruby.yml
name: Ruby
branches: [ master ]
branches: [ master ]
tadast / capybara_chrome_download.rb
Created Jun 3, 2020
Rails Capybara chromedriver setup for testing downloads
View capybara_chrome_download.rb
# in rails_helper.rb
driver = if ENV['CHROME_DEBUG'] == 'true'
Capybara.register_driver :chrome do |app|, browser: :chrome)
Capybara.register_driver :headless_chrome do |app|
browser_options =
tadast / with_active_support.rb
Last active Dec 10, 2018 — forked from mbyczkowski/with_active_support.rb
session cookie decrypter for Rails 5.1
View with_active_support.rb
require 'cgi'
require 'json'
require 'active_support'
def verify_and_decrypt_session_cookie(cookie, secret_key_base = Rails.application.secrets.secret_key_base)
cookie = CGI::unescape(cookie)
salt = 'encrypted cookie'
signed_salt = 'signed encrypted cookie'
key_generator =, iterations: 1000)
secret = key_generator.generate_key(salt)[0, ActiveSupport::MessageEncryptor.key_len]
tadast /
Created Nov 28, 2012 — forked from JeanMertz/
Ruby on Rails syntax highlight switcher for Sublime Text 2
# Forked from
# Makes it work with Ruby on Rails snippets
import sublime, sublime_plugin
import os
class DetectFileTypeCommand(sublime_plugin.EventListener):
""" Detects current file type if the file's extension isn't conclusive """
""" Modified for Ruby on Rails and Sublime Text 2 """
tadast / json_api_to_graphviz.js
Created Nov 19, 2016
This is a script to take in a {json:api} document ( and generate a visual graph ( representation of it
View json_api_to_graphviz.js
This is a script to take in a {json:api} document (
and generate a graphviz ( representation of it.
> node <this_file>
then copy and paste the output to some graphviz parser
e.g. or