This file contains 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 | |
# https://github.com/pi-hole/docker-pi-hole/blob/master/README.md | |
docker run -d \ | |
--name pihole \ | |
-p 53:53/tcp -p 53:53/udp \ | |
-p 80:80 \ | |
-p 443:443 \ | |
-e TZ="Europe/London" \ |
This file contains 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
//Configuration.h | |
#import <Foundation/Foundation.h> | |
@interface Configuration : NSObject | |
extern NSString *const kRMAWebServiceURL; | |
extern const NSTimeInterval kRMTimeoutValue; |
This file contains 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 | |
# | |
# Simple script to upload .ipa to testflight | |
# Usage: upload_testflight.sh /path/to/file.ipa /path/to/app.dSYM {build version} | |
# | |
# src: https://gist.github.com/rob-murray/7941761 | |
# | |
if [ $# -lt 3 ] |
This file contains 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
linters: | |
LineLength: | |
max: 40 |
This file contains 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
sudo rm -rfv /Library/Caches/com.apple.iconservices.store; sudo find /private/var/folders/ \( -name com.apple.dock.iconcache -or -name com.apple.iconservices \) -exec rm -rfv {} \; ; sleep 3; killall Dock; killall Finder |
This file contains 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/sh | |
# Wait for a bit and then click in the top right of the screen to turn off the "chrome did not shut down properly" popup. | |
sleep 10 | |
export DISPLAY=":0" | |
xdotool mousemove 1905 20 # change co-ords to suit | |
xdotool click 1 |
This file contains 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
# frozen_string_literal: true | |
# Helper to run a database command with given db config | |
class DbRunner | |
RESTORE_CMD_TEMPLATE = <<-CMD.squish | |
pg_restore -1 --disable-triggers -a -h %{host} -U %{username} -w -d %{database} #{Rails.root}/tmp/full-dump.pgsql | |
CMD | |
BACKUP_CMD_TEMPLATE = <<-CMD.squish | |
pg_dump --clean -w -U %{username} -d %{database} -h %{host} --format=c --compress=9 -T ar_internal_metadata -T schema_migrations -O > #{Rails.root}/tmp/full-dump.pgsql | |
CMD |
This file contains 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
[Unit] | |
Description=LendingBot service | |
After=network.target | |
[Service] | |
Type=simple | |
ExecStart=/usr/bin/python <CODE_DIR>/lendingbot.py | |
WorkingDirectory=<CODE_DIR> | |
RestartSec=10 | |
Restart=on-failure |
This file contains 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
desc "Kill and block incoming connections and then drop the current environment's database." | |
task "db:force_drop" => "environment" do | |
if Rails.env.production? && ENV["DISABLE_DATABASE_ENVIRONMENT_CHECK"] !~ /true|1/ | |
raise "Cannot drop the production database. Disable this with 'DISABLE_DATABASE_ENVIRONMENT_CHECK=true'" | |
end | |
db_config = Rails.configuration.database_configuration[Rails.env] | |
db_name = db_config.fetch("database") | |
kill_postgres_connections_sql = <<-SQL | |
SELECT pg_terminate_backend(pg_stat_activity.pid) |
This file contains 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
select n.nspname as enum_schema, | |
t.typname as enum_name, | |
string_agg(e.enumlabel, ', ') as enum_values | |
from pg_type t | |
join pg_enum e on t.oid = e.enumtypid | |
join pg_catalog.pg_namespace n ON n.oid = t.typnamespace | |
group by n.nspname, t.typname | |
order by enum_name; |