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 / bump-deps-major.js
Last active October 8, 2022 10:45
Small JS script to bump all Yarn dependencies to the latest version available. Supports Yarn workspaces.
const { exec } = require('child_process')
const path = require('path')
const glob = require('glob').sync
const bumpDeps = async (depsList, dev = false, workspace) => {
await new Promise((resolve, reject) => {
const _workspace = workspace ? `workspace ${workspace}` : '-W'
const _devFlag = dev ? '-D' : ''
const cmd = `yarn ${_workspace} add ${_devFlag} ${Object.keys(depsList).join(' ')}`
@VottusCode
VottusCode / nohiber.sh
Created April 30, 2021 14:26
Fuck Hiberfile right off your drive. Just rewrite /dev/sda to your Windows drive.
if ! [ $(id -u) = 0 ]; then
echo "You need to run this script as root (or use sudo)." >&2
exit 1
fi
if grep -qs '/dev/sda4 ' /proc/mounts; then
echo '/dev/sda4 is already mounted, proceeding to unmount'
umount /dev/sda4
if [ $? -eq 0 ]; then
@VottusCode
VottusCode / build.gradle.kts
Created April 26, 2021 13:19
Explicitly set UTF-8 in Gradle (build.gradle.kts)
tasks.withType<JavaCompile> {
options.encoding = "UTF-8"
}
tasks.withType<Javadoc>{
options.encoding = "UTF-8"
}
@VottusCode
VottusCode / app-Facades-Hash.php
Last active July 1, 2023 18:13
Simple implementation of AuthMe SHA256 as a Laravel Facade.
<?php declare(strict_types=1);
namespace App\Facades;
use Illuminate\Contracts\Hashing\Hasher;
use Illuminate\Support\Facades\Facade;
use Illuminate\Support\Str;
/**
* Hasher implementation that supports
@VottusCode
VottusCode / fake-data.php
Created April 11, 2021 12:40
Fixtures not working, fuck them
<?php declare(strict_types = 1);
/**
*
* This file is just a "scratch file" for creating fake
* data in development environment, not meant and not used
* in production. Fixtures are not working at the moment for some reason,
* probably related to PHP 8, so at the moment this is a shitty alternative.
*
* This code isn't gonna use some fancy shit, it's just gonna be a crappy shit,
@VottusCode
VottusCode / Sha256.ts
Created October 6, 2020 18:43
Port of AuthMe's SHA256 hashing to Node.js
import { createHash } from "crypto";
import { range } from "lodash";
export class Sha256 {
/** Range of characters for salt generation */
private chars: string[];
public static SALT_LENGTH = 16;
constructor() {
@VottusCode
VottusCode / Shit-script-to-remove-ads-on-KissAnime.js
Last active October 6, 2020 18:52
Script for Tampermonkey that deletes iframe ads on KissAnime, and the one over the play (beta server)
// ==UserScript==
// @name FuckAdsKA
// @version 1.0
// @description my stupid little js script that deletes ads at the Anime watch page
// @author Vottus
// @match https://kissanime.ru/Anime/*
// @require http://code.jquery.com/jquery-3.4.1.min.js
// ==/UserScript==
/**