Skip to content

Instantly share code, notes, and snippets.

View ian-cox's full-sized avatar

Ian Cox ian-cox

View GitHub Profile
@ian-cox
ian-cox / bookmarklet
Created November 25, 2013 21:46
Bookmarklet to click link based on ID
javascript:(function()%7Bwindow.onload=setTimeout(document.getElementById('idName').click(),1000);%7D)();
@ian-cox
ian-cox / .readme.md
Last active December 29, 2015 14:49
Vimeo/Youtube Kirbytext extension.

Vimeo/Youtube Kirbytext extension

Place this php file in the site/plugins folder of your kirby install. The plugin strips the video id from the end of both Vimeo and Youtube links.

Use the kirbytag like this:

(video: vimeo.com/79338229) (video: youtube.com/watch?v=0--NbrJX_xQ) (video: youtu.be/0--NbrJX_xQ)

@ian-cox
ian-cox / .zshrc
Created August 23, 2014 02:02
Update Kirby 2 (Core and Panel)
update() {
rm -rf kirby
git clone --recursive https://github.com/getkirby/kirby.git
rm -rf panel
git clone --recursive https://github.com/getkirby/panel.git
}
@ian-cox
ian-cox / _readme.md
Last active August 29, 2015 14:15
Minify Kirby HTML

Minify Kirby HTML

A temporary solution to minify Kirby's HTML output.

site.php should be placed in the root of your Kirby install.

In the "site" folder, create a new folder called library for the minify class. minify_html.php should be placed in /site/library/

Only a temporary solution untill I can find a cleaner way.

@ian-cox
ian-cox / fields.php
Created February 13, 2015 20:19
Adding panel fields to front end Kirby templates
<?php if($user = $site->user() and $user->hasRole('admin')):?>
<form autocomplete="off" class="form" method="post" action="/panel/api/pages/update/<?php echo kirby()->request()->path();?>">
<label class="label" for="form-field-title">Title</label>
<input autocomplete="on" class="input" id= "form-field-title" name="title" required="" type="title" value="<?php echo $page->title() ?>">
<input type="submit" value="Save">
</form>
<?php endif;?>
@ian-cox
ian-cox / index.html
Last active August 29, 2015 14:15
Basedrop Animated Logo
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 420 80" enable-background="new 0 0 420 80" xml:space="preserve">
<g id="baselogo">
<path fill="#345984" d="M22.3,16.1c10,0,15.6,5,15.6,12.5c0,4.2-2.1,7-5.3,8.8C40.4,39.5,44,44.6,44,50.9c0,8.5-7.1,15-16.7,15H11 l-0.4-0.4V16.4l0.4-0.4H22.3z M16.1,36.1h6.2c5.8,0,9.3-2.6,9.3-7.5c0-4.3-2.8-7.1-9.3-7.1h-6.2V36.1z M16.1,60.4h11.1 c6.4,0,10.5-3.8,10.5-9.5c0-5.4-4.1-9.3-10.5-9.3H16.1V60.4z" />
<path fill="#345984" d="M79.3,16.1l0.4,0.4l19.9,49.1l-0.4,0.4h-5.3l-0.4-0.4l-5.3-13H65.4l-5.3,13l-0.4,0.4h-5.3l-0.4-0.4 l19.8-49.1l0.4-0.4H79.3z M67.6,47H86l-9.3-23.4L67.6,47z" />
<path fill="#345984" d="M132.6,25.4c-2.2-2.9-4.3-4.6-7.7-4.6c-3.6,0-6.5,2.8-6.5,6.6c0,8.5,22.8,8.2,22.8,24 c0,8.6-7,15.6-15.6,15.6c-7.1,0-12.5-3.9-15-10.3l4-3.1h0.7c2.1,5.1,5.6,7.7,10.3,7.7c5.3,0,9.3-4.2,9.3-9.8 c0-10.8-22.9-10.3-22.9-24c0-6.8,5.6-12.4,12.8-12.4c5.7,0,10,3.2,12.5,7.5l-4.1,2.