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 update-index --add --chmod=+x filename.sh | |
git commit -m 'filename permission error fixed.' | |
git push |
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
// 🚀 Fiber is an Express inspired web framework written in Go with 💖 | |
// 📌 API Documentation: https://fiber.wiki | |
// 📝 Github Repository: https://github.com/gofiber/fiber | |
package main | |
import ( | |
"context" | |
"log" | |
"time" |
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
SELECT MAX(id) FROM "Content"; | |
SELECT nextval('"Content_id_seq"'::text); | |
BEGIN; | |
-- protect against concurrent inserts while you update the counter | |
LOCK TABLE "Content" IN EXCLUSIVE MODE; | |
-- Update the sequence | |
SELECT setval('"Content_id_seq"', COALESCE((SELECT MAX(id)+1 FROM "Content"), 1), false); |
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 | |
dir="/Users/$USER/images" | |
find $dir -type f -name '*.png' -print0 | while IFS= read -r -d '' file; do | |
convert "$file" "${file%.*}.jpg" | |
rm -f $file | |
echo "$file converted" | |
done |
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
# -*- coding: utf-8 -*- | |
import threading | |
class ThreadSafeCounter: | |
def __init__(self, counter=0, max_counter=0): | |
self.lock = threading.Lock() | |
self.counter = counter | |
self.max_counter = max_counter |
OlderNewer