Skip to content

Instantly share code, notes, and snippets.

View gist:24ff6db72213af049024522967eb50f7
/*
cargo.toml
[dependencies]
actix = "0.9.0"
actix-rt = "1.0.0"
actix-web = { version="2.0.0", features=["openssl"] }
actix-service = "1.0.5"
env_logger = "0.6.1"
bytes = "0.5.4"
@crmckenzie
crmckenzie / Watch.ps1
Last active Aug 18, 2017
Pester-Watch
View Watch.ps1
param([switch] $Start)
function New-FileSystemWatcher(
[Parameter(Mandatory)][ValidateNotNullOrEmpty()] [string] $TargetFile,
[Parameter(Mandatory)][ValidateNotNull()] [ScriptBlock] $Action
) {
$fullPath = Resolve-Path $TargetFile
$fsw= New-Object System.IO.FileSystemWatcher
$fsw.Path = (Split-Path $fullPath -Parent)
View Enable-RunAsDifferentUser-Windows10.reg
Windows Registry Editor Version 5.00
[HKEY_CURRENT_USER\SOFTWARE\Policies\Microsoft\Windows\Explorer]
"ShowRunAsDifferentUserInStart"=dword:00000001
View crmckenzie-box-starter.ps1
# BoxStarter script
#START http://boxstarter.org/package/nr/url?<raw url>
Set-ExplorerOptions -showHiddenFilesFoldersDrives -showProtectedOSFiles -showFileExtensions
Enable-RemoteDesktop
Move-LibraryDirectory "Personal" "$env:UserProfile\OneDrive\documents"
cinst 7zip
cinst chrome
View ServiceHealth.cs
public class ServiceHealthStatus
{
public string Type { get; set; }
public string Status { get; set; }
public string[] Messages { get; set; }
public string Name { get; set; }
public string Data { get; set; }
}
public class ServiceHealthController : ApiController
@crmckenzie
crmckenzie / sample.cs
Created May 4, 2016
Web Api + OData + AutoMapper + HyperMedia
View sample.cs
[System.Web.Http.HttpGet]
[System.Web.OData.EnableQuery]
[System.Web.Http.Route("~/api/v1/widgets/query", Name = "widgets-query")]
[ResponseType(typeof(List<widgetJson>))]
public IQueryable<widgetJson> Query(ODataQueryOptions<WidgetEntity> query)
{
var odata = query.ApplyTo(_dbContext.widgets)
.Cast<WidgetEntity>()
.ToList()
View install-developer-dependencies.js
var fs = require('fs');
fs.readFile('package.json', 'utf8', function(err, data){
console.log("reading package.json");
if (err) throw err;
obj = JSON.parse(data);
if (obj.devDependencies) {
View install-developer-dependencies.js
var fs = require('fs');
fs.readFile('package.json', 'utf8', function(err, data){
console.log("reading package.json");
if (err) throw err;
obj = JSON.parse(data);
if (obj.devDependencies) {
View ExecuteSql.cs
public int ExecuteSql(string sql, object parameters = null)
{
int result;
using (var connection = ConnectToDb())
using (var command = new SqlCommand(sql, connection))
{
Log.Info(sql);
if (parameters != null)
@crmckenzie
crmckenzie / xd2md.cs
Created Feb 19, 2016 — forked from formix/xd2md.cs
Generates Markdown From VisualSturio XML documentation files
View xd2md.cs
using System;
using System.Collections.Generic;
using System.IO;
using System.Text.RegularExpressions;
using System.Xml;
using System.Xml.Linq;
namespace Formix.Utils
{
class Program
You can’t perform that action at this time.