Skip to content

Instantly share code, notes, and snippets.

View crossan007's full-sized avatar

Charles Crossan crossan007

View GitHub Profile
javascript:(function(){
var iframes = document.getElementsByTagName("iframe");
var ifr=iframes[iframes.length-1].contentWindow.document;
ifr.getElementById('ctl00_PlaceHolderMain_chkSendEmailv15').checked=false;
ifr.getElementById('divMoreOptions').style="";
})();
@crossan007
crossan007 / Convert-FromHex
Last active August 17, 2017 13:58
SharePoint AllDocStreams Content To File String
function Convert-FromHex
{
Process
{
     $_ -replace '^0x', '' -split "(?<=\G\w{2})(?=\w{2})" | %{ [Convert]::ToByte( $_, 16 ) } | %{ $([char]$_) }
}
}
$(<SharePoint.dbo.AllDocStreams.Content> | Convert-FromHex) -Join ""
@crossan007
crossan007 / CSSTabIndex.js
Last active August 18, 2017 17:36
CSS Class Based TabIndex
function setTabIndex()
{
NWF$("[class^='ts-']").each(function(i,ele) {
var tabIndex = parseInt(ele.className.match(/ts-(-?\d?)/)[1]);
NWF$(ele).attr("tabindex",tabIndex);
console.log("set Tabindex " + tabIndex);
});
}
function clearTabIndex()
@crossan007
crossan007 / deUgly.bookmarklet
Last active August 30, 2017 18:38
Remove Certain colors from the DOM
javascript:(function() {
if (! window.jQuery) {
var script = document.createElement("SCRIPT");
script.src = 'https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js';
script.type = 'text/javascript';
script.onload = function() {
var $ = window.jQuery;
};
document.getElementsByTagName("head")[0].appendChild(script);
@crossan007
crossan007 / Responsive TweetDeck Bookmarklet.js
Created August 30, 2017 20:32
Responsive TweetDeck Bookmarklet
javascript:(function(){$(".app-columns section").css("float","left").css("height","400px");}())
@crossan007
crossan007 / Write-PSEventlog
Last active August 31, 2017 01:50
PowerShell Logging Tee Function App -> Windows Event Log && Terminal
<#
.EXAMPLE
Write-PSEventLog @LogParams -EntryType Information -EventId 100 -Message "Starting Installation"
#>
#region SetupLogging
$LogParams =@{
'LogName' = '<LOG NAME: Application|Setup|System|Security>';
'Source' = '<Your Custom Script Name>'
@crossan007
crossan007 / Unapprove-PendingForms.ps1
Last active October 31, 2017 17:18
Unapprove previously approved forms which are now pending
$Web = Get-SPWeb "https://somesite.someorg.org/somesubsite"
$List = $web.Lists.TryGetList("Forms")
$Items = $List.Items | Where-Object {$_.ModerationInformation.Status -eq "Pending" -and $(Test-HasPreviousPublished -Item $_)}
Function Test-HasPreviousPublished {
Param(
function prompt {
$origLastExitCode = $LASTEXITCODE
$Leaf = $(Split-Path -Path $($ExecutionContext.SessionState.Path.CurrentLocation) -Leaf)
$ParentLeaf = Split-Path -Path $($(Split-Path -Path $($ExecutionContext.SessionState.Path.CurrentLocation) -Parent)) -Leaf
Write-Host "$ParentLeaf\$Leaf" -NoNewline
Write-VcsStatus
$LASTEXITCODE = $origLastExitCode
"$('>' * ($nestedPromptLevel + 1)) "
}
@crossan007
crossan007 / README.md
Created November 10, 2017 20:21
FCC VoctoMix Setup
Raspberry Pi Camera ----------TCP/IP -----\
3.5MM ALSA Audio Capture --------------------> VoctoCore Video Mixer --------> FaceBook LiveStream
Slide projector comptuer ---- TCP/IP ---- /                              \---> Record to Disk
Using #https://github.com/crossan007/voctomix-outcasts/blob/ingest-lightweight/ingest.py
#On VMix Server
./ingest.py --custom-pipeline "tcpserversrc port=30001 host=0.0.0.0 ! queue max-size-time=4000000000 ! matroskademux name=d ! decodebin ! videoconvert ! videorate ! videoscale ! video/x-raw, format=(string)I420, width=(int)320, height=(int)240, framerate=(fraction)25/1, pixel-aspect-ratio=(fraction)1/1 ! mux. audiotestsrc name=audiosrc ! audio/x-raw,format=S16LE,channels=2,layout=interleaved,rate=48000 ! matroskamux name=mux ! queue max-size-time=4000000000 ! tcpclientsink host=127.0.0.1 port=10000"
#On Pi
./ingest.py --custom-pipeline "rpicamsrc bitrate=7000000 do-timestamp=true ! h264parse ! matroskamux ! queue ! tcpclientsink host=172.30.9.160 port=30001" --host 172.30.9.160