As a freelancer, I build a lot of web sites. That's a lot of code changes to track. Thankfully, a Git-enabled workflow with proper branching makes short work of project tracking. I can easily see development features in branches as well as a snapshot of the sites' production code. A nice addition to that workflow is that ability to use Git to push updates to any of the various sites I work on while committing changes.
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
import numpy as np | |
import matplotlib.pyplot as plt | |
import matplotlib.font_manager as font_manager | |
# Set the font properties (can use more variables for more fonts) | |
font_path = 'C:\Windows\Fonts\AGaramondPro-Regular.otf' | |
font_prop = font_manager.FontProperties(fname=font_path, size=14) | |
ax = plt.subplot() # Defines ax variable by creating an empty plot |
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
function var_dump_pre($mixed = null) { | |
echo "<pre>"; | |
var_dump($mixed); | |
echo "</pre>"; | |
return null; | |
} |
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
# This file has to be saved in your Jupyter config directory (found by running | |
# jupyter --config-dir | |
# but usually C:\Users\<username>\.jupyter\jupyter_notebook_config.py on Windows | |
def scrub_output_pre_save(model, **kwargs): | |
"""scrub output before saving notebooks""" | |
# only run on notebooks | |
if model['type'] != 'notebook': | |
return | |
# only run on nbformat v4 |
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
# [filter "lfs"] | |
# clean = git-lfs clean -- %f | |
# smudge = git-lfs smudge -- %f | |
# process = git-lfs filter-process | |
# required = true | |
[core] | |
# editor = notepad | |
editor = code -w # -n --disable-extensions | |
[rerere] | |
enabled = true |
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
sealed partial class App : Application | |
{ | |
... | |
private static List<ContentDialog> DialogQueue { get; } = new List<ContentDialog>(); | |
public static async void Alert(string text) | |
{ | |
var Dialog = new ContentDialog() | |
{ | |
Title = text, |
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
# IPython-like history search: | |
Set-PSReadLineKeyHandler -Key UpArrow -Function HistorySearchBackward | |
Set-PSReadLineKeyHandler -Key DownArrow -Function HistorySearchForward | |
function Get-BranchName () { | |
try { | |
$branch = git rev-parse --abbrev-ref HEAD | |
if ($branch -eq "HEAD") { |
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 bash | |
set -eo pipefail | |
USAGE=' | |
Usage: | |
$ convert2gif <input_video_file> <output_gif_file> [<speedup_factor>] | |
Convert video to .gif using ffmpeg. Optionally speed up the footage. | |
' |
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
set revert-all-at-newline on | |
"\e\e": kill-whole-line | |
"\e[A": history-search-backward | |
"\e[B": history-search-forward |