Skip to content

Instantly share code, notes, and snippets.

Avatar
💮
わたしは あの路で死んだ花

Ilya 13xforever

💮
わたしは あの路で死んだ花
View GitHub Profile
View percent.js
var stats = document.getElementsByClassName('stats-both');
var firstOnlyStats = document.getElementsByClassName('stats-firstonly');
var total = parseInt(stats[stats.length-2].textContent, 10) + parseInt(firstOnlyStats[firstOnlyStats.length-2].textContent, 10);
for (var i = 0; i < stats.length; i++)
{
var num = parseInt(stats[i].textContent, 10);
var numBoth = parseInt(firstOnlyStats[i].textContent, 10) + num;
if (!isNaN(num))
{
var percent = ""+Math.round(num*100/total);
@13xforever
13xforever / Organize-Content.ps1
Last active Oct 16, 2020
Renames and moves PSN PKGs into folders
View Organize-Content.ps1
#!/bin/pwsh
if ($PSVersionTable.PSVersion.Major -lt 6)
{
Write-Host "This script requires PowerShell 6.0 or newer"
Write-Host "Trying to restart..."
&pwsh $PSCommandPath
}
$content_id_matcher = [regex]'(?<content_id>(?<service_id>(?<service_letters>\w\w)(?<service_number>\d{4}))-(?<product_id>(?<product_letters>\w{4})(?<product_number>\d{5}))_(?<part>\d\d)-(?<label>\w{16}))'
$pkgs = @(Get-ChildItem *.pkg)
@13xforever
13xforever / sign-nvidia.ps1
Last active Mar 31, 2020
NVIDIA kernel module signing script for Fedora
View sign-nvidia.ps1
#!/usr/bin/pwsh
# You will need to install and configure some stuff beforehand
# See https://docs.fedoraproject.org/en-US/fedora/f31/system-administrators-guide/kernel-module-driver-configuration/Working_with_Kernel_Modules/#sect-signing-kernel-modules-for-secure-boot
# dnf install openssl kernel-devel perl mokutil keyutils akmod-nvidia
# dnf update -y
$kver = Get-ChildItem "/usr/src/kernels/" -Attributes Directory | Sort-Object -Bottom 1 {
#5.4.19-200.fc31.x86_64
@13xforever
13xforever / windows terminal colors.json
Last active Nov 18, 2019
Windows Terminal color schemes, put this in the appropriate section of your profile.json
View windows terminal colors.json
{
"name" : "Ayu Mirage",
"background" : "#1f2430",
"foreground" : "#cbccc6",
"black" : "#191e2a",
"red" : "#ed8274",
"green" : "#a6cc70",
"yellow" : "#fad07b",
"blue" : "#6dcbfa",
"purple" : "#cfbafa",
View slack themes.txt
dark:
ayu dark: #0A0E14,#01060E,#01060E,#3D424D,#01060E,#3D424D,#91B362,#E6B450
ayu mirage: #1F2430,#191E2A,#191E2A,#707A8C,#191E2A,#707A8C,#A6CC70,#FFCC66
eva dark: #21252B,#191E2A,#2C313A,#D7DAE0,#598DEF66,#B0B7C3,#98C379,#A78CFA,#282C34,#B0B7C3
mariana: #25292D,#3F4A55,#3F4A55,#DDDDDD,#3F4A55,#AAAAAA,#70A6DB,#4C4F52
obsidian: #293134,#2F393C,#293134,#93C763,#2F393C,#81969A,#EC7600,#EC7600
light:
ayu light: #FAFAFA,#959DA61A,#959DA61A,#959DA6,#959DA61A,#959DA6,#99BF4D,#FF9940
View keybase.md

Keybase proof

I hereby claim:

  • I am 13xforever on github.
  • I am 13xforever (https://keybase.io/13xforever) on keybase.
  • I have a public key ASBv7cQQnzNQ64fyBFomr7-8ujat1BjLf5wvCM7Ujh46KAo

To claim this, I am signing this object:

View PoorMansNamedSemaphore.cs
internal static class Program
{
private static readonly SemaphoreSlim InstanceCheck = new SemaphoreSlim(0, 1);
private static readonly SemaphoreSlim ShutdownCheck = new SemaphoreSlim(0, 1);
internal static async Task Main(string[] args)
{
var thread = new Thread(() =>
{
using (var instanceLock = new Mutex(false, @"Global\mutex name"))
View Enable-Aero.ps1
if ([System.Environment]::OSVersion.Version.Major -lt 6) { throw "Unsupported OS" }
$aeroEnablerSource = @'
using System;
using System.Runtime.InteropServices;
namespace CustomInterop
{
[Flags]
public enum DWM_BB
@13xforever
13xforever / hotspot_conf_decoder.cs
Created Oct 20, 2016
Nintendo Zone hotspot.conf Decoder
View hotspot_conf_decoder.cs
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
namespace hotspot_conf_decoder
{
class Program
{
@13xforever
13xforever / IXMLDOMDocument.d.ts
Last active Apr 18, 2018
TypeScript typings for IXMLDOMDocument and IXMLDOMSchemaCollection ActiveX objects
View IXMLDOMDocument.d.ts
declare module ActiveX {
export interface IXMLDOMNode {
attributes: IXMLDOMNamedNodeMap;
baseName?: string;
childNodes: IXMLDOMNodeList;
dataType?: string;
definition?: IXMLDOMNode;
firstChild: IXMLDOMNode;
lastChild: IXMLDOMNode;
namespaceURI?: string;