Skip to content

Instantly share code, notes, and snippets.

View danott's full-sized avatar
📈
Chart with upward trend

Dan Ott danott

📈
Chart with upward trend
View GitHub Profile
@danott
danott / pi.post_to_tumblr.php
Created June 14, 2010 01:32
Post to Tumblr from Expression Engine using the Tumblr API
<?php
/* Daniel Ott
* 13 June 2010
* A plugin that you can use to send stuff to Tumblr from Expression Engine
* using Tumblr's API
*
* Very minimal for right now. You could expand it to send categories using
* the API's "tags" option, send different types of posts, etc.
*
@danott
danott / export_to_moveable_type.tumblr
Created June 14, 2010 13:11
Export from Tumblr to Moveable Type
<textarea rows="40" cols="100">{block:Posts}
TITLE: {block:Title}{Title}{/block:Title}
DATE: {block:Date}{MonthNumberWithZero}/{DayOfMonthWithZero}/{Year} {12HourWithZero}:{Minutes}:{Seconds} {CapitalAmPm}{/block:Date}
-----
{block:Text}BODY:
{Body}
--------
-----
--------{/block:Text}{block:Photo}
BODY:
@danott
danott / moveable_type.ee.php
Created June 14, 2010 20:14
Export EE entires to Moveable Type format.
{!--
Expression Engine Template code to export entries in Moveable Type format
TODO: Categories, commments, author, etc.
--}
{exp:weblog:entries weblog="default_blog" limit="999" show_future_entries="yes" category="21"}
TITLE: {title}
DATE: {entry_date format="%m/%d/%Y %h:%i:%s %A"}
{if excerpt}-----
EXCERPT:
{excerpt}
/* Fold Header
* A fancy h1 header that appears to fold over the top of the page
*/
/* <h1 id="fold_header" class="column grid_4 overflow-visible {my_color}-background-color">{my_cat_title} <span class="arrow"></span></h1> */
#fold_header {
padding: 10px 20px;
position: relative;
font-size:16px;
/* Animation that rotates the logo */
@-webkit-keyframes spin-logo
{
0% { -webkit-transform: scale(1); }
50% { -webkit-transform: scale(.98); }
100% { -webkit-transform: scale(1); }
}
.selector {
-webkit-animation-name: spin-logo;
/*
* WEBKIT SCROLLBARS
*
* Testing the waters with this code...
* Technique found on http://elliottkember.com
*/
::-webkit-scrollbar {
width: 6px;
height: 6px;
@danott
danott / time_of_day.css
Created October 7, 2010 13:15
CSS to style the page based on the time of day.
/*!
* time_of_day.css
* Time Sensitive CSS
* @danott in reply to @kalebheitzman's tweet http://twitter.com/#!/kalebheitzman/status/26639173336
*
* Here is a basis of class names for how I would approach a time-sensitive CSS stylesheet.
*
* Along with these classnames, I'd use side-by-side PHP and Javascript functions to add classes to
* the body element of your html document.
*/
@danott
danott / youversion_abbreviations.js
Last active December 24, 2022 15:11
YouVersion.com URL Abbreviations
/*!
* youversion_abbreviations.js
* JSON of YouVersion.com Bible Book URL Abbreviations.
*/
var books = {
'gen': 'Genesis',
'exo': 'Exodus',
'lev': 'Leviticus',
'num': 'Numbers',
'deu': 'Deuteronomy',
/* While implementing shorturls, I wanted to make the url easily copyable.
* To do this, I placed it in a text input field, that was styled like the copy text
* of the page. To ease the copying process, I wanted to select the entire contents
* of the text on focus. Webkit browser would select on focus, but would then quickly deselect.
* This is the workaround I came up with. */
// Meant to select <input type="text" class="short-url" value="http://danott.us/s/123" />
$(".short-url").focus(function(e){
this.select();
}).mouseup(function(e){
@danott
danott / on-this-page.js
Created October 29, 2010 16:17
An idea for generating navigation based on header tags.
/*
* ON THIS PAGE
* an idea for generating heirarchy from P.O.S.H.
*/
on_this_page = $("#on-this-page");
$("#page h2").each(function(index,element){
element = $(element);
id = element.attr('id');