You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Instantly share code, notes, and snippets.
Andrey Novikov
Envek
Web developer with a strong passion to build rock solid applications: secure, reliable, fast.
Opt-in ability to soft-delete records in future for gem paranoia
Paranoia in the future
Opt-in ability to soft-delete records in future for gem paranoia
The problem
By default Paranoia treats any record with non-null deleted_at as already deleted record no matter actual value of the attribute. And sometimes you may want to mark records for automatic deletion in the future.
If you have an application installed on one device, but for some reason can't install it on another via Play Market (e.g. dumb country restrictions!), then this script will allow you to grab APKs from one phone and install them on another!
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
Example of separate metrics exporter process for Yabeda with Prometheus (Ruby)
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
Preload first N records of an association in ActiveRecord (Ruby on Rails)
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
# Now @collections.first.projects will have only first 3 projects accessible
# Constructs SQL like this to preload limited number of recent projects along with collections:
# SELECT * FROM (
# SELECT "projects".*, row_number() OVER (PARTITION BY collection_projects.collection_id ORDER BY collection_projects.created_at) AS collection_position
GNOME Shell extension to switch between two most recently used keyboard layouts
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
Signing-in user for integration tests via cookie-only session with Rails, Devise, Capybara, and Cuprite
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
Example of “true money” PostgreSQL composite type including both amoiunt and currency and how to work with it in Ruby on Rails
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
Minimal image to be used as Kubernetes default backend as maintenance page
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
Иногда при работе с несколькими удалёнными репозиториями в git, может произойти страшное: git push --force в не тот remote и/или не в ту ветку.
Такое может случиться, например, если вы используете [Deis], в котором деплой запускается при git push нужного коммита в сборщик, когда при отладке деплоя после очередного git commit --amend по запарке вместо git push deis master --force делается просто git push --force. Упс.
Как результат, последние коммиты коллег безвозвратно потеряны, и вы чувствуете неотвратимость их ярости…