###Strip units
@function strip-unit($number) {
@if type-of($number) == 'number' and not unitless($number) {
@return $number / ($number * 0 + 1);
}
@return $number;
}
sudo ntpdate -u ntp.ubuntu.com |
// https://davidwalsh.name/javascript-debounce-function | |
// Returns a function, that, as long as it continues to be invoked, will not | |
// be triggered. The function will be called after it stops being called for | |
// N milliseconds. If `immediate` is passed, trigger the function on the | |
// leading edge, instead of the trailing. | |
function debounce(func, wait, immediate) { | |
var timeout; | |
return function() { | |
var context = this, args = arguments; | |
var later = function() { |
###Strip units
@function strip-unit($number) {
@if type-of($number) == 'number' and not unitless($number) {
@return $number / ($number * 0 + 1);
}
@return $number;
}
clearTimeout($.data(this, 'scrollTimer')); | |
$.data(this, 'scrollTimer', setTimeout(function() { | |
// Do something | |
console.log('Haven\'t scrolled in 250ms!'); | |
}, 250)); |
All of the below properties or methods, when requested/called in JavaScript, will trigger the browser to synchronously calculate the style and layout*. This is also called reflow or layout thrashing, and is common performance bottleneck.
elem.offsetLeft
, elem.offsetTop
, elem.offsetWidth
, elem.offsetHeight
, elem.offsetParent
elem.clientLeft
, elem.clientTop
, elem.clientWidth
, elem.clientHeight
elem.getClientRects()
, elem.getBoundingClientRect()
/** | |
* http://applemusic.tumblr.com/ | |
* https://jsfiddle.net/xq56dmrh/ | |
*/ | |
/** Ultra Light */ | |
@font-face { | |
font-family: "San Francisco"; | |
font-weight: 100; | |
src: url("https://applesocial.s3.amazonaws.com/assets/styles/fonts/sanfrancisco/sanfranciscodisplay-ultralight-webfont.woff"); |
/***** Selector though hack ******/ | |
/* Only for IE6 and below */ | |
* html div { color: gray } | |
/* Only for IE7 */ | |
*:first-child+html div { color: gray } | |
alias w='cd ~/www' | |
alias gs='gulp serve' |
<?php | |
defined('BASEPATH') OR exit('No direct script access allowed'); | |
class MY_Config extends CI_Config { | |
public function __construct() | |
{ | |
$this->config =& get_config(); | |
// Set the base_url automatically if none was provided |