Skip to content

Instantly share code, notes, and snippets.

Avatar

Kris Bot krisbulman

View GitHub Profile
View meetings.js
<script type="text/javascript">
var meeting = {number:"1"};
while (meeting==meeting) {
document.write( '1++');
}
</script>
@krisbulman
krisbulman / SassMeister-input-HTML.html
Created Nov 18, 2015
Generated by SassMeister.com.
View SassMeister-input-HTML.html
<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 Nov 18, 2015
Generated by SassMeister.com.
View SassMeister-input-HTML.html
<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 Sep 3, 2015
Generated by SassMeister.com.
View SassMeister-input-HTML.html
<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 Aug 17, 2015
Generated by SassMeister.com.
View SassMeister-input-HTML.html
<div class="grid-wrapper">
<div class="grid-item">one</div>
<div class="grid-item">two</div>
</div>
@krisbulman
krisbulman / SassMeister-input.scss
Last active Aug 29, 2015
Generated by SassMeister.com.
View SassMeister-input.scss
// ----
// libsass (v3.1.0)
// ----
@import 'susy';
$susy: (columns: 4);
$map: (columns: 4);
// doesn't work
@krisbulman
krisbulman / SassMeister-input-HTML.html
Created Mar 10, 2015
Generated by SassMeister.com.
View SassMeister-input-HTML.html
<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 Oct 7, 2014
Generated by SassMeister.com.
View SassMeister-input.scss
// ----
// 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 Feb 6, 2019 — 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.
View countCSSRules.js
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 Jun 18, 2014
Generated by SassMeister.com.
View SassMeister-input-HTML.html
<div class="selector">Hi I am Text</div>
You can’t perform that action at this time.