Skip to content

Instantly share code, notes, and snippets.

@htmlr
htmlr / dabblet.css
Created July 4, 2016 14:57 — forked from dstorey/dabblet.css
set the size of the boxes and any decoration
.slider {
/* set initial width */
width: 520px;
/* hide the content that overflows (to allow second box to show through) */
overflow: hidden;
display: inline-block;
/* skew container so that it has angled edge, and set up transition */
transform: skewX(-20deg);
@htmlr
htmlr / example.js
Last active March 31, 2016 13:50
Trello - How to get cards for given list
/*
Include Client API
*/
<script src="https://api.trello.com/1/client.js?key=<api key>"></script>
<script>
var getListCards = function(){
/*
Note to get the List ID use Trello Sandbox examples to first get the relavent Board ID then in turn use this to get the relavent List ID (https://developers.trello.com/sandbox)
*/
Trello.get('/lists/<Card ID>/cards?fields=all&cards=open&card_fields=all&members=true',
@htmlr
htmlr / style.css
Last active March 28, 2016 07:04
Stacking and re-ordering in responsive emails
.feature-table {
width:600px;
}
.feature-desc {
}
.feature-image {
@htmlr
htmlr / dabblet.css
Created April 15, 2015 09:59
Untitled
table { border-collapse:collapse; }
@htmlr
htmlr / jQuery Plugin Boilerplate
Last active August 29, 2015 14:08
jQuery Plugin Boilerplate
/*
jQuery Plugin Boilerplate
Thanks to http://stackoverflow.com/a/22976877/417933
*/
(function($) {
var CustomPlugin = function($el, options) {
@htmlr
htmlr / gist:6c6bd789b8dbee57af20
Created October 1, 2014 12:57
CSS selector counter console script for checking IE limit
var
styleSheets = document.styleSheets,
totalStyleSheets = styleSheets.length;
for (var j = 0; j < totalStyleSheets; j++){
var
styleSheet = styleSheets[j],
rules = styleSheet.cssRules,
totalRulesInStylesheet = rules.length,
totalSelectorsInStylesheet = 0;
@htmlr
htmlr / gist:7be4ad6cf13ef190b63c
Created September 23, 2014 00:19
Detecting DOM ready in jQuery
// If the DOM is already ready
if ( jQuery.isReady ) {
// Execute the function immediately
fn.call( document, jQuery );
} // ...
function myClickHandler(event) {
// do stuff
$(document).ready(function() {
@htmlr
htmlr / SassMeister-input-HTML.html
Created September 2, 2014 05:17
Generated by SassMeister.com.
<div class="container">
<div class="message">red</div>
<div style="3000px;color:#fff">adawdawdawd</div>
awdawd
ad
adawdawda
</div>
<div class="foo">Foobar</div>
@htmlr
htmlr / getTextNodesIn()
Created August 26, 2014 23:42
Getting text nodes using Javascript
// source: http://stackoverflow.com/a/4399718/417933
function getTextNodesIn(node, includeWhitespaceNodes) {
var textNodes = [], nonWhitespaceMatcher = /\S/;
function getTextNodes(node) {
if (node.nodeType == 3) {
if (includeWhitespaceNodes || nonWhitespaceMatcher.test(node.nodeValue)) {
textNodes.push(node);
}
} else {
@htmlr
htmlr / boot_langselector.vm
Last active August 29, 2015 14:03
Liferay 6.1 Bootstrap language selector
#* BOOTSTRAP 2.3.2 LANGUAGE SELECTOR
I've found this doesnt work consistently in LR 6.1 GA2 also it prefixes the text with 'Beta' for some unknown reason
$taglibLiferay.language("fm",null,"languageId",1)
*#
<div class="dropdown">
<a class="dropdown-toggle" id="language-selector" role="button" data-toggle="dropdown" href="#">
<strong>#*$locale.getDisplayName()*#$locale.getLanguage().toUpperCase() ($locale.getCountry().toUpperCase())</strong>
<i class="-icon-caret-down"></i>
</a>