This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@app.route('/healthz/live', methods=['GET']) | |
def healthz_live(): | |
return 'ok\n' | |
@app.route('/healthz/ready', methods=['GET']) | |
def healthz_ready(): | |
if ready: | |
return 'ok\n' | |
else: | |
return 'not ready\n', 503 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Replace the sub-string "foo" with "bar" in a bunch of files with different file names: | |
ls | %{ $new = $_ -replace "foo", "bar"; echo $new; mv $_ $new } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;; Silent: /NP /NFL /NDL /NJH /NJS /NC /NS | |
;; Copy native build into Debug and Release: | |
if $(ConfigurationName) == Debug ((robocopy $(SolutionDir)..\..\build\native $(TargetDir) *.dll *.pdb /NP ) ^& IF %ERRORLEVEL% LEQ 1 exit 0) | |
if $(ConfigurationName) == Release ((robocopy $(SolutionDir)..\..\build\native $(TargetDir) *.dll /XF *_d.dll /NP ) ^& IF %ERRORLEVEL% LEQ 1 exit 0) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Update all the submodules to the latest version: | |
git submodule foreach git pull origin master | |
# Prune a git repo of all folders EXCEPT the listed ones | |
git filter-branch --index-filter 'git rm --cached -qr --ignore-unmatch -- . && git reset -q $GIT_COMMIT -- apps/AAA libs/XXX' --prune-empty -- --all | |
# Remove all empty commits, but keep the commit info (author, date, etc.) | |
git filter-branch --prune-empty --parent-filter \ | |
'sed "s/-p //g" | xargs -r git show-branch --independent | sed "s/\</-p /g"' | |
#Git command to multiple dirs: | |
git add .; git commit -m "Removed unecessary dependencies and moved to snapshots"; git push origin master |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Creates C resources file from files in given directory | |
function(create_resources dir output) | |
# Create empty output file | |
file(WRITE ${output} "") | |
# Collect input files | |
file(GLOB bins ${dir}/*) | |
# Iterate through input files | |
foreach(bin ${bins}) | |
# Get short filename | |
string(REGEX MATCH "([^/]+)$" filename ${bin}) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
docker run -d -v `pwd`:/data/webroot -p 8080:80 --name apaxy-home xetusoss/apaxy |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Implementation of ISynchronizeInvoke for Unity3D game engine. | |
Can be used to invoke anything on main Unity thread. | |
ISynchronizeInvoke is used extensively in .NET forms, it's is elegant and quite useful in Unity as well. | |
I implemented it so i can use it with System.IO.FileSystemWatcher.SynchronizingObject. | |
help from: http://www.codeproject.com/Articles/12082/A-DelegateQueue-Class | |
example usage: https://gist.github.com/aeroson/90bf21be3fdc4829e631 | |
version: aeroson 2017-07-13 (author yyyy-MM-dd) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Script adapted from the answers in this thread: | |
# https://social.technet.microsoft.com/Forums/windowsserver/en-US/1fd035f3-a170-4721-a6b5-d4809ca2e39d/getting-list-of-installed-software-that-matches-control-panels-addremove-programs-or-programs?forum=winserverpowershell | |
# Formatting taken from: | |
# https://www.howtogeek.com/165293/how-to-get-a-list-of-software-installed-on-your-pc-with-a-single-command/ | |
if (!([Diagnostics.Process]::GetCurrentProcess().Path -match '\\syswow64\\')) { | |
$unistallPath = "\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\" | |
$unistallWow6432Path = "\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\" | |
@( |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# A simple task runner implemented in Powershell | |
Param( | |
[String]$TaskName, # The name of the task to run | |
[parameter(ValueFromRemainingArguments=$true)][String[]]$TaskArgs # The list of repos to run the task on | |
) | |
# Define the tasks | |
$tasks = @{} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# | |
# ROBOCOPY Script | |
# | |
# This script calls robocopy over a few folders, and then emails you when they're done | |
Param( | |
[Parameter(Mandatory=$true)] | |
[string]$basesrc, #"G:\", | |
[Parameter(Mandatory=$true)] | |
[string]$basedst, # |
NewerOlder