Skip to content

Instantly share code, notes, and snippets.

View waynesutton's full-sized avatar

Wayne Sutton waynesutton

View GitHub Profile
@niallsmart
niallsmart / copy-checklist.js
Last active December 28, 2023 00:10
Copy Trello checklist to clipboard
copy($(".checklist-item:not(.checklist-item-checked)").map(function() {
var e = $(this),
item = e.find(".checklist-item-details-text").text()
if (e.hasClass("checklist-item-state-complete")) {
item = item + " (DONE)"
}
return item
}).get().join("\n"))
@mhawksey
mhawksey / functions.php
Created May 13, 2013 14:39
Snippet to add intercom.io code to your wordpress theme functions.php
<?php
function add_intercom() {
if ( is_user_logged_in() ) {
global $current_user;
get_currentuserinfo();
?>
<script id="IntercomSettingsScriptTag">
window.intercomSettings = {
@ndarville
ndarville / business-models.md
Last active January 13, 2024 17:27
Business models based on the compiled list at http://news.ycombinator.com/item?id=4924647. I find the link very hard to browse, so I made a simple version in Markdown instead.

Business Models

Advertising

Models Examples
Display ads Yahoo!
Search ads Google
@jasonclark
jasonclark / booklist.css
Last active May 6, 2019 05:52
booklist CSS - display as table row
<style type="text/css">
.items {display:table;list-style:none;margin:0;padding:0;border-spacing:5px;}
.items li {display:table-row;border-radius:10px;border:1px solid #ccc;padding:5px;margin:0 0 10px 0;}
.items li img {display:table-cell;vertical-align:top;}
.items li span.meta {display:table-cell;vertical-align:top;margin:0;padding:0 0 0 5px;}
.items li {margin:0 0 5px 0;}
</style>
@mhammonds
mhammonds / HideMobileAddressBar.js
Created September 3, 2011 03:23
Hide Browser Address Bar - Android + iPhone
function hideAddressBar()
{
if(!window.location.hash)
{
if(document.height < window.outerHeight)
{
document.body.style.height = (window.outerHeight + 50) + 'px';
}
setTimeout( function(){ window.scrollTo(0, 1); }, 50 );
@robbiet480
robbiet480 / directions_example.html
Created September 1, 2011 07:30
This HTML file contains Javascript code to detect location and redirect to Google Maps. Useful to tell people when they call asking for directions "go to http://robbiet.us/directions/" and it will auto direct them based on Geolocation. Uses Modernizr
<!DOCTYPE html>
<html>
<head>
<title>Directions Example</title>
<script type="text/javascript" src="http://cdnjs.cloudflare.com/ajax/libs/modernizr/2.0.6/modernizr.min.js"></script>
<script type="text/javascript">
//Ask for HTML5 geolocation, use Modernizr to detect if we can even do it. If allow, go to show_map, if deny go to handle_error. Please note the High Accuracy flag, which may cause the location fix to take longer, but it gives a more precise reading
function get_location() {
if (Modernizr.geolocation) {
navigator.geolocation.getCurrentPosition(show_map, handle_error, {maximumAge: 75000, enableHighAccuracy: true});