Skip to content

Instantly share code, notes, and snippets.

View gouflv's full-sized avatar
🏄‍♂️
Surfing

gouflv gouflv

🏄‍♂️
Surfing
  • Fuzhou, China
View GitHub Profile
@gouflv
gouflv / keybindings.json
Last active April 4, 2023 04:01
vscode setting
[
// Auto Complete
{
"key": "ctrl+enter",
"command": "editor.action.triggerSuggest",
"when": "editorHasCompletionItemProvider && textInputFocus && !editorReadonly"
},
// Focus Editor View
{
function countMatchingBrackets(str) {
const stack = []
let result = 0
const isMatch = (start, end) => start === '(' && end === ')'
for (let i = 0; i < str.length; i++) {
const prev = stack[stack.length - 1]
const curr = str[i]
@gouflv
gouflv / stringify.js
Last active January 26, 2021 09:32
Condition Stringify
const ML = (arr) => {
const gen = (arr) => {
let isLeaf = true;
const g = arr.reduce((res, val) => {
if (Array.isArray(val)) {
res.push(`(${gen(val)})`);
isLeaf = false;
} else {
res.push(`"${val}"`);
}
@gouflv
gouflv / check-git-status
Last active November 8, 2021 08:16
bash
find . -name .git -execdir bash -c 'echo -en "\033[1;31m"repo: "\033[1;34m"; basename "`git rev-parse --show-toplevel`"; git status -s' \;
(function () {
var dragYThreshold = 10
var dragDurationThreshold = 300 //ms
var el = $('.panel.footer + a')
var minTop = 20
var maxTop = window.innerHeight - el.height() - 50
var currentClientY = 0
var hasMovedY = 0
@gouflv
gouflv / jenkins-dark-theme.css
Last active July 2, 2020 10:12
jenkins dark theme for Stylebot
body {
background-color: #282C35;
}
body, table, form, td, th, p {
line-height: 1.6;
color: #bebebe;
}
a {
@gouflv
gouflv / drawer.js
Last active March 25, 2020 13:38
wx canvas drawer base on json2canvas
Page({
data: {
shareCardPaintingData: {},
shareCardVisible: false,
shareCardImagePath: '',
},
initShareCard() {
wx.showLoading({
sudo spctl --master-disable
xattr -cr /path/to/application.app
@gouflv
gouflv / init.lua
Last active July 11, 2022 02:53
hammerspoon for mac window layout
local hotkey = require 'hs.hotkey'
local screen = require 'hs.screen'
local window = require 'hs.window'
local layout = require 'hs.layout'
local geometry = require 'hs.geometry'
local application = require 'hs.application'
local hints = require 'hs.hints'
local grid = require 'hs.grid'
local logger = require 'hs.logger'
local fnutils = require 'hs.fnutils'