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 binarySearch(target, sortedArray, start = -1, end = -1) { | |
if (start < 0) { | |
start = 0; | |
} | |
if (end < 0) { | |
end = sortedArray.length; | |
} | |
let halfDist = sortedArray.length; | |
let centerIndex = 0; | |
let center = 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
// To be executed from a task overlay, with subtasks shown. | |
$('a[wrike-task-view-row-info-plate]') | |
.map((i, ele) => { | |
var eleid = ele.href.replace('https://www.wrike.com/open.htm?id=',''); | |
$.ajax({ | |
url: '/ui/batch_task_save', | |
method: 'POST', | |
headers: { | |
'wrike-client-id': 'web-[your wrike id here]', |
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
<div class="left"> | |
<h1>Input</h1> | |
<div id="input"></div> | |
<hr /> | |
<h1>Distance Table</h1> | |
<div id="distance"></div> | |
<hr/> | |
<div class="left"> | |
<h1>Lowest Solution:</h1> | |
<p id="lowestSolution"></p> |
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
# INVERTED STYLE GITIGNORE -- ALL FILES/FOLDERS ARE IGNORED UNLESS SPECIFIED. | |
# Ignore everything in the root except the "wp-content" directory. | |
/* | |
!.gitignore | |
!wp-content/ | |
!resources/ | |
!favicon.ico | |
# Ignore everything in the "wp-content" directory, except the "plugins" and "themes" directories. | |
wp-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"; | |
function findMult ( limit ) { | |
let mulOfX = ( num, x ) => { return !(num % x) } | |
let multiples = []; | |
while ( --limit ) { | |
if ( mulOfX(limit, 5) || mulOfX( limit, 3 ) ) { | |
multiples.push( limit ); | |
} | |
} |
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
var $window = $(window); //Window object | |
var scrollTime = 1.2; //Scroll time | |
var scrollDistance = 270; //Distance. Use smaller value for shorter scroll and greater value for longer scroll | |
$window.on("mousewheel DOMMouseScroll", function(event){ | |
event.preventDefault(); | |
var delta = event.originalEvent.wheelDelta/120 || -event.originalEvent.detail/3; |
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
$(document).on('cbox_complete', function(){ | |
if ( $('#colorbox').find('video').length > 0 ) { | |
$('#colorbox').find('video')[0].play(); | |
} | |
}); |
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
var scrubpoint = 0; | |
var isScrolling = null; | |
$('body').hammer().on('pan', function (e) { | |
var deltaY = e.gesture.deltaY; | |
if ( deltaY != 0 && Math.abs(deltaY) > 2 ) { | |
if ( !isScrolling ) { | |
$('video').each( function (i, ele) { ele.pause() } ); | |
} | |
master.pause(); | |
scrubpoint = ( deltaY / Math.abs(deltaY) ); |
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
$(document).off('mousewheel'); | |
var isScrolling = null; | |
$(document).on('mousewheel', function (e) { | |
if ( e.deltaY != 0 && Math.abs(e.deltaY) > 5 ) { | |
if ( !isScrolling ) { | |
$('video').each( function (i, ele) { ele.pause() } ); | |
var _label = ''; | |
if ( e.deltaY > 0 ) { | |
_label = master.getLabelBefore(); |
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
var scrubpoint = 0; | |
var isScrolling = null; | |
$(document).on('mousewheel', function (e) { | |
e.preventDefault(); | |
if ( e.deltaY != 0 && Math.abs(e.deltaY) > 5 ) { | |
if ( !isScrolling ) { | |
$('video').each( function (i, ele) { ele.pause() } ); | |
} | |
master.pause(); | |
scrubpoint = ( e.deltaY / Math.abs(e.deltaY) ); |
NewerOlder