Skip to content

Instantly share code, notes, and snippets.

View Beej126's full-sized avatar

Beej Beej126

View GitHub Profile
@Beej126
Beej126 / snippets.ps1
Last active January 16, 2020 23:47
powershell snippets
# oh yeah!!
npm i ((Get-Content .\package.json | ConvertFrom-Json).dependencies | gm -Name @Progress* | select -ExpandProperty Name | % { $_ + "@latest" } )
# npm list filtered by name and joined on one line
# facilitates doing a bunch of updates to the whole kendo bundle
# old way: npm list 2>$null | sls "^\+-- (@progress.*?)@" | select @{n="val";e={$_.matches[0].groups[1].value+"@latest"}} | join-string -property val -separator " " | clip
npm list 2>$null | sls "^\+-- (@progress.*?)@" | % { $_.matches[0].groups[1].value} | join-string -Separator " "
# *nix sed is more concise on this one
@Beej126
Beej126 / enum.ts
Created June 19, 2019 22:23
typescript populate enum at runtime
export enum LimsApiEndpoint {
admin = 'admin',
dataprocessing = 'dataprocessing',
documentmanagement = 'documentmanagement',
labmanagement = 'labmanagement',
projectmanagement = 'projectmanagement',
qualitycontrol = 'qualitycontrol',
resourceaccess = 'resourceaccess',
samplemanagement = 'samplemanagement'
}
// showing functions & regexs
Function.prototype.toJSON = function() { return this.toString(); }
RegExp.prototype.toJSON = function() { return this.toString(); }
console.log("webpack config: " + JSON.stringify(config, null /*filter function or array*/, 2 /*indent*/));
@Beej126
Beej126 / Directory.Build.props
Last active March 20, 2019 09:18
dotnet msbuild - launch tool after build
<Project>
<PropertyGroup>
<TsModelsPath>$(MSBuildThisFileDirectory)SPA</TsModelsPath>
</PropertyGroup>
</Project>
@Beej126
Beej126 / wsh_debug.md
Created March 17, 2019 20:43
Debugging WSH Scripts on Windows 10 x64 (Windows Script Host)
@Beej126
Beej126 / reactFaSvg.tsx
Created March 7, 2019 23:24
react fontawesome svg
import { ReactComponent as FasSyncAlt } from './faSvg/fas-sync-alt.svg';
<FasSyncAlt />
@Beej126
Beej126 / BizSkypeMac.md
Created February 19, 2019 20:24
Configuring Skype for Business for Mac OSX on-prem

autodetect was't working when i was connected on-prem... interestingly, it worked fine when i was external so i knew i had a shot... i've seen this issue mentioned in numerous other support forums

typical error message: You're not configured to connect to the server.

steps that worked for me:

  • pull working Windows configs by CTRL+RightMouse on Skype tray icon > Configuration Information
  • based on educated guess i took the "DG URL Internal/External" https: urls and plugged them into skype's [advanced options] page
  • also on windows, i also exported the certificate from the browser for the above server and imported it into mac's keychain
    • i exported the .p7b format INCLUDING the parent certificate chain
  • i imported as "system" level
::usage call datetime.cmd yourdatevar yourtimevar
set t=%time::=%
:: make sure we replace spaces with 0 to handle times prior to 10am (i.e. " 930")
set t=%t: =0%
set %2=%t:~0,4%
set %1=%date:~10,4%%date:~4,2%%date:~7,2%
@Beej126
Beej126 / mac bash for-each-file do
Last active February 18, 2019 08:49
mac bash for-each-file do
for file in /Volumes/*; do echo $file && diskutil info "$file" | grep -i "volume uuid"; done
for file in $(find . -name 'screenshot.png'); do open "$file"; done