Skip to content

Instantly share code, notes, and snippets.

View tuomasj's full-sized avatar

Tuomas Jomppanen tuomasj

View GitHub Profile
@tuomasj
tuomasj / .rspec
Created February 15, 2014 20:59 — forked from coreyhaines/.rspec
--colour
-I app
function _git_prompt() {
local git_status="`git status -unormal 2>&1`"
if ! [[ "$git_status" =~ Not\ a\ git\ repo ]]; then
if [[ "$git_status" =~ nothing\ to\ commit ]]; then
local ansi=42
elif [[ "$git_status" =~ nothing\ added\ to\ commit\ but\ untracked\ files\ present ]]; then
local ansi=43
else
local ansi=45
fi
@tuomasj
tuomasj / Gemfile
Created August 24, 2012 09:10
Live Reload
source "https://rubygems.org"
gem 'guard'
gem 'guard-livereload'
gem 'rack-livereload'

This is how we test that all translation keys match up between locales.

Stuff that only goes in one locale (such as an admin section) or that can't be translated yet (if you use external translators) can simply go in files that don't match the path "config/locales/??.yml", like "config/locales/wip.fo.yml".

@tuomasj
tuomasj / have_link_endswith.rb
Last active December 27, 2015 11:29
Have a link that ends with specific text, Capybara matcher
@tuomasj
tuomasj / Preferences.sublime-settings
Last active January 28, 2017 11:32
My Sublime Text 3 settings file
// Preferences.sublime-settings
// Sublime Text 3, 28.1.2017
{
"auto_complete": true,
"auto_complete_commit_on_tab": true,
"auto_complete_with_fields": true,
"bold_folder_labels": true,
"default_encoding": "UTF-8",
"detect_indentation": true,
@tuomasj
tuomasj / patch-edid.rb
Created September 14, 2017 08:34
Create display override file to force Mac OS X to use RGB mode for Display
#!/usr/bin/ruby
# Create display override file to force Mac OS X to use RGB mode for Display
# see http://embdev.net/topic/284710
#
# Update 2013-06-24: added -w0 option to prevent truncated lines
#
# original source: https://embdev.net/topic/284710#3027030 (by Andreas Schwarz)
require 'base64'
@tuomasj
tuomasj / .bash_aliases
Created October 22, 2017 08:30
Bash shell aliases
# Assuming that ~/.bash_aliases has the aliases defined
# These work on Bash, not sure what happens with other shells
# Run previous command
alias r='fc -s'
# Open .vimrc
alias vimrc="vim ~/.vimrc"
# Reload aliases
@tuomasj
tuomasj / nhl_games_tonight.rb
Created September 21, 2018 20:28
Fetch NHL game scores and post the results on a Telegram channel
require 'date'
require "open-uri"
require 'json'
# This is just one big file, because it's easy to copy&paste (a.k.a. deploy)
# this script on a cheap VPN and set up a cronjob to run this once per day.
#
#
# Example output with Telegram markdown formatting
# shows the winning team and players who have goals or assists