Skip to content

Instantly share code, notes, and snippets.

View Gaubee's full-sized avatar
🫐
Growing

Gaubee Gaubee

🫐
Growing
View GitHub Profile
@Gaubee
Gaubee / myEditor.java
Last active December 18, 2015 13:29
简单的文本编辑器。 知识点:菜单栏、快捷键、文件流、剪切板
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import java.awt.datatransfer.*;
import java.io.*;
public class myEditor extends JFrame {
String filename;
JTextArea tx;
Clipboard clip = getToolkit().getSystemClipboard();
myEditor() {

Debugging & Profiling Node.js

This is a maintained listing of all the different ways to debug and profile Node.js applications. If there is something missing or an improvement, post a comment! :)

Interactive Stack Traces with traceGL - Shareware

  1. Guide here
@Gaubee
Gaubee / gist:5014033
Last active March 1, 2018 03:04
javascript(ES3)实现闭包共享(namespace 简单版,可分文件编辑,并整合输出,不污染全局变量),通过闭包实现。 注:Compression函数用于提取代码中的变量。由于JS无块作用域,Compression并不提取块作用域中的变量,为了简化代码,也算是一个Bug。
var log = console.log;
//泳衣格式化代码的正则表达式
var reg = {
DoubleQuotedString : new RegExp('"(?:\\.|(\\\\\\")|[^\\""\\n])*"','g'),//双引号字符串
SingleQuotedString : new RegExp("'(?:\\.|(\\\\\\')|[^\\''\\n])*'",'g'),//单引号字符串
Chars : new RegExp('([(=[{])','g'),//需用空格隔开的字符(用以逻辑判断代码规则)
Empty : new RegExp('[ ]+','g'),//空字符
MultiLineCComments : new RegExp('/\\*[\\s\\S]*?\\*/', 'gm'),//多行注释
SingleLineCComments : new RegExp('//.*$', 'gm'),//单行注释
}
@Gaubee
Gaubee / gist:5013908
Last active March 1, 2018 03:04
javascript继承复写原型链函数的this._super()实现调用原函数(ES3版)
log = console.log;
var c = function(){};
c.create = function( Config ){
var newFn = function(){
//return newFn;
};
newFn.prototype = new c;
var fn = c.prototype;
for (var i in Config)