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
# PDF to PNG shell script for Quickdrop app | |
# https://quickdrop.antran.app/ | |
# pdfburst shell script | |
# chmod 0755 pdfburst | |
#!/usr/bin/swift | |
import Foundation | |
import PDFKit |
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 | |
set -e | |
###################################################################### | |
# This simple backup script generates commands to recreate dokku apps | |
# | |
# It creates the app, adds domains, and restores configuration for each app | |
# It does not handle databases, persistent storage, or other plugin settings | |
# | |
# Usage: Run this script on a Dokku server (you must either be logged in as the |
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 | |
set -e | |
###################################################################### | |
# This Bootstrap Script installs Dokku latest on Ubuntu (use LTS or latest) | |
# | |
# This script also installs UFW (firewall), some basic Dokku plugins, and | |
# raises ulimits. Comment out any step you wish to skip. | |
# | |
# IMPORTANT: This script also disables password authentication via SSH for |
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
# available limit | |
user@ubuntu:~$ ulimit -n | |
1024 | |
# To increase the available limit to say 65535 | |
user@ubuntu:~$ sudo vim /etc/sysctl.conf | |
# add the following line to it | |
fs.file-max = 65535 |
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
// Script to control SiteGPT.AI chat Interface elements | |
// Usage: | |
// _sitegpt.open() | |
// _sitegpt.hide() | |
// _sitegpt.show() | |
// etc. | |
window._sitegpt = { | |
is_open: function() { return !document.querySelector('#sitegpt-chat-icon img').src.includes('logo') }, | |
open: function() { if (!_sitegpt.is_open()) { _sitegpt.toggle() } }, | |
close: function() { if (_sitegpt.is_open()) { _sitegpt.toggle() } }, |
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
//////////////////////////////////// | |
/* "dependencies": { | |
"@supabase/supabase-js": "^2.13.1", | |
"langchain": "^0.0.44" | |
} */ | |
//////////////////////////////////// | |
import { OpenAI } from "langchain/llms"; | |
import { |
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
const { Configuration, OpenAIApi } = require('openai'); | |
let openai; | |
const instructions = ``; | |
if (process.env.OPEN_AI_API_KEY) { | |
const configuration = new Configuration({ apiKey: process.env.OPEN_AI_API_KEY }); | |
openai = new OpenAIApi(configuration); | |
} |
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
function countryCodeToName(code) { | |
const data = { | |
"AD": "Andorra", | |
"AE": "United Arab Emirates", | |
"AF": "Afghanistan", | |
"AG": "Antigua and Barbuda", | |
"AI": "Anguilla", | |
"AL": "Albania", | |
"AM": "Armenia", | |
"AO": "Angola", |
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
// Raw data from: https://github.com/country-regions/country-region-data/blob/master/data.json | |
const data = JSON.parse('[{"countryName":"Afghanistan","countryShortCode":"AF","regions":[{"name":"Badakhshan","shortCode":"BDS"},{"name":"Badghis","shortCode":"BDG"},{"name":"Baghlan","shortCode":"BGL"},{"name":"Balkh","shortCode":"BAL"},{"name":"Bamyan","shortCode":"BAM"},{"name":"Daykundi","shortCode":"DAY"},{"name":"Farah","shortCode":"FRA"},{"name":"Faryab","shortCode":"FYB"},{"name":"Ghazni","shortCode":"GHA"},{"name":"Ghor","shortCode":"GHO"},{"name":"Helmand","shortCode":"HEL"},{"name":"Herat","shortCode":"HER"},{"name":"Jowzjan","shortCode":"JOW"},{"name":"Kabul","shortCode":"KAB"},{"name":"Kandahar","shortCode":"KAN"},{"name":"Kapisa","shortCode":"KAP"},{"name":"Khost","shortCode":"KHO"},{"name":"Kunar","shortCode":"KNR"},{"name":"Kunduz","shortCode":"KDZ"},{"name":"Laghman","shortCode":"LAG"},{"name":"Logar","shortCode":"LOW"},{"name":"Maidan Wardak","shortCode":"WAR"},{"name":"Nangarhar","shortCode":"NAN |
NewerOlder