This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
if ( ! function_exists('register_equpiment_post_type') ) { | |
// Register Custom Post Type | |
function register_equpiment_post_type() { | |
$labels = array( | |
'name' => 'Equipment', | |
'singular_name' => 'Equpiment', |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function lottery_spin_the_wheel() { | |
//Form is key (reward as string) value (frequency as int) | |
$rewards_master = array( | |
'1 bonus token'=>25, | |
'5-album mini themed list'=>20, | |
'Album on demand'=>20, | |
'Trade 1 token for 2 tokens of your choice'=>15, | |
'Top-off overload +5 on Wednesday'=>10, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
window.addEventListener("load", function(event) { | |
const ratingtd = document.getElementById("ratingstdtitle"); | |
const orig_rating = document.getElementById("form_rating").value; | |
const button = document.createElement('a'); | |
button.setAttribute("id", "rate-button"); | |
button.innerHTML = "<h3>Rate Book (Current Rating: "+orig_rating+")</h3>" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
window.addEventListener("load", fixStupidDiscordSpellcheck, false); | |
window.addEventListener('locationchange', fixStupidDiscordSpellcheck, false); | |
window.addEventListener('hashchange', fixStupidDiscordSpellcheck, false); | |
function fixStupidDiscordSpellcheck(event){ | |
setTimeout(function() { | |
var textBoxes = document.querySelectorAll('div[role="textbox"]'); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import subprocess | |
result = subprocess.run(['mullvad', 'status'], stdout=subprocess.PIPE) | |
mullvad_status = result.stdout.decode('utf-8') | |
if 'Disconnected' in mullvad_status: | |
print('Mullvad VPN is Disconnected: Connect and try again') | |
quit() | |
else: | |
print('Mullvad VPN is Active, continuing: ') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
This script creates a PrivateBin using Python 3. | |
Code is based on https://github.com/r4sas/PBinCLI repository. | |
Thanks a lot @r4sas! | |
Below modules should be installed in the environment. | |
requests | |
base58 | |
pycryptodome | |
""" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function generateDownload(filename, text, type='text/plain;charset=utf-8') { | |
// Create an invisible A element | |
const a = document.createElement('a'); | |
a.style.display = 'none'; | |
document.body.appendChild(a); | |
var BOM = new Uint8Array([0xEF,0xBB,0xBF]); | |
// Set the HREF to a Blob representation of the data to be downloaded |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function generateTextDownload(filename, text, type='text/plain;charset=utf-8') { | |
// Create an invisible A element | |
const a = document.createElement('a'); | |
a.style.display = 'none'; | |
document.body.appendChild(a); | |
var BOM = new Uint8Array([0xEF,0xBB,0xBF]); | |
// Set the HREF to a Blob representation of the data to be downloaded |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
start_countdown(); | |
function start_countdown() { | |
for (let i = 1; i <= 2; i++) { | |
setTimeout(function timer() { | |
window.scrollTo({ top: document.body.scrollHeight, behavior: 'smooth' }) | |
if (i == 2) { | |
export_csv_favorites(); | |
} | |
}, i * 4000); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
#Requires exiftool installed | |
#Subfolder to store results in | |
containingfolder="./epubs-folder/" | |
for i in *.epub; do | |
[ -f "$i" ] || break |