$ rails new my-i8n --webpack
Gemfile
gem 'i18n-js'
$ rails new my-i8n --webpack
Gemfile
gem 'i18n-js'
# Use this script to test that your Telegram bot works. | |
# | |
# Install the dependency | |
# | |
# $ gem install telegram_bot | |
# | |
# Run the bot | |
# | |
# $ ruby bot.rb | |
# |
TL;DR
Install Postgres 9.5, and then:
sudo pg_dropcluster 9.5 main --stop
sudo pg_upgradecluster 9.3 main
sudo pg_dropcluster 9.3 main
def save_with_lock | |
r = Record.first | |
# This will raise PG::LockNotAvailable if already locked | |
# | |
r.with_lock("FOR UPDATE NOWAIT") do | |
# do stuff | |
end | |
# This rescue block isn't executed for some reason?? |
I have moved this over to the Tech Interview Cheat Sheet Repo and has been expanded and even has code challenges you can run and practice against!
\
#################### | |
# FROM MAIN COMPUTER | |
#################### | |
# Create the sync directory in Dropbox | |
$ mkdir ~/Dropbox/sublime-text-3 | |
# Move your ST3 "Packages" and "Installed Packages" to Dropbox | |
$ cd ~/Library/Application\ Support/Sublime\ Text\ 3 | |
$ mv Packages/ ~/Dropbox/sublime-text-3 | |
$ mv Installed\ Packages/ ~/Dropbox/sublime-text-3 |
module ActiveAdmin | |
module Reports | |
module DSL | |
def enable_reports | |
action_item only: :index do | |
link_to("Download", {action: :report, params: params}, {method: :post, data: { confirm: "Are you sure you want to generate this report?"}}) | |
end | |
collection_action :report, method: :post do |
# spec/support/capybara/select2_helper.rb or features/support/select2_helper.rb | |
module Select2Helper | |
# @example | |
# select2 "Item", from: "select_id" | |
# select2 /^Item/, from: "select_id" | |
# | |
# @note Works with Select2 version 3.4.1. | |
def select2(text, options) | |
find("#s2id_#{options[:from]}").click |
<!-- Raven.js Config --> | |
<script src="{{ JS_PATH }}/lib/raven.js" type="text/javascript"></script> | |
<script type="text/javascript"> | |
// Ignore list based off: https://gist.github.com/1878283 | |
var ravenOptions = { | |
// Will cause a deprecation warning, but the demise of `ignoreErrors` is still under discussion. | |
// See: https://github.com/getsentry/raven-js/issues/73 | |
ignoreErrors: [ | |
// Random plugins/extensions | |
'top.GLOBALS', |
-- show running queries (pre 9.2) | |
SELECT procpid, age(clock_timestamp(), query_start), usename, current_query | |
FROM pg_stat_activity | |
WHERE current_query != '<IDLE>' AND current_query NOT ILIKE '%pg_stat_activity%' | |
ORDER BY query_start desc; | |
-- show running queries (9.2) | |
SELECT pid, age(clock_timestamp(), query_start), usename, query | |
FROM pg_stat_activity | |
WHERE query != '<IDLE>' AND query NOT ILIKE '%pg_stat_activity%' |