Skip to content

Instantly share code, notes, and snippets.

View irwinwilliams's full-sized avatar

Irwin irwinwilliams

View GitHub Profile
@irwinwilliams
irwinwilliams / gh-pages-deploy.md
Created April 10, 2016 00:23 — 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).

@irwinwilliams
irwinwilliams / ImgToBase64.ps1
Created October 29, 2019 19:15 — forked from colinMac/ImgToBase64.ps1
Powershell script to convert an image to base64 data uri format and store in a text file
function ImageToBase64 {
Param([String]$path)
[bool]$valid = ($path -ne "")
if ($valid) {
[String[]]$elements = $path.split(".")
[int]$max = $elements.Count - 1
[String]$ext = $elements[$max]
[String]$uri = "data:image/$($ext);base64,"
$elements[$max] = "txt"