Skip to content

Instantly share code, notes, and snippets.

View linlymatsumura's full-sized avatar
🐇
follow the white rabbit

LNLY linlymatsumura

🐇
follow the white rabbit
View GitHub Profile
@linlymatsumura
linlymatsumura / image-of-unknown-size.html
Last active February 20, 2017 02:38
Markup and styling to fit an image of unknown size into a certain rectangle
<style>
figure{
width: /*WIDTH*/;
height: /*HEIGHT*/;
overflow: hidden;
position: relative;
margin: 0;
padding: 0;
float: left;
}
@linlymatsumura
linlymatsumura / only-the-first-time.js
Last active November 30, 2017 16:45
最初だけ違うことをする関数
let foo = () => {
console.log('hello!')
foo = () => {
console.log('hi')
}
}
foo() // hello!
foo() // hi
foo() // hi
@linlymatsumura
linlymatsumura / months-by-blackmagic.js
Last active December 25, 2017 05:11
黒魔術っぽく月のリストを作る
const months = Array(12).join().split(',').map((v,i)=>{return `${i+1}月`})
console.log(months)
// (12) ["1月", "2月", "3月", "4月", "5月", "6月", "7月", "8月", "9月", "10月", "11月", "12月"]
@linlymatsumura
linlymatsumura / _smooth gradient.scss
Created April 23, 2018 16:00
this is smooth gradient mixin for sass.
@mixin smooth-gradient($direction, $from, $to) {
background-color: $to;
background-image: linear-gradient($direction,
rgba($from, 1) 0%,
rgba($from, 0.738) 19%,
rgba($from, 0.541) 34%,
rgba($from, 0.382) 47%,
rgba($from, 0.278) 56.5%,
rgba($from, 0.194) 65%,
rgba($from, 0.126) 73%,