Skip to content

Instantly share code, notes, and snippets.

View Ahrengot's full-sized avatar
🤟

Jens Ahrengot Boddum Ahrengot

🤟
View GitHub Profile
@Ahrengot
Ahrengot / index.html
Created March 6, 2012 10:29
basic HTML5 document
<!doctype html>
<html class="no-js" xmlns:og="http://ogp.me/ns#" xmlns:fb="http://www.facebook.com/2008/fbml" lang="en-US">
<head>
<meta charset="utf-8">
<title>Untitled</title>
<style type="text/css">
body { background: white; color: #999; font-family: sans-serif; }
h1 { color: #333; }
</style>
@Ahrengot
Ahrengot / wp-post-meta
Created March 12, 2012 15:38
Get post/page custom meta data
// Get multiple values with one DB query
$post_meta = get_post_custom();
$prefix = 'my_custom_field_';
$value_1 = $post_meta[$prefix . '1'][0];
$value_2 = $post_meta[$prefix . '2'][0];
$value_3 = $post_meta[$prefix . '3'][0];
// Get a single value
$value = get_post_meta(get_the_ID(), 'my_custom_field', true);
<!DOCTYPE html>
<!-- Helpful things to keep in your <head/>
// Brian Blakely, 360i
// http://twitter.com/brianblakely/
-->
<head>
<!-- Disable automatic DNS prefetching.
@Ahrengot
Ahrengot / mobile-webapp.html
Created March 20, 2012 14:48
mobile-webapp
<meta name="viewport" content="width=device-width; initial-scale=1.0; maximum-scale=1.0; user-scalable=no;">
<meta name="apple-mobile-web-app-capable" content="yes" />
<meta name="apple-mobile-web-app-status-bar-style" content="black" />
<link rel="apple-touch-icon-precomposed" sizes="114x114" href=img/icons/114x114.png">
<link rel="apple-touch-icon-precomposed" sizes="72x72" href="img/icons/72x72.png">
<link rel="apple-touch-icon-precomposed" sizes="57x57" href="img/icons/57x57.png">
<link rel="apple-touch-startup-image" href="img/icons/splash-screen.png" />
<body onload="setTimeout(function() { if(Modernizr.touch && window.pageYOffset <= 1) window.scrollTo(0, 1) }, 100);">
@Ahrengot
Ahrengot / backbone-app.js
Created March 27, 2012 12:00
Backbone app from https://peepcode.com/products/backbone-ii used for best-practises reference
(function($) {
window.Album = Backbone.Model.extend({
isFirstTrack: function(index) {
return index == 0;
},
isLastTrack: function(index) {
return index >= this.get('tracks').length - 1;
@Ahrengot
Ahrengot / dabblet.css
Created March 28, 2012 09:52
Do not wrap!
/**
* Do not wrap!
*/
#wrap {
width: 100%;
height: 400px;
padding: 0;
overflow: hidden;
background: gray;
@Ahrengot
Ahrengot / bg.css
Created March 30, 2012 20:32
Full size background
body {
background: url(images/bg.jpg) no-repeat center center fixed;
-webkit-background-size: cover;
-moz-background-size: cover;
-o-background-size: cover;
background-size: cover;
// god dammit, IE.
filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='images/bg.jpg', sizingMethod='scale');
-ms-filter: "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='images/bg.jpg', sizingMethod='scale')";
@Ahrengot
Ahrengot / dabblet.css
Created April 12, 2012 15:03
FORM STYLES
/******************************************************************
FORM STYLES
******************************************************************/
/* line 1208, ../sass/_default.scss */
form {
margin-bottom: 15px;
margin-top: -10px; }
/* line 1212, ../sass/_default.scss */
form input[type=email] {
@Ahrengot
Ahrengot / dabblet.css
Created April 12, 2012 15:09
UI COMPONENTS
/******************************************************************
UI COMPONENTS
******************************************************************/
/*
* BUTTONS
*/
/* line 177, ../sass/_default.scss */
a.btn, .widget li[id*=menu-item] a, .widget .blogroll a, button.btn {
display: block;
position: relative;
@Ahrengot
Ahrengot / dabblet.css
Created April 12, 2012 15:13
UI COMPONENTS
/******************************************************************
UI COMPONENTS
******************************************************************/
/*
* BUTTONS
*/
/* line 177, ../sass/_default.scss */
a.btn, .widget li[id*=menu-item] a, .widget .blogroll a, button.btn {
display: block;
position: relative;