Skip to content

Instantly share code, notes, and snippets.

View jnthnclrk's full-sized avatar

Jonathan Clarke jnthnclrk

View GitHub Profile
@nacin
nacin / p2-qa-comments.php
Created August 13, 2011 22:44
P2 Q&A Comments
<?php
/* Plugin Name: P2 Q&A Comments
* Description: Allows you to mark P2 comments as +1/-1 and as answered. Ideal for live Q&A sessions.
* Author: Andrew Nacin
* Author URI: http://andrewnacin.com/
*/
/* WARNING about studying and copying this code:
*
* P2 is not currently an ideal platform for developing extensions. Some of this
@lou
lou / gmap-fullscreen.js
Created January 2, 2012 12:10
Google map Fullscreen with jQuery
$(function() {
var map = new google.maps.Map(document.getElementById("map_canvas"), {});
var newyork = new google.maps.LatLng(40.69847032728747, -73.9514422416687);
var googleMapWidth = $("#map_canvas").css('width');
var googleMapHeight = $("#map_canvas").css('height');
map.setCenter(newyork);
$('#enter-full-screen').click(function(){
@rocketslide
rocketslide / Notes:
Created April 18, 2012 16:51
Creating a custom login form for Basecamp
The Account ID is different from the number in your account URL.
To get the Account ID, log out of Basecamp, and then go to your Basecamp address again.
This will redirect you to a launchpad address like:
https://launchpad.37signals.com/basecamp/######/signin
That ###### is your Account ID.
This form will not work for Basecamp Classic. We have info on login forms for our other products:
@JimWestergren
JimWestergren / index-with-redis.php
Last active February 11, 2023 18:28
Redis as a Frontend Cache for WordPress
<?php
/*
Author: Jim Westergren & Jeedo Aquino
File: index-with-redis.php
Updated: 2012-10-25
This is a redis caching system for wordpress.
see more here: www.jimwestergren.com/wordpress-with-redis-as-a-frontend-cache/
@studiopress
studiopress / custom-viewport.php
Last active January 1, 2020 04:41
Add viewport meta tag.
<?php
//* Do NOT include the opening php tag shown above. Copy the code shown below.
//* Add custom Viewport meta tag for mobile browsers
add_action( 'genesis_meta', 'sp_viewport_meta_tag' );
function sp_viewport_meta_tag() {
echo '<meta name="viewport" content="width=device-width, initial-scale=1.0"/>';
}
@cleverdevil
cleverdevil / markdown-to-email
Created January 4, 2014 01:06
markdown-to-email A simple script to send beautifully formatted emails that you write in Markdown. The email will have an HTML payload and a plain-text alternative, so you'll make everyone happy, including yourself.
#!/usr/bin/env python
'''
Send an multipart email with HTML and plain text alternatives. The message
should be constructed as a plain-text file of the following format:
From: Your Name <your@email.com>
To: Recipient One <recipient@to.com>
Subject: Your subject line
---
@gruber
gruber / make_bookmarklet.pl
Last active May 5, 2024 21:11
JavaScript Bookmarklet Builder
#!/usr/bin/env perl
#
# http://daringfireball.net/2007/03/javascript_bookmarklet_builder
use strict;
use warnings;
use URI::Escape qw(uri_escape_utf8);
use open IO => ":utf8", # UTF8 by default
":std"; # Apply to STDIN/STDOUT/STDERR