Skip to content

Instantly share code, notes, and snippets.

@fragje
fragje / gist:2027581
Created March 13, 2012 08:22 — forked from eculver/gist:530619
JavaScript: Super sexy IE detection
// ----------------------------------------------------------
// If you're not in IE (or IE version is less than 5) then:
// ie === undefined
// If you're in IE (>5) then you can determine which version:
// ie === 7; // IE7
// Thus, to detect IE:
// if (ie) {}
// And to detect the version:
// ie === 6 // IE6
// ie > 7 // IE8, IE9 ...
@fragje
fragje / mediaqueries.css
Created March 13, 2012 08:31 — forked from saturngod/mediaqueries.css
css: Media queries
@media screen and (max-width:480px){
#content {
width:470px;
}
}
@media screen and (max-width:320px){
@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
@fragje
fragje / snippet.js
Created March 13, 2012 09:36
JavaScript: Simple function
var myFunction = function(a, b) {
return (a + b);
}
@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 / javascript-reference.js
Created April 3, 2012 19:25
JavaScript: reference
// JavaScript reference
// Operators
// Variables
/**
* Conditionals
*/
/**
@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'];
function pwypno2014_preprocess_field(&$vars) {
dpm($vars);
}
@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>
@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