Skip to content

Instantly share code, notes, and snippets.

View Avaray's full-sized avatar
🙂
Looking for work

Avaray Avaray

🙂
Looking for work
View GitHub Profile
@Avaray
Avaray / default.sh
Last active March 7, 2024 10:46
ai-dock/provisioning/default.sh
#!/bin/false
DISK_GB_REQUIRED=30
MAMBA_PACKAGES=(
#"package1"
#"package2=version"
)
PIP_PACKAGES=(
@Avaray
Avaray / index.html
Created January 17, 2024 14:04 — forked from bellbind/index.html
[chrome][android] BarcodeDetector example
<!doctype html>
<html>
<head>
<script type="module">
// WICG Shape Detection API
// - https://wicg.github.io/shape-detection-api/
try {
const start = document.getElementById("start");
const video = document.getElementById("video");
const result = document.getElementById("result");
@Avaray
Avaray / mip
Last active January 15, 2024 12:53
[BASH] Get public IP address
#!/bin/bash
S1='whatismyip.akamai.com'
S2='icanhazip.com'
S3='ifconfig.me'
IP=$(curl -sk $S1)
IP_regex='^[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+$'
if [[ ! $IP =~ $IP_regex ]]; then
@Avaray
Avaray / data.ts
Last active February 24, 2023 10:30
Battlefield 4 DATA
export const gamemodes: {[key: string]: string} = {
"AirSuperiority": "Air Superiority",
"CaptureTheFlag": "Capture The Flag",
"CarrierAssault": "Carrier Assault Small",
"CarrierAssaultLarge": "Carrier Assault Large",
"Chainlink": "Chainlink",
"ConquestLarge": "Conquest Large",
"ConquestSmall": "Conquest Small",
"Domination": "Domination",
"Elimination": "Defuse",
@Avaray
Avaray / playwright.js
Last active September 27, 2022 15:03
[NodeJS] Playwright Starter
const { chromium } = require('playwright-core');
// set browser to disable images loading
const browser = await chromium.launch({
headless: true,
executablePath: CHROMIUM_PATH_HERE,
args: [ '--blink-settings=imagesEnabled=false', '--window-size=800,800' ]
});
const page = await browser.newPage({ viewport: null });
@Avaray
Avaray / BF4_MAPS.json
Last active September 26, 2022 06:38
List of all Batlefield 4 maps and gamemodes.
{
"MP_Abandoned": "Zavod 311",
"MP_Damage": "Lancang Dam",
"MP_Flooded": "Flood Zone",
"MP_Journey": "Golmud Railway",
"MP_Naval": "Paracel Storm",
"MP_Prison": "Operation Locker",
"MP_Resort": "Hainan Resort",
"MP_Siege": "Siege of Shanghai",
"MP_TheDish": "Rogue Transmission",
@Avaray
Avaray / time_between.js
Created September 24, 2022 18:19
Calculate Days / Hours / Minutes / Seconds between two dates in JavaScript
// days between
(b - a) / (1000 * 60 * 60 * 24)
// minutes between
(b - a) / 60000
// seconds between
(b - a) / 1000
@Avaray
Avaray / jump.cfg
Last active December 4, 2021 21:27
TF2 (Team Fortress 2) Jump Script with Ammo and Health Regeneration
// ----- INSTALLATION GUIDE
// 1. Copy jump.cfg file into directory:
// STEAM/steamapps/common/Team Fortress 2/tf/cfg
// or
// STEAM/steamapps/common/Team Fortress 2/tf/custom/YOUR_NICE_DIRECTORY_NAME/cfg
// 2. Launch your home (Local) server
// 3. Join to team, pick your class (Soldier? Demo? Pyro?)
// 4. Open console and type "exec jump"
// 5. Play
//
@Avaray
Avaray / MagPi_Issues.sh
Last active July 23, 2021 17:38
[BASH] Download all MagPi Issues at once (sequentially) // Because official download page is not user friendly
#!/bin/bash
TOTAL=$(curl -s "https://www.raspberrypi.org/magpi-issues/" | grep -Eo "\"MagPi[0-9]+.pdf" | wc -l)
for issue in $(eval echo {01..$TOTAL}); do
[ ! -f "MagPi$issue.pdf" ] && curl -Os "https://www.raspberrypi.org/magpi-issues/MagPi$issue.pdf"
done
@Avaray
Avaray / rpi_update
Last active June 10, 2021 07:46
[BASH] Script for updating Raspberri Pi 3b+
#!/bin/bash
dir="$(dirname "$(realpath "$0")")"
log="$(
date
sudo apt-get -y update
sudo apt-get -y upgrade
sudo rpi-update
sudo apt-get autoremove