Skip to content

Instantly share code, notes, and snippets.

@creatigent
creatigent / angular2-starter.md
Created March 13, 2017 14:57 — forked from mirkonasato/angular2-starter.md
Angular 2 with Webpack Project Setup - Code Snippets
@creatigent
creatigent / Get-MsdnKeys.ps1
Created April 3, 2017 19:03 — forked from Jaykul/Get-MsdnKeys.ps1
PowerShell + Selenium Demo: Getting Started, and reusing cookies with Invoke-Request
# It might work in 4, but I'm not testing there. Lower you'll have to tweak code
#requires -Version 5.0
param(
# Your Live ID for MSDN login
[Parameter(Mandatory)]
[PSCredential]
[System.Management.Automation.CredentialAttribute()]
$Credential,
# Pick a browser to use. Defaults to Firefox (which doesn't seem to require an external Driver file)
@creatigent
creatigent / msbuild.ps1
Created September 20, 2017 22:23 — forked from kamsar/msbuild.ps1
PowerShell to resolve MSBuild.exe on VS2017 or VS2015 (or with Build Tools 2015)
function Resolve-MsBuild {
$msb2017 = Resolve-Path "${env:ProgramFiles(x86)}\Microsoft Visual Studio\*\*\MSBuild\*\bin\msbuild.exe" -ErrorAction SilentlyContinue
if($msb2017) {
Write-Host "Found MSBuild 2017 (or later)."
Write-Host $msb2017
return $msb2017
}
$msBuild2015 = "${env:ProgramFiles(x86)}\MSBuild\14.0\bin\msbuild.exe"
@creatigent
creatigent / Get-CDPInfo.ps1
Created October 22, 2017 21:25 — forked from supercheetah/Get-CDPInfo.ps1
Gets the CDP information from a Windows computer with PowerShell.
<#
.SYNOPSIS
Gets the CDP information from a computer.
.DESCRIPTION
Attempts to get the CDP information from a computer. It automatically downloads tcpdump.exe if it's not already on a computer.
.PARAMETER DeviceNumber
Alias: dn
@creatigent
creatigent / powershell.groovy
Created November 8, 2017 22:59 — forked from MiguelTVMS/powershell.groovy
Groovy script to execute powershell commands on Jenkins
def exec(Map map = [:], command){
def debug = map.debug ?: false
if (debug) echo "[DEBUG] powershell method called with parameter: \n $command"
def returnFileName = new Date().format("yyyyMMddHHmmssSSS")
if (debug) echo "[DEBUG] The return file name will is $returnFileName"
def pwCommand = "powershell.exe -ExecutionPolicy Bypass -NoLogo -NonInteractive -NoProfile -Command \"$command\" > $returnFileName"
@creatigent
creatigent / ZipUnzip.groovy
Created November 9, 2017 15:02 — forked from bitsnaps/ZipUnzip.groovy
Zip and UnZip files using Groovy
import java.util.zip.*
String zipFileName = "file.zip"
String inputDir = "logs"
def outputDir = "zip"
//Zip files
ZipOutputStream zipFile = new ZipOutputStream(new FileOutputStream(zipFileName))
new File(inputDir).eachFile() { file ->
@creatigent
creatigent / app.css
Created November 13, 2017 13:24 — forked from scottdomes/app.css
React Audio Tutorial
body {
background: #f9f9f9;
font-family: 'Open Sans', sans-serif;
text-align: center;
}
#container {
position: relative;
z-index: 2;
padding-top: 100px;
@creatigent
creatigent / Google maps geocode.txt
Created November 29, 2017 18:38 — forked from boldfacedesign/Google maps geocode.txt
Google maps geocode multiple addresses and add info windows
var locations = [
['Bondi Beach', '850 Bay st 04 Toronto, Ont'],
['Coogee Beach', '932 Bay Street, Toronto, ON M5S 1B1'],
['Cronulla Beach', '61 Town Centre Court, Toronto, ON M1P'],
['Manly Beach', '832 Bay Street, Toronto, ON M5S 1B1'],
['Maroubra Beach', '606 New Toronto Street, Toronto, ON M8V 2E8']
];
var map = new google.maps.Map(document.getElementById('map'), {
zoom: 10,
@creatigent
creatigent / Deploy-Windows-Service-Via-MSBuild.proj.xml
Created December 5, 2017 14:18 — forked from mrchief/Deploy-Windows-Service-Via-MSBuild.proj.xml
MSBuild Script to deploy Windows Service to remote or local machine
<Project DefaultTargets="CopyOutputs;DeployService" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="4.0">
<!-- These settings control what the service's name, description etc appear in services.msc task panel. -->
<PropertyGroup Label="ServiceMetaData">
<ServiceName>ShinyNewService</ServiceName>
<ServiceDisplayName>Shiny New Service</ServiceDisplayName>
<ServiceDescription>A shiny new service, that changes the world for the greater good.</ServiceDescription>
</PropertyGroup>
<Choose>
@creatigent
creatigent / knockoutUtility.js
Created October 1, 2018 19:17 — forked from mbejda/knockoutUtility.js
List of Knockout Utility Functions
ko.utils.arrayForEach
ko.utils.arrayFirst
ko.utils.arrayFilter
ko.utils.arrayGetDistinctValues
ko.utils.arrayIndexOf
ko.utils.arrayMap
ko.utils.arrayPushAll
ko.utils.arrayRemoveItem
ko.utils.extend
ko.utils.fieldsIncludedWithJsonPost