Skip to content

Instantly share code, notes, and snippets.

View vipickering's full-sized avatar
🦧
Contemplating things

Vincent Pickering vipickering

🦧
Contemplating things
View GitHub Profile
@vipickering
vipickering / KirbyPostType
Created November 24, 2012 10:53
PHP: Kirby Post Type Detection
<?php foreach($page->children()->visible() as $article): ?>
<article>
<?php if($article->template() == 'article.text'): ?>
<!-- put the HTML for the text post here -->
<div>text post</div>
<?php elseif($article->template() == 'article.video'): ?>
<!-- put the HTML for the video post here -->
<div>video post</div>
<?php elseif($article->template() == 'article.image'): ?>
<!-- put the HTML for the image post here -->
@vipickering
vipickering / gist:6229427
Last active December 21, 2015 01:39
CSS:Image Replacement
ir{ border:0; font:0/0 a; text-shadow:none; color:transparent; background-color:transparent; }
@vipickering
vipickering / reset.css
Last active December 21, 2015 01:39
CSS: Reset
/* Reset
-------------------------------------------------- */
/* It is an intelligent reset, that gives the most flexible starting options. */
/* Code
-------------------------------------------------- */
html,body,div,span,applet,object,iframe, h1,h2,h3,h4,h5,h6,p,blockquote,pre,hr, a,abbr,address,cite,code, del,dfn,em,img,ins,kbd,q,s,samp, small,strong,sub,sup,tt,var, b,u,i, fieldset,form,label,legend, table,caption,tbody,tfoot,thead,tr,th,td, article,aside,canvas,details,figcaption,figure, footer,header,hgroup,menu,nav,section,summary, time,mark,audio,video{ margin:0; padding:0; }
article,aside,details,figcaption,figure,footer, header,hgroup,menu,nav,section{ display:block; }
@vipickering
vipickering / clear.scss
Last active December 21, 2015 01:39
SCSS: Float Clearing
// Fix clearing issues as per: nicolasgallagher.com/micro-clearfix-hack/ */
.group { zoom:1;
&:before { content:""; display:table; }
&:after { content:""; display:table; clear:both; }
}
@vipickering
vipickering / index.html
Last active December 21, 2015 01:39
HTML: Boilerplate
<!DOCTYPE html>
<html lang="en">
<head>
<title>Title Here</title>
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
<meta name="description" content=" ">
<meta name="author" content=" ">
@vipickering
vipickering / image-replacement.css
Last active December 21, 2015 01:39
CSS: Alternate Image Replacement
.hide-text {
text-indent: 100%;
white-space: nowrap;
overflow: hidden;
}
@vipickering
vipickering / style.css
Created August 17, 2013 09:14
CSS: Responsive CSS Stub
/* Desktop
-------------------------------------------------- */
/* Tablet (Portrait)
-------------------------------------------------- */
@media only screen and (min-width: 768px) and (max-width: 959px) {
}
@vipickering
vipickering / find-last-element-array.js
Last active December 21, 2015 07:49
Javascript: Find Last Element in Array
if (!Array.prototype.last){
Array.prototype.last = function(){
return this[this.length - 1];
};
};
//invoke via: array.last();
@vipickering
vipickering / sort.array.desc.js
Created August 19, 2013 21:27
Javascript: Sort Array Descending
myArray.sort(function(a,b){return b - a;});
@vipickering
vipickering / Preferences.sublime-settings
Created August 29, 2013 07:58
Sublime: Preferences
{
"bold_folder_labels": true,
"caret_style": "phase",
"color_scheme": "Packages/Monokai Extended/Monokai Extended.tmTheme",
"draw_indent_guides": true,
"draw_white_space": "selection",
"ensure_newline_at_eof_on_save": true,
"folder_exclude_patterns":
[
".git",