I hereby claim:
- I am rafaelsq on github.
- I am rafaelsq (https://keybase.io/rafaelsq) on keybase.
- I have a public key ASC51pXT8Rt9W-4OReF1l4nNpfZJcCYIGWsO5gOI-5VNngo
To claim this, I am signing this object:
// ORP: Optimal Recgonition Point | |
function getORPIndex(word) { | |
var length = word.length; | |
var lastChar = word[word.length - 1]; | |
if (lastChar == '\n') { | |
lastChar = word[word.length - 2]; | |
length--; | |
} | |
if (',.?!:;"'.indexOf(lastChar) != -1) length--; | |
return length <= 1 ? 0 : (length == 2 ? 1 : (length == 3 ? 1 : Math.floor(length / 2) - 1)); |
I hereby claim:
To claim this, I am signing this object:
#!/bin/sh | |
git diff --name-status --no-renames ss/development | ag -v vendor | ag -v "\.qtpl" | ag -v "/gqlgen.go" | ag -v "^D" | cut -f2 | ag "\.go$" | xargs -r dirname | sort | uniq | xargs -r golangci-lint run --config ${PWD}/.golangci.yml |
#!/bin/bash | |
echo "limon" > encdec.dec | |
echo "Encrypt" | |
openssl enc -aes-256-cbc -md sha512 -pbkdf2 -iter 10000 -salt -in encdec.dec -out encdec.enc | |
ls encdec.* | |
# encdec.enc encdec.dec |
def app(environ, start_response): | |
data = bytes("<!DOCTYPE html>\nOlá\n", 'utf-8') | |
start_response("200 OK", [ | |
["Content-Type", "text/html; charset=utf-8"], | |
["Content-Length", str(len(data))], | |
]) | |
return iter([data]) |
<!DOCTYPE html> | |
<html lang="en-us"> | |
<head> | |
<meta charset="UTF-8" /> | |
<meta name="viewport" content="width=device-width" /> | |
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/css/bulma.min.css"> | |
<title>TOTP</title> | |
</head> | |
<body> | |
<section class="section"> |
package main | |
import ( | |
"io" | |
"io/ioutil" | |
"log" | |
"net/http" | |
"net/http/httputil" | |
"os" | |
) |
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"); |
<!-- MIT License --> | |
<html> | |
<head> | |
<script> | |
function generateKey(alg, scope) { | |
return new Promise(function(resolve) { | |
var genkey = crypto.subtle.generateKey(alg, true, scope) | |
genkey.then(function (pair) { | |
resolve(pair) | |
}) |
package main | |
import ( | |
"bytes" | |
"crypto/rand" | |
"crypto/rsa" | |
"crypto/x509" | |
"encoding/pem" | |
"fmt" | |
"log" |