Skip to content

Instantly share code, notes, and snippets.

View cyrilis's full-sized avatar
😕
Confusing...

Cyril Hou cyrilis

😕
Confusing...
View GitHub Profile
@cyrilis
cyrilis / prefix.js
Created January 12, 2014 15:57
Use ECMAScript 5 in Shit Browsers
/**
* Created by Cyril Hou on 14-1-12.
*/
/*
Object.keys fix for IE7, IE8
*/
if (!Object.keys) {
// http://whattheheadsaid.com/2010/10/a-safer-object-keys-compatibility-implementation
@cyrilis
cyrilis / weixin.php
Created May 3, 2013 09:27
PHP版简单微信机器人源码 Read More http://cyrilis.com/20121117.html
<?php
/**
* wechat php test
*/
//define your token
define("TOKEN", "你的token");
$wechatObj = new wechatCallbackapiTest();
//验证微信的时候记得把下面的注释取消。还有最后两行添加注释。
@cyrilis
cyrilis / V2EX_ShortCut.user.js
Created May 3, 2013 06:22
V2EX 快捷键 用户脚本
// ==UserScript==
// @name Shotcut for V2ex
// @namespace http://cyrilis.com
// @author cyr1l(me@cyrilis.com)
// @description V2ex 添加快捷键
// @include http://*.v2ex.com/*
// @include http://v2ex.com/*
// @include http://*.v2ex.com/
// @include http://v2ex.com/
// @version 0.1
@cyrilis
cyrilis / V2ex_Gist_Style.css
Last active December 16, 2015 11:18
V2EX gist style
.line-numbers .line-number {
width: 22px;
}
.line-numbers {
background: #ececec;
}
.gist {
background: #eee;
@cyrilis
cyrilis / download_img.user.js
Created March 12, 2013 15:53
user script to download images on webpage
// ==UserScript==
// @name Img DownLoad Helper
// @namespace http://shellex.info
// @author cyr1l(houshoushuai@gmail.com)
// @description 图片下载助手-By Cyril
// @include http://*.*/*
// @include http://*.*/
// @include https://*.*/*
// @include https://*.*/
// @version 0.1
@cyrilis
cyrilis / simsimi.js
Created January 8, 2013 15:52
happy simsimi
var biu=0;
var xunhuan=function(){
if($('#msgs .new-templete .bot').size()>biu)
{$('#chatbox input').val($('#msgs .new-templete .bot span').last().html().split('<br>',1));
sendChat();
biu=$('#msgs .new-templete .bot').size();
console.log(biu+":"+$('#msgs .new-templete .bot span').last().html().split('<br>',1));
}
};
var kaishi=function(){
@cyrilis
cyrilis / index.php
Created November 11, 2012 13:42
博客php代码
<?php
require("simple_html_dom.php");
function get_files($dir) {
$files = array();
for (; $dir->valid(); $dir->next()) {
if ($dir->isDir() && !$dir->isDot()) {
if ($dir->haschildren()) {
//$files = array_merge($files, get_files($dir->getChildren()));
$files =get_files($dir->getChildren());
};