This file contains hidden or 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; | |
using System.Globalization; | |
using System.Linq; | |
using System.Net; | |
using System.Net.Sockets; | |
using System.Runtime.Serialization; | |
using System.Text; | |
using System.Text.RegularExpressions; |
This file contains hidden or 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 DynamicMatch : DynamicObject | |
{ | |
private readonly Regex _Regex; | |
private readonly Match _Match; | |
public DynamicMatch( Regex regex, Match match ) | |
{ | |
Contract.Requires( regex != null, "Regex cannot be null." ); |
This file contains hidden or 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-Module ActiveDirectory | |
# Get all of the computer names in active directory. | |
# Displays a progress bar as each computer is queried for | |
# the state of its hard drives using WMI. | |
# The Status parameter selects the computer name to display | |
# in the progress message. | |
Get-ADComputer -Filter * | | |
Measure-Progress -Status { $_.Name } { |
This file contains hidden or 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
' TRANSPOSEOILVENDORDATA.VB | |
' BY JOSH EINSTEIN | |
' | |
' This is an Excel VBA macro that transposes a contiguous range of selected cells in Excel | |
' and repeats the header rows. Created specifically for a friend of mine, so probably not | |
' generally useful. | |
' INSTRUCTIONS | |
' To use, select a rectangular range of cells containing the table that you want to transpose. | |
' The first row should include the header values across that you want to be repeated |
This file contains hidden or 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
// Handle back button issues with Twitter Bootstrap's tab component. | |
// Based on: http://stackoverflow.com/a/10120221/81769 | |
// It has been changed to avoid the following side effects: | |
// - Switching tabs was being added to navigation history which is undesirable | |
// (Worked around this by using location.replace instead of setting the hash property) | |
// - Browser scroll position was lost due to fragment navigation | |
// (Worked around this by converting #id values to #!id values before navigating.) | |
$(document).ready(function () { | |
if (location.hash.substr(0,2) == "#!") { |
This file contains hidden or 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
# Module manifest for module 'WolframAlpha' | |
# Generated by: Josh Einstein | |
# Generated on: 4/25/2013 | |
@{ | |
RootModule = 'WolframAlpha.psm1' | |
ModuleVersion = '1.0' | |
GUID = 'bddce958-afa6-46d5-baa4-a277e0f9ccc1' | |
Author = 'Josh Einstein' |
This file contains hidden or 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
url="http://api.wolframalpha.com/v2/query" | |
appid="YOUR APP ID" # get one at https://developer.wolframalpha.com/portal/apisignup.html | |
query="$@" | |
value="$(perl -MURI::Escape -e 'print uri_escape($ARGV[0]);' "$query")" | |
echo "Computing: $query" | |
curl -s -L -G -d "input=$value&appid=$appid&format=plaintext" $url >/tmp/wolfram-alpha.xml | |
xsltproc ~/Scripts/wolf.xslt /tmp/wolfram-alpha.xml |
This file contains hidden or 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
############################################################################## | |
#.SYNOPSIS | |
# Scans your Outlook rules (Outlook must be running) and disables any rules | |
# whose name matches a specific pattern such as: | |
# Move Stuff (Until 4/10/2013 5:00 PM) | |
# Ignore Stuff (Until 4/11/2013) | |
# | |
#.DESCRIPTION | |
# | |
# To create temporary rules in Outlook, just create rules as you would |
This file contains hidden or 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
<table id="people"> | |
<thead> | |
<th>First Name</th> | |
<th>Last Name</th> | |
<th>Phone Number</th> | |
<th>Location</th> | |
</thead> | |
<tbody> | |
<tr> | |
<td><input /></td> |
This file contains hidden or 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
# PowerShell 3 adds the new [PSCustomObject] pseudo type attribute which | |
# lets you declare an object literal using a syntax very similar to that | |
# of an ordinary Hashtable. (There's also a new [Ordered] attribute that | |
# creates a hash table with the order of keys preserved.) | |
# | |
# But it only lets you declare an object literal with NoteProperties. | |
# What I would really love to have seen is the syntax look for script | |
# blocks and create ScriptProperties out of them if there is no param | |
# block or ScriptMethods out of them if there is a param block. | |
# |