This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
javascript: (function () { | |
function createLipsum() { | |
var p = document.createElement("textarea"); | |
p.appendChild( | |
document.createTextNode( | |
"Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aenean commodo ligula eget dolor. Aenean massa. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Donec quam felis, ultricies nec, pellentesque eu, pretium quis, sem. Nulla consequat massa quis enim. Donec pede justo, fringilla vel, aliquet nec, vulputate eget, arcu. In enim justo, rhoncus ut, imperdiet a, venenatis vitae, justo. Nullam dictum felis eu pede mollis pretium. Integer tincidunt. Cras dapibus. Vivamus elementum semper nisi. Aenean vulputate eleifend tellus. Aenean leo ligula, porttitor eu, consequat vitae, eleifend ac, enim. Aliquam lorem ante, dapibus in, viverra quis, feugiat a, tellus. Phasellus viverra nulla ut metus varius laoreet." | |
) | |
); | |
p.setAttribute( | |
"style", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* This script checks for image load errors. | |
* It will try to load the image from a fallback provided server name. | |
* | |
* Usage: | |
* | |
* - Include it: | |
* <script src="/js/imgProxy.js"></script> | |
* | |
* - Call it from your script (or un-comment the call below): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/////////////////////////////////////////////////// | |
// SASS & Compass tooltip mixin | |
/////////////////////////////////////////////////// | |
@mixin tooltip( | |
$dir: top, | |
$pos: 50%, | |
$color1: #fff, | |
$color2: darken($color1, 30%), | |
$size1: 6px, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function THEME_image_style($variables) { | |
// Skip GIFs. | |
$ext = pathinfo($variables['path'], PATHINFO_EXTENSION); | |
if ($ext == 'gif') { | |
return theme('image', $variables); | |
} | |
// Determine the dimensions of the styled image. | |
$dimensions = array( |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Put this in your template.php | |
* Change YOURTHEME to your theme name and YOUR_DISQUS_SHORTNAME to yours. | |
* Implements template_preprocess_page(). | |
*/ | |
function YOURTHEME_preprocess_page(&$variables, $hook) { | |
// inlineDisqussions |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@mixin size($x, $y: $x) { | |
@if type_of($x) == string { | |
width: image-width($x); | |
} @else { | |
width: $x; | |
} | |
@if type_of($y) == string { | |
height: image-height($y); | |
} @else { | |
height: $y; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function($) { | |
// My micro jQuery templating engine | |
// Include this script before your closing </body> tag. | |
// Usage: | |
// | |
// <section data-html="content"></section> | |
// | |
// This will load <html/content.html> into <section> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
javascript:(function(){ | |
function encodeString(string) { | |
return encodeURIComponent(string | |
.replace(/\\/g,"\\\\") | |
.replace(/\"/g, '\\"') | |
.replace(/\n\r?/g, '\\n') | |
.replace(/%/g, 'U0025') | |
.replace(/</g, '\\<') | |
.replace(/>/g, '\\>') | |
.replace(/script/ig, 'scr\"\+\"ipt') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// With Salsa | |
// | |
// Using a Sass based system, my mark-up can look something like this: | |
// | |
// <article></article> | |
// <aside><aside> | |
// | |
// and in my scss file, I'll do | |
@import "settings"; |