Skip to content

Instantly share code, notes, and snippets.

@iFwu
iFwu / LearnVuejs-01.html
Last active September 18, 2016 03:18
Hello!
<h2 id="引入-vuejs">引入 Vue.js</h2>
<hr>
<h3 id="起因">起因</h3>
<ul>
<li>jQuery 的DOM操作与异步回调有天生的冲突</li>
<template>
<div id="app">
<form id="search">
Search <input name="query" v-model="searchQuery">
</form>
<qrcode-table
:data="gridData"
:columns="gridColumns"
:filter-key="searchQuery">
</qrcode-table>
<template>
<div id="app">
<form id="search">
Search <input name="query" v-model="searchQuery">
</form>
<qrcode-table
:data="gridData"
:columns="gridColumns"
:filter-key="searchQuery">
</qrcode-table>
<template>
<table>
<thead>
<tr>
<th
v-for="key in columns"
:key="key"
@click="sortBy(key)"
:class="{ active: sortKey == key }"
>
@iFwu
iFwu / search-selected-text.js
Last active May 23, 2019 11:08
Seach Selected Text in JavaScript Mac Automation Scripting
function validURL(str) {
var pattern = new RegExp(
'^(https?:\\/\\/)?' + // protocol
'((([a-z\\d]([a-z\\d-]*[a-z\\d])*)\\.)+[a-z]{2,}|' + // domain name
'((\\d{1,3}\\.){3}\\d{1,3}))' + // OR ip (v4) address
'(\\:\\d+)?(\\/[-a-z\\d%_.~+]*)*' + // port and path
'(\\?[;&a-z\\d%_.~+=-]*)?' + // query string
'(\\#[-a-z\\d_]*)?$',
'i'
); // fragment locator
@iFwu
iFwu / findJandanArticle.js
Last active May 21, 2019 11:46
从煎蛋标题找到文章链接的阿里云函数计算服务
const { promisifyAll, promisify } = require('bluebird');
const request = promisify(require('request'));
promisifyAll(request, { multiArgs: true });
const cheerio = require('cheerio');
module.exports.handler = async function(req, resp, context) {
const articleTitle = req.queries.articleTitle;
console.log(articleTitle);
const commentId = req.queries.commentId;
const commentAnchor = commentId ? `#comment-${commentId}` : '';
@iFwu
iFwu / Hi.jpg
Last active August 7, 2020 07:50 — forked from ryanlucas/Hi.jpg
Image Prototype Demo
Hi.jpg
@iFwu
iFwu / SketchSystems.spec
Last active August 16, 2020 08:40
Todos&
Todos&
Filter State
all -> Filter All
active -> Filter Active
completed -> Filter Completed
Filter All*
Filter Active
Filter Completed
Todo&
State
Active*
Completed
@iFwu
iFwu / machine.js
Last active August 16, 2020 15:13
Generated by XState Viz: https://xstate.js.org/viz
// Available variables:
// - Machine
// - interpret
// - assign
// - send
// - sendParent
// - spawn
// - raise
// - actions