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
Verifying my Blockstack ID is secured with the address 1KtZbxfSncmJSwXUdsmAVgJfksZW6xhTWT https://explorer.blockstack.org/address/1KtZbxfSncmJSwXUdsmAVgJfksZW6xhTWT |
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
" Minimal neovim configuration for go | |
" | |
" deoplete requires neovim, so this will not work with regular vim | |
" | |
" prereqs: | |
" - neovim | |
" - neovim python3 (pip3 install --upgrade neovim) | |
" | |
" includes: | |
" - syntax checking on save (using neomake, go and gometalinter) |
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
diff --git a/Src/compat.c b/Src/compat.c | |
index 81afd4d..02412b3 100644 | |
--- a/Src/compat.c | |
+++ b/Src/compat.c | |
@@ -635,7 +635,18 @@ strtoul(nptr, endptr, base) | |
#endif /* HAVE_STRTOUL */ | |
/**/ | |
-#if defined(BROKEN_WCWIDTH) && (defined(__STDC_ISO_10646__) || defined(__APPLE__)) | |
+#ifdef ENABLE_UNICODE9 |
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
// Replace reimplements bytes.Replace in a way that can reuse the buffer | |
func Replace(s, old, new []byte, n int, buf *bytes.Buffer) error { | |
m := 0 | |
if n != 0 { | |
// Compute number of replacements. | |
m = bytes.Count(s, old) | |
} | |
if buf == nil { |
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
// Processor implements an io.Reader | |
type Processor struct { | |
Src io.Reader | |
Old, New []byte | |
ChunkSize int | |
buf, rbuf bytes.Buffer | |
} | |
// Reset the processor | |
func (m *Processor) Reset(src io.Reader) { |
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
func Process(w io.Writer, r io.Reader) error { | |
var buf, rbuf bytes.Buffer | |
for { | |
_, err := io.CopyN(&buf, r, DefaultChunkSize) | |
if err != nil && err != io.EOF { | |
return err | |
} | |
if rerr := Replace(buf.Bytes(), []byte("hodor"), []byte("hold the door"), -1, &rbuf); rerr != nil { | |
return rerr |
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
// DefaultChunkSize is the default amount of data read from an io.Reader | |
const DefaultChunkSize = 1024 * 16 | |
// Process starts to stream data | |
func Process(r io.Reader) (io.Reader, error) { | |
var buf, rbuf, result bytes.Buffer | |
for { | |
_, err := io.CopyN(&buf, r, DefaultChunkSize) | |
if err != nil && err != io.EOF { |
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
func process(r io.Reader) (io.Reader, error) { | |
data, err := ioutil.ReadAll(r) | |
if err != nil { | |
return nil, err | |
} | |
return strings.NewReader(strings.Replace(string(data), "hodor", "hold the door", -1)), nil | |
} |
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
func process(text string) string { | |
return strings.Replace(text, "hodor", "hold the door", -1) | |
} |
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
var re = regexp.MustCompile(`hodor`) | |
func process(text string) string { | |
return re.ReplaceAllString(text, `hold the door`) | |
} |
NewerOlder