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
# Local Dates: | |
git log --date=local --pretty=format:"%h%x09%an%x09%ad%x09%s" > commits.local.tsv.txt | |
# ISO Dates: | |
git log --date=iso --pretty=format:"%h%x09%an%x09%ad%x09%s" > commits.iso.tsv.txt |
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
using System; | |
using System.Collections.Generic; | |
namespace Robotics | |
{ | |
public static class Program | |
{ | |
private static readonly Dictionary<string, Order> Orders = new Dictionary<string, Order>(StringComparer.OrdinalIgnoreCase) | |
{ | |
["Start"] = Order.Start, |
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
<CR> : move to the start of the next line | |
- : move to the start of the previous line | |
^ : move to the start of the first word on the current line | |
0 : move to the start of the current line | |
$ : move to the end of the current line | |
P% : move to the point P% through the buffer | |
% : move between the matching bracket of a (), {}, [] pair |
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
" Use Vim settings, rather than Vi settings (much better!). | |
" This must be first, because it changes other options as a side effect. | |
set nocompatible | |
set wildmenu | |
set wildmode=full | |
let mapleader = "," | |
" toggle on whether to show line numbers | |
nmap <leader>n :set number!<CR> |
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
Get-Content Dockerfile | docker build - |
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
--Get execution stats for a query | |
db.people.find({"ssn": "720-38-5636"}).explain("executionStats") | |
--Get explain object | |
exp = db.people.find({"ssn": "720-38-5636"}).explain("executionStats") |
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
public sealed class Singleton | |
{ | |
private static readonly Lazy<Singleton> lazy = new Lazy<Singleton>(() => new Singleton()); | |
public static Singleton Instance {=> lazy.Value; | |
private Singleton() {} | |
} |
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
public sealed class Singleton | |
{ | |
private static readonly Singleton instance = new Singleton(); | |
// Explicit static constructor to tell C# compiler | |
// not to mark type as beforefieldinit | |
static Singleton() | |
{ | |
} |
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
SELECT [rs].[destination_database_name], | |
[rs].[restore_date], | |
[bs].[backup_start_date], | |
[bs].[backup_finish_date], | |
[bs].[database_name] as [source_database_name], | |
[bmf].[physical_device_name] as [backup_file_used_for_restore] | |
FROM msdb..restorehistory rs | |
INNER JOIN msdb..backupset bs | |
ON [rs].[backup_set_id] = [bs].[backup_set_id] | |
INNER JOIN msdb..backupmediafamily bmf |
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 PowerShell execution policy | |
Set-ExecutionPolicy Unrestricted | |
Set-ExecutionPolicy Bypass -Scope Process -Force | |
# Install Chocolatey | |
ex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1')) | |
# Install Boxstarter | |
. { iwr -useb http://boxstarter.org/bootstrapper.ps1 } | iex; get-boxstarter -Force |
NewerOlder