Skip to content

Instantly share code, notes, and snippets.

niaher

Block or report user

Report or block niaher

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@niaher
niaher / deploy-sqlproj
Last active Apr 2, 2019
MSDeploy script
View deploy-sqlproj
msbuild "MyApp.Database/MyApp.Database.sqlproj" `
/t:"Build;Publish" `
/p:SqlPublishProfilePath="MyApp.Database.automated-tests.publish.xml" `
/p:UpdateDatabase=True `
/p:PublishScriptFileName="publish-script.sql"
View keybase.md

Keybase proof

I hereby claim:

  • I am niaher on github.
  • I am niaher (https://keybase.io/niaher) on keybase.
  • I have a public key ASBktBkUBBhH4rZTMKTq-GQt26QcxCoLnnj4-F9hNkQK5go

To claim this, I am signing this object:

@niaher
niaher / excel-download-images-from-url
Last active Sep 23, 2018
Excel macro (VBA script) to download images based on the URL specified in the cells
View excel-download-images-from-url
Private Declare Function URLDownloadToFile Lib "urlmon" Alias _
"URLDownloadToFileA" (ByVal pCaller As Long, _
ByVal szURL As String, _
ByVal szFileName As String, _
ByVal dwReserved As Long, _
ByVal lpfnCB As Long) As Long
Public Sub GURoL(url As String, FileName As String)
Dim lngRetVal As Long
lngRetVal = URLDownloadToFile(0, url, FileName, 0, 0)
@niaher
niaher / paginator.js
Created May 6, 2016
"pagination" factory for angular
View paginator.js
angular.module("paginator", [])
.service("base64", function() {
var keyStr = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";
function utf8Encode(string) {
string = string.replace(/\r\n/g, "\n");
var utftext = "";
for (var n = 0; n < string.length; n++) {
@niaher
niaher / SmartWatch.cs
Created Feb 25, 2016
Similar to Stopwatch but allows recording many measurements
View SmartWatch.cs
using System.Collections.Generic;
using System.Diagnostics;
public class SmartWatch
{
private readonly List<string> measurements = new List<string>();
private readonly Stopwatch watch = new Stopwatch();
public SmartWatch()
{
View init-server.ps1
# This script configures IIS application pool and app.
# example usage:
# PS> init-server.ps1 -AppName MyApp -TargetComputers computer1,computer2 -PSSessionUser $(PSSessionUser) -PSSessionPassword $(PSSessionPassword) -AppPoolUser $(AppPoolUser) -AppPoolPassword $(AppPoolPassword)
param(
[Parameter(Mandatory=$true)][string]$AppName,
[string]$TargetComputers,
[string]$PSSessionUser,
[string]$PSSessionPassword,
[string]$AppPoolUser,
@niaher
niaher / server-setup.ps1
Last active Apr 2, 2019
This script configures IIS application pool and site. It needs to be run once on each machine where the app is deployed. Run it in powershell with admin rights. For example to deploy release config run `server-setup.ps1 -Target release`
View server-setup.ps1
# This script configures IIS application pool and site.
# This script needs to be run once on each machine where the app is deployed.
# Run this file in powershell with admin rights. For example to deploy release config:
# PS > server-setup.ps1 -Target release
param (
[Parameter(Mandatory=$true,
HelpMessage="Name of the build (e.g. - local, debug, release, etc)")]
[string]$Target
)
View comma-separated-list.less
.list-csl {
display: inline;
list-style: none;
padding:0;
li {
display: inline;
}
li:after {
@niaher
niaher / Resources.tt
Last active Apr 2, 2019
T4 template to generate list of files that are part of the project. This template is useful for generating list of css/js resources to be put in bundle. The value comes from the fact that files which are not part of the project (e.g. - excluded files) will not actually be included in the resulting list.
View Resources.tt
// This is an auto-generated file.
<#@ template language="C#" hostSpecific="true" debug="True" #>
<#@ output extension="cs" #>
<#@ assembly name="System.Core" #>
<#@ assembly name="EnvDte" #>
<#@ import namespace="System.Linq" #>
<#@ import namespace="System.IO" #>
<#@ import namespace="System.Collections.Generic" #>
<#@ import namespace="System.Text.RegularExpressions" #>
<#@ import namespace="System" #>
View player.html
<html>
<head>
<title></title>
</head>
<body>
#3
<div id="content" style="height: 100%; width: 100%;"><script data-config="//config.playwire.com/14907/videos/v2/3791965/player.json" data-css="//cdn.playwire.com/bolt/js/zeus/skins/default.css" data-height="100%" data-width="100%" src="//cdn.playwire.com/bolt/js/embed.min.js" type="text/javascript"></script></div>
You can’t perform that action at this time.