Skip to content

Instantly share code, notes, and snippets.

View tadast's full-sized avatar

Tadas Tamošauskas tadast

View GitHub Profile
@tadast
tadast / countries_codes_and_coordinates.csv
Last active May 20, 2024 01:36
Countries with their (ISO 3166-1) Alpha-2 code, Alpha-3 code, UN M49, average latitude and longitude coordinates
Country Alpha-2 code Alpha-3 code Numeric code Latitude (average) Longitude (average)
Afghanistan AF AFG 4 33 65
Åland Islands AX ALA 248 60.116667 19.9
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
@tadast
tadast / gist:6038585
Last active December 19, 2015 23:59
turbolinks sparkles
☆。★。☆。★
。☆ 。☆。☆
★。\|/。★
turbolinks
★。/|\。★
。☆。 。☆。
☆。 ★。 ☆
@tadast
tadast / Alphasights_technical_challenge.md
Last active April 3, 2024 12:25
A technical challenge we give to our Ruby on Rails applicants in order to evaluate their coding proficiency.Job description: http://www.alphasights.com/positions/ruby-developer-london or http://www.alphasights.com/positions/ruby-developer-new-york

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 http://goo.gl)
  • 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
tadast / .irbrc
Created May 6, 2013 19:46
easy rails route scanning in Rails console
# 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
tadast / syntax_highlighting.py
Created November 28, 2012 15:17 — forked from JeanMertz/syntax_highlighting.py
Ruby on Rails syntax highlight switcher for Sublime Text 2
# Forked from https://gist.github.com/925008
# Makes it work with Ruby on Rails snippets
# https://github.com/tadast/sublime-rails-snippets#sublime-text-2-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
tadast / gist:4160627
Created November 28, 2012 11:34
Open the last migration file from shell
# stole this from Tor Erik Linenrud @telinnerud
alias olm='subl `ls -r db/migrate/* | head -n 1`'
# helpers
module PublicHelper
def router_attributes
{
"data-router-class" => "#{controller_name.to_s.titleize}Controller",
"data-router-action" => action_name.to_s
}
end
end
https://gist.github.com/1688857
=== 1.9.3-p0
✗ time (rails runner 'puts(1)')
6.33s user 0.69s system 99% cpu 7.027 total
✗ time (rspec spec)
1736/1736: 100% |==========================================| Time: 00:00:34
42.32s user 1.52s system 92% cpu 47.279 total
@tadast
tadast / gist:1569954
Created January 6, 2012 10:07
useful sublime text 2 stuff

== Key Bindings

[
  //https://github.com/alexstaubo/sublime_text_alternative_autocompletion
  { "keys": ["escape"], "command": "alternative_autocomplete", "context":
    [
      { "key": "num_selections", "operator": "equal", "operand": 1 },

{ "key": "overlay_visible", "operator": "equal", "operand": false },

@tadast
tadast / terminal_color.sh
Created August 10, 2011 15:14
Colorize heroku production console for Terminal on OSX
# Terminal, OS X (iTerm version: https://gist.github.com/1137050)
# 1. change 'your_app_production' to your application name
# 1a. Tune the colors by your taste
# 2. put these functions to your .bashrc, .zshrc
# or anywhere where it gets loaded for your iTerm session
# 3. restart iTerm or 'source ~/.zshrc' and use these functions
set_color() {
local R=$1
local G=$2