Skip to content

Instantly share code, notes, and snippets.

@robsonsobral
robsonsobral / pageant-autoload-keys-at-startup.txt
Created January 21, 2019 23:13 — forked from chunter/pageant-autoload-keys-at-startup.txt
Make Pageant autoload keys at startup
To make Pageant automatically run and load keys at startup:
- Find the location of pageant.exe
- Windows key + R to open the 'run' dialog box
- Type: 'shell:startup' in the dialog box
- Create a shortcut to the pageant.exe and put into this startup folder.
@robsonsobral
robsonsobral / gist:1df6bb51ef0c04dc5fcc0afd5b36bddf
Created January 9, 2019 18:32
Hugo query string cachebusting
<script src="{{ $script.RelPermalink }}?mtime={{ (os.Stat "/static/scripts/index.js" ).ModTime.Unix }}"></script>
function getQueryString() {
var url = arguments.length > 0 && arguments[0] !== undefined ?
arguments[0] :
window.location.search;
var queryString = url.indexOf('?') !== -1 ?
url.split('?')[1] :
url;
var queries = queryString.indexOf('&') !== -1 ?
@robsonsobral
robsonsobral / _redirects
Created November 24, 2018 15:48
SPA redirect
/* /index.html 200
@robsonsobral
robsonsobral / .gitignore
Created November 19, 2018 00:14
GitIgnore folder content
# Ignore everything in this directory
*
# Except this file
!.gitignore
{{ with .Lastmod }}
<meta http-equiv="Last-Modified" content="{{ .Format "2006-01-02T15:04:05-0700" }}" />
{{ end }}
{{ $packageJson := getJSON "./package.json" }}
{{ with $packageJson.version }}
<meta name="version" content="{{ . }}">
{{ end }}
@robsonsobral
robsonsobral / example.html
Last active July 20, 2018 01:14 — forked from raulmangolin/example.html
postMessage example
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>postMessage Example</title>
<script type="text/javascript">
var popup;
function openWindow(){
/*
This function will take the scripts specified and load them in order
asynchronously. It will not continue until the specified type from
each file is loaded.
*/
(function () {
function loadScripts () {
/*
This loadScript function takes the name of the object as it
@robsonsobral
robsonsobral / hugoMarkdownBlock.html
Created December 18, 2017 22:11
hugoMarkdownBlock
{{ $markdown := . | markdownify }}
{{ if not ( strings.Contains $markdown "<p>" ) }}
<p>{{ $markdown }}</p>
{{ else }}
{{ $markdown }}
{{ end }}
@robsonsobral
robsonsobral / unused_img.sh
Created September 4, 2017 16:04
Delete unused image files
#!/bin/bash
if [ $# -eq 0 ]
then
echo "Please supply paths to search under"
exit 1
fi
IMG_PATH=$1
HTML_AND_CSS_PATH=$2