Skip to content

Instantly share code, notes, and snippets.

View cjfarrelly's full-sized avatar
🏠
Working from home

Colin Farrelly cjfarrelly

🏠
Working from home
  • Remote, Donegal
View GitHub Profile
choco install nodejs
choco install notepadplusplus.install
choco install 7zip.install
choco install adobereader
choco install fiddler
choco install visualstudiocode
@cjfarrelly
cjfarrelly / test.ps1
Last active July 26, 2022 01:48
Powershell self elevating as admin in 64bit mode script
$myWindowsID=[System.Security.Principal.WindowsIdentity]::GetCurrent()
$myWindowsPrincipal=new-object System.Security.Principal.WindowsPrincipal($myWindowsID)
$adminRole=[System.Security.Principal.WindowsBuiltInRole]::Administrator
if ($myWindowsPrincipal.IsInRole($adminRole))
{
$Host.UI.RawUI.WindowTitle = $myInvocation.MyCommand.Definition + "(Elevated)"
$Host.UI.RawUI.BackgroundColor = "DarkBlue"
Clear-Host
@cjfarrelly
cjfarrelly / gist:2628c786f4a5af5a48d7
Created November 18, 2014 09:29
Javascript function to check/uncheck all checkboxes in a checkboxlist, this also allows for normally functionality
function cblNamesChecked(event) {
var checkBoxList = document.getElementById("<%=cblNames.ClientID %>");
var checkBoxes = checkBoxList.getElementsByTagName("input");
event = event || window.event;
var target = event.target || event.srcElement;
if (target.id == "cblNames_0") {
for (var i = 0; i < checkBoxes.length; i++) {
checkBoxes[i].checked = target.checked;
@cjfarrelly
cjfarrelly / Copy-DirectoryStructure
Created October 14, 2014 15:39
The gist below will copy all html files from one directory to another keeping the directory structure in place
function Create-WebSite
{
Push-Location ..\
$webSiteContainer = "WebSite"
Remove-Item .\$webSiteContainer -Recurse -Force
New-Item -ItemType "directory" -Name $webSiteContainer | Out-Null
$items = Get-ChildItem -Recurse -Filter "*.html"
@cjfarrelly
cjfarrelly / Boxstarter-Dev-Setup
Created October 9, 2014 16:04
Run this gist to setup your development environment.
Set-WindowsExplorerOptions -EnableShowHiddenFilesFoldersDrives -EnableShowProtectedOSFiles -EnableShowFileExtensions
Enable-RemoteDesktop -Disable-InternetExplorerESC -Disable-UAC -Enable-MicrosoftUpdate
cinst git
cinst javaruntime
cinst notepadplusplus
cinst 7zip
cinst 7zip.commandline
cinst adobereader
cinst nodejs