This gist provides polyfill code for the
[scrollIntoViewIfNeeded()
][SIVIN] Element method found on WebKit
browsers.
There is no particular requirement on the position in the hierarchy of the
Notes: All the examples below are only tested on Vue.js 1.0 (above).
Notes: The examples below use ES6 so it's recommended to use browserify or webpack to easily integrate babel.
When you need to access DOM attribute, be careful with the lifecycle. Vue.js has a few useful lifecycle hooks.
Let's say we want to scroll our component to the bottom (imagine it's a long list with overflow-y: auto
) once it's instantiate.
/** | |
* Depth-first and Breadth-first graph traversals. | |
* | |
* In this diff we implement non-recursive algorithms for DFS, | |
* and BFS maintaining an explicit stack and a queue. | |
* | |
* by Dmitry Soshnikov <[email protected]> | |
* MIT Style license | |
*/ |
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.
Generally, all APIs that synchronously provide layout metrics will trigger forced reflow / layout. Read on for additional cases and details.
elem.offsetLeft
, elem.offsetTop
, elem.offsetWidth
, elem.offsetHeight
, elem.offsetParent
language: ruby | |
rvm: | |
- 2.0.0 | |
env: | |
global: | |
- USER="username" | |
- EMAIL="[email protected]" | |
- REPO="name of target repo" | |
- FILES="README.md foo.txt bar.txt" | |
- GH_REPO="github.com/${USER}/${REPO}.git" |
# -*- mode: ruby -*- | |
# vi: set ft=ruby : | |
# Vagrantfile API/syntax version. Don't touch unless you know what you're doing! | |
VAGRANTFILE_API_VERSION = "2" | |
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| | |
# https://github.com/AndrewDryga/vagrant-box-osx | |
config.vm.box = "osx-yosemite" |
var async = require('async'); | |
var Redis = require('redis'); | |
/* | |
* Rebalance a Redis cluster | |
* | |
* 1. Keeps slot allocations in blocks to maintain tidy configuration. | |
* 2. Moves slots to the coldest node from the hottest node, so the cluster stays healthy whilst rebalancing (`liveBalance`) | |
*/ |
Since modern.ie released vagrant boxes, it' no longer necessary to manually import the ova file to virtualbox, as mentioned here.
However, the guys at modern.ie didn't configured the box to work with WinRM. This how-to addresses that, presenting steps to proper repackage these boxes, adding WinRM support. Additionally configures chocolatey package manager and puppet provisioner.
#include <stdio.h> | |
#include <stdlib.h> | |
#include <stdbool.h> | |
#include <stdint.h> | |
#include <string.h> | |
#include <unistd.h> | |
#include <fcntl.h> | |
#include <sys/mman.h> | |
/* For supporting Linux and other systems that don't have mach-o headers */ |