Skip to content

Instantly share code, notes, and snippets.

@fragje
fragje / full-inline-img.html
Last active August 29, 2015 14:10
Full inline image
<!-- Current markup -->
<p class="align-center fig--full"><img alt="Carne Irland Kaia Means" class="media-image fig--full" src="http://admin.norskgolf.newsfront.no/sites/default/files/carne_irland_kaia_means.jpg" title="Carne Irland Kaia Means"></p>
<!-- Javascript modification -->
<!-- Javascript looks for .fig--full, and when if it find it, a new element is created with the class .fig--full__inner, and elements originally inside .fig--full gets addeded inside the new element -->
<p class="align-center fig--full">
<span class="fig--full__inner">
<img alt="Carne Irland Kaia Means" class="media-image fig--full" src="http://admin.norskgolf.newsfront.no/sites/default/files/carne_irland_kaia_means.jpg" title="Carne Irland Kaia Means">
</span>
</p>
@fragje
fragje / SassMeister-input-HTML.html
Created June 4, 2014 22:13
Generated by SassMeister.com.
<div class="container">
<main>Main</main>
<aside>Aside</aside>
<footer>Footer</footer>
</div>
@fragje
fragje / my.cnf
Created April 3, 2014 13:07
Custom my.cnf for use with MAMP. Place this file in `/Application/MAMP/conf/` and restart MAMP
# Example MySQL config file for large systems.
#
# This is for a large system with memory = 512M where the system runs mainly
# MySQL.
#
# MySQL programs look for option files in a set of
# locations which depend on the deployment platform.
# You can copy this option file to one of those
# locations. For information about these locations, see:
# http://dev.mysql.com/doc/mysql/en/option-files.html
@fragje
fragje / SassMeister-input-HTML.html
Created April 3, 2014 06:44
Generated by SassMeister.com.
<header>Header</header>
<main>Main</main>
<aside>Aside</aside>
<footer>Footer</footer>
function pwypno2014_preprocess_field(&$vars) {
dpm($vars);
}
@fragje
fragje / snippet.php
Created April 20, 2012 21:02
drupal php: ds custom field example code
<?php
print_r($entity);
print_r($entity->field_attachment);
echo $entity->field_company_rl[LANGUAGE_NONE][0]['display_url'];
echo $entity->field_attachment[LANGUAGE_NONE][0]['uri'];
// Print url from uri if it's valid
$uri = $entity->field_attachment[LANGUAGE_NONE][0]['uri'];
@fragje
fragje / javascript-reference.js
Created April 3, 2012 19:25
JavaScript: reference
// JavaScript reference
// Operators
// Variables
/**
* Conditionals
*/
/**
@fragje
fragje / gist:2035908
Created March 14, 2012 11:33 — forked from brunofrank/gist:2025969
JavaScript: Popup blocker detector tested on Chrome, Firefox, Safari and IE
var test = window.open(null,"","width=1,height=1");
setTimeout(function(){
if (test && test.innerHeight && test.innerHeight > 0) {
// POPUP BLOCKER DISABLED
test.close();
}
}, 10);
@fragje
fragje / snippet.js
Created March 13, 2012 09:36
JavaScript: Simple function
var myFunction = function(a, b) {
return (a + b);
}
@fragje
fragje / _rounded.sass
Created March 13, 2012 09:29 — forked from maran/_rounded.sass
css: rounded corners
@mixin rounded-corner($radius: 5px)
-moz-border-radius: $radius
-webkit-border-radius: $radius
border-radius: $radius
@mixin rounded-top-left-corner($radius: 5px)
-moz-border-radius-topleft: $radius
-webkit-border-top-left-radius: $radius
border-top-left-radius: $radius