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
param ( | |
[Parameter(Mandatory=$True)] | |
[ValidatePattern("https?://")] | |
[System.Uri]$CrawlUrl = "", | |
# Only check for broken links internal to the site (ignore things like https://ya_badlink.com) | |
[Boolean]$OnlyCheckRelativeLinks = $True | |
) | |
# Keep a tab on what we've already crawled |
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
//type and url dictionary | |
ytplayer.config.args.adaptive_fmts | |
.split(',') | |
.map((format) => format.split('&')) | |
.reduce((a, cv) => { | |
a[decodeURIComponent(cv[0].split("=")[1])] = decodeURIComponent(cv[1].split("=")[1]); | |
return a; | |
}, {}) | |
// All props as arrays |
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
# -*- mode: ruby -*- | |
# vi: set ft=ruby : | |
# Vagrantfile API/syntax version. Don't touch unless you know what you're doing! | |
VAGRANTFILE_API_VERSION = "2" | |
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| | |
# All Vagrant configuration is done here. The most common configuration | |
# options are documented and commented below. For a complete reference, | |
# please see the online documentation at vagrantup.com. |
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
([adsisearcher]"samaccountname=prefix-*").FindAll().Properties.cn | |
([adsisearcher]"(&(objectcategory=computer)(samaccountname=prefix-*))").FindAll().Properties.cn |
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
#Get all results when rest endpoints paginate. | |
function Get-All-RestMethod ($CurrentObj, [int] $Skip, [string] $Uri, [hashtable] $Headers){ | |
$results = Invoke-RestMethod -Uri "$Uri`?skip=$skip" -Headers $Headers | |
$ItemsPerPage = [int]$results.ItemsPerPage | |
$TotalResults = [int]$results.TotalResults | |
$NextSkip = $skip + $ItemsPerPage | |
if( ($TotalResults - $NextSkip) -gt 0 ){ | |
$results = Get-All-RestMethod $results $NextSkip "$Uri" $Headers |
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
# Stupid simple mustash template expander | |
function Expand-Template(){ | |
param( | |
[string] $template, | |
[hashtable] $scope | |
) | |
return iex $($template -replace '{{([^}]+)}}', "`$(`$scope.Get_Item('`$1'))") | |
} |
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
git push origin $(git tag | egrep -ie "build-[0-9]+$" | awk '{print ":" $0}') |
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
git push origin $(git for-each-ref --format "%(refname)" refs/remotes | cut -d"/" -f4- | grep -Eiv '(^HEAD|^master)' | awk '{print ":"$1}') |
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
#Find and replace | |
$fileNameMatch = "\.html|\.txt" | |
$find = "" | |
$replace = "" | |
$webFiles = get-childitem . -Recurse | Where-Object {$_.Name -match $fileNameMatch} | |
foreach ($file in $webFiles) | |
{ | |
Write-Host $file |
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 | |
branch=$1 | |
output=$2 | |
(IFS=$'\n'; git archive -o $output $branch $(git diff @{0} $branch --name-only --diff-filter=ACM)) |
NewerOlder