Skip to content

Instantly share code, notes, and snippets.

View Elbone's full-sized avatar

Niels Oeltjen Elbone

View GitHub Profile
@Elbone
Elbone / MD-cheatsheet.txt
Created November 8, 2012 00:47
Markdown Cheatsheet
# Header 1 #
## Header 2 ##
### Header 3 ### (Hashes on right are optional)
#### Header 4 ####
##### Header 5 #####
## Markdown plus h2 with a custom ID ## {#id-goes-here}
[Link back to H2](#id-goes-here)
This is a paragraph, which is text surrounded by whitespace. Paragraphs can be on one
@Elbone
Elbone / CSS Stuff
Last active December 11, 2015 12:18
Some html tips for Shillington web students
/*
BOX MODEL
=========
Changes default box model behaviour so that padding is INSIDE the box dimensions. Add this under your reset.
*/
*, *::after, *::before {
-moz-box-sizing: border-box;
-webkit-box-sizing: border-box;
box-sizing: border-box;
// GET FEATURED IMAGE
function ST4_get_featured_image($post_ID) {
$post_thumbnail_id = get_post_thumbnail_id($post_ID);
if ($post_thumbnail_id) {
$post_thumbnail_img = wp_get_attachment_image_src($post_thumbnail_id, 'featured_preview');
return $post_thumbnail_img[0];
}
}
// ADD NEW COLUMN
@Elbone
Elbone / gist:6721847
Last active May 30, 2023 19:31
List of Chrome browser pages at chrome://about/

List of Chrome URLs

  • chrome://accessibility
  • chrome://appcache-internals
  • chrome://blob-internals
  • chrome://bookmarks
  • chrome://cache
  • chrome://chrome-urls
  • chrome://crashes
  • chrome://credits
@Elbone
Elbone / gist:8446676
Created January 15, 2014 23:15
Brand colours as SASS variables
// www.brandcolors.net
$network-facebook-blue: #3b5998
$network-behance-blue: #005cff
$network-blogger-red: #fc4f08
$network-delicious-blue: #205cc0
$network-dribbble-blue: #ea4c89
$network-etsy-blue: #eb6d20
$network-flickr-blue: #0063dc
$network-flickr-pink: #ff0084
$network-github-black: #171515
@Elbone
Elbone / gist:9126833
Created February 21, 2014 01:05
File types as object grouped by type
var filematches = {
// Word
"doc" : "word",
"docx" : "word",
// PDF
"pdf" : "pdf",
// Excell
@Elbone
Elbone / gist:9806469
Created March 27, 2014 12:29
Assemble errors
module.exports = function (grunt) {
grunt.initConfig({
sass: {
dist: {
files: {
'web/css/screen.css': 'src/sass/screen.sass'
}
}
},
@Elbone
Elbone / gist:916df43609d75efae21e
Created June 19, 2014 04:09
Grunt task to write some .html files as templates into a js object
module.exports = function(grunt) {
// Create the template files
grunt.registerMultiTask("templates", "Build a js file from html templates", function() {
var paths = grunt.file.expand( this.data.paths );
var out = this.data.output;
var contents = "var Templates = {";
var count = 0;
// count files
@Elbone
Elbone / gist:702c7cf418a4a27e9ffe
Created June 23, 2014 04:32
metaQuery Bookmarklet
<!-- Bookmarklet -->
<a href='javascript:var _metaQueryDiv = document.createElement("div");_metaQueryDiv.id = "_metaQueryBookmarklet";document.getElementsByTagName("body")[0].appendChild(_metaQueryDiv);var _metaQuery_style = document.createElement("style");_metaQuery_style.type = "text/css";_metaQuery_style.innerHTML = "#_metaQueryBookmarklet{position:fixed; bottom:-1px;right: -1px;border-radius:3px 0 0 0;background-color:#ddd;color:#666;border:1px solid;padding:8px;font-family:sans-serif;font-size:12px;}";document.getElementsByTagName("body")[0].appendChild(_metaQuery_style);metaQuery.onBreakpointChange( function (activeBreakpoints) {document.getElementById( "_metaQueryBookmarklet").innerHTML = activeBreakpoints.join(", ");});'>metaQuery Bookmarklet</a>
<!-- Source -->
<script>
// Create the div
var _metaQueryDiv = document.createElement("div");
_metaQueryDiv.id = "_metaQueryBookmarklet";
document.getElementsByTagName("body")[0].appendChild(_metaQueryDiv);
@Elbone
Elbone / gist:b9bffeffe79a3ada3221
Last active August 29, 2015 14:02
metaQuery with custom prefix
(function ( window, document ) {
var metaQuery = {
breakpoints: {},
prefix: 'breakpoint-', // @Elbone: Default prefix
_isTicking: false,
_debounceLastTime: 0,
_namedEvents: {},
_eventMatchCache: {},
_globalEvents: [],
onBreakpointChange: function () {