Skip to content

Instantly share code, notes, and snippets.

View princeppy's full-sized avatar

👑 Prince Park 👑 princeppy

View GitHub Profile
@princeppy
princeppy / Logging_Functions.ps1
Created June 20, 2016 13:53 — forked from 9to5IT/Logging_Functions.ps1
PowerShell: Logging Functions
Function Log-Start{
<#
.SYNOPSIS
Creates log file
.DESCRIPTION
Creates log file with path and name that is passed. Checks if log file exists, and if it does deletes it and creates a new one.
Once created, writes initial logging data
.PARAMETER LogPath
@princeppy
princeppy / host-named-sites.ps1
Created April 13, 2017 19:54 — forked from wpsmith/host-named-sites.ps1
Powershell: SharePoint 2013 Create Web Application, Root Site Collection,
# Replace:
# DATABASE
# NAMED
# APPLICATION NAME
# hostheadername
# DOMAIN\USER
# DOMAIN\SP_FARM_ACCOUNT
# PATHNAME
# SITE COLLECTION NAME
# DIRECTORYPORT
@princeppy
princeppy / IE CSS Conditionals
Created July 21, 2017 09:01 — forked from fauverism/IE CSS Conditionals
IE CSS Conditionals
Target ALL VERSIONS of IE
<!--[if IE]>
<link rel="stylesheet" type="text/css" href="all-ie-only.css" />
<![endif]-->
Target everything EXCEPT IE
<!--[if !IE]><!-->
<link rel="stylesheet" type="text/css" href="not-ie.css" />
Function Get-AgeAndGender()
{
[CmdletBinding()]
Param(
[Parameter(Mandatory=$true,ValueFromPipeline=$true)]
[string] $ImagePath
)
$Splat = @{
@princeppy
princeppy / dataURItoBlob.js
Created November 8, 2017 05:08 — forked from davoclavo/dataURItoBlob.js
Convert dataURI to Blob so large images do not crash the browser. Based on: http://stackoverflow.com/questions/10412299 and http://stackoverflow.com/questions/6850276
/*
The MIT License (MIT)
Copyright (c) 2016 David Gomez-Urquiza
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
@princeppy
princeppy / InstallSqlForDev.ps1
Created March 29, 2018 09:25 — forked from LeeCampbell/InstallSqlForDev.ps1
Install SQL 2016 Dev command line (Powershell)
#Installs SQL Server locally with standard settings for Developers/Testers.
# Install SQL from command line help - https://msdn.microsoft.com/en-us/library/ms144259.aspx
$sw = [Diagnostics.Stopwatch]::StartNew()
$currentUserName = [System.Security.Principal.WindowsIdentity]::GetCurrent().Name;
$SqlServerIsoImagePath = "???\Downloads\Microsoft\SQL Server 2016 Developer Edition\en_sql_server_2016_developer_x64_dvd_8777069.iso"
#Mount the installation media, and change to the mounted Drive.
$mountVolume = Mount-DiskImage -ImagePath $SqlServerIsoImagePath -PassThru
$driveLetter = ($mountVolume | Get-Volume).DriveLetter
$drivePath = $driveLetter + ":"
@princeppy
princeppy / 0 openssl.md
Last active September 11, 2022 10:21 — forked from jchandra74/openssl.MD
HOWTO: Create Your Own Self-Signed Certificate with Subject Alternative Names Using OpenSSL in Ubuntu Bash for Window

Extensions

  • .pem => Privacy Enhancement Mail Certificate
  • .key extension => is a PEM file containing just the private-key
  • .pkcs|.pfx|.p12 => is a fully encrypted passworded container format that contains both pubkic and private certificate pairs
  • .cert|.cer|.crt => is a public .pem formatted file with diffrent extenssions for windows
  • *.private.pem = *.key.pem = *.key
  • *.public.pem = *.crt.pem = *.crt = *.cer.pem = *.cer
  • passworded(*.key + *.cer) = *.pkcs|*.pfx|*.p12
  • *.key.pem + *.crt.pem in one file => *.keycer.pem
@princeppy
princeppy / Generate-SignalrProxy.ps1
Created April 28, 2018 20:51 — forked from jcoutch/Generate-SignalrProxy.ps1
Generate a SignalR hub proxy (taking into account any binding redirects in your project)
# This script is designed to be ran as a post-build step.
# If running directly, make sure you're in the root of your project's folder.
# This project also relies on the Microsoft.AspNet.SignalR.Utils package to be
# installed in your project, and packages restored prior to running this script
# Modify the variables below to correspond with your build settings
$packagesFolder = "..\packages" # Your NuGet packages
$appConfigFile = "app.config" # Your app/web.config to grab binding redirects from
$outputDir = "bin\debug" # The build output directory containing your SignalR hubs
@princeppy
princeppy / gh-pages-deploy.md
Created July 7, 2018 07:52 — forked from cobyism/gh-pages-deploy.md
Deploy to `gh-pages` from a `dist` folder on the master branch. Useful for use with [yeoman](http://yeoman.io).

Deploying a subfolder to GitHub Pages

Sometimes you want to have a subdirectory on the master branch be the root directory of a repository’s gh-pages branch. This is useful for things like sites developed with Yeoman, or if you have a Jekyll site contained in the master branch alongside the rest of your code.

For the sake of this example, let’s pretend the subfolder containing your site is named dist.

Step 1

Remove the dist directory from the project’s .gitignore file (it’s ignored by default by Yeoman).