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/bash | |
# SEE: https://stackoverflow.com/a/29754866/888294 | |
# More safety, by turning some bugs into errors. | |
# Without `errexit` you don’t need ! and can replace | |
# ${PIPESTATUS[0]} with a simple $?, but I prefer safety. | |
set -o errexit -o pipefail -o noclobber -o nounset | |
# -allow a command to fail with !’s side effect on errexit | |
# -use return value from ${PIPESTATUS[0]}, because ! hosed $? |
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
Rails.application.configure do | |
# … | |
# SEE: https://prathamesh.tech/2020/08/10/creating-unlogged-tables-in-rails/ | |
# SEE: config/initializers/active_record_postgresql_create_unlogged_tables_patch.rb | |
config.to_prepare do | |
ActiveSupport.on_load(:active_record) do | |
ActiveRecord::ConnectionAdapters::PostgreSQLAdapter.create_unlogged_tables = true | |
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
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
# | |
# Usage: | |
# spdns-client.py <hostname> <user> <passwd> | |
# | |
# With xargs and arguments-file: | |
# xargs -a spdns-client.args -n 3 spdns-client.py | |
# | |
# Copyright 2013 -- Michael Nowak |
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
script Service | |
property service_name : null | |
property service_state : null | |
on start_pre() | |
-- start pre-action here | |
end start_pre | |
on start_up() | |
tell me to start_pre() |
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
=begin | |
Paste this code snippet into your Gemfile. It let's you easily define gems for certain OSes using gem_for_darwin, gem_for_linux or gem_for_windows as gem-statement, e. g. | |
# notifications for file changes | |
gem_for_osx 'rb-fsevent', :platforms => :ruby | |
gem_for_linux 'rb-inotify', :platforms => :ruby | |
gem_for_windows 'rb-fchange', :platforms => [:mswin, :mingw] | |
# console color for windows | |
gem_for_windows 'win32console', :platforms => [:mswin, :mingw] |