This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
###### application_controller.rb | |
before_filter :set_locale | |
def set_locale | |
locale = params[:locale] || cookies[:locale] || TLD_LOCALES[request.host.split('.').last] || request.headers['HTTP_ACCEPT_LANGUAGE'].split(',').map { |l| l.split(';').first } | |
locale = DEFAULT_LOCALE unless (SUPPORTED_LOCALES).include?(locale.to_s) | |
I18n.locale = locale.to_s | |
cookies[:locale] = locale unless (cookies[:locale] && cookies[:locale] == locale) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" | |
" | |
" ██╗ ██╗██╗███╗ ███╗██████╗ ██████╗ | |
" ██║ ██║██║████╗ ████║██╔══██╗██╔════╝ | |
" ██║ ██║██║██╔████╔██║██████╔╝██║ | |
" ╚██╗ ██╔╝██║██║╚██╔╝██║██╔══██╗██║ | |
" ╚████╔╝ ██║██║ ╚═╝ ██║██║ ██║╚██████╗ | |
" ╚═══╝ ╚═╝╚═╝ ╚═╝╚═╝ ╚═╝ ╚═════╝ | |
" | |
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# config valid only for current version of Capistrano | |
lock '3.4.0' | |
set :application, 'domochat' | |
set :repo_url, '[email protected]:domochat/domochat.git' | |
set :ruby_version, '2.2.3' | |
# Default branch is :master | |
# ask :branch, `git rev-parse --abbrev-ref HEAD`.chomp |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
defmodule Pin do | |
def generate(length \\ 4) when is_integer(length) and length >= 0 do | |
Enum.join(gen_pin(length)) | |
end | |
defp gen_pin(1) do | |
[:rand.uniform(9)] | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Path to your oh-my-zsh installation. | |
export ZSH=/Users/alec/.oh-my-zsh | |
# Set name of the theme to load. | |
# Look in ~/.oh-my-zsh/themes/ | |
# Optionally, if you set this to "random", it'll load a random theme each | |
# time that oh-my-zsh is loaded. | |
ZSH_THEME="robbyrussell" | |
# Uncomment the following line to use case-sensitive completion. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Quick edits | |
alias ea 'vim ~/.config/fish/aliases.fish' | |
alias ef 'vim ~/.config/fish/config.fish' | |
alias eg 'vim ~/.gitconfig' | |
alias ev 'vim ~/.vimrc' | |
# OS related | |
alias cd.. 'cd ..' | |
alias .. 'cd ..' | |
alias ... 'cd ../..' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
tap "dart-lang/dart" | |
tap "hashicorp/tap" | |
tap "heroku/brew" | |
tap "homebrew/bundle" | |
tap "homebrew/cask-versions" | |
tap "homebrew/core" | |
tap "muesli/tap" | |
tap "romkatv/powerlevel10k" | |
tap "rs/tap" | |
tap "stripe/stripe-cli" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
String.class_eval do | |
def to_id | |
if self.match?(/[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}/i) | |
self.to_s | |
else | |
self.to_i | |
end | |
end | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM ruby:latest | |
WORKDIR /usr/src/app/ | |
ADD . /usr/src/app/ | |
CMD ["ruby", "/usr/src/app/test.rb"] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
code --list-extensions | while read extension; | |
do | |
code --uninstall-extension $extension --force | |
done | |
rm -rfv "$HOME/.vscode" | |
rm -rfv "$HOME/Library/Application Support/Code" | |
rm -rfv "$HOME/Library/Caches/com.microsoft.VSCode" |