Skip to content

Instantly share code, notes, and snippets.

module End
class End
def initialize
@end = 'end'
end
def end(end_end)
return @end
end
end
end
@csalzman
csalzman / svg-randomize.html
Created May 22, 2012 19:12
Randomize the points and locations of an svg polygon
<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"/>
@csalzman
csalzman / explanation
Created August 23, 2012 17:58
Build Silverpop Rulesets
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 / gist:3778562
Created September 24, 2012 21:37
Sample Book Ad Placement
<a href="..."><img src="..."></a> <br>
<a href="...">Buy it now!</a><br>
<p>Description</p>
@csalzman
csalzman / addlinks.js
Created December 8, 2012 23:00
Add Links
@csalzman
csalzman / ridebetter.js
Last active September 14, 2016 18:02
Make The Ride's Live Maps So Much Better
//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];
<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";
<!DOCTYPE html>
<html>
<head>
<style>
body {
display: grid;
grid-template-columns:1fr 1fr;
}
header,
@csalzman
csalzman / rss.xml
Created October 14, 2019 16:21
Hugo RSS Implementation with Categories
<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 }}