Skip to content

Instantly share code, notes, and snippets.

@sashtown
sashtown / reset.css
Created May 8, 2012 06:32
My personal CSS Reset with box-sizing
* {
margin: 0;
padding: 0;
border: 0;
background-repeat: no-repeat;
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
}
article, aside, details, figcaption, figure,
@sashtown
sashtown / linear-gradient.css
Created July 7, 2012 12:20
Linear gradient syntax
section.linear-gradient {
background-color: #333333;
background-image: -webkit-gradient(linear, left top, left bottom, from(#333333), to(#999999)); /* Saf4+, Chrome */
background-image: -webkit-linear-gradient(top, #333333, #999999); /* Chrome 10+, Saf5.1+, iOS 5+ */
background-image: -moz-linear-gradient(top, #333333, #999999); /* FF3.6+ */
background-image: -ms-linear-gradient(top, #333333, #999999); /* IE10 */
background-image: -o-linear-gradient(top, #333333, #999999); /* Opera 11.10+ */
background-image: linear-gradient(to bottom, #333333, #999999);
}
@sashtown
sashtown / animation.css
Created July 9, 2012 12:25
CSS3 Animation shorthand syntax
/*** You don't need a -ms-prefix for IE10. [http://msdn.microsoft.com/en-us/library/ie/hh673530(v=vs.85).aspx] ***/
.my-animation {
-webkit-animation: my-animation 2s 0.5s 1 ease-in-out normal both;
-moz-animation: my-animation 2s 0.5s 1 ease-in-out normal both;
-o-animation: my-animation 2s 0.5s 1 ease-in-out normal both;
animation: my-animation 2s 0.5s 1 ease-in-out normal both;
}
/*** Single values in this case (prefix-free). ***/
@sashtown
sashtown / gist:3527146
Created August 30, 2012 11:58
Sublime Text 2 - Awesome Shortcuts (Windows)

Sublime Text 2 – Awesome Shortcuts for Windows

Basics

CTRL+⇧+P show/hide command palette
CTRL+KB show/hide sidebar
CTRL+ALT+Down add next line
ALT+F3 add all occurrences of the current word to the selection
@sashtown
sashtown / kirby.fetching-pix.php
Created October 31, 2012 15:30
Kirby: Fetching all pix of a folder
<ul>
<? $image = $pages->find('home/slider'); ?>
<? $images = $image->images(); ?>
<? foreach($images as $image): ?>
<li>
<img src="<?php echo $image->url() ?>" alt="<?php echo $image->title() ?>" />
</li>
<?php endforeach ?>
</ul>
@sashtown
sashtown / gist:4040280
Created November 8, 2012 17:36
Kirby: How to display the search query item and the count of results
<?php if($results): ?>
<h1>
<?php echo $results->pagination->countItems() ?>
<?php if($results->pagination->countItems()=='1'): ?> result
<?php else: ?> results
<?php endif ?>
for <em><?php echo $search->query() ?></em>
</h1>
<?php endif ?>
@sashtown
sashtown / kirby-static-tweet.php
Created November 8, 2012 22:35
A simple, static Tweet button/link in Kirby.
<a class="button" href="https://twitter.com/intent/tweet?source=webclient&text=<?php echo rawurlencode($page->title()); ?>%20<?php echo rawurlencode ($page->url()); ?>%20<?php echo ('via @your_account')?>" target="blank" title="Tweet this">Tweet</a>
@sashtown
sashtown / article.video.php
Created November 9, 2012 19:21
Kirby: Video post template
<article>
<div class="video">
<?php if($article->video() == 'youtube'): ?>
<iframe src="http://www.youtube.com/embed/<?php echo $article->video_id(); ?>" frameborder="0" allowfullscreen></iframe>
<?php else: ?>
<iframe src="http://player.vimeo.com/video/<?php echo $article->video_id(); ?>" frameborder="0" allowfullscreen></iframe>
<?php endif ?>
</div>
<?php echo kirbytext($article->text()) ?>
<footer class="meta"> <!-- Your fancy article meta markup --> </footer>
@sashtown
sashtown / about.txt
Created November 26, 2012 13:13
Kirby: Adding icon fonts to the navigation
title: About
----
description: My awesome about site
----
icon: &#xe007;
@sashtown
sashtown / st2-prefs
Last active October 26, 2015 06:38
My Sublime Text 2 Preferences
{
"bold_folder_labels": true,
"caret_style": "phase",
"color_scheme": "Packages/Tomorrow Color Schemes/Tomorrow-Night.tmTheme",
"font_face": "Source Code Pro",
"font_size": 15.0,
"highlight_line": true,
"line_padding_bottom": 4,
"tab_size": 4,
"translate_tabs_to_spaces": true,