Skip to content

Instantly share code, notes, and snippets.

Dan Smith dansmith65

  • B.C. Canada
Block or report user

Report or block dansmith65

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@dansmith65
dansmith65 / Install-GoogleChrome.ps1
Last active Sep 25, 2019 — forked from kurokikaze/gist:350fe1713591641b3b42
install chrome from powershell
View Install-GoogleChrome.ps1
$InstallerPath = Join-Path $env:TEMP "chrome_installer.exe"; Invoke-WebRequest "https://dl.google.com/chrome/install/latest/chrome_installer.exe" -OutFile $InstallerPath; Start-Process -FilePath $InstallerPath -Args "/silent /install" -Verb RunAs -Wait; Remove-Item $InstallerPath
@dansmith65
dansmith65 / AutoHotkey.ahk
Created Nov 8, 2018
Snippets from my main AutoHotkey script to load scripts from a folder, and close them when the main script exists.
View AutoHotkey.ahk
OnExit, ExitSub
;AUTO LOAD SCRIPTS
;==============================================================================
Loop, AutoHotkey.d\*.ahk
{
OutputVarPID =
Run, %A_AhkPath% "%A_LoopFileFullPath%", , , OutputVarPID
CloseProcessesOnExit = %CloseProcessesOnExit%%OutputVarPID%`n
}
@dansmith65
dansmith65 / WindowsServerSetup.ps1
Last active Nov 9, 2018
Windows Server Setup; perform common tasks on a fresh server
View WindowsServerSetup.ps1
# Install Google Chrome (code downloaded from another Gist)
Invoke-Expression ((Invoke-WebRequest "https://gist.githubusercontent.com/dansmith65/4c012304ed96596dbbcad8e4a15f7583/raw/Install-GoogleChrome.ps1").Content)
# Install Nodepad++ (code downloaded from another Gist)
Invoke-Expression ((Invoke-WebRequest "https://gist.githubusercontent.com/dansmith65/a862f301fce553b26db9689ad0f87b6a/raw/Install-NotepadPlusPlus.ps1").Content)
# Install AWS CLI (code downloaded from another Gist)
Invoke-Expression ((Invoke-WebRequest "https://gist.githubusercontent.com/dansmith65/79275f15fe25550e65ccd4d6bf1448cf/raw/Install-AWSCLI.ps1").Content)
# Set Timezone
@dansmith65
dansmith65 / Install-AWSCLI.ps1
Created Nov 9, 2018
Install latest version of AWS CLI via PowerShell
View Install-AWSCLI.ps1
# https://docs.aws.amazon.com/cli/latest/userguide/awscli-install-windows.html
$dlurl = "https://s3.amazonaws.com/aws-cli/AWSCLI64PY3.msi"
$installerPath = Join-Path $env:TEMP (Split-Path $dlurl -Leaf)
Invoke-WebRequest $dlurl -OutFile $installerPath
Start-Process -FilePath msiexec -Args "/i $installerPath /passive" -Verb RunAs -Wait
Remove-Item $installerPath
@dansmith65
dansmith65 / Install-NotepadPlusPlus.ps1
Created Oct 25, 2018
Install latest version of Nodepad++ via PowerShell, inspired by: https://gist.github.com/kurokikaze/350fe1713591641b3b42
View Install-NotepadPlusPlus.ps1
# https://github.com/notepad-plus-plus/notepad-plus-plus/issues/604#issuecomment-126175283
$res = Invoke-WebRequest https://notepad-plus-plus.org/update/getDownloadUrl.php
if ($res.StatusCode -ne 200) {throw ("status code to getDownloadUrl was not 200: "+$res.StatusCode)}
$dlurl = ($res.Content | Select-Xml /GUP/Location).node.InnerXML
$installerPath = Join-Path $env:TEMP (Split-Path $dlurl -Leaf)
Invoke-WebRequest $dlurl -OutFile $installerPath
Start-Process -FilePath $installerPath -Args "/S" -Verb RunAs -Wait
Remove-Item $installerPath
@dansmith65
dansmith65 / Get-TodoistBackup.ps1
Created May 17, 2016
Powershell script to download the latest backup from Todoist
View Get-TodoistBackup.ps1
# Get-TodoistBackup.ps1
# Created By: Daniel Smith dan@dansmith65.com
#
# Download the latest backup from Todoist
#
$token = ""
# get list of backups from Todoist
@dansmith65
dansmith65 / ExecuteSQL
Last active Apr 2, 2018
ExecuteSQL template for FileMaker which allows for viewing the query in the data viewer while debugging, and testing for an error.
View ExecuteSQL
Let ( [
$sqlQuery =
"SELECT "
& SQLTableAndField ( field )
& "¶FROM "
& SQLTable ( field )
& "¶LEFT JOIN "
& SQLTable ( field )
& "¶ON "
& SQLTableAndField ( field )
@dansmith65
dansmith65 / VirtualBoxFixNIC.cmd
Created Dec 13, 2013
Fix issue with VirtualBox Host-Only Network adapter in Windows by adding *NdisDeviceType=1 to registry.
View VirtualBoxFixNIC.cmd
@ECHO OFF
ECHO.-------------------------------------------------------------------------------
ECHO.
ECHO. VirtualBoxFixNIC.cmd
ECHO.
ECHO. Created on 2013-DEC-13 by Dan Smith http://scr.im/dansmith
ECHO.
ECHO. Fix issue with VirtualBox Host-Only Network adapter in Windows by adding
ECHO. *NdisDeviceType=1 to registry.
ECHO.
@dansmith65
dansmith65 / ListContains.fmfn
Created Jan 4, 2014
FileMaker Custom Function: ListContains ( ValueList ; ValuesToTestExistence )
View ListContains.fmfn
/* ListContains ( ValueList ; ValuesToTestExistence )
PURPOSE:
Test if all specified values exist in a list.
PARAMETERS:
ValueList (text) values to search in
ValuesToTestExistence (text) value(s) to search for
RETURNS:
@dansmith65
dansmith65 / GetDelimitedValue.fmfn
Last active Dec 29, 2015
In FileMaker, return value in specified location of delimited text.
View GetDelimitedValue.fmfn
/**
* =====================================
* GetDelimitedValue ( text ; delimiter ; occurrence )
*
* RETURNS:
* Value in specified location of delimited text.
*
* PARAMETERS:
* text = (text) delimited data
* delimiter = (text) single character used to separate values
You can’t perform that action at this time.