This file contains 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
foreach ($DriveRoot in (Get-PSDrive | Where-Object {$_.Provider -like "*FileSystem"} | Select-Object -ExpandProperty Root)) { | |
Set-Location $DriveRoot | |
$FoundRepos = | |
Get-ChildItem ".git" -Directory -Force -Recurse -ErrorAction SilentlyContinue | | |
Select-Object @{Name = "Repository"; Expression = { $_.FullName.Substring(0, $_.FullName.IndexOf("\.git")) }} | |
if ($FoundRepos -eq $null) { | |
$RepoCount = 0 | |
} |
This file contains 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
Write-Warning "This code is not meant to be run sequentially, run it in sections following comment instructions" | |
exit | |
<############################################################################## | |
create transfer file | |
##############################################################################> | |
$FilePath = "C:\temp\transfer_file.txt" | |
$DesiredFileSizeKB = 1024 * 7 # 7 MB |
This file contains 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
\ / | |
\ / HAPPY /---\ /---\ /-| /---\ | |
** NEW ___/ | | | | | |
___* *___ YEAR / | | | |---\ | |
* * \___/ \---/ | \---/ | |
** *** | |
/| \ * * \|/ | |
/ | \ * * * * -*- | |
| * * * /|\ | |
| \|/ * * * * | |
This file contains 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
$codeProcessName = "code" | |
$sublimePath = "C:\Program Files\Sublime Text 2\sublime_text.exe" | |
$sublimeProcessName = "sublime_text" | |
function StartAndTimeProcess { | |
param ( | |
[string]$processName, | |
[string]$processPath | |
) | |
$before = Get-Date |
This file contains 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
if (!(Test-Path "hkcr:\")) { | |
New-PSDrive -PSProvider registry -Root HKEY_CLASSES_ROOT -Name HKCR -ErrorAction Stop | Out-Null | |
} | |
$rootKey = "HKCR:\Local Settings\Software\Microsoft\Windows\CurrentVersion\AppModel\Repository\Packages" | |
$associationsParent = "App\Capabilities\URLAssociations" | |
$output = | |
foreach ($child in (Get-ChildItem -Path $rootKey)) { | |
try { |
This file contains 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
#!/bin/bash | |
create_venv() { | |
python3 -m venv venv >& /dev/null | |
. venv/bin/activate | |
} | |
remove_venv() { | |
if [ -d "./venv" ]; then | |
rm -rf ./venv |
This file contains 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
#!/usr/bin/env python3 | |
"""Generate the parent index for the wiki repo""" | |
import os | |
import re | |
def direct_dirs(): | |
"""Retrieve immediate directories list""" |
This file contains 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
#!/bin/bash | |
CWD=$(python -c "import os; print(os.getcwd())") | |
python3 -m venv venv | |
. venv/bin/activate | |
pip install -r requirements.txt | |
cat > ~/bin/miki << EOF | |
cd $CWD |
This file contains 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
from flask import Flask, jsonify, request | |
import redis | |
app = Flask(__name__) | |
@app.route('/') | |
def default_route(): | |
"""Default route to return a simple message""" | |
return jsonify('hello world') |
This file contains 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
FROM python:alpine3.6 | |
WORKDIR /usr/src/app | |
EXPOSE 8000 | |
COPY requirements.txt ./ | |
RUN pip install --no-cache-dir -r requirements.txt | |
COPY . . | |
CMD ["gunicorn", "--workers=2", "--bind=0.0.0.0:8000", "app:app"] |
OlderNewer