Skip to content

Instantly share code, notes, and snippets.

@krisbulman
krisbulman / meetings.js
Last active April 11, 2016 18:06 — forked from willaalt/meetings
<script type="text/javascript">
var meeting = {number:"1"};
while (meeting==meeting) {
document.write( '1++');
}
</script>
@krisbulman
krisbulman / SassMeister-input-HTML.html
Created November 18, 2015 18:23
Generated by SassMeister.com.
<div class="container">
<!-- Note the order in DOM and rendered -->
<div class="content">content</div>
<div class="sidebar1">sidebar1</div>
<div class="sidebar2">sidebar2</div>
</div>
@krisbulman
krisbulman / SassMeister-input-HTML.html
Created November 18, 2015 18:19
Generated by SassMeister.com.
<div class="container">
<!-- Note the order in DOM and rendered -->
<div class="content">content</div>
<div class="sidebar1">sidebar1</div>
<div class="sidebar2">sidebar2</div>
</div>
@krisbulman
krisbulman / SassMeister-input-HTML.html
Last active September 3, 2015 13:13
Generated by SassMeister.com.
<div class="grid-wrapper">
<div class="grid-item">1</div>
<div class="grid-item">2</div>
<div class="grid-item">3</div>
<div class="grid-item">4</div>
<div class="grid-item">5</div>
<div class="grid-item">6</div>
<div class="grid-item">7</div>
<div class="grid-item">8</div>
<div class="grid-item">9</div>
@krisbulman
krisbulman / SassMeister-input-HTML.html
Created August 17, 2015 16:13
Generated by SassMeister.com.
<div class="grid-wrapper">
<div class="grid-item">one</div>
<div class="grid-item">two</div>
</div>
@krisbulman
krisbulman / SassMeister-input.scss
Last active August 29, 2015 14:19
Generated by SassMeister.com.
// ----
// libsass (v3.1.0)
// ----
@import 'susy';
$susy: (columns: 4);
$map: (columns: 4);
// doesn't work
@krisbulman
krisbulman / SassMeister-input-HTML.html
Created March 10, 2015 18:46
Generated by SassMeister.com.
<div class="centre">
<h1>Understanding JavaScript Behaviors in Drupal</h1>
<p class="text--hecto">I can barely remember the first time I added JavaScript to a Drupal page using a custom module. I'm sure looked at the documentation, took the example snippet, tweaked it, tested it, and moved on to something else. It was only later, using a debugger, that I saw how Drupal's "behavior" system worked and realized that my code was not being executed as I expected.</p>
<p class="text--base">In this article we' cover the key facts about Drupal behaviours, then look at a real Drupal project to inspect it's behaviours and optimize them.</p>
<h2>Unraveling Drupal behaviors</h2>
<p>Drupal’s official JavaScript documentation suggests that modules should implement JavaScript by attaching logic to Drupal.behaviors. Here is an example taken from that page:</p>
<p class="text--centi">heading default metadata</p>
<p class="text--kilo">in-content quote/highlight</p>
<p>Some regular text</p></div>
</div>
@krisbulman
krisbulman / SassMeister-input.scss
Created October 7, 2014 16:28
Generated by SassMeister.com.
// ----
// Sass (v3.4.4)
// Compass (v1.0.1)
// ----
.channel-tab.is-selected {
.channel-tab__link--mobile:before {
content: ' ';
}
&.channel-tab--msnbctv {
@krisbulman
krisbulman / countCSSRules.js
Last active August 25, 2022 19:53 — forked from psebborn/countCSSRules.js
Count the number of rules and selectors for CSS files on the page. Flags up the >4096 threshold that confuses IE. — This snippet has been modified to count more than just the first level of CSSStyleRule objects within CSSMediaRule.
function countCSSRules() {
var results = '',
log = '';
if (!document.styleSheets) {
return;
}
for (var i = 0; i < document.styleSheets.length; i++) {
countSheet(document.styleSheets[i]);
}
function countSheet(sheet) {
@krisbulman
krisbulman / SassMeister-input-HTML.html
Created June 18, 2014 13:37
Generated by SassMeister.com.
<div class="selector">Hi I am Text</div>