This file contains 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
#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases. | |
; #Warn ; Enable warnings to assist with detecting common errors. | |
SendMode Input ; Recommended for new scripts due to its superior speed and reliability. | |
SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory. | |
CapsLock:: | |
SetFormat, Integer, H | |
WinGet, WinID,, A | |
ThreadID:=DllCall("GetWindowThreadProcessId", "UInt", WinID, "UInt", 0) | |
InputLocaleID:=DllCall("GetKeyboardLayout", "UInt", ThreadID, "UInt") |
This file contains 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 | |
ncpath='/var/www/nextcloud' | |
htuser='www-data' | |
htgroup='www-data' | |
rootuser='root' | |
printf "Creating possible missing Directories\n" | |
mkdir -p $ncpath/data | |
mkdir -p $ncpath/assets | |
mkdir -p $ncpath/updater |
This file contains 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
#!/usr/bin/python | |
import sys | |
import datetime | |
import re | |
from pathlib import Path | |
file = Path(sys.argv[1]) | |
date_parts = list(map(lambda x: x.replace('.txt', ''), file.parts[-3:])) | |
with Path('out').open('w+') as nf: |
This file contains 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
#!/usr/bin/python | |
import sys | |
import datetime | |
import re | |
from pathlib import Path | |
file = Path(sys.argv[1]) | |
date_parts = list(map(lambda x: x.replace('.txt', ''), file.parts[-3:])) | |
with Path('out').open('w+') as nf: |
This file contains 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
var nodes = document.getElementsByClassName('text-center font-weight-bold form-control') | |
var res = []; | |
for (var i = 0; i < nodes.length; i++) { res.push(nodes[i].value);} | |
console.log(res.join("\n")) |
This file contains 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
/* | |
== Adapted from the code over at https://gist.github.com/graymouser/a33fbb75f94f08af7e36 == | |
Log into your account at packtpub.com and save the cookies with the "cookies.txt" Chrome extension or the "Export cookies" Firefox extension into the file cookies.txt. | |
Then open the console in your browsers dev tools and paste the following code. | |
You will get a list of wget commands that you can copy and paste as a whole into a terminal to download all books. | |
Example: wget --load-cookies=cookies.txt --content-disposition "https://packtpub.com//ebook_download/20217/mobi" -O "R Data Visualization Cookbook.mobi" | |
If you only want some filetypes, edit the "pattern" vaiable accordingly. |
This file contains 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 extractPacktpubUrl() { | |
try { | |
var ss = SpreadsheetApp.getActiveSheet(); | |
var label = GmailApp.getUserLabelByName("packt_free_ebook"); | |
var threads = label.getThreads(); | |
if (threads[0] == undefined || threads[0].getMessages()[0] == undefined) { | |
Logger.log('No valid message found'); |