Skip to content

Instantly share code, notes, and snippets.

View xpando's full-sized avatar

David Findley xpando

View GitHub Profile
@xpando
xpando / .dircolors
Created December 1, 2014 02:03
my dircolors
# Exact Solarized Dark color theme for the color GNU ls utility.
# Designed for dircolors (GNU coreutils) 5.97
#
# This simple theme was simultaneously designed for these terminal color schemes:
# - Solarized dark (best)
# - Solarized light
# - default dark
# - default light
# with a slight optimization for Solarized Dark.
#
@xpando
xpando / .zshrc
Last active February 28, 2016 15:33
My zsh settings
# Path to your oh-my-zsh installation.
export ZSH=$HOME/.oh-my-zsh
# Set name of the theme to load.
# Look in ~/.oh-my-zsh/themes/
# Optionally, if you set this to "random", it'll load a random theme each
# time that oh-my-zsh is loaded.
ZSH_THEME="ys"
# Uncomment the following line to use case-sensitive completion.
@xpando
xpando / xpando.json
Last active August 29, 2015 14:09
pshazz theme
{
"plugins": [ "git", "ssh", "z", "aliases", "dircolors" ],
"dircolors": {
"dirs": [
["^\\..*$", "darkcyan", ""],
[".*", "cyan", ""]
],
"files": [
["^\\..*$", "darkgray", ""],
["(?ix)\\.(7z|zip|tar|gz|rar)$", "yellow", ""],
@xpando
xpando / unzip.ps1
Last active June 27, 2019 11:01
Powershell function to unzip files using 7zip. Accounts for tar.ga and tgz files. Uses piping to process gzipped tar files in a single pass.
function unzip($path,$to) {
$7z = "$env:TEMP\7z"
if (!(test-path $7z) -or !(test-path "$7z\7za.exe")) {
if (!(test-path $7z)) { md $7z | out-null }
push-location $7z
try {
write-host "Downloading 7zip" -foregroundcolor cyan
$wc = new-object system.net.webClient
$wc.headers.add('user-agent', [Microsoft.PowerShell.Commands.PSUserAgent]::FireFox)
$wc.downloadFile("http://softlayer-dal.dl.sourceforge.net/project/sevenzip/7-Zip/9.20/7za920.zip","$7z\7z.zip")
@xpando
xpando / ConEmu.xml
Last active August 29, 2015 14:05
My ConEmu configuration
<?xml version="1.0" encoding="utf-8"?>
<!--
Rename this file to "ConEmu.xml" to enable portable mode.
You may place "ConEmu.xml" file AFTER ConEmu starts,
so You can save settings to xml, loaded from registry,
and vice versa.
-->
<key name="Software">
<key name="ConEmu">
<!-- Main configuration (/config argument is not specified) -->
@xpando
xpando / gist:6488731
Created September 8, 2013 21:52
Combining windows install images into an all in one bootable usb drive
imagex /compress maximum /export <path_of_source_wim_file> <index_no> <path_of_destination_wim_file> <description_of_edition>
@xpando
xpando / Install Chocolatey
Created August 16, 2013 18:01
Install Chocolatey
$a=new-object net.webclient;$a.proxy.credentials=[system.net.credentialcache]::Defaultnetworkcredentials;$a.downloadstring('https://chocolatey.org/install.ps1')|iex
@xpando
xpando / IterativeTreeExt.cs
Created July 21, 2012 00:41
Extensions methods for iteratively traversing trees using Stack<T> and Queue<T>
public static class IterativeTreeExt
{
public static IEnumerable<T> AsDepthFirstEnumerable<T>(this T head, Func<T, IEnumerable<T>> children)
{
var nodes = new Stack<T>(new [] { head });
while(nodes.Count > 0)
{
var currentnode = nodes.Pop();
@xpando
xpando / RecursiveTreeExt.cs
Created July 21, 2012 00:40
Extensions methods for traversing trees using recursion
public static class RecursiveTreeExt
{
public static IEnumerable<T> AsDepthFirstEnumerable<T>(this T head, Func<T, IEnumerable<T>> children)
{
yield return head;
foreach (var node in children(head))
{
foreach (var child in AsDepthFirstEnumerable(node, children))
{
@xpando
xpando / gist:2901449
Created June 9, 2012 15:30
Full Text Catalog properties
SELECT
cat.name,
ItemCount = FULLTEXTCATALOGPROPERTY(cat.name, 'ItemCount'),
MergeStatus = FULLTEXTCATALOGPROPERTY(cat.name, 'MergeStatus'),
PopulateCompletionAge = FULLTEXTCATALOGPROPERTY(cat.name, 'PopulateCompletionAge'),
PopulateStatus = FULLTEXTCATALOGPROPERTY(cat.name, 'PopulateStatus'),
ImportStatus = FULLTEXTCATALOGPROPERTY(cat.name, 'ImportStatus')
FROM
sys.fulltext_catalogs AS cat