Loads the sqlps module if the "Invoke-Sqlcmd" cmdlet does not exist. This is the suggested method for loading the module according to MSDN docs. You can download the module installer from here.
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
from urllib2 import urlopen | |
from datetime import timedelta | |
import re | |
timedelta_regex = re.compile(r'(?P<days>\d+):(?P<hours>\d+):(?P<minutes>\d+):(?P<seconds>\d+)') | |
def get_modem_status(modem_uri="http://192.168.100.1"): | |
content = urlopen(modem_uri + "/index.cgi?page=modemStatusData").read() | |
parts = content.split("##") | |
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 Task CreateAsync(ApplicationUser user) | |
{ | |
if (user == null) | |
{ | |
throw new ArgumentNullException("user cannot be null."); | |
} | |
if (string.IsNullOrEmpty(user.UserName)) | |
{ | |
throw new ArgumentNullException("username cannot be null or empty."); |
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
/// <summary> | |
/// A replacement for the <see cref="UserValidator"/> which requires that an email | |
/// address be used for the <see cref="IUser.UserName"/> field. | |
/// </summary> | |
/// <typeparam name="TUser">Must be a type derived from <see cref="Microsoft.AspNet.Identity.IUser"/>.</typeparam> | |
/// <remarks> | |
/// This validator check the <see cref="IUser.UserName"/> property against the simple email regex provided at | |
/// http://www.regular-expressions.info/email.html. If a <see cref="UserManager"/> is provided in the constructor, | |
/// it will also ensure that the email address is not already being used by another account in the manager. | |
/// |
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
$timestamp = Get-Date -Format yyyyMMdd-HHmm | |
$dir = "pack_$timestamp" | |
Remove-Item "$dir" -Force -Recurse -ErrorAction SilentlyContinue | |
New-Item -ItemType Directory -Path "$dir" | |
Get-ChildItem .\* -Include *.md, *.exe, *.exe.config, *.dll -Exclude *.vshost.exe, *.vshost.exe.config | | |
% { Copy-Item $_ "$dir" } |
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
#region Dispose Pattern | |
private bool _disposed; | |
public void Dispose() | |
{ | |
Dispose(true); | |
GC.SuppressFinalize(this); | |
} |
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
################################################################################ | |
# Run Files Last Accessed After Date | |
Get-ChildItem C:\Input | | |
Select-Object FullName, LastAccessTime | | |
Where-Object {$_.LastAccessTime -g "01/01/2013"} | |
%{.\SuperAwesomize.exe $_.FullName} | |
################################################################################ | |
# Get full path of last file accessed item in directory | |
# ? is short for Where-Object |
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
REM VS2010 | |
CALL "%VS100COMNTOOLS%\vsvars32.bat" | |
REM VS2012 | |
CALL "%VS110COMNTOOLS%\vsvars32.bat" |
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 urllib2 | |
url = "http://google.com" | |
usock = urllib2.urlopen(url) | |
data = usock.read() | |
usock.close() | |
print data |
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
2013-04-29T03:14:23.510263+00:00 heroku[web.1]: Starting process with command `node dist/app.js` | |
2013-04-29T03:14:24.724186+00:00 app[web.1]: | |
2013-04-29T03:14:24.724501+00:00 app[web.1]: module.js:340 | |
2013-04-29T03:14:24.724765+00:00 app[web.1]: throw err; | |
2013-04-29T03:14:24.724895+00:00 app[web.1]: ^ | |
2013-04-29T03:14:24.727523+00:00 app[web.1]: Error: Cannot find module 'debug' | |
2013-04-29T03:14:24.727523+00:00 app[web.1]: at Function.Module._load (module.js:280:25) | |
2013-04-29T03:14:24.727523+00:00 app[web.1]: at Function.Module._resolveFilename (module.js:338:15) | |
2013-04-29T03:14:24.727523+00:00 app[web.1]: at Module.require (module.js:364:17) | |
2013-04-29T03:14:24.727523+00:00 app[web.1]: at Object.Module._extensions..js (module.js:474:10) |