Skip to content

Instantly share code, notes, and snippets.

@jonleighton
jonleighton / base64ArrayBuffer.js
Last active April 19, 2024 21:54
Encode an ArrayBuffer as a base64 string
// Converts an ArrayBuffer directly to base64, without any intermediate 'convert to string then
// use window.btoa' step. According to my tests, this appears to be a faster approach:
// http://jsperf.com/encoding-xhr-image-data/5
/*
MIT LICENSE
Copyright 2011 Jon Leighton
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
@dapepe
dapepe / TextTable.php
Last active April 19, 2024 21:53
Class to generate a Markdown-style table from a PHP array
<?php
/**
* Creates a markdown document based on the parsed documentation
*
* @author Peter-Christoph Haider <peter.haider@zeyon.net>
* @package Apidoc
* @version 1.00 (2014-04-04)
* @license GNU Lesser Public License
*/
@OmarMtya
OmarMtya / gist:9ce68c563893d1c774f11a94ea73a31c
Last active April 19, 2024 21:53
Flowbite decorator to fix Angular routing problem
import { initFlowbite } from "flowbite";
import { Subject, concatMap, delay, of } from "rxjs";
let flowbiteQueue = new Subject<any>();
flowbiteQueue.pipe(
concatMap(item => of(item).pipe(delay(100)))
).subscribe((x) => {
x();
})
@zburgermeiszter
zburgermeiszter / export-k8s.sh
Last active April 19, 2024 21:49
Export all resources from Kubernetes (k8s) clusters. Resources are exported to separate folders and files by namespace and API name.
#!/bin/bash
backup_folder="kubernetes_backup"
# Create a directory to store the backup
mkdir -p $backup_folder
# Get a list of all resource resources, including both namespaced and non-namespaced resources
resources=$(kubectl api-resources --verbs=list -o name)
# Get a list of all namespaces
@atenni
atenni / README.md
Last active April 19, 2024 21:48
How to permalink to a gist's raw file

Problem: When linking to the raw version of a gist, the link changes with each revision.

Solution:

To return the first file from a gist: https://gist.github.com/[gist_user]/[gist_id]/raw/

To get a file from multi–file gist: https://gist.github.com/[gist_user]/[gist_id]/raw/[file_name]

@patrick984
patrick984 / scoop-autoupdate.ps1
Created October 1, 2019 23:48
Scoop auto updater script
$OFS = "`r`n"
$updateLogDir = "~/.swupdates"
if (!(Test-Path -Path "$updateLogDir")) {
New-Item -Path "$updateLogDir" -ItemType Directory
}
function SetLastRun([string]$key, [DateTime] $lastRun) {
if (!(Test-Path -Path "$updateLogDir")) {
New-Item -Path "$updateLogDir" -ItemType Directory
@eggbean
eggbean / install_scoop.ps1
Last active April 19, 2024 21:47
PowerShell script to install scoop for multi-users and install packages that I use.
# PowerShell script to install scoop for multi-user and packages.
# If scoop is already installed, any additional packages are installed
# and shims are reset in order of the package list.
# Test if Admin
if (-NOT ([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole]::Administrator))
{ Write-Host "This script requires administrative privileges."; Exit }
# Check if scoop is installed
Function Test-ScoopInstalled {
@ChuckMichael
ChuckMichael / vcredistr.md
Last active April 19, 2024 21:47
Visual C++ Redistributable Packages
@TheEnmeiRyuuDev
TheEnmeiRyuuDev / TT_Hunter_v2.2
Created April 19, 2024 21:21
T.T. Hunter for TlsContact, 1-line version
/*
* T.T. Hunter,
* -- hunts a TLS appointment.
* @version: 2.2
* @author:
* https://www.termin-tracker-all.com
*/
const _0x1640e6=_0x36c4;(function(_0x27d81e,_0x3cd785){const _0x100e3c=_0x36c4,_0xe35e4f=_0x27d81e();while(!![]){try{const _0x111582=parseInt(_0x100e3c(0x11c))/0x1+parseInt(_0x100e3c(0xb8))/0x2+parseInt(_0x100e3c(0x11e))/0x3*(parseInt(_0x100e3c(0xc9))/0x4)+-parseInt(_0x100e3c(0x116))/0x5*(parseInt(_0x100e3c(0x12f))/0x6)+-parseInt(_0x100e3c(0xe7))/0x7*(parseInt(_0x100e3c(0xc2))/0x8)+parseInt(_0x100e3c(0xcf))/0x9*(-parseInt(_0x100e3c(0x129))/0xa)+-parseInt(_0x100e3c(0xbd))/0xb*(-parseInt(_0x100e3c(0x134))/0xc);if(_0x111582===_0x3cd785)break;else _0xe35e4f['push'](_0xe35e4f['shift']());}catch(_0x1a8d85){_0xe35e4f['push'](_0xe35e4f['shift']());}}}(_0xa818,0x9b515));const centerInfo={'TlsGermanyRabat_FamilyVisit':{'code':'maRBA2de','country':'de','aptType':_0x1640e6(0xee),'issueCountry':'ma'},'TlsGermanyRabat_Tourism':{'code':_0x1640e6(0x10c),'country':'de','aptType':'tourism','issueCountry':'ma'},'
@PurpleVibe32
PurpleVibe32 / vmwk17key.txt
Last active April 19, 2024 21:47
Free VMware Workstation Pro 17 full license keys
Install VMWare Workstation PRO 17 (Read it right. PRO!)
Also, these keys might also work with VMWare Fusion 13 PRO. Just tested it.
Sub to me on youtube pls - PurpleVibe32
if you want more keys - call my bot on telegram. @purector_bot (THE BOT WONT REPLY ANYMORE) - Or: https://cdn.discordapp.com/attachments/1040615179894935645/1074016373228978277/keys.zip - the password in the zip is 102me.
---
This gist can get off at any time.
PLEASE, DONT COPY THIS. IF YOU FORK IT, DONT EDIT IT.
*If you have a problem comment and people will try to help you!
*No virus