This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php snippet('header', array('section' => 'journal', 'title' => $page->title(), 'customdesc' => $page->text())); ?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Provides a device_scale class on iOS devices for scaling user | |
// interface elements relative to the current zoom factor. | |
// | |
// http://37signals.com/svn/posts/2407-device-scale-user-interface-elements-in-ios-mobile-safari | |
// Copyright (c) 2010 37signals. | |
// Slightly optimized by Mathias Bynens <http://mathiasbynens.be/> | |
// | |
// Permission is hereby granted, free of charge, to any person obtaining a copy | |
// of this software and associated documentation files (the "Software"), to deal | |
// in the Software without restriction, including without limitation the rights |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env perl | |
# Description: http://daringfireball.net/2010/08/open_urls_in_safari_tabs | |
# License: See below. | |
# http://gist.github.com/507356 | |
use strict; | |
use warnings; | |
use URI::Escape; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# test | |
# A script to calculate some basic stats on Grant Hutchinson's haircuts. | |
# See http://splorp.com/about/haircut/ | |
# | |
# Sample output: | |
# Number of haircuts since December 22, 1998: 53 | |
# Average days between haircuts: 77 | |
# Shortest time between haircuts was April 10, 1999 to May 25, 1999 (45 days) | |
# Longest time between haircuts was August 11, 2007 to December 09, 2007 (120 days) | |
# You'll probably want a haircut in about 63 days (March 08, 2010) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<meta name="description" content="<?php echo $page->description()->or($site->description()) ?>"> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Mirroring homepage.mac.com sites to mirrors.unna.org: | |
1) Use `wget` to pull down a copy of the site. If pulling down a single file & all its prerequisites, use the following: | |
/usr/local/bin/wget -p --mirror -k -t 30 -w 5 -e robots=off -o homepage.mac.com-splorp.$(date +%Y-%m-%d-%H%M).log "http://homepage.mac.com/splorp/PhotoAlbum3.html" & | |
Alternatively, if pulling down an entire directory, use the following (Note: _make sure_ you include the trailing slash on the directory name!): | |
/usr/local/bin/wget --mirror -k -t 30 -w 5 -e robots=off -o homepage.mac.com-splorp.$(date +%Y-%m-%d-%H%M).log "http://homepage.mac.com/splorp/" & |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function uf_getLastDir($sUrl) | |
{ | |
$sPath = parse_url($sUrl, PHP_URL_PATH); // parse URL and return only path component | |
$aPath = explode('/', trim($sPath, '/')); // remove surrounding "/" and return parts into array | |
end($aPath); // last element of array | |
if (is_dir($sPath)) // if path points to dir | |
return current($aPath); // return last element of array | |
if (is_file($sPath)) // if path points to file | |
return prev($aPath); // return second to last element of array | |
return false; // or return false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Found this tip in comment here: http://www.tipb.com/2011/01/04/tipb-bug-home-button-working-iphone/ | |
1.) Open any application | |
2.) Press and hold the power button until the slide to shutdown swipe bar appears. | |
3.) Release Power button | |
4.) Press and hold Home button Lightly | |
until screen returns to icon screen |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Distribute all stickies evenly on the main screen, with optional padding | |
# how many columns? | |
set num_columns to 7 | |
# how many pixels of padding between the stickies? | |
set padding to 20 | |
# Find the dimensions of the main screen | |
# https://stackoverflow.com/questions/1866912/applescript-how-to-get-current-display-resolution |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Kirby site config file | |
// site/config/config.php | |
return [ | |
'routes' => [ | |
[ | |
// This sets up two different URLs as an array that will | |
// return the JSON Feed representation of a page in Kirby | |
'pattern' => ['feed', 'some-other-path/feed'], | |
'action' => function() { |
OlderNewer