Skip to content

Instantly share code, notes, and snippets.

@csalzman
csalzman / rss.xml
Created Oct 14, 2019
Hugo RSS Implementation with Categories
View rss.xml
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
<channel>
<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 -- gohugo.io</generator>{{ with .Site.LanguageCode }}
<language>{{.}}</language>{{end}}{{ with .Site.Author.email }}
<managingEditor>{{.}}{{ with $.Site.Author.name }} ({{.}}){{end}}</managingEditor>{{end}}{{ with .Site.Author.email }}
<webMaster>{{.}}{{ with $.Site.Author.name }} ({{.}}){{end}}</webMaster>{{end}}{{ with .Site.Copyright }}
<copyright>{{.}}</copyright>{{end}}{{ if not .Date.IsZero }}
View basic-grid-example.html
<!DOCTYPE html>
<html>
<head>
<style>
body {
display: grid;
grid-template-columns:1fr 1fr;
}
header,
View whatdoesthisdo.html
<script type="text/javascript">
/*
Walking through this page as a tutorial on how Javascripts object model works:
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Details_of_the_Object_Model#Class-Based_vs._Prototype-Based_Languages
*/
//Function for Employee creates a constructor for Employee objects
function Employee() {
this.name = "";
this.dept = "General";
@csalzman
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:
//http://www.theride.org/Schedules-Maps-and-Tools/Live-Maps
//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
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>
<p>Description</p>
@csalzman
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
csalzman / svg-randomize.html
Created May 22, 2012
Randomize the points and locations of an svg polygon
View svg-randomize.html
<html>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
<body>
<button id="click"/>Generate your spirit animal</button>
<p>
<svg>
<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'
end
def end(end_end)
return @end
end
end
end