Skip to content

Instantly share code, notes, and snippets.

@conspirator
conspirator / Simplified HTML5 pushState
Created February 3, 2011 19:21
Just call hijack.init(); on document.ready.
var documentPathname = document.location.pathname,
hijack = {
history: $('html').hasClass('history'),
currentLocation: documentPathname,
firstLoad: 1,
init: function(){
var context = this;
// Normal link clicks
$('a').live('click',function(e){
context.firstLoad = 0;
@conspirator
conspirator / Facebook Like
Created October 3, 2011 15:22
I 'like' Facebook and its Like button. I 'dislike' the comment box that flies out when you click it. Here's a quick and easy fix. Boom!
/* hide the like button count */
.fb_edge_widget_with_comment iframe {
width:52px !important;
}
/* hide that pesky comment box */
span.fb_edge_comment_widget.fb_iframe_widget iframe {
display: none;
}
config.init({
meta: {
title: 'Premier Dental Implant Practices',
name: "Christopher Webb",
homepage: 'http://conspirator.co',
twitter: 'conspirator',
banner: '/* \n' +
' * \tAuthor:\t\t{{meta.name}}\n' +
' * \tWebsite:\t{{meta.homepage}}\n' +
' * \tTwitter:\thttp://twitter.com/{{meta.twitter}}\n' +
@conspirator
conspirator / Grunt Here
Created January 31, 2012 14:17
The following AppleScript opens up Terminal, navigates to the path of the active Finder window, opens that directory in Sublime Text 2, and finally kicks off Grunt.js.
-- ========================================
-- Author: Christopher Webb
-- Web: http://conspirator.co
-- Twitter: http://twitter.com/conspirator
-- ========================================
set finderPath to ""
tell application "Finder"
try
@conspirator
conspirator / index.html
Created February 3, 2012 18:27
Sticky element (absolute/fixed positioning)
<!DOCTYPE html>
<html lang="en-us">
<head>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>
<script>
function sticky_relocate() {
var window_top = $(window).scrollTop() || 0,
div_top = 200;
if (window_top > div_top) {
@conspirator
conspirator / index.html
Created February 12, 2012 21:06
I 'borrowed' this JavaScript from a page, and am tweaking it a bit. Pretty cool effect.
<html>
<head>
<title>Pixie</title>
</head>
<body style="background:#000;">
<canvas id="pixie" style="display:block;margin:50px auto;width:480px;"></canvas>
<script src="pixie.js"></script>
<script>
window.onload = function() {
canvas = document.getElementById('pixie');
@conspirator
conspirator / index.html
Created February 20, 2012 15:23
Sunology HTML issue
<li class="riteaid newjersey newyork oregon california massachusetts connecticut washington pennsylvania">
<a href="http://www.riteaid.com/" target="_blank">
<span class="logo"></span>
<span class="url">www.riteaid.com</span>
</a>
</li>
@conspirator
conspirator / index.html
Created February 20, 2012 15:34
Sunology: #featured-wrap expected HTML (notice no #slides-nav => It's generated dynamically)
<div id="featured-wrap" class="clearfix">
<div id="slides">
<a href="ourproducts.html"><img src="assets/images/slide1.png"></a>
<a href="#"><img src="assets/images/slide2.png"></a>
<a href="#"><img src="assets/images/slide3.png"></a>
</div>
<div id="featured">
<h3>Featured products</h3>
<ul>
<li class="clearfix">
/*
Christopher Webb
http://conspirator.co
http://twitter.com/conspirator
*/
/* Reset */
html,body,div,span,object,iframe,
@conspirator
conspirator / Asset.js
Created March 28, 2012 03:29
header('Content-type: application/json');
header('Content-type: application/json');