Skip to content

Instantly share code, notes, and snippets.

View megurock's full-sized avatar

Eiji Meguro megurock

  • Fork
  • Tokyo / Japan
View GitHub Profile
@megurock
megurock / parallax.html
Last active September 27, 2023 10:00
IntersectionObserver を使ったパララックス
<!DOCTYPE html>
<html lang="ja">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Document</title>
<style>
body {
margin: 0;
}
@megurock
megurock / SlotOperation.vue
Last active September 22, 2023 04:43
slot に対する変更(script setup を使わない)
<script>
import { mergeProps } from 'vue'
export default {
setup(props, context) {
const slotContent = context.slots?.default?.()
if (slotContent) {
slotContent.forEach(vNode => {
vNode.props.class = (vNode.props.class ?? '') + ' foo'
vNode.props.style = mergeProps(vNode.props.style, style)
@megurock
megurock / .gitconfig
Last active April 29, 2023 02:54
.gitconfig
[user]
name = Eiji Meguro
email = [email protected]
[core]
autocrlf = input
editor = emacs -nw
[alias]
br = branch
st = status
cm = commit -m
@megurock
megurock / css-support-test.js
Last active December 2, 2015 01:28
simple css support test
/**
* CSSが使えるかチェックします。
* @param prop:String CSSプロパティ(ベンダープリフィックスがある場合を考慮)
* @param useVendorPrefix:Boolean ベンダープリフィックスを付けるか(default: false)
* @see http://caniuse.com/#feat=css-transitions
* @return:Boolean 指定のCSSが使える場合trueを返却
*/
function canUseCss(prop, useVendorPrefix) {
var props = [ prop ],
// ベンダープリフィックス
@megurock
megurock / Gruntfile.js
Last active August 29, 2015 14:20
dynamic compilation config for jade and sass
module.exports = function(grunt) {
var glob = require('glob');
// load plugins in 'devDependencies'
require('load-grunt-tasks')(grunt, {
scope: 'devDependencies'
});
// load a configuration file that specifies 'jade' amd 'sass' compilation settings.
@megurock
megurock / csscomb-config.json
Created April 14, 2015 09:13
csscomb simple setting ver
{
"exclude": [
".git/**",
"node_modules/**",
"bower_components/**"
],
"always-semicolon": true,
"block-indent": "",
"color-case": "lower",
"color-shorthand": true,
@megurock
megurock / gulpfile.js
Created November 24, 2014 16:47
will be updated.
// plugins
var gulp = require('gulp');
var del = require('del');
var webserver = require('gulp-webserver');
var sass = require('gulp-sass');
var pleeease = require('gulp-pleeease');
var changed = require('gulp-changed');
var usemin = require('gulp-usemin');
var uglify = require('gulp-uglify');
var minifyHtml = require('gulp-minify-html');
@megurock
megurock / pictuerfill-test.html
Created October 7, 2014 09:54
picturefill 1.2 exmaple
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<title>Picturefill 1.2 Example</title>
<link rel="stylesheet" href="css/main.css">
<!--[if IE 9]><script src="js/vendor/matchMedia.js"></script><![endif]-->
<script src="js/vendor/picturefill.js"></script>
</head>
{
"exclude": [
".git/**",
"node_modules/**",
"bower_components/**"
],
"always-semicolon": true,
"block-indent": "\t",
"color-case": "lower",
"color-shorthand": true,
@megurock
megurock / package.json
Created October 1, 2014 12:08
package.json for my grunt template #1
{
"name": "application-name",
"version": "0.0.1",
"private": true,
"scripts": {
"start": "node app.js"
},
"dependencies": {
"express": "3.4.8",
"jade": "*"