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
<!DOCTYPE html> | |
<html lang="ja"> | |
<head> | |
<meta charset="utf-8"> | |
<title>Snow Canvas</title> | |
<style> | |
body { | |
background-color: #2c3e50; | |
} |
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
const getCssUnitsVal = value => { | |
const tester = document.createElement('div'); | |
let size; | |
tester.style.width = value; | |
document.body.appendChild(tester); | |
size = tester.offsetWidth; | |
document.body.removeChild(tester); | |
return size; | |
}; |
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
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charaset="utf-8"> | |
<title>vertical center</title> | |
<style> | |
body { | |
margin: 0; | |
} | |
.wrapper { |
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
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="utf-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1"> | |
<title>Element in the vertical center where you can scroll</title> | |
<style> | |
.center { | |
position: fixed; | |
right: 50%; |
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'; | |
import Velocity from 'velocity-animate'; | |
let baseEasings = {}; | |
baseEasings.Bounce = p => { | |
let pow2; | |
let bounce = 4; | |
while (p < ((pow2 = Math.pow(2, --bounce)) - 1) / 11) {} |
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
Array.prototype.slice.call( | |
document.querySelectorAll('.fbPhotoStarGridElement') | |
).filter(function (el) { | |
return el.querySelector('.uiMediaThumb'); | |
}).map(function (el) { | |
return el.dataset.fbid; | |
}).forEach(function (id, i) { | |
setTimeout(function () { | |
var url = 'https://www.facebook.com/photo/download/?fbid=' + id; | |
location.href= url; |
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
array.reduce((obj, val, i) => { | |
obj[i] = val; | |
return obj; | |
}, {}); |
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 Promise = require('bluebird') | |
Promise.map(arr, fn, { concurrency: n }) |
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
javascript:[].slice.call(document.querySelectorAll('.fbPhotoStarGridElement')).filter(function(el){return el.querySelector('.uiMediaThumb')!==null}).map(function(el){return el.dataset.fbid}).forEach(function(id,i){setTimeout(function(){location.href='https://www.facebook.com/photo/download/?fbid='+id},1000*i)}) |
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 filter (array, cb) { | |
var i; | |
var l = array.length; | |
var item; | |
var matched = []; | |
var unmatched = []; | |
for (i = 0; i < l; i++) { | |
item = array[i]; |