Skip to content

Instantly share code, notes, and snippets.

View greycode's full-sized avatar
💭
I may be slow to respond.

Calvin Yu greycode

💭
I may be slow to respond.
View GitHub Profile
@greycode
greycode / go_scp.go
Created June 26, 2013 09:40 — forked from jedy/go_scp.go
// https://blogs.oracle.com/janp/entry/how_the_scp_protocol_works
package main
import (
"code.google.com/p/go.crypto/ssh"
"crypto"
"crypto/rsa"
"crypto/x509"
"encoding/pem"
"fmt"
@greycode
greycode / editableDIV.html
Last active December 17, 2015 16:08
如何在可编辑的DIV标签中插入一段 HTML 代码。 how to insert HTML to a contenteditable DIV (IE6+)
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title> TEST </title>
<style type="text/css">
.container { border: 1px solid blue;height: 200px;padding: 5px;width: 100%; }
.container p { margin:0;padding:0; }
.holder { border:1px dashed black; margin:0 2px 0 2px; padding: 0 3px 0 3px;}
</style>
</head>
@greycode
greycode / asyncCall.js
Last active December 17, 2015 02:49
简单的AJAX调用封装,传入参数仿jQuery.ajax
/***
* 简单的异步调用封装,传入参数仿jQuery,其中url为必填项
* @example
* 示例参数如下:<pre>
* var ajaxOption = {
* type : "" , // GET/POST
* url : "" ,
* data : "" , // 传入参数
* beforeSend : function() {},
* complete : function() {},