Skip to content

Instantly share code, notes, and snippets.

using System.Text;
namespace Yzorg.Gist {
class NoteBuilder : IDisposable {
StringBuilder _note;
Func<string> _get;
Action<string> _set;
public NoteBuilder(Func<string> get, Action<string> set) {
# my version of http://stackoverflow.com/a/3364468/195755
netsh http add urlacl ("url=http://{0}:{1}/" -f $env:COMPUTERNAME,64199) user=everyone
@yzorg
yzorg / CreateHardLinks.ps1
Last active August 29, 2015 14:06
recursive create hardlinks
@yzorg
yzorg / local-git-setup.ps1
Last active August 29, 2015 14:20
create a local GIT folder for windows: create directory links for default SQL Server Management Studio and WindowsPowershell directories
pushd C:\Projects\local-git
$poshdir = $(gi '~\Documents\WindowsPowershell' | select -exp FullName)
cmd /c mklink /J PowerShell $poshdir
$sqldir = $(gi '~\Documents\SQL Server Management Studio' | select -exp FullName)
cmd /c mklink /J SSMS $sqldir
# path to cspack
$cspackPath = Join-Path $env:ProgramFiles 'Microsoft SDKs\Azure\.NET SDK\v2.7\bin\cspack.exe'
$PackagePath = 'c:\mycloudpackage.cspkg'
$serviceDefinitionFile = 'c:\myProject\ServiceDefinition.csdef'
$webRoleName = 'MyWebRole'
$webRolePath = 'c:\myProject'
$webRoleEntryPoint = 'MyWebRole.dll'
# define the cspack parameters
@yzorg
yzorg / CopyFileList.ps1
Created September 17, 2015 02:28
copy selective list of files from text file using PowerShell and xcopy
'c:\git\mycompany_prj2\Legacy\Comp1\f1.cs
c:\git\mycompany_prj2\Legacy\Comp2\Domain\f2.cs
c:\git\mycompany_prj2\Legacy\MyWeb\web.config' > files.txt
cd c:\git\mycompany_prj2
$dest = '..\project_archive\prep_6.11_merge'
if (!(Test-Path $dest)) { md $dest -Verbose }
gc .\files.txt | %{
$rel = (Resolve-Path -Relative $_)
xcopy $_ (Join-Path $dest $rel*) /Y
@yzorg
yzorg / IE 'Send to Chrome' bookmarklet
Last active December 11, 2015 03:08 — forked from anonymous/gist:4334192
'Send to Chrome' button in IE, adds chrome2:// protocol to Windows
// in desktop IE and metro IE - create a bookmark with the line below
javascript:document.location=("chrome2://"+document.location)
@yzorg
yzorg / time.html
Last active January 21, 2016 21:27
Static page that formats the current time for copy/pasting into source code comment or as part of a filename. Only has my programming languages (C/JS/Java, shell, SQL). Live demo: http://htmlpreview.github.io/?https://gist.github.com/yzorg/bbffec29c7d350d2635b/raw
<!doctype html>
<html>
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>time comments</title>
<link rel="stylesheet" href="//ajax.aspnetcdn.com/ajax/bootstrap/3.0.0/css/bootstrap.min.css" />
<style type="text/css">
body {
padding-top: 80px;
@yzorg
yzorg / DataTables-js-links.md
Created June 14, 2016 15:01
A few interesting links regarding DataTables.