Skip to content

Instantly share code, notes, and snippets.

csalzman / rss.xml
Created Oct 14, 2019
Hugo RSS Implementation with Categories
View rss.xml
<rss version="2.0" xmlns:atom="">
<title>{{ if eq .Title .Site.Title }}{{ .Site.Title }}{{ else }}{{ with .Title }}{{.}} on {{ end }}{{ .Site.Title }}{{ end }}</title>
<link>{{ .Permalink }}</link>
<description>Recent content {{ if ne .Title .Site.Title }}{{ with .Title }}in {{.}} {{ end }}{{ end }}on {{ .Site.Title }}</description>
<generator>Hugo --</generator>{{ with .Site.LanguageCode }}
<language>{{.}}</language>{{end}}{{ with }}
<managingEditor>{{.}}{{ with $ }} ({{.}}){{end}}</managingEditor>{{end}}{{ with }}
<webMaster>{{.}}{{ with $ }} ({{.}}){{end}}</webMaster>{{end}}{{ with .Site.Copyright }}
<copyright>{{.}}</copyright>{{end}}{{ if not .Date.IsZero }}
View basic-grid-example.html
<!DOCTYPE html>
body {
display: grid;
grid-template-columns:1fr 1fr;
View whatdoesthisdo.html
<script type="text/javascript">
Walking through this page as a tutorial on how Javascripts object model works:
//Function for Employee creates a constructor for Employee objects
function Employee() { = "";
this.dept = "General";
csalzman / ridebetter.js
Last active Sep 14, 2016
Make The Ride's Live Maps So Much Better
View ridebetter.js
//Use this on The Ride's Live Maps page:
//Find an extension or plugin that let's you run your own javascript on a page
//I'm using "Custom JavaScript for websites" in Chrome.
//Replace the array with the route numbers you care about. Just the number
var routesYouCareAbout = [65, 23];
View addlinks.js
csalzman / gist:3778562
Created Sep 24, 2012
Sample Book Ad Placement
View gist:3778562
<a href="..."><img src="..."></a> <br>
<a href="...">Buy it now!</a><br>
csalzman / explanation
Created Aug 23, 2012
Build Silverpop Rulesets
View explanation
Silverpop uses xml rulesets to display dynamic content in emails. When you have the content already created elsewhere, it can be a pain to create rulesets with more than one rule. This script goes out of its way to remove you from having to touch xml, instead opting for building the ruleset based on parameters in objects.
Mainly gisting this for retrieval later on by myself, however, if you want help using it contact me.
csalzman / svg-randomize.html
Created May 22, 2012
Randomize the points and locations of an svg polygon
View svg-randomize.html
<script src=""></script>
<button id="click"/>Generate your spirit animal</button>
<polygon id="polygon" points="200,10 250,190 160,210" fill="green" stroke="black" stroke-width="1"/>
View end.rb
module End
class End
def initialize
@end = 'end'
def end(end_end)
return @end