Skip to content

Instantly share code, notes, and snippets.

View jelmerdemaat's full-sized avatar

Jelmer jelmerdemaat

View GitHub Profile
@jelmerdemaat
jelmerdemaat / ignore_regexes.json
Last active December 15, 2015 02:38
Additional SFTP ignore files
[
"/src/",
"/.sass-cache/", "/node_modules/",
"\\.scssc", "\\.sassc"
]
@jelmerdemaat
jelmerdemaat / dabblet.css
Created May 13, 2013 10:04
CSS Mask (WebKit only)
/**
* CSS Mask (WebKit only)
*/
div {
width: 300px;
height: 200px;
background: red;
mask-image: linear-gradient(to bottom, rgba(0,0,0,1), rgba(0,0,0,0));
}
@jelmerdemaat
jelmerdemaat / dabblet.css
Created May 13, 2013 10:07
CSS Mask (WebKit only)
/* CSS Mask (WebKit only) */
div {
width: 300px;
height: 200px;
background: red;
mask-image: linear-gradient(to bottom, rgba(0,0,0,1), rgba(0,0,0,0));
}
div:last-child {
@jelmerdemaat
jelmerdemaat / site.js
Created May 13, 2013 13:52
Get site URL in JavaScript
var siteURL = "http://" + top.location.host.toString();
@jelmerdemaat
jelmerdemaat / gist:5848442
Last active December 9, 2019 17:19
Cookie handling functions by Quirksmode Source: http://www.quirksmode.org/js/cookies.html
/*
* COOKIE HANDLING FUNCTIONS
* Source: http://www.quirksmode.org/js/cookies.html
*/
function createCookie(name,value,days) {
if (days) {
var date = new Date();
date.setTime(date.getTime()+(days*24*60*60*1000));
var expires = "; expires="+date.toGMTString();
@jelmerdemaat
jelmerdemaat / gist:5866939
Last active December 19, 2015 00:09
Flash detection
/*
* FLASH DETECTION
* https://coderwall.com/p/0drlya
*/
if(typeof navigator.plugins != "undefined" &&
typeof navigator.plugins["Shockwave Flash"] == "object") {
document.documentElement.className = document.documentElement.className + ' flash';
} else {
document.documentElement.className = document.documentElement.className + ' no-flash';
@jelmerdemaat
jelmerdemaat / gist:6411336
Created September 2, 2013 10:12
Sublime better paste key mapping (Windows)
[
{ "keys": ["ctrl+v"], "command": "paste_and_indent" },
{ "keys": ["ctrl+shift+v"], "command": "paste" }
]
@jelmerdemaat
jelmerdemaat / animation.scss
Created October 16, 2013 09:12
SASS cross-browser animation mixins
@mixin keyframes( $animationName ) {
@-webkit-keyframes $animationName {
@content;
}
@-moz-keyframes $animationName {
@content;
}
@-o-keyframes $animationName {
@content;
}
@jelmerdemaat
jelmerdemaat / post-has-content.php
Last active November 7, 2016 09:29
If WordPress post has content
<?php the_post(); if(trim($post->post_content) != "") : ?>
<div class="main-content">
<?php the_content(); ?>
</div>
<?php endif; ?>
// usage: log('inside coolFunc',this,arguments);
// http://paulirish.com/2009/log-a-lightweight-wrapper-for-consolelog/
window.log = function(){
log.history = log.history || []; // store logs to an array for reference
log.history.push(arguments);
if(this.console){
console.log( Array.prototype.slice.call(arguments) );
}
};