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
var CryptoJS = require("crypto-js");//replace thie with script tag in browser env | |
//encrypt | |
var rawStr = "hello world!"; | |
var wordArray = CryptoJS.enc.Utf8.parse(rawStr); | |
var base64 = CryptoJS.enc.Base64.stringify(wordArray); | |
console.log('encrypted:', base64); | |
//decrypt | |
var parsedWordArray = CryptoJS.enc.Base64.parse(base64); |
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" | |
func main() { | |
fmt.Println("Hello, World", "!") // 参数以空格分隔 | |
fmt.Print(1, 2, 3, "a", "\n") // 非字符串参数以空格分隔 | |
fmt.Printf("%s, %s! %d", "Hello", "World", 12) // 第一个字符串是标准字符串,将后面的参数填充到标准字符串中 | |
} |
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
{ | |
"window.zoomLevel": 1, | |
"editor.fontSize": 20, | |
"files.autoSave": "onFocusChange", | |
"editor.fontFamily": "'source code pro','lucida console',Consolas, 'Courier New', monospace", | |
"editor.renderWhitespace": "boundary", | |
"extensions.autoUpdate": true, | |
"editor.wrappingColumn": 0, | |
"editor.lineHeight": 29, | |
"files.trimTrailingWhitespace": 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
// ==UserScript== | |
// @name msn header | |
// @namespace http://tampermonkey.net/ | |
// @version 0.1 | |
// @description try to take over the world! | |
// @author You | |
// @match https://www.msn.com/* | |
// @grant none | |
// ==/UserScript== |
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
var MS_DAY = 1000 * 60 * 60 * 24; | |
var MS_HOUR = 1000 * 60 * 60; | |
var MS_MINUTE = 1000 * 60; | |
var MS_SECOND = 1000; | |
function addBit(num) { | |
var str = "" + num; | |
if (num < 10 && num > -1) { | |
str = "0" + 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
// 循环 | |
let find = (str, keyword) => { | |
let i = 0, arr = [] | |
let index = 0 | |
while (true) { | |
index = str.indexOf(keyword, i) | |
if (index == -1) break | |
arr.push(index) | |
i = index + 1 | |
} |
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
var path = require('path') | |
var fs = require('fs') | |
let pattern | |
let except | |
if (process.argv.length == 3) pattern = toRE(process.argv[2]) | |
if (process.argv.length == 4) { | |
pattern = toRE(process.argv[2]) | |
except = toRE(process.argv[3]) | |
} |
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 getLastDate(y, m) { return new Date(m > 11 ? y + 1 : y, m % 12, 0) } |
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
C:\Users\Administrator\AppData\Roaming\npm | |
+-- [email protected] | |
+-- [email protected] | |
+-- [email protected] -> C:\Users\Administrator\AppData\Roaming\npm\node_modules\.browser-sync_npminstall\node_modules\.2.18.6@browser-sync | |
+-- [email protected] | |
+-- [email protected] | |
+-- [email protected] | |
+-- [email protected] | |
+-- [email protected] | |
+-- [email protected] -> C:\Users\Administrator\AppData\Roaming\npm\node_modules\.generator-fountain-vue_npminstall\node_modules\.1.0.0-rc2@generator-fountain-vue |
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 vendor(style) { | |
if (!styles[style]) { | |
prefixes.map(function (prefix) { | |
return prefix | |
? prefix + style[0].toUpperCase() + style.slice(1) | |
: style | |
}).some(function (prefixedStyle) { | |
if (elementStyle[prefixedStyle] !== void 0) { | |
styles[style] = prefixedStyle | |
return true |