Amazing performance optimization live session with @paul_irish and @aerotwist
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* SitePoint Code Challenge: CSS – Drop Down Menus | |
*/ | |
/* Layout */ | |
.menu, | |
.menu ul { padding: 0; list-style-type: none; } | |
.menu > li { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Making an ugly range slider (webkit only) | |
*/ | |
input[type="range"] { | |
width: 100%; | |
height: 1em; | |
border-radius: 0.25em; | |
background-color: rgba(0, 0, 0, 0.05); | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Vertical alignment | |
* Inspired by https://coderwall.com/p/oo2bqg | |
*/ | |
html, | |
body { height: 100%; } | |
div:before { | |
content: " "; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict'; | |
define( | |
[ | |
'component' | |
], | |
function (defineComponent) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
on ^*:text:*:#:{ | |
if (($me isin $strip($1-)) && ($chan != $active)) { | |
echo -a - | |
echo -a $nick is talking about you on $chan ( $+ $1- $+ ) | |
echo -a - | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@function pxtorem($values) { | |
$base-remContext: 16px !default; | |
$rem-values: (); | |
@each $value in $values { | |
@if $value == 0 or $value == 0px { | |
$rem-values: join($rem-values, 0); | |
} @else if type-of($value) == number and not unitless($value) and (unit($value) == px) { | |
$new-rem-value: $value / $base-remContext; | |
$rem-values: join($rem-values, #{$new-rem-value}rem); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// FizzBuzz solution with one comparison: | |
// Bitwise operations, using predefined 0-15 numbers mask | |
// live demo: http://jsfiddle.net/TbAuQ/ | |
// source: http://www.zoharbabin.com/which-fizzbuzz-solution-is-the-most-efficient | |
var words = [undefined, "Fizz", "Buzz", "FizzBuzz"], | |
mask = 810092048, //11 00 00 01 00 10 01 00 00 01 10 00 01 00 00 | |
c = 0; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function (window, name, fn) { | |
if (typeof module === "object" && module && typeof module.exports === "object") { | |
module.exports = fn; | |
} else { | |
window[name] = fn; | |
if (typeof define === "function" && define.amd) { | |
define(name, [], function () { | |
return fn; | |
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
this.on = function() { | |
var $element, type, callback, originalCb, delegateRules; | |
var lastIndex = arguments.length - 1, origin = arguments[lastIndex]; | |
if (lastIndex == 2) { | |
$element = $(arguments[0]); | |
type = arguments[1]; | |
} else { | |
$element = this.$node; | |
type = arguments[0]; |