Skip to content

Instantly share code, notes, and snippets.

@bokunodev
bokunodev / CopyBuffer.go
Last active December 3, 2020 08:04
same as io.CopyBuffer from stdlib. except I add a cancellation channel and prioritize the allocated buffer over the io.ReadFrom and io.WriteTo interfaces.
package customio
import (
"errors"
"io"
)
var ErrCanceled = errors.New("operation canceled")
func CopyBuffer(dst io.Writer, src io.Reader, buf []byte, cancel chan struct{}) (written int64, err error) {
@bokunodev
bokunodev / init.lua
Last active July 2, 2020 16:38
rxi/lite init file
local keymap = require "core.keymap"
local config = require "core.config"
local style = require "core.style"
keymap.add { ["ctrl+q"] = "core:quit" }
require "user.colors.nord"
config.fps = 30
config.ignore_files = "!"
@bokunodev
bokunodev / nord.lua
Created June 30, 2020 00:12
Nord color sheme for github.com/rxi/lite
local style = require "core.style"
local common = require "core.common"
--[[ Nord palette
Polar Night
#2e3440
#3b4252
#434c5e
#4c566a
Snow Storm
@bokunodev
bokunodev / init.lua
Last active May 14, 2021 15:22
my textadept init file
_M["go"] = require("go")
_M["go"].format_command = "goimports"
_M["m/f"] = require("functions")
keys["`"] = function() _M["m/f"].enclose_selection("`", "`") end
keys["'"] = function() _M["m/f"].enclose_selection("'", "'") end
keys['"'] = function() _M["m/f"].enclose_selection('"', '"') end
keys['('] = function() _M["m/f"].enclose_selection('(', ')') end
keys['['] = function() _M["m/f"].enclose_selection('[', ']') end
@bokunodev
bokunodev / nord.lua
Last active May 14, 2021 15:22
Dark scheme for textadept with Nord color palette. ( look nice with go )
-- Copyright 2007-2020 Mitchell mitchell.att.foicica.com. See LICENSE.
-- Dark theme for Textadept.
-- Contributions by Ana Balan.
local view = view
local property, property_int = view.property, view.property_int
--[[ Nord palette
Polar Night
#2e3440