Skip to content

Instantly share code, notes, and snippets.

View meehanman's full-sized avatar
😎
Coding + Sunning

Dean Meehan meehanman

😎
Coding + Sunning
View GitHub Profile
@meehanman
meehanman / TOTP-Go.md
Last active March 27, 2024 11:44
TOTP-Go

TOTP-Go

TOTP in your terminal (with built in add to clipboard) written to go. This is a quick hack and the secret keys are hard-coded into the binary for this example.

Get your TOTP Codes from Authy via alexzorin/authy: authy-export

AUTHY_EXPORT_PASSWORD='<MY_EXPORT_PASSWORD>' go run cmd/authy-export/authy-export.go
otpauth://totp/....?secret=redacted
otpauth://totp/....?secret=redacted
@meehanman
meehanman / game.js
Created April 3, 2020 18:09
NodeJS Examples of Promises for accessing AWS
return await docClient.query(findGameParams).promise().then((games) => {
if (games.Count == 1) {
return Promise.resolve(games.Items[0])
} else {
return Promise.reject("Could not find that game")
}
});
return await new Promise((resolve, reject) => {
docClient.query(findGameParams, function (err, games) {
@meehanman
meehanman / ConfigurationUpdater.ps1
Created May 14, 2019 14:10
DevOps | Automated upgrade for old configuration to new format. For upgrading the project's, see: https://gist.github.com/meehanman/7947b9076845c6c2dd606eb258bfbcec
function Transform-Config {
Param ([string]$application)
$SaveFolderLoc = "%system.teamcity.build.workingDir%\Configuration"
$folders = Get-ChildItem -Path "%system.teamcity.build.workingDir%\Dev4.0\Configuration\*" | ?{ $_.PSIsContainer }
New-Item -Path $SaveFolderLoc -Name "$($application)" -ItemType "directory"
@meehanman
meehanman / ConfigurationProjectUpdater.ps1
Created May 14, 2019 14:09
DevOps | Updates Configuration stored in a separate location to support the new "inline" configuration in newer versions of C# automatically
#Params
$projLoc = "C:\Repositories\trunk\Dev4.0\Direct\src\Web\Direct.Web.csproj"
$confLoc = "C:\Repositories\trunk\Dev4.0\Direct\src\Configuration"
#$projLoc = "%ApplicationProject%"
#$confLoc = "Configuration/%ApplicationName%"
#Load .csproj
$proj = [xml](get-content $projLoc)
#Where to save within the csproj
@meehanman
meehanman / IISPoolWebsiteAndApplication.ps1
Created May 14, 2019 14:07
DevOps | IIS | Creates a new IIS Pool containing a website and that contains a single application
Import-Module ServerManager
Import-Module WebAdministration
######################################################################################################################################################################################
# Functions
######################################################################################################################################################################################
function Refresh-Directory {
Param (
[Parameter(Position=0,mandatory=$true)]
[String]$DirectoryPath
@meehanman
meehanman / Fastfile
Last active August 10, 2018 12:52
Example Fastfile
default_platform(:ios)
platform :ios do
desc "Push a new beta build to TestFlight"
lane :beta do |options|
build_number = increment_build_number(
build_number: latest_testflight_build_number + 1
)
version_number = increment_version_number(
version_number: options[:version_number]
document.write('Jason is ' + jason.age); // Output: Jason is 24
document.write('Jason is a ' + jason.gender); // Output: Jason is a male