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
Dispatch = cowboy_router:compile([ | |
{'_', [ | |
{"/", cowboy_static, | |
[{directory, {priv_dir, web, []}}, | |
{mimetpyes, [{<<".html">>, [<<"text/html">>]}]}, | |
{file, <<"index.html">>}]}, | |
{"/js/[...]", cowboy_static, | |
[{directory, {priv_dir, web, [<<"js">>]}}, | |
{mimetypes, {fun mimetypes:path_to_mimes/2, default}}]}, |
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
[Test] | |
public void decodeTest() { | |
Assert.AreEqual(19158, decode("e9a")); | |
} | |
[Test] | |
public void encodeTest() | |
{ | |
Assert.AreEqual("cb", encode(125)); | |
} |
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
# Create required directories | |
mkdir -p ~/.vim/autoload ~/.vim/bundle | |
# Install pathogen | |
wget -O ~/.vim/autoload/pathogen.vim https://raw.github.com/tpope/vim-pathogen/HEAD/autoload/pathogen.vim | |
echo "call pathogen#infect()" >> ~/.vimrc | |
# Install vimerl | |
wget -O vimerl.tar.gz https://github.com/jimenezrick/vimerl/tarball/master |
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
$app = "C:\Users\rrusu\Documents\GitHub\Er101" | |
$watcher = New-Object System.IO.FileSystemWatcher | |
$watcher.Path = "$app\src\" | |
$watcher.IncludeSubdirectories = $true | |
$watcher.EnableRaisingEvents = $false | |
$watcher.NotifyFilter = [System.IO.NotifyFilters]::LastWrite -bor [System.IO.NotifyFilters]::FileName | |
set-location $app | |
while($TRUE){ |
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
Dump | |
BCP PRO_CITIFXRPTDB01.dbo.network_metrics OUT c:\network_metrics.txt -T -c | |
Load | |
BCP PRO_CITIFXRPTDB01.dbo.network_metrics IN C:\reporting\network_metrics.txt -T -c | |
More details here | |
http://sqlwithmanoj.wordpress.com/tag/bcp-queryout/ | |
http://msdn.microsoft.com/en-us/library/ms162802.aspx |
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
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="utf-8"> | |
<title>{Title}</title> | |
<link rel='icon' href='{Favicon}'> | |
<link rel='shortcut icon' href='{Favicon}'> | |
<link rel='alternate' type='application/rss+xml' href='{RSS}'> | |
<meta name='description' content='{MetaDescription}'> | |
<meta name='color:Link' content='#6699cc'> |
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
=========== BACKUP | |
USE master; | |
BACKUP DATABASE [Ecp] | |
TO DISK = N'C:\dbbackups\ecp.Bak' WITH NOFORMAT, NOINIT, | |
NAME = N'Ecp-Full Database Backup', SKIP, NOREWIND, NOUNLOAD, STATS = 10 | |
=========== RESTORE | |
USE master; | |
ALTER DATABASE [Ecp] SET OFFLINE WITH | |
ROLLBACK IMMEDIATE |
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 class TaskScheduler | |
{ | |
private static readonly ILog Log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); | |
private readonly Timer _timer; | |
public ServiceContext(DrawingsController controller, IAppConfig config): base(controller) | |
{ | |
var _interval = 1000 * 60 * config.DrawEveryNMinutes; |
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 class Pipe<T> | |
{ | |
private static readonly ILog Log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); | |
private readonly List<Type> _operations = new List<Type>(); | |
public Pipe<T> Register<TOperation>() where TOperation : IOperation<T> | |
{ | |
_operations.Add(typeof(TOperation)); | |
IoC.Register<TOperation>(); |
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 class AppDependencies | |
{ | |
public static void AreAllSatisfied() | |
{ | |
IsValidConnectionString(); | |
IoC.AllTheTypesAreResolvable(); | |
var appConfig = IoC.Resolve<IAppConfig>(); | |
AssertDirectoryExists(appConfig.Logs); | |
AssertDirectoryExists(appConfig.Assets); |
NewerOlder