Skip to content

Instantly share code, notes, and snippets.

View michaelvdnest's full-sized avatar

Michael van der Nest michaelvdnest

View GitHub Profile
@michaelvdnest
michaelvdnest / branch prefixes.md
Last active May 23, 2022 19:17
Git branch names
wip       Works in progress; stuff I know won't be finished soon

feat      Feature I'm adding or expanding

bug       Bug fix or experiment

junk      Throwaway branch created to experiment
@michaelvdnest
michaelvdnest / pipenv_django.bat
Last active August 18, 2020 18:36
Create django app
mkdir [project]
cd [project]
pipenv shell
pipenv install Django
python
>>> import django
>>> print(django.get_version())
python -m django --version
@michaelvdnest
michaelvdnest / Dart Cheatsheet.md
Last active February 6, 2020 08:15
A Dart Cheatsheet

Comments

// This is a single line comment

/*
  This is a multiline comment
*/

/// This is a single line documentation comment
@michaelvdnest
michaelvdnest / android_sync.md
Last active January 16, 2020 08:37
Sync android files with adb
  1. Download the Android SDK Platform Tools.

  2. To pull a directory from the device run the below command

    .\adb.exe pull -a /sdcard/Download/dir C:\Temp\

  3. To push the directory run the below command.

.\adb.exe push -sync C:\Temp\dir /sdcard/Download/

@michaelvdnest
michaelvdnest / git.md
Last active January 13, 2020 12:55
Common git commands

Reset to remote master

# Add a remote brannch
git remote add upstream /url/to/original/repo

# fetch the upstream repo
git fetch upstream

# ensures current branch is master
@michaelvdnest
michaelvdnest / filepath.ts
Created December 18, 2019 14:24
Read a file path from an Excel range in power query to fix error [Formula.Firewall: Query references other queries, so it may not directly access a data source.]
/* Use function like this
Folder.Files(FilePath())
*/
= () => let
/* Source = File_Path, (Replace this line with the one below) */
Source = Excel.CurrentWorkbook(){[Name="File_Path"]}[Content], // File_Path is range name
Path = Source{0}[Column1] // Column1 is the name of the source table column
in
Path
@michaelvdnest
michaelvdnest / Progress Example.ps1
Created November 20, 2019 13:49
An example of multiple progress bars in Powershell
For ($i=0; $i -le 10; $i++) {
Start-Sleep -Milliseconds 1
Write-Progress -Id 1 -Activity "First Write Progress" -Status "Current Count: $i" -PercentComplete (($i/10)*100) -CurrentOperation "Counting ..."
For ($j=0; $j -le 10; $j++) {
Start-Sleep -Milliseconds 1
Write-Progress -Id 2 -Activity "Second Write Progress" -Status "Current Count: $j" -PercentComplete (($j/10)*100) -CurrentOperation "Counting ..."
For ($k=0; $k -le 20; $k++) {
Start-Sleep -Milliseconds 1
@michaelvdnest
michaelvdnest / Display-Progress.ps1
Last active June 20, 2019 10:42
A PowerShell function that displays a progress bar with ETA.
<#
.Synopsis
Displays a progress bar with ETA
.DESCRIPTION
Long description
.EXAMPLE
Example of how to use this cmdlet
Display-Progress -Id 1 -Count $i -Total $total -Activity "Exporting $($item.TestType)"
#>
@michaelvdnest
michaelvdnest / Example-Progress-ETA.ps1
Last active April 28, 2022 07:00
An example of calculating ETA for a PowerShell progress bar.
# Data Source
$items = 1..85
# Loop
$items | ForEach-Object `
-Begin {
# Initialize Tracking
$total = $items.Count
$start = Get-Date
$i = 0
@michaelvdnest
michaelvdnest / profiles.clj
Created May 7, 2019 07:36
My Clojure profiles file.
;; Calva depends on nREPL and Cider nREPL middleware
;; Clojure
{:repl {:plugins [[cider/cider-nrepl "0.21.2-SNAPSHOT"]]
:dependencies [[nrepl "0.6.0"]]}}
;; ClojureScript
{:repl {:plugins [[cider/cider-nrepl "0.21.2-SNAPSHOT"]]
:dependencies [[nrepl "0.6.0"]
[cider/piggieback "0.4.0"]
[figwheel-sidecar "0.5.18"]]