I hereby claim:
- I am mtso on github.
- I am mtso (https://keybase.io/mtso) on keybase.
- I have a public key whose fingerprint is 12C2 545D 6A9E D9CA 0E05 863A E2E2 68A1 AEBC DC78
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
/* | |
Main color: #00BF93 / #00917E | |
2ndary color: #4D698E | |
*/ | |
@import 'https://fonts.googleapis.com/css?family=Ubuntu'; |
<!DOCTYPE html> | |
<html> | |
<head> | |
<style> | |
body { | |
padding: 10em; | |
} | |
.tsukkomi-enabled { | |
/*margin: 10em;*/ |
[user] | |
name = Pavan Kumar Sunkara | |
email = pavan.sss1991@gmail.com | |
[core] | |
editor = vim | |
whitespace = fix,-indent-with-non-tab,trailing-space,cr-at-eol | |
excludesfile = ~/.gitignore | |
[sendemail] | |
smtpencryption = tls | |
smtpserver = smtp.gmail.com |
// rot13Reader's `Read([]byte) (int, error)` implementation | |
// following the go tool tour | |
// mtso, 2016 | |
// would be interesting to try a ternary with: | |
// https://play.golang.org/p/ZgLwC_DHm0 | |
package main | |
import ( | |
"io" |
package main | |
import ( | |
"golang.org/x/tour/pic" | |
"image" | |
"image/color" | |
) | |
type Image struct { | |
w int |
// My primitive solution to the web crawler exercise in the go tool tour | |
// Definitely need more practice on concurrency patterns and error package usage | |
// | |
// After much frustration, I ended up peeking at the official solution: | |
// https://github.com/golang/tour/blob/master/solutions/webcrawler.go | |
// so, I stole these ideas: | |
// the use of a concurrent closure | |
// iterating through the done channel | |
package main |
module.exports = function(callback, threshold) { | |
var isReady = true; | |
var onceMore = false; | |
var context; | |
var args; | |
function trigger() { | |
isReady = false; | |
callback.apply(context, args); | |
setTimeout(refresh, threshold); | |
} |
<!doctype html> | |
<html> | |
<body> | |
<script> | |
function readSago(src) { | |
return new Promise(function(resolve, reject) { | |
var rawFile = new XMLHttpRequest(); | |
rawFile.open('GET', src, false); | |
rawFile.onreadystatechange = function() { | |
if (rawFile.readyState === 4 && |
/** | |
* @param {string} s | |
* @return {string} | |
*/ | |
var frequencySort = function(s) { | |
var map = {}; | |
s.split('').forEach(function(char) { | |
map[char] = map[char] ? map[char] + 1 : 1; | |
}); | |
map = getEntries(map).sort(function(a, b) { |