Skip to content

Instantly share code, notes, and snippets.

@jtwalters
jtwalters / SassMeister-input-HTML.html
Created December 11, 2014 17:31
Generated by SassMeister.com.
<div class="gallery-item">1</div>
<div class="gallery-item">2</div>
<div class="gallery-item">3</div>
<div class="gallery-item">4</div>
<div class="gallery-item">5</div>
<div class="gallery-item">6</div>
<div class="gallery-item">7</div>
<div class="gallery-item">8</div>
<div class="gallery-item">9</div>
<div class="gallery-item">10</div>
@jtwalters
jtwalters / 0_reuse_code.js
Last active August 29, 2015 14:12
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@jtwalters
jtwalters / d7-remote-file-save.php
Created January 20, 2015 17:52
Save a remote file URI in Drupal 7
<?php
$file = remote_stream_wrapper_file_create_by_uri($uri);
$file_result = file_save($file);
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Form</title>
</head>
<body>
<form>
# Don't cache anything
<ifModule mod_headers.c>
Header unset ETag
Header set Cache-Control "max-age=0, no-cache, no-store, must-revalidate"
</ifModule>
@jtwalters
jtwalters / pixel-border-workaround.css
Last active August 29, 2015 14:15
CSS Workaround: 1 pixel border with percentage width columns
.parent {
position: relative;
}
.parent:before {
content: "";
position: absolute;
top: 0;
left: 0;
right: 0;
@jtwalters
jtwalters / huge-click-regions.js
Last active August 29, 2015 14:15
Make the click regions big.
$(function initLargeClickRegions() {
// Make the entire views row clickable to the first link element within the row.
$('.views-row').each(function () {
var $link = $(this).find('a:first');
if ($link.length) {
$(this).css('cursor', 'pointer');
$(this).on('click.expanded', function (e) {
// Only if a simple primary mouse button click (no ctrl/meta key
// pressed) and not a link (or child of link)
foo = false;
(function () {
foo = true;
})();
setTimeout(function () {
foo = false;
}, 0);
@jtwalters
jtwalters / jquery-patterns.js
Last active August 29, 2015 14:15
Some JS/jQuery patterns.
/**
* JS Patterns
*/
/**
* 1. Mixed jQuery
*/
(function($, window, document, undefined) {
@jtwalters
jtwalters / please.js
Created March 5, 2015 22:01
console.log('PLEASE');
[][(![]+[])[+[]]+([![]]+[][[]])[+!+[]+[+[]]]+(![]+[])[!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+!+[]]][([][(![]+[])[+[]]+([![]]+[][[]])[+!+[]+[+[]]]+(![]+[])[!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+!+[]]]+[])[!+[]+!+[]+!+[]]+(!![]+[][(![]+[])[+[]]+([![]]+[][[]])[+!+[]+[+[]]]+(![]+[])[!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+!+[]]])[+!+[]+[+[]]]+([][[]]+[])[+!+[]]+(![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[+!+[]]+([][[]]+[])[+[]]+([][(![]+[])[+[]]+([![]]+[][[]])[+!+[]+[+[]]]+(![]+[])[!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+!+[]]]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[][(![]+[])[+[]]+([![]]+[][[]])[+!+[]+[+[]]]+(![]+[])[!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+!+[]]])[+!+[]+[+[]]]+(!![]+[])[+!+[]]](([][(![]+[])[+[]]+([![]]+[][[]])[+!+[]+[+[]]]+(![]+[])[!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+!+[]]]+[])[!+[]+!+[]+!+[]]+(!![]+[][(![]+[])[+[]]+([![]]+[][[]])[+!+[]+[+[]]]+