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
do $$ | |
declare r record; | |
BEGIN | |
FOR r IN ( | |
SELECT FORMAT( | |
'UPDATE pg_constraint SET convalidated=false WHERE conname = ''%I'' AND connamespace::regnamespace = ''%I''::regnamespace; ALTER TABLE %I.%I VALIDATE CONSTRAINT %I;', | |
constraint_name, | |
table_schema, | |
table_schema, | |
table_name, |
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
# Loop through each file in the directory | |
for file in *; do | |
if [ -f "$file" ]; then # Check if it's a file (and not a directory) | |
echo "Filename: $file" # Print the name of the file | |
cat "$file" # Print the contents of the file | |
echo # Print a newline for better readability between files | |
fi | |
done |
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
watch -n 1 ls -lh backup.sql |
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 | |
brew install jq | |
ORG="xxxx" | |
TOKEN="xxxx" # 30 days valid | |
# Ensure jq and curl are installed | |
REPOS=$(curl -H "Authorization: token $TOKEN" "https://api.github.com/orgs/${ORG}/repos?per_page=100&type=all" | jq -r '.[].clone_url') |
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
curl -s 'https://pbs.twimg.com/media/E9T96Q9XIAcs8xJ?format=jpg&name=large' -o - | tesseract stdin stdout | grep --color 609 |
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
--- | |
development: | |
url: <%= ENV['DATABASE_URL'].gsub('?', '_development?') %> | |
test: | |
url: <%= ENV['DATABASE_URL'].gsub('?', '_test?') %> | |
staging: | |
url: <%= ENV['DATABASE_URL'].gsub('?', '_staging?') %> | |
production: | |
url: <%= ENV['DATABASE_URL'].gsub('?', '_production?') %> |
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
file "example.flac" | |
example.flac: FLAC audio bitstream data, 16 bit, stereo, 44.1 kHz, 2474304 samples |
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
# Here is how to create a slideshow from images (1.jpg,2.jpg..,8.jpg) with FFmpeg on your Linux or Unix box: | |
ffmpeg -y -r 1/3 -framerate 1 -i %1d.jpg -c:v libx264 -vf fps=5 -pix_fmt yuv420p out.mp4 |
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
Sidekiq.redis { |r| puts r.flushall } |
NewerOlder