Skip to content

Instantly share code, notes, and snippets.

SELECT "customers".*
FROM (
SELECT "customers".*
FROM "customers"
WHERE "customers"."company_id" = $1
AND (
NOT (
EXISTS (
SELECT "import_logs".*
FROM "import_logs"

Keybase proof

I hereby claim:

  • I am nicnilov on github.
  • I am nicnilov (https://keybase.io/nicnilov) on keybase.
  • I have a public key whose fingerprint is E874 E06B A8E0 4F88 D634 417E 673F BE4F 14A9 B008

To claim this, I am signing this object:

@nicnilov
nicnilov / gist:bc30fd01d9f58fd9dc7e64eb076495ea
Created June 1, 2017 10:57
Brew revert Postgresql to 9.4 after auto upgrade and use existing data directory
brew search postgres
brew uninstall postgresql
brew install postgresql@9.4
brew link postgresql@9.4 --force
pg_ctl -D /usr/local/var/postgres/ start # << specify the existing data directory and not the newly installed one
@nicnilov
nicnilov / disable.sh
Created October 23, 2017 12:53
Disable bunch of #$!@ in Sierra (Version 2.1)
#!/bin/bash
# IMPORTANT: You will need to disable SIP aka Rootless in order to fully execute this script, you can reenable it after.
# WARNING: It might disable things that you may not like. Please double check the services in the TODISABLE vars.
# Get active services: launchctl list | grep -v "\-\t0"
# Find a service: grep -lR [service] /System/Library/Launch* /Library/Launch* ~/Library/LaunchAgents
# Agents to disable
TODISABLE=('com.apple.security.keychainsyncingoveridsproxy' 'com.apple.personad' 'com.apple.passd' 'com.apple.screensharing.MessagesAgent' 'com.apple.CommCenter-osx' 'com.apple.Maps.mapspushd' 'com.apple.Maps.pushdaemon' 'com.apple.photoanalysisd' 'com.apple.telephonyutilities.callservicesd' 'com.apple.AirPlayUIAgent' 'com.apple.AirPortBaseStationAgent' 'com.apple.CalendarAgent' 'com.apple.DictationIM' 'com.apple.iCloudUserNotifications' 'com.apple.familycircled' 'com.apple.familycontrols.useragent' 'com.apple.familynotificationd' 'com.apple.gamed' 'com.apple.icloud.findmydeviced.findmydevi
@nicnilov
nicnilov / script.rb
Created December 9, 2017 17:40
Mailgun console test
mg_client = Mailgun::Client.new('api-key')
message_params = {
from: 'alice@example.com',
to: 'bob@example.com',
subject: 'The Ruby SDK is awesome!',
text: 'It is really easy to send a message!'
}
mg_client.send_message('mg.registered.domain', message_params)
pg_ctl -D /usr/local/var/postgresql@9.6 start
pg_ctl -D /usr/local/var/postgresql@9.6 stop
@nicnilov
nicnilov / pgdb2csv.sh
Created September 15, 2018 11:08
Dump postgresql database to csv
#!/bin/bash
DB_SCHEMA="public"
DB_USER="postgres"
DB_HOST="localhost"
DB_PORT="db_port"
DB_NAME="db_name"
# DB_PASS="" to be passed from shell
psql "postgresql://$DB_USER:$DB_PASS@$DB_HOST:$DB_PORT/$DB_NAME" -Atc "select tablename from pg_tables where schemaname='$DB_SCHEMA'" $DB_NAME |\
@nicnilov
nicnilov / retry.sh
Created February 28, 2019 11:26 — forked from felipou/retry.sh
Retry command
#
# Created by Felipe Machado - 2016/02/14
#
# A retry command for bash
# Retries the given command up to MAX_RETRIES, with an interval of SLEEP_TIME
# between each retry. Just put it on your bash_profile and be happy :)
# Usage:
# retry [-s SLEEP_TIME] [-m MAX_RETRIES] COMMAND_WITH_ARGUMENTS
#
# Codes used as reference:
noindex () {
mdutil -i off .
sudo rm -rf .{,_.}{fseventsd,Spotlight-V*,Trashes,DocumentRevisions-V*}
mkdir .fseventsd
touch .fseventsd/no_log .metadata_never_index .Trashes
echo "Done"
}
# Install llvm@8
brew install llvm@8
# Clone the repo
cd <some directory>
git clone git@github.com:Beep6581/RawTherapee.git
cd RawTherapee