Skip to content

Instantly share code, notes, and snippets.

View heytomsmith's full-sized avatar

Tom Eberhardt-Smith heytomsmith

View GitHub Profile
<!--A VERY SPICY ANALYTICS-->
<script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','https://www.google-analytics.com/analytics.js','ga');
ga('create', 'UA-76139961-1', 'auto');
ga('send', 'pageview');
@heytomsmith
heytomsmith / index.html
Last active December 8, 2015 20:34
Samuel C. Allen Markup
<!doctype html>
<html>
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=0, minimum-scale=1.0, maximum-scale=1.0" /><!-- Responsive on mobile -->
<title>Samuel C. Allen - Web Developer</title>
<link rel="stylesheet" type="text/css" href="style.css"><!--Singular-->
<style>
a,a:visited {
@heytomsmith
heytomsmith / slugify.js
Created November 13, 2015 17:56
Create unique tumblr ID based on permalink slug
function slugify() {
function removeBaseURL(url) {
return url.substring(url.lastIndexOf('/') + 1);
}
function convertToSlug(text) {
return text.toLowerCase()
.replace(/ /g, '-')
.replace(/[^\w-]+/g, '');
@heytomsmith
heytomsmith / getpostdata.js
Last active November 13, 2015 15:48
Get Tumblr Post Data
function getNotes(id){ // Example function, can be getWhateverYouWant()
var blogName = 'YOUR_BLOG_URL'; // something.tumblr.com
var apiKey = 'YOUR_API_KEY'; // Obtained from tumblr
return $.ajax({
type: 'GET',
url: 'http://api.tumblr.com/v2/blog/'+blogName+'/posts?id='+id+'&api_key='+apiKey,
data: {
get_param: 'value'
},