I hereby claim:
- I am Envek on github.
- I am envek (https://keybase.io/envek) on keybase.
- I have a public key whose fingerprint is 5439 E3DC F03F 4317 524E E679 301A D540 0512 05A2
To claim this, I am signing this object:
# Enables PostgreSQL interval datatype support (as ActiveSupport::Duration) in Ruby on Rails 4.1. | |
# Based on https://gist.github.com/clarkdave/6529610 | |
require 'active_support/duration' | |
# add a native DB type of :interval | |
ActiveRecord::ConnectionAdapters::PostgreSQLAdapter::NATIVE_DATABASE_TYPES[:interval] = { name: 'interval' } | |
# add the interval type to the simplified_type list. because this method is a case statement | |
# we can't inject anything into it, so we create an alias around it so calls to it will call |
# Full list of Russian Federation time zones with helper to get this list. | |
# Place this file in config/initializers/timezones.ru.rb | |
class ActiveSupport::TimeZone | |
@country_zones = ThreadSafe::Cache.new | |
def self.country_zones(country_code) | |
code = country_code.to_s.upcase | |
@country_zones[code] ||= | |
TZInfo::Country.get(code).zone_identifiers.select do |tz_id| |
source "https://rubygems.org" | |
gem "pg" | |
gem "activesupport" |
#!/bin/sh | |
usage() { | |
echo "DNS Master DynDNS update script. Updates A and/or AAAA records with public IPs that you have on your interfaces." | |
echo "Usage: $0 -h hostname[,hostname…] -u username -p password" | |
} | |
if [ $# -eq 0 ]; then usage; exit 1; fi | |
USERNAME="" |
I hereby claim:
To claim this, I am signing this object:
# For Ruby on Rails master branch | |
begin | |
require 'bundler/inline' | |
rescue LoadError => e | |
$stderr.puts 'Bundler version 1.10 or later is required. Please update your Bundler' | |
raise e | |
end | |
gemfile(true) do |
Иногда при работе с несколькими удалёнными репозиториями в git, может произойти страшное: git push --force
в не тот remote
и/или не в ту ветку.
Такое может случиться, например, если вы используете [Deis], в котором деплой запускается при git push
нужного коммита в сборщик, когда при отладке деплоя после очередного git commit --amend
по запарке вместо git push deis master --force
делается просто git push --force
. Упс.
Как результат, последние коммиты коллег безвозвратно потеряны, и вы чувствуете неотвратимость их ярости…
Но это git, а значит всё можно починить!
AllCops: | |
TargetRubyVersion: 2.5 | |
Style/AsciiComments: | |
Enabled: false | |
Metrics/LineLength: | |
Max: 120 |
FROM nginx:stable-alpine | |
COPY default.conf /etc/nginx/conf.d/default.conf | |
COPY maintenance.html /usr/share/nginx/html/ |
# Example of custom PostgreSQL composite type support | |
# Works with Rails 6.0, also should work with Rails 5.2 | |
# Place this file to config/initializers/ | |
gem "money" | |
require "money" | |
# Subclass Money class just to get pretty output in rails console | |
class TrueMoney < Money | |
def inspect |