Skip to content

Instantly share code, notes, and snippets.

View OscarGodson's full-sized avatar
:shipit:
Workin'

Oscar Godson OscarGodson

:shipit:
Workin'
  • CTO
  • Portland, OR
  • 15:54 (UTC -07:00)
View GitHub Profile
<?php if(!is_front_page()){ ?>
<script>/* the breadcrumb code */</script>
<?php } ?>
header(“Pragma: no-cache”);
header(“cache-Control: no-cache, must-revalidate”);
header(“Expires: Mon, 26 Jul 1997 05:00:00 GMT”);
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
$(window).scroll(function(e){
$fixed = $('.fixed');
if ($(this).scrollTop() > 300 && $fixed.css('position') != 'fixed'){
$fixed.css({'position': 'fixed', 'top': '0px'});
}
});
jQuery(function(){
jQuery('.lcp_catlist li a')
//Set up the imgs for the green overlay
.find('img').css({
position:'relative',
zIndex:'1',
height: '120px',
width: '120px'
})
//Back to the <a>s
/**
* parseTemplate takes a string and a JS Object and returns a string with template
* replaced with content you provided. Template tags look like: {{tag}}
* @param {String} s This is the string to search for tags in.
* @param {Object} j This is the JS object that contains a key=>value pair for the tag and what to be replaced
* @returns {String} returns the modified string with the content you provided in replacement of the tags
* @example var html = parseTemplate('Hey, {{name}}',{ name:'John' }); //returns "Hey, John"
*/
var parseTemplate = function(s,j){
for(x in j){ var r = new RegExp('{{'+x+'}}','g'); s = s.replace(r,j[x]); }
@OscarGodson
OscarGodson / makemyvideobigger.js
Created June 20, 2011 18:07
Tumblr + Vimeo Mod To Make Videos Larger Than 500
/**
* Makes Vimeo videos on Tumblr larger than the max of 500px that Tumblr forces
* Change the 650 to whatever you want, but do NOT add px or %
* The height, by default, is set to auto which will calculate the 16:9 video size.
* You can set the height to a static number as well if you want.
* If you have any questions feel free to ask me: @oscargodson | oscargodson.com
*/
(function(){
var iframes = document.body.getElementsByTagName('iframe')
, newVimeoWidth = 650
var str = "" +
"First line goes here" +
"Second line goes here" +
"and now the third" +
"and hell, let's throw in this line" +
"while we're at it" +
"";
var parseTemplate = function(s,j){
for(x in j){ var r = new RegExp('{{'+x+'}}','g'); s = s.replace(r,j[x]); }
return s;
}