Skip to content

Instantly share code, notes, and snippets.

View fulicat's full-sized avatar

Jack Chan fulicat

  • Social Power Information Technology(Shanghai) Co.,Ltd.
  • Shanghai, China
View GitHub Profile
@xdtianyu
xdtianyu / xxx.php
Last active December 31, 2018 11:45
<?php
if (rand()%5==0) {
echo "1111";
} else {
echo "0000";
}
?>
@qhhonx
qhhonx / weibo.py
Last active December 20, 2016 08:26
Login assist for Sina Weibo which can process verify code required situation.(新浪微博登录实现,包含验证码解析)
# coding=utf8
import base64
import binascii
import cookielib
import json
import os
import random
import re
import rsa
import time
<?php
//方法1 递归
function file_list($path)
{
$result = array();
if (is_dir($path) && $handle = opendir($path)) {
while (FALSE !== ($file = readdir($handle))) {
if ($file == '.' || $file == '..') continue 1;
$real_path = str_replace(DIRECTORY_SEPARATOR.DIRECTORY_SEPARATOR, DIRECTORY_SEPARATOR, $path.DIRECTORY_SEPARATOR.$file); //realpath($path.DIRECTORY_SEPARATOR.$file);//得到当前文件的全称路径
$result[] = $real_path
@isayme
isayme / songtaste-download.user.js
Last active January 19, 2017 11:11
油猴脚本 => 获取SongTaste歌曲下载链接, 点击页面中的"下载歌曲"即可直接下载.
// ==UserScript==
// @name SongTasteDownload
// @namespace http://www.onefloweroneworld.com
// @description 自动解析SongTaste歌曲URL,点击即可下载~
// @include http://www.songtaste.com/song/*
// @include http://songtaste.com/song/*
// @include http://www.songtaste.com/playmusic.php?song_id=*
// @include http://songtaste.com/playmusic.php?song_id=*
// @version 0.1
// @author iSayme
@lifesign
lifesign / update.php
Last active February 27, 2017 09:53
纯真数据库自动更新
<?php
/*
纯真数据库自动更新原理实现
示例代码使用php实现,从copywrite.rar中读取解密需要的一个key,然后解密qqwry.rar头0x200字节数据,随后使用zlib解压数据即可得到qqwry.dat文件
通过此代码的实现,你应该可以自行实现一个纯真数据库更新工具。copywrite.rar中还有一些更多的数据,没有一一列出,比如版本号、qqwry.rar文件大小。
collect from https://github.com/shuax/QQWryUpdate/blob/master/update.php
*/
$copywrite = file_get_contents("http://update.cz88.net/ip/copywrite.rar");
$qqwry = file_get_contents("http://update.cz88.net/ip/qqwry.rar");
@chenwery
chenwery / iframeclick.js
Created February 20, 2014 06:21
javascript:监听页面中iframe被点击
var IframeOnClick = {
resolution : 200,
iframes : [],
interval : null,
Iframe : function() {
this.element = arguments[0];
this.cb = arguments[1];
this.hasTracked = false;
},
track: function(element, cb) {
@pwartbichler
pwartbichler / Object.keys for IE8
Created August 19, 2013 12:07
Object.keys does not exist in IE8. This is a workaround.
Object.keys = Object.keys || (function () {
var hasOwnProperty = Object.prototype.hasOwnProperty,
hasDontEnumBug = !{toString:null}.propertyIsEnumerable("toString"),
DontEnums = [
'toString',
'toLocaleString',
'valueOf',
'hasOwnProperty',
'isPrototypeOf',
'propertyIsEnumerable',
@xcjs
xcjs / PHP.sublime.build
Created July 25, 2013 00:44
A JSON configuration file for Sublime Text 2 that provides a build system for PHP.
{
"selector": "source.php",
"cmd": ["php", "-l", "$file"],
"variants": [
{
"name": "Run",
"cmd": ["php", "$file"]
},
@binjoo
binjoo / date.prototype.format.js
Last active February 14, 2024 04:44
JAVASCRIPT:时间格式化
/**
* 对Date的扩展,将 Date 转化为指定格式的String
* 月(M)、日(d)、12小时(h)、24小时(H)、分(m)、秒(s)、周(E)、季度(q) 可以用 1-2 个占位符
* 年(y)可以用 1-4 个占位符,毫秒(S)只能用 1 个占位符(是 1-3 位的数字)
* eg:
* (new Date()).pattern("yyyy-MM-dd hh:mm:ss.S") ==> 2007-07-02 08:09:04.423
* (new Date()).pattern("yyyy-MM-dd E HH:mm:ss") ==> 2007-03-10 二 20:09:04
* (new Date()).pattern("yyyy-MM-dd EE hh:mm:ss") ==> 2007-03-10 周二 08:09:04
* (new Date()).pattern("yyyy-MM-dd EEE hh:mm:ss") ==> 2007-03-10 星期二 08:09:04
* (new Date()).pattern("yyyy-M-d h:m:s.S") ==> 2007-7-2 8:9:4.18
@bgrins
bgrins / Log-.md
Last active August 1, 2023 16:32
Prevent errors on console methods when no console present and expose a global 'log' function.

Javascript log Function

Every time I start a new project, I want to pull in a log function that allows the same functionality as the console.log, including the full functionality of the Console API.

There are a lot of ways to do this, but many are lacking. A common problem with wrapper functions is that the line number that shows up next to the log is the line number of the log function itself, not where log was invoked. There are also times where the arguments get logged in a way that isn't quite the same as the native function.

This is an attempt to once and for all document the function that I pull in to new projects. There are two different options:

  • The full version: Inspired by the plugin in HTML5 Boilerplate. Use this if you are writing an application and want to create a window.log function. Additionally,