Skip to content

Instantly share code, notes, and snippets.

View VottusCode's full-sized avatar
💭
enjoying corona, hbu

VottusCode

💭
enjoying corona, hbu
View GitHub Profile
@VottusCode
VottusCode / i_hate_myself_too_dw.php
Created March 22, 2023 12:48
wip random bullshit
<?php declare(strict_types=1);
ini_set('auto_detect_line_endings', true);
// Utility code
interface Processor
{
/**
* @param resource|string $source
*/
@VottusCode
VottusCode / TemplateHelper.php
Created December 2, 2022 22:33
Extended template resolution with themes
<?php declare(strict_types=1);
namespace App\Templating;
use Nette\Application\UI\Presenter;
use Nette\Utils\FileSystem;
class TemplateHelper
{
@VottusCode
VottusCode / index.js
Created October 20, 2022 08:26
Vodafone AR2SINEW Restart script
const VodafoneUrl = "http://192.168.0.1";
const Username = "admin";
const Password = "password";
const {
fill,
createBrowser,
elementExists,
waitAndClick,
} = require("./puppeteer");
@VottusCode
VottusCode / link_binaries.sh
Created April 3, 2022 10:40
Link binaries one-liner (example on jdk/bin)
@VottusCode
VottusCode / rebuild_dkms_modules.sh
Created March 16, 2022 11:50
Rebuild DKMS modules for all kernel versions
ls /var/lib/initramfs-tools | \
sudo xargs -n1 /usr/lib/dkms/dkms_autoinstaller start
@VottusCode
VottusCode / webpack.config.js
Created February 20, 2022 10:38
My go-to webpack encore config
const encore = require("@symfony/webpack-encore");
const fs = require("fs");
const path = require("path");
const frontend = path.join(__dirname, "frontend/");
const output = path.join(__dirname, "public", "build");
// Checks whether NODE_ENV is set to dev/development, otherwise defaults to production.
const env = ["dev", "development"].includes(String(process.env.NODE_ENV).toLowerCase())
? "development"
@VottusCode
VottusCode / _deploy.js
Last active February 17, 2022 11:37
My serverfull deploy/setup scripts
/**
* Script that deploys the application to an FTP/SFTP server.
*/
const {params, credentials, deploy: deployConfig} = require("./utils")
const {exec} = require("better-exec");
const {Deploy} = require("@vottuscode/deploy-script");
const {SftpFileRemote} = require("@remotefull/file");
const {SshCmdRemote} = require("@remotefull/commander");
const deploy = new Deploy(
const {BaseCmdRemote} = require("@remotefull/commander/dist/remote/BaseCmdRemote")
class AptCommandError extends Error {
/**
* Raw command output.
* @type {string[]|null}
*/
rawOut;
/**
@VottusCode
VottusCode / remove_ps_eval.sh
Created August 24, 2021 21:44
Remove PhpStorm evaluation (Linux)
rm ~/.config/JetBrains/PhpStorm*/options/other.xml
rm ~/.config/JetBrains/PhpStorm*/eval/*
rm -rf .java/.userPrefs
@VottusCode
VottusCode / build.sh
Created August 2, 2021 21:55
prisma-client-go binaries/publish.sh without the publish stuff
#!/bin/sh
set -eux
v="$1"
mkdir -p build
cd build
npm init --yes
npm i "pkg" --dev