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 openAiApiKey = '***' | |
const openAiCompletionApiUrl = 'https://api.openai.com/v1/completions'; | |
const additionalPromptCharsLimit = 1600; | |
function myFunction() { | |
const idOfFolderContainingPdfs = '{ADD ID HERE}' | |
const idOfDestinationFolder = '{ADD ID HERE}' | |
const SourceFolder = DriveApp.getFolderById(idOfFolderContainingPdfs) | |
const DestinationFolder = DriveApp.getFolderById(idOfDestinationFolder) |
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 | |
# system update | |
pacman -Syyu | |
# install sudo | |
pacman -S sudo | |
nano /etc/sudoers # change what you need |
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/zsh | |
# keyboard | |
loadkeys de-latin1 | |
# list network cards | |
ip link | |
# connect to LAN | |
dhcpcd <name like 'enp4s0'> |
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 | |
docker context create remote --docker "host=ssh://user@remotemachine" | |
docker-compose -f docker-compose.production.yml --context remote up -d --no-deps --build |
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
{ | |
"type": "https://tools.ietf.org/html/rfc2616#section-10", | |
"title": "An error occurred", | |
"detail": "Class rray<string,string> does not exist", | |
"trace": [ | |
{ | |
"namespace": "", | |
"short_class": "", | |
"class": "", | |
"type": "", |
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 | |
LINES=$(tput lines) | |
COLUMNS=$(tput cols) | |
declare -A snowflakes | |
declare -A lastflakes | |
clear |
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
let M = 255; | |
let C = (x,y) => (M - Math.sqrt((Math.pow(M-x,2)+Math.pow(M-y,2))/2)).toFixed(0); | |
let mixColors = (x,y) => [C(x[0],y[0]),C(x[1],y[1]),C(x[2],y[2])]; | |
mixColors([255,125,23],[0,255,0]) // ["75","163","11"] |
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
<?php | |
/** | |
* Trait EnumTrait | |
* @author Philipp Dahse <[email protected]> | |
*/ | |
trait EnumTrait | |
{ | |
/** | |
* @return array |
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/env bash | |
# cleaner.sh by Philipp Dahse <[email protected]> | |
# ------------------------------------------------ | |
# checks all files and directories next to itself. | |
# If there "last modified date" is older then given days (file_live_time_in_days) | |
# it remove those data. | |
# I use this script in something like a personal tmp directory: | |
# | |
# /home/my/tmp/cleaner.sh |
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
<?php | |
/** | |
* Class GeoOffsetByDistance | |
*/ | |
class GeoOffsetByDistance | |
{ | |
//Earth’s radius, sphere in meters | |
const R = 6378137; | |
/** @var float */ |
NewerOlder