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 data = [-1, 3, -4, 5, 1, -6, 2, 1]; | |
function upperTotal(index, data) { | |
var totalUpper = 0; | |
for (var i = index + 1, l = data.length; i < l; i++) { | |
totalUpper = totalUpper + data[i]; | |
} | |
return totalUpper; |
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 getLargestBinaryGap(input) { | |
var binary = (input >>> 0).toString(2); | |
var longestGap = 0; | |
var matchArray = []; | |
var regexp = /1{1}(0+)(?=1)/g; | |
while ((matchArray = regexp.exec(binary)) !== null) { | |
let matchLength = matchArray[1].length; |
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
wpdb: | |
image: mysql | |
ports: | |
- "8081:3306" | |
environment: | |
MYSQL_ROOT_PASSWORD: p@33w0rd | |
wp: | |
image: wordpress | |
volumes: |
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
let keys = document.querySelector('.keys'); | |
keys.addEventListener('transitionend', function(e) { | |
if (e.propertyName === 'transform') { | |
e.target.classList.remove('playing'); | |
} | |
}); | |
function playPercussion(e) { | |
const audioTrack = document.querySelector(`audio[data-key="${e.keyCode}"]`); |
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
{ | |
"afterInteractionCloseTime": 5000, | |
"defaultSidebarInterval": 10, | |
"defaultSidebarCloseTime": 7000, | |
"timeElapsedFormula": 1000, | |
"nonuseDestroyTime": 120000, | |
"waitInterval": 10000 | |
} |
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
let callMe = function() { | |
if (condition) { | |
// base case reached | |
} else { | |
// recursive case | |
callMe(); | |
} | |
return; | |
}; |
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
/* | |
* Creative Coding | |
* Week 1, 01 - Draw your name! | |
* by Indae Hwang and Jon McCormack | |
* Updated 2016 | |
* Copyright (c) 2014-2016 Monash University | |
This program is free software: you can redistribute it and/or modify | |
it under the terms of the GNU General Public License as published by | |
the Free Software Foundation, either version 3 of the License, or |
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
/* | |
* Creative Coding | |
* Week 1, 02 - Draw your name! (part 2) | |
* by Indae Hwang and Jon McCormack | |
* Updated 2016 | |
* Copyright (c) 2014-2016 Monash University | |
This program is free software: you can redistribute it and/or modify | |
it under the terms of the GNU General Public License as published by | |
the Free Software Foundation, either version 3 of the License, or |
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
#standardSQL | |
SELECT | |
origin, | |
SUM(bin.density) * 100 AS `fraction_of_users_lt_1000` | |
FROM ( | |
SELECT | |
origin, | |
first_contentful_paint.histogram.bin AS bins | |
FROM | |
`chrome-ux-report.chrome_ux_report.201710` |
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
# Node Version Manager | |
# Implemented as a POSIX-compliant function | |
# Should work on sh, dash, bash, ksh, zsh | |
# To use source this file from your bash profile | |
# | |
# Implemented by Tim Caswell <[email protected]> | |
# with much bash help from Matthew Ranney | |
# "local" warning, quote expansion warning | |
# shellcheck disable=SC2039,SC2016,SC2001 |