Skip to content

Instantly share code, notes, and snippets.

View johndonnelly's full-sized avatar

John Donnelly johndonnelly

View GitHub Profile
Function Invoke-WolframAlphaAPI($Query)
{
Return (Invoke-RestMethod -Uri "http://api.wolframalpha.com/v2/query?appid=APIKEY&input=$($Query.Replace(' ','%20'))").queryresult
}
@johndonnelly
johndonnelly / DownloadImages_fromURL.ps1
Created May 6, 2019 20:15 — forked from PrateekKumarSingh/DownloadImages_fromURL.ps1
Extracting Images from a URL and saving it in a desired directory
$url="https://geekeefy.wordpress.com/2016/03/12/powershell-extract-text-from-image-and-convert-print-in-any-language/"
(Invoke-WebRequest -Uri $url).images.src | ?{$_ -like "*Geekeefy.files*"} -PipelineVariable pv `
| %{$fn = ($pv.split("/")[-1]).split('?')[0];iwr $pv -OutFile "D:\scraping\$fn"}
@johndonnelly
johndonnelly / common_interface.py
Created January 21, 2021 15:58 — forked from oliver-batey/common_interface.py
Common interface for parsing txt, docx, pdf, html and pptx
import os
import io
from docx import Document
from pdfminer3.layout import LAParams, LTTextBox
from pdfminer3.pdfpage import PDFPage
from pdfminer3.pdfinterp import PDFResourceManager
from pdfminer3.pdfinterp import PDFPageInterpreter
from pdfminer3.converter import PDFPageAggregator
from pdfminer3.converter import TextConverter
@johndonnelly
johndonnelly / Add-PageParserPath.ps1
Created April 2, 2021 21:14 — forked from joerodgers/Add-PageParserPath.ps1
Uses the SPWebConfigModifications class to deploy custom PageParserPath entries to web.config.
Add-PSSnapin Microsoft.SharePoint.PowerShell
function Add-PageParserPath
{
[CmdletBinding()]
param
(
[Parameter(Mandatory=$true,ValueFromPipeline=$true)][Microsoft.SharePoint.Administration.SPWebApplication]$WebApplication,
[Parameter(Mandatory=$true)][string]$VirtualPath,
[Parameter(Mandatory=$false)][bool]$AllowServerSideScript = $false,
@johndonnelly
johndonnelly / Test-ProcessElevated.ps1
Created August 10, 2022 15:47 — forked from 0xfeeddeadbeef/Test-ProcessElevated.ps1
Test whether or not a process is elevated (UAC run as admin)
function Test-ProcessElevated
{
[CmdletBinding()]
[OutputType([bool])]
param (
[Parameter(Mandatory = $true, ValueFromPipeline = $true)]
[System.Diagnostics.Process] $Process
)
begin {