The general formula of the column width for a known separator width is columnWidth = ( fullWidth + separatorWidth * (1 - columnNb) ) / columnNb
This file contains 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
<!-- JS Includes --> | |
<script src="//cdnjs.cloudflare.com/ajax/libs/underscore.js/1.4.4/underscore-min.js" type="text/javascript"></script> | |
<script src="//cdnjs.cloudflare.com/ajax/libs/backbone.js/1.0.0/backbone.js" type="text/javascript"></script> | |
<script src="https://rawgithub.com/mikeric/rivets/master/dist/rivets.js" type="text/javascript"></script> | |
<script src="https://rawgithub.com/azproduction/rivets-backbone-adapter/master/rivets-backbone.js" type="text/javascript"></script> | |
<p style="color: red;"> | |
Open your dev tools and watch the console log for output. You should notice that when setting the value manually using the Backbone set(), the "routine" is fired off twice. | |
</p> |
This file contains 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
var MemDB = require('memdb'); | |
var db = MemDB(); | |
console.log('memdb db = ', db); |
This file contains 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
<div> | |
<span> | |
<a class="menu-item">Home</a> | |
</span> | |
<span> | |
<a class="menu-item">Contact</a> | |
</span> | |
</div> |
This file contains 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
# Git aliases | |
alias g="git" | |
alias gits="git status" | |
alias gitc="git commit" | |
alias gitb="git branch" | |
alias gs='git status' | |
alias gc='git commit' | |
alias gb='git branch' | |
alias gbr='git branch -r' | |
alias gf='git fetch && git fetch --tags' |
This file contains 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
/** | |
* Simple plugin to track scroll events and trigger a custom jQuery event (scroll_vertical or scroll_horizontal) | |
* when the corresponding type of scroll has happened. | |
* Event handlers can receive the original scroll event and the scroll delta as second values. | |
* e.g. function(jqEvent, scrollEvent, delta) | |
* | |
* To stop this, unbind the 'scroll.trackScroll.vertical' or 'scroll.trackScroll.horizontal' event | |
* @param {string} direction Scroll direction to track | |
* @return {jQuery} | |
*/ |
This file contains 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
/** | |
* Simulate a mouse event to a given DOM element | |
* @param {string, WebElement} elem | |
* @param {string} evtName Event name | |
* @param {object} eventInitProps Properties to set on the mouse event | |
*/ | |
function triggerMouseEvent(elem, evtName, eventInitProps) { | |
return browser.executeScript(function(_elem, _evtName, _eventInitProps) { | |
var $ = window.jQuery; | |
elem = $(_elem); |
This file contains 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
@echo off | |
rem Shows the list of current running processes | |
rem Run "WMIC path win32_process" to get further process details | |
WMIC path win32_process get Caption,Processid,Commandline |
This file contains 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
/** | |
* js-timeout-polyfill | |
* @see https://blogs.oracle.com/nashorn/entry/setinterval_and_settimeout_javascript_functions | |
*/ | |
(function (global) { | |
'use strict'; | |
if (global.setTimeout || | |
global.clearTimeout || | |
global.setInterval || |
This file contains 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
/** | |
* $q.allSettled returns a promise that is fulfilled with an array of promise state snapshots, | |
* but only after all the original promises have settled, i.e. become either fulfilled or rejected. | |
* | |
* This method is often used in order to execute a number of operations concurrently and be | |
* notified when they all finish, regardless of success or failure. | |
* | |
* @param promises array or object of promises | |
* @returns {Promise} when resolved will contain an an array or object of resolved or rejected promises. | |
* A resolved promise have the form { status: "fulfilled", value: value }. A rejected promise will have |
OlderNewer