Skip to content

Instantly share code, notes, and snippets.

View Gaubee's full-sized avatar
🫐
Growing

Gaubee Gaubee

🫐
Growing
View GitHub Profile
@Gaubee
Gaubee / MVC_view.html
Created July 15, 2013 07:11
一种模板解析的思路
<html>
<head>
<title>parse View</title>
</head>
<body>
<script type="template">
Hello,{{fullName}}.
<!--{{fullName}} = {{firstName}}+" "+{{lastName}}-->
<hr />
<input ms-value={{firstName}} ms-title = "姓:{{firstName}}" ></input>
function StartTagToken(){
}
function EndTagToken(){
}
function Attribute(){
}
@Gaubee
Gaubee / WebKit-Style.js
Last active December 19, 2015 17:49
write all element's style in the prototye of style. 将元素所有的样式写到style中,方便单文件复制。 mhtml的保存并不完整。
(function (G) {
function simpleDOM(tagName){
var dom = document.createElement(tagName);
document.body.appendChild(dom);
return dom;
}
function getDifStyle(el){
var baseDOM = simpleDOM(el.tagName);
var elStyle = getComputedStyle(el);
var baseDOMStyle = getComputedStyle(baseDOM);
@Gaubee
Gaubee / namespace0.2Vs0.3.js
Last active March 1, 2018 03:03
司徒正美的解析和abcd的解析比较测试。
(function(){
var KEYWORDS = "abstract,boolean,byte,char,double,final,float,goto,implements,int,interface,long,native,package,private,protected,public,short,static,synchronized,throws,transient,volatile,arguments,let,yield";
var NO_VAR_KEYWORDS={};
var REMOVE_RE = /\/\*(?:.|\n)*?\*\/|\/\/[^\n]*\n|\/\/[^\n]*$|'[^']*'|"[^"]*"|[\s\t\n]*\.[\s\t\n]*[$\w\.]+/g;
var SPLIT_RE = /[^\w$]+/g;
var KEYWORDS_RE = new RegExp(["\\b" + KEYWORDS.replace(/,/g, '\\b|\\b') + "\\b"].join('|'), 'g');
var NUMBER_RE = /\b\d[^,]*/g;
var BOUNDARY_RE = /^,+|,+$/g;
var getVariables = this.g1 = function(code) {
code = code
@Gaubee
Gaubee / 发展鬼懿群的建议.md
Created July 6, 2013 16:33
关于鬼懿IT-成长群

Gaubeegaubee@126.com 23:42:43

@管理员
需要一份群规。

还有,问问题 的话,我觉得现在国内git-osc这个git平台就不错,上面的issue就是一个十分优秀的问答平台,和Github一样,贴代码什么的高亮也方便。访问速度快。 搜索、上标签等等功能一应俱全,干嘛非要用QQ这种及时通讯来讨论低质量的话题。 时效性是QQ的优势,但难免失去了发问的质量与回答的方式,经常很多问题同时在群上提出。 也因为QQ的特性,很多优秀的问题在设备上不同步、不方便查找导致一直在重复的发问。 QQ可以作为一个召集的平台,但不应该是发问与回答的平台。

@Gaubee
Gaubee / getVariables.js
Last active March 1, 2018 03:03
获取一个函数体中出现的所有变量。
var KEYWORDS = "abstract,boolean,byte,char,double,final,float,goto,implements,int,interface,long,native,package,private,protected,public,short,static,synchronized,throws,transient,volatile,arguments,let,yield";
var NO_VAR_KEYWORDS={};
var REMOVE_RE = /\/\*(?:.|\n)*?\*\/|\/\/[^\n]*\n|\/\/[^\n]*$|'[^']*'|"[^"]*"|[\s\t\n]*\.[\s\t\n]*[$\w\.]+/g;
var SPLIT_RE = /[^\w$]+/g;
var KEYWORDS_RE = new RegExp(["\\b" + KEYWORDS.replace(/,/g, '\\b|\\b') + "\\b"].join('|'), 'g');
var NUMBER_RE = /\b\d[^,]*/g;
var BOUNDARY_RE = /^,+|,+$/g;
var getVariables = function(code) {
code = code
.replace(REMOVE_RE, '')
[
{
"spec name": "CSS Animations",
"uri": "http://www.w3.org/TR/css3-animations",
"category": "css-property",
"Name": "animation-name",
"Value": "<single-animation-name> [\n ‘,’ <single-animation-name> ]*",
"Initial": "‘none’",
"Applies To": "all elements, ::before and ::after pseudo-elements",
"Inherited": "no",
Full Line Selection 选择文本是否根据文本内容进行描边
Highlight Active Line 是否高亮所选行
Show Invisibles 显示空格、Tab、回车等不可见符号
Show Indent Guides 显示缩进对齐线
Persistent HScroll 是否保持水平滚动条的显示
Animate scrolling 滚动动画,比如查找时的跳跃
Show Gutter 显示左栏行标
Show Print Margin 显示打印边界线,超过就溢出打印范围
Use Soft Tab 软Tab,即用4个空格体态\t
Highlight selected word 提醒显示和所选单词类似的词
@Gaubee
Gaubee / 正则
Last active December 19, 2015 01:39
转换《Think in Java》成markdown格式时遇到的正则
([0-9])[ ]+\.[ ]+([0-9])
$1\.$2
[①-⑳]
#!/bin/bash
#script extraido de: http://paulocassiano.wordpress.com/2008/08/29/deixando-o-gedit-com-a-cara-do-textmate/
#tip for better "resolution" here: http://blog.siverti.com.br/2008/05/22/fonte-monaco-no-ubuntugedit/
cd /usr/share/fonts/truetype/
#TODO: put validation if folder already exists
sudo mkdir ttf-monaco