Skip to content

Instantly share code, notes, and snippets.

@hinga-
hinga- / precision.scss
Created June 3, 2022 04:31
dart sass 小数点の精度
@use "sass:math";
@function precision($num, $digit: 2) {
$multiplier: math.pow(10, $digit);
@return math.div(math.round($num * $multiplier), $multiplier);
}
@hinga-
hinga- / github-migration.sh
Last active May 28, 2019 12:11
to github migration
#!/bin/bash
set -e
# e.g ./github-migration.sh csvfile
# e.g ./github-migration.sh ./repositories.csv
csvFile=$1
while read row; do
@hinga-
hinga- / three-disable-log.js
Created February 25, 2019 13:02
Three.jsのログを非表示
const disableLog = () => {
const logger = console.log
console.log = (...args) => {
if (args[0] !== 'THREE.WebGLRenderer') {
logger(...args)
}
}
}
@hinga-
hinga- / sqrt.styl
Last active February 11, 2019 17:02
stylus 三平方の定理用関数
sqrt(x)
return math(x, 'sqrt')
//powは使えないっぽい?かわりに**で2乗をつかう
//例)
p(sqrt(4**2+3**2)) -> 5
@hinga-
hinga- / transparent.html
Last active April 19, 2016 10:43
base64透過gif
@see https://css-tricks.com/snippets/html/base64-encode-of-1x1px-transparent-gif/
<img src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7">
<img src="data:image/gif;base64,R0lGODlhAQABAIAAAAUEBAAAACwAAAAAAQABAAACAkQBADs=">
@hinga-
hinga- / .css
Last active December 13, 2015 12:03
【CSS】袋文字
.bag-char {
text-shadow: 2px 0px 0px #4d4d4d, -1.74661px -0.97435px 0px #4d4d4d, 1.05064px 1.70181px 0px #4d4d4d, -0.08846px -1.99804px 0px #4d4d4d, -0.89615px 1.78799px 0px #4d4d4d, 1.65367px -1.12488px 0px #4d4d4d, -1.99218px 0.17674px 0px #4d4d4d, 1.82588px 0.81619px 0px #4d4d4d, -1.19692px -1.60231px 0px #4d4d4d, 0.26467px 1.98241px 0px #4d4d4d, 0.73464px -1.86019px 0px #4d4d4d, -1.5478px 1.26662px 0px #4d4d4d, 1.96876px -0.35209px 0px #4d4d4d, -1.89086px -0.65165px 0px #4d4d4d, 1.33383px 1.49027px 0px #4d4d4d, -0.43882px -1.95127px 0px #4d4d4d, -0.56738px 1.91783px 0px #4d4d4d;
color: #fff;
}
@hinga-
hinga- / .js
Last active December 13, 2015 12:05
【javascript】小数点切り捨て
//@see http://ikeryou.jp/log/?p=146
var hoge = 12.345;
var hoge2 = ~~(hoge);
console.log(hoge2); // 12
@hinga-
hinga- / .css
Last active December 13, 2015 12:06
【CSS】IE7、8で透過の背景
/*
* @see http://unstandard.info/journal/background-color/
* #AARRGGBBで記述
* ・「AA」は透明度、”ff”で不透明、”00″で透明。
*/
.bg_opacity {
background-color: rgba(9, 60, 111, 0.6);
-ms-filter: "progid:DXImageTransform.Microsoft.gradient(StartColorStr='#99093C6F',EndColorStr='#99093C6F')" /* IE8 */;
filter: progid:DXImageTransform.Microsoft.gradient(StartColorStr='#99093C6F',EndColorStr='#99093C6F'); /* lte IE7 */
}