Skip to content

Instantly share code, notes, and snippets.

@hzhopen
hzhopen / cURL网页抓取
Created July 3, 2014 07:14
cURL网页抓取
<?php
/**
* 名称:cURL网页抓取
* 版本:v0.3
* 作者:吣碎De人(http://www.qs5.org)
* 最后更新时间:2013年2月4日
* 获取更新:http://www.qs5.org/
*
*/
@hzhopen
hzhopen / huijinjie backup
Created June 25, 2014 03:52
huijinjie backup
huijinjie backup
cettic
14249364
企业管理指导师系列课程-突破
<img src="/uploads/allimg/130314/1-130314214249364.jpg" style="width: 665px; height: 367px;" />
企业总裁创造力
@hzhopen
hzhopen / getElementsByClassName
Created June 25, 2014 03:51
getElementsByClassName
getElementsByClassName
<script type="text/javascript">
function ele(){
/* var elements = getElementsByClassName(document," ace_editor ace-chrome"); */
var elements = getElementsByClass("div"," ace_editor ace-chrome");
var ele1 =elements[0];
console.log("shhd"+ele1);
ele1.style.height="260px";
}
@hzhopen
hzhopen / 纯js版ajax
Created June 25, 2014 03:50
纯js版ajax
纯js版ajax
/**
* 得到ajax对象
*/
function getajaxHttp() {
var xmlHttp;
try {
// Firefox, Opera 8.0+, Safari
xmlHttp = new XMLHttpRequest();
@hzhopen
hzhopen / min.js格式化工具
Created April 3, 2014 06:21
min.js格式化工具
<html>
<head>
<title>min.js格式化工具</title> <meta http-equiv="content-type" content="text/html; charset=gb2312" />
<style>
/* Global CSS */
* { padding:0px; margin:0px; font-size:13px; font-family: arial 宋体; }
body { overflow:auto; border:0px none black; background-color:buttonface; }
li { margin:0px 0px 0px 40px; padding:2px 4px; }
/* Class CSS */
@hzhopen
hzhopen / js 64编码
Created April 3, 2014 06:14
js 64编码
// js 64编码
function base64_encode(str) {
var base64encodechars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
var out, i, len;
var c1, c2, c3;
len = str.length;
i = 0;
out = "";
while (i < len) {
c1 = str.charCodeAt(i++) & 0xff;
@hzhopen
hzhopen / 检测一个网页上的链接是否都可以正常访问
Created April 1, 2014 01:52
检测一个网页上的链接是否都可以正常访问
<?php
//检测一个网页上的链接是否都可以正常访问
//指定测试的地址(页面):
$viewUrl = "";
$host = "";
function _striplinks($document) {
@hzhopen
hzhopen / PHP CURL存储COOKIE
Created April 1, 2014 01:47
PHP CURL存储COOKIE
@hzhopen
hzhopen / Node.js模拟浏览器文件上传
Created March 26, 2014 07:19
Node.js模拟浏览器文件上传
Node.js模拟浏览器文件上传
这段代码只能一次上传一个文件
参考:
参考自(XiongLiding) 所分享代码
http://www.cnodejs.org/topic/4ffed8544764b729026b1da3
@hzhopen
hzhopen / JavaScript设计模式-单例模式
Created March 24, 2014 06:24
JavaScript设计模式-单例模式
JavaScript设计模式-单例模式
/*study*/
/**
* 使用单例模式创建一个应用程序名称空间
* 调用$(document).ready(myApp.init)
*/
var myApp = {
//初始化