Skip to content

Instantly share code, notes, and snippets.

@rutger1140
rutger1140 / viewportwidth.js
Created April 12, 2012 10:03
Display viewport width with jQuery
/**
* Display your window width - useful for responsive web design
* @author: Rutger Laurman
*/
// Ready?
$(function(){
// Create debug element
$("body").append("<div style='position:fixed;top:0;left:0;border:1px solid #999;background:#eee;' id='viewportwidth'></div>");
@orioltf
orioltf / check_vars_haml.md
Last active July 6, 2019 23:45
#HAML: Checking variables in partials
  1. Check if a page variable has been defined
    1. Set variables in a page (page.html.haml) at the very biginning of the file:

      ---
      variable: value
      variable2: value 2
      ---