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
import { useState } from "react"; | |
export class Loadable<T> { | |
private promise: Promise<T>; | |
private value?: T; | |
private error?: unknown; | |
private status: "pending" | "resolved" | "rejected" = "pending"; | |
constructor(promise: Promise<T>) { | |
this.promise = promise |
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
export const vnodeRender = { | |
methods: { | |
vnodeRender(vnode) { | |
if (process.browser) { | |
if (!vnode.tag) { | |
return document.createTextNode(vnode.text) | |
} | |
const el = document.createElement(vnode.tag) | |
if (vnode.data) { | |
if (vnode.data.staticClass) { |
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 _delegate = function(elms, type, selector, callback){ | |
elms = (_type(elms) === "string") ? document.querySelectorAll(elms) | |
: (! elms.length) ? [elms] | |
: elms; | |
Array.from(elms).forEach(function(elm){ | |
elm.addEventListener(type, function(e){ | |
var valid = !! Array.from(this.querySelectorAll(selector)) | |
.filter(function(el){ | |
return el === e.target; | |
}).length; |
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 lottery = function(data, rate, times){ | |
var source = []; | |
rate = rate || (function(){ | |
var i, rate; | |
i = data.length; | |
rate = []; | |
while(i--){ | |
rate.push(1); | |
} | |
return rate; |
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
module.exports = function(grunt){ | |
var path = require("path"), | |
_ = grunt.util._; | |
/** | |
* Resolve dest and src files' path | |
* @param {String} file | |
* @returns {Object} | |
*/ |
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"> | |
<title>Document</title> | |
<style> | |
.demo { | |
height: 3em; | |
line-height: 1.5em; | |
overflow: hidden; |
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
/** | |
* Grunt Task : phps | |
* ----------------- | |
* Run php built-in server | |
*/ | |
module.exports = function(grunt) { | |
grunt.registerMultiTask("phps", "", function() { | |
var exec, cmd, options; |
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($){ | |
/** | |
* LineUp | |
* ------ | |
* Fix heights of the cols in the same row | |
* | |
* @class | |
* @param String selector | |
* @param Object option |
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></title> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
<script src="./jquery-1.10.2.min.js"></script> | |
<script src="../dest/jquery.equalrowheights.js"></script> | |
<script> | |
$(function() { |
NewerOlder