Skip to content

Instantly share code, notes, and snippets.

View chairuosen's full-sized avatar

Ruosen Chai chairuosen

View GitHub Profile
@chairuosen
chairuosen / 111.vue
Last active August 14, 2020 08:12
111
<style lang="less" type="text/less" scoped>
.pull-reload{
position:relative;
overflow:hidden;
.hidden{
position:absolute;
top:-10px;
left:0;
right:0;
line-height:20px;
function debounce(){
let lock = false;
return function(fn){
return async function(...args){
if(lock) return;
lock = true;
try{
let res = await fn(...args);
lock = false;
return res;
@chairuosen
chairuosen / test.js
Created January 17, 2019 03:08
烟花动画
function createPaper(options) {
var angle = options.angle * (Math.PI / 180);
var spread = options.spread * (Math.PI / 180);
return {
x: options.x,
y: options.y,
depth: .5 * Math.random() + .6, // 匀速下落速度系数
wobble: 10 * Math.random(), // 摇晃系数
velocity: .5 * options.startVelocity + Math.random() * options.startVelocity,
angle2D: -angle + (.5 * spread - Math.random() * spread),
var exec = require('child_process').exec;
var map = {
'qicai-fe':{
cmd:'cd /data/node/qicai-fe/;sh update.sh'
},
'hotchat-panel':{
cmd:'cd /data/node/hotchat-public-platform-panel/;git pull;cnpm install;npm run build;cp -r dist/* ./dist2'
},
};
var count = 0;
<style lang="less">
.highlight{
color:red;
}
</style>
<template>
<input type="text" v-model="keyword" @keyup="search(keyword);" >
<ul>
<li v-for="item in list" v-search-target >{{item}}</li>
</ul>
[
{
type:"header",
name:"数据层级",
list:[
{
type:"text",
value:"数据名称"
},
{
Jun@VAIO 192.168.1.216 23:52:54 ~ >
cat shell/a.sh
#!/bin/bash
echo '$0: '$0
echo "pwd: "`pwd`
echo "scriptPath1: "$(cd `dirname $0`; pwd)
echo "scriptPath2: "$(pwd)
echo "scriptPath3: "$(dirname $(readlink -f $0))
echo "scriptPath4: "$(cd $(dirname ${BASH_SOURCE:-$0});pwd)
Jun@VAIO 192.168.1.216 23:53:17 ~ >
import urllib2
import urllib
import datetime
import time
id = str(100000153892)
content = urllib2.urlopen('http://bj.wokuan.cn/phoneservice/get_server_time.php').read()
year = int(content[15:19])
mon = int(content[20:22])
day = int(content[23:25])
hour = int(content[26:28])
@chairuosen
chairuosen / gist:7467c59bfa5bb1432f3c
Created December 28, 2015 06:32
grep 没有某个字符串
grep -v