This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <!DOCTYPE html> | |
| <html> | |
| <head> | |
| <meta charset="UTF-8"> | |
| <title></title> | |
| <script src="https://www.jq22.com/jquery/vue.min.js"></script> | |
| <style> | |
| * { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| (function() { | |
| //判断浏览器是否支持localStorage | |
| if(!window.localStorage) { | |
| console.log('当前浏览器不支持localStorage!'); | |
| return false; | |
| } | |
| var test = '0123456789'; | |
| //递归 加到10kb | |
| var add = function(num) { | |
| num += num; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| //权限按钮控制指令 | |
| Vue.directive('auth', { | |
| inserted: function (el, binding) { | |
| let hasAuth = false; | |
| if(Cookies.get('roles')){ | |
| let roles = JSON.parse(Cookies.get('roles')); | |
| let value = binding.value; | |
| roles.forEach(item => { | |
| if (item === value) { | |
| hasAuth = true; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| # | |
| # GoLang cross-compile snippet for Go 1.6+ based loosely on Dave Chaney's cross-compile script: | |
| # http://dave.cheney.net/2012/09/08/an-introduction-to-cross-compilation-with-go | |
| # | |
| # To use: | |
| # | |
| # $ cd ~/path-to/my-awesome-project | |
| # $ go-build-all | |
| # |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| TIMESTAMP := $(shell /bin/date "+%F %T") | |
| NAME := snowflake | |
| VERSION := 1.0.3 | |
| LDFLAGS := -s -w \ | |
| -X 'main.BuildVersion=$(VERSION)' \ | |
| -X 'main.BuildGitBranch=$(shell git describe --all)' \ | |
| -X 'main.BuildGitRev=$(shell git rev-list --count HEAD)' \ | |
| -X 'main.BuildGitCommit=$(shell git rev-parse HEAD)' \ | |
| -X 'main.BuildDate=$(shell /bin/date "+%F %T")' | |
| fmt: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package main | |
| import ( | |
| "log" | |
| "os/exec" | |
| ) | |
| func main() { | |
| path, err := exec.LookPath("ls") | |
| if err != nil { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package main | |
| import ( | |
| "fmt" | |
| "io/ioutil" | |
| "log" | |
| ) | |
| func main() { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* | |
| ** create by @d1y in 2020/04/02 | |
| ** see: https://stackoverflow.com/questions/38673673/access-http-response-as-string-in-go | |
| */ | |
| package main | |
| import ( | |
| "net/http" | |
| "io/ioutil" | |
| "log" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| "use strict"; | |
| Object.defineProperty(exports, "__esModule", { value: true }); | |
| const vscode = require("vscode"); | |
| const allConfig = vscode.workspace.getConfiguration(); | |
| const config = allConfig.gohome; | |
| const GetOffMessage = '已经下班啦~ 赶紧滚回家去'; | |
| const NotificationMessage = '到点啦~ 该下班了!'; | |
| /** 获取提示消息 */ | |
| function getMessage() { | |
| const now = new Date(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package main | |
| import ( | |
| "fmt" | |
| "os" | |
| ) | |
| func main() { | |
| file, err := os.Open("filetoread.txt") | |
| if err != nil { |