Skip to content

Instantly share code, notes, and snippets.

View meancode's full-sized avatar
🏠
Working from home

Ken Edwards meancode

🏠
Working from home
View GitHub Profile
<!doctype html>
<html>
<head>
<!-- Run in full-screen mode. -->
<meta name="mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-capable" content="yes">
<!-- Make the status bar black with white text. -->
<meta name="apple-mobile-web-app-status-bar-style" content="black">
@meancode
meancode / asset_insertion.html
Created March 6, 2012 01:56
Asset Insertion template module
<mt:Ignore>Asset Insertion template module</mt:Ignore>
<mt:Ignore>Modified Ken Edwards 03/05/2012 8:30p EST</mt:Ignore>
<mt:Asset id="$asset_id">
<mt:if tag="AssetType" eq="image">
<mt:SetVarBlock name="width" trim="1">
<mt:AssetProperty property="image_width">
</mt:SetVarBlock>
<mt:if name="width" gt="640">
<mt:SetVarBlock name="href"><mt:AssetThumbnailURL width="640" height="640"></mt:SetVarBlock>
@meancode
meancode / disqus-javascript.js
Created September 26, 2011 16:52
Disqus Movable Type JavaScript
<div id="story-comments">
<div id="comments" class="comments">
<h3>Reader Comments (<script type='text/javascript' src='http://disqus.com/forums/yourshortname/get_num_replies_for_entry.js?url=<mt:EntryLink>index.php'></script><noscript>View</noscript>)</h3>
<div id="comments-list">
<div class="comments-content">
<div id="disqus_thread"></div>
<script type="text/javascript">
/* * * CONFIGURATION VARIABLES: EDIT BEFORE PASTING INTO YOUR WEBPAGE * * */
@meancode
meancode / authenticate.php
Created May 9, 2011 16:34
Authenticate Template Module
<?php
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "<$mt:AdminCGIPath$><$mt:CommentScript$>?__mode=session_js&blog_id=<mt:BlogID>&jsonp=mtSetUserOrLogin");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_COOKIE, $_SERVER["HTTP_COOKIE"]);
$json = curl_exec($ch) or die("Cannot connect to MT!");
curl_close($ch);
$json = substr($json, 17, strlen($json)-20);
$session = json_decode($json, true);
if ($session['can_post'] == 0) {
@meancode
meancode / asset_insertion.mtml
Created April 21, 2011 00:14
Asset Insertion
<mt:Asset id="$asset_id"><mt:if tag="AssetType" eq="image"><MTSetVarBlock name="width" trim="1"><MTAssetProperty property="image_width"></MTSetVarBlock><mt:if name="width" gt="640">
<mt:setvarblock name="href"><mt:AssetThumbnailURL width="640"></mt:setvarblock></mt:if><mt:unless name="href"><mt:setvarblock name="href"><mt:var name="a_href"></mt:setvarblock></mt:unless><mt:var name="form_tag"><div class="article-image" style="text-align: left; width: <mt:var name="img_width">px;<mt:If name="align" eq="left"> float: left; margin-right: 10px;</mt:If><mt:If name="align" eq="right"> float: right; margin-left: 10px;</mt:If><mt:If name="align" eq="center"> margin: 0px auto;</mt:If>"><a rel="lightbox" href="<mt:var name="href">" title="<mt:var name="caption" escape="html"> (click to enlarge)"><mt:var name="img_tag"></a><mt:if var="description" ne=""><p class="credit"><mt:var name="description"></p></mt:if><mt:if var="caption" ne=""><p class="caption"><mt:var name="caption"></p></mt:if></div><mt:if name="enclose"></fo
@meancode
meancode / main_index.html
Created December 12, 2010 04:35
html5boilerplate-960grid-movabletype
<!DOCTYPE html>
<!--[if lt IE 7 ]> <html lang="en" class="no-js ie6"> <![endif]-->
<!--[if IE 7 ]> <html lang="en" class="no-js ie7"> <![endif]-->
<!--[if IE 8 ]> <html lang="en" class="no-js ie8"> <![endif]-->
<!--[if IE 9 ]> <html lang="en" class="no-js ie9"> <![endif]-->
<!--[if (gt IE 9)|!(IE)]><!--> <html lang="en" class="no-js" xmlns:og="http://opengraphprotocol.org/schema/" xmlns:fb="http://www.facebook.com/2008/fbml" xmlns:fb="http://developers.facebook.com/schema/"> <!--<![endif]-->
<head profile="http://gmpg.org/xfn/11">
<meta charset="<$mt:PublishCharset$>">
@meancode
meancode / apple-touch-startup-image.php
Created December 10, 2010 20:25
Serve correct apple-touch-startup-image
<?php
function is_android(){
return strstr($_SERVER['HTTP_USER_AGENT'], 'Android');
}
function is_ipad(){
return strstr($_SERVER['HTTP_USER_AGENT'], 'iPad');
}
if (is_android()){
//Android 1.x User
echo ' <link rel="apple-touch-icon-precomposed" href="<$mt:BlogURL$>apple-touch-icon-precomposed.png"/>';
<?php
$username = 'namehere';
$password = 'passhere';
$url = '<$mt:EntryPermalink$>'; // This would be for Movable Type
$format = 'simple';
$api_url = 'http://domain.com/yourls-api.php';
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $api_url);
curl_setopt($ch, CURLOPT_HEADER, 0); // No header in the result
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); // Return, do not echo result
<div class="textarea-wrapper"><input type="text" name="<mt:var name="field_name">" id="<mt:var name="field_id">" value="<mt:var name="field_value">" class="full-width" autocomplete="off" mt:watch-change="1" /></div>
<mt:ignore>
This template module is responsible for outputing the associated image with the current
photo/entry in context. You can pass in the max_size parameter to control the size of
the image.
Example:
<mt:getvar name="photo" max_size="90">
</mt:ignore>
<MTSetVarTemplate name="photo">