This file contains 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" | |
"golang.org/x/crypto/bcrypt" | |
) | |
func main() { | |
pass := []byte("pa$$w0rd") |
This file contains 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
# -*- coding:utf-8 -*- | |
from cStringIO import StringIO | |
from PIL import Image | |
def _saveAsPNG(data, path): | |
output = open(path, 'wb') | |
output.write(data) | |
output.close() |
This file contains 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
export const EncodeGCM = (pass, salt, iv, iterations, data) => | |
new window.Promise((ok, fail) => { | |
pbkdf2(strToBuf(pass), salt, iterations, 'SHA-256', 'AES-GCM') | |
.then(key => { | |
const chunkSize = 2 << 10 | |
let len = data.byteLength / chunkSize + (data.byteLength % chunkSize ? 1 : 0) | 0 | |
let out = new window.Uint8Array([...salt, ...iv]) | |
for (let i = 0; i < len; i++) { |
This file contains 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
export default { | |
name: 'content_editable', | |
template: '<div ref="element" v-html="text"></div>', | |
props: { | |
text: [String], | |
customTag: [String], | |
}, | |
mounted: function() { | |
let newElement = document.createElement(this.customTag || 'div') |
This file contains 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" | |
"net/http" | |
"net/http/httputil" | |
"net/url" | |
) | |
func main() { |
This file contains 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 svg_to_png(svg, callback) { | |
var svgData = (new XMLSerializer()).serializeToString(svg); | |
var canvas = document.createElement("canvas"); | |
var svgSize = svg.getBoundingClientRect(); | |
canvas.width = svgSize.width; | |
canvas.height = svgSize.height; | |
var ctx = canvas.getContext("2d"); | |
var img = document.createElement("img"); |
This file contains 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
const parseJwt = token => JSON.parse(window.atob(token.split('.')[1].replace('-', '+').replace('_', '/'))) |
This file contains 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 ( | |
"bufio" | |
"fmt" | |
"os" | |
"os/exec" | |
) | |
func raw(start bool) error { |
This file contains 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
module.exports = { | |
extends: 'eslint:recommended', | |
env: { | |
browser: true, | |
}, | |
parserOptions: { | |
ecmaFeatures: { | |
jsx: true, | |
experimentalObjectRestSpread: true, | |
}, |
This file contains 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 ( | |
"context" | |
"fmt" | |
"io" | |
"math/rand" | |
"os" | |
"sync" | |
"time" |
OlderNewer