Skip to content

Instantly share code, notes, and snippets.

View bluven's full-sized avatar

Jianbo Yan bluven

  • BoCloud
  • Beijing
  • 16:48 (UTC +08:00)
View GitHub Profile
package store
import (
"math"
"gorm.io/gorm"
)
// Param 分页参数
type Param struct {
@bluven
bluven / dytt-clean.js
Last active March 15, 2021 08:54
一些油猴脚本
// ==UserScript==
// @name 电影天堂去广告
// @namespace http://tampermonkey.net/
// @version 0.1
// @description try to take over the world!
// @author You
// @match *://www.dygod.net/*
// @match *://www.javbus.com/*
// @grant none
// ==/UserScript==
package main
import "fmt"
func quicksort(nums []int) {
if nums == nil || len(nums) <= 1 {
return
}
quicksort2(nums, 0, len(nums) - 1)
@bluven
bluven / quicksort.go
Last active September 11, 2020 07:32
package main
import "fmt"
func quicksort(nums []int) {
if nums == nil || len(nums) <= 1 {
return
}
quicksort2(nums, 0, len(nums) - 1)
@bluven
bluven / template.ebnf
Created June 15, 2020 00:51
a EBNF description of go text/template' grammar
Template = {Text | Action} .
Action = CommentAction | PipelineAction | IfAction | RangeAction | TemplateAction | BlockAction | WithAction .
CommentAction = LD "/*" Text "*/" RD .
PipelineAction = LD ( Pipeline | VarDeclarePipeline | VarAssignPipeline ) RD .
IfAction = LD "if" Pipeline RD Template [ LD "else" ["if" Pipeline] RD Template ] End .
RangeAction = LD "range" ( Pipeline | VarDeclarePipeline ) RD Template [ LD "else" RD Template] End .
TemplateAction = LD "template" Name [Pipeline] RD .
BlockAction = LD "block" Name [Pipeline] RD .
WithAction = LD "with" Pipeline RD Template [ LD "else" RD Template] End .
Pipeline = Argument { "|" Argument } | MethodCall | FuncCall { Argument } .
@bluven
bluven / expvar_rates.py
Created November 6, 2019 09:04
filebeat metrics
import requests
import argparse
import time
import re
def main():
parser = argparse.ArgumentParser(
description="Print per second stats from expvars")
parser.add_argument("--url", default="http://localhost:6060",
@bluven
bluven / bash-cheatsheet.sh
Created March 1, 2019 04:06 — forked from LeCoupa/bash-cheatsheet.sh
Bash CheatSheet for UNIX Systems --> UPDATED VERSION --> https://github.com/LeCoupa/awesome-cheatsheets
#!/bin/bash
#####################################################
# Name: Bash CheatSheet for Mac OSX
#
# A little overlook of the Bash basics
#
# Usage:
#
# Author: J. Le Coupanec
# Date: 2014/11/04
apiVersion: v1
kind: ConfigMap
metadata:
labels:
app: mysql-operator
name: mysql
namespace: default
data:
my.cnf: |
[mysqld]
@bluven
bluven / interval.js
Created November 29, 2018 09:46
一个简化interval管理的vue-mixin
/**
* interval structure {
* name: 'syncStatus' // 需要管理的方法,必须返回boolean值
* time: 5000 必须填
* autoStart: true // 组件加载时是否自动启动 默认 false
* onFinish: 'loadBigIps' // 结束时要执行的动作,可以不设置
* }
*/
export default {
@bluven
bluven / idea-im.md
Created October 18, 2018 07:29
解决IDEA在ubuntu下不能使用的问题

idea.sh

export GTK_IM_MODULE=fcitx 
export QT_IM_MODULE=fcitx 
export XMODIFIERS=@im=fcitx