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 setupFixedBg() { | |
const $fixed = $('.js-fixed-bg'); | |
const $wrapper = isSP() ? $(window) : $('.wrapper'); | |
let _tmpTop = $wrapper.scrollTop(); | |
(function _update() { | |
const top = $wrapper.scrollTop(); | |
if(top !== _tmpTop) { | |
$fixed.css('transform', `translateY(${top}px)`); | |
} | |
_tmpTop = top; |
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
getRandomString(length = 8) { | |
// 生成する文字列に含める文字セット | |
const chars = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"; | |
let r = ""; | |
for(let i = 0, charsLength = chars.length; i < charsLength; i++){ | |
r += chars[Math.floor(Math.random()*cl)]; | |
} | |
return r; | |
} |
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 getRandomFlattenNum(min, max, divide) { | |
let n = Math.random() * (max - min) + min; | |
n = flattenNum(n, divide); | |
return n; | |
} | |
function flattenNum(n, d) { | |
return n = n - (n % d); | |
} |
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
// letter-spacingは span + span にmargin-leftを指定することでいい感じにできる | |
=condensed($size, $scale: 0.7) | |
display: flex | |
overflow: visible | |
font-size: #{$size}px | |
& > span | |
display: flex | |
justify-content: center | |
align-items: center | |
transform: scaleX($scale) |
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:var img=new Image(); img.src="https://images-na.ssl-images-amazon.com/images/I/41kEvP4RfXL._SX342_.jpg"; img.style.position="absolute"; img.style.opacity=0.01; img.style.bottom=0; img.style.right=0; var op = 0; var val = 0.01; img.onload = function() { var tid = setInterval(function(){ img.style.opacity = op; op += val; if(img.style.opacity >= 0.5) clearInterval(tid); }, 80); document.body.appendChild(img); } |
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 factrical(n) { | |
if(typeof n !== "number") return "Not Number"; | |
return n === 1 ? 1 : n * factrical(n-1); | |
} |
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
#!/bin/sh | |
# 設定 ############ | |
# DB構築に必要な設定 | |
DB_NAME="" | |
DB_USER="root" | |
DB_PASS="" | |
DB_HOST="127.0.0.1" | |
DB_PREFIX="wp_" |
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
// http://qiita.com/nyawach/items/108c8e2551c26674f57b | |
function combination(n, m) { | |
var list = []; | |
m = (m == null) ? n : m; | |
for(var i=n-1; i--;) list.push(i); | |
for(var i=list.length,j;--i;){ | |
j = Math.random()*(i+1) | 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
function combination(n, m) { | |
var arr = []; | |
var num; | |
var i = 0; | |
while(i < m) { | |
num = Math.floor(Math.random() * n); | |
if(~arr.indexOf(num)) continue; | |
arr.push(num); | |
i++; | |
} |