Skip to content

Instantly share code, notes, and snippets.

@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
@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
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 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 / 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 / gs_rgb2cymk
Last active November 19, 2020 01:06
convert pdf file from RGB to CYMK using ghost script
#!/usr/bin/bash
help(){
echo "Usage: $0 <input.pdf> <output.pdf> [safe]"
echo "optional \`safe\` option, preform less processing, possibly better quality with a much larger file size."
exit 127
}
if [[ $1 == "" ]] ; then
echo "Missing parameter input pdf file"
help
@bokunodev
bokunodev / nord.micro
Last active December 4, 2020 07:45
Nordic colorscheme for Micro text editor.
color-link default "#d8dee9,#2e3440"
color-link comment "#4c566a,"
# color-link comment.bright
color-link identifier "#5e81ac,"
# color-link identifier.class
# color-link identifier.macro
# color-link identifier.var
color-link constant "#bf616a,"
# color-link constant.bool
# color-link constant.bool.true
@bokunodev
bokunodev / dragable.js
Created April 17, 2021 06:41
make html element, dragable.
// dragableElement(document.querySelector("#mydiv"))
function dragableElement(a) {
let f = 0,
g = 0,
d = 0,
e = 0
eh = a.querySelector("#header") || a
eh.onmousedown = function(b) {
b = b || window.event
@bokunodev
bokunodev / Makefile
Created April 26, 2021 13:09
Makepkg default flags in a makefile
all: help
build:
makepkg --ignorearch \
--clean \
--force \
--log \
--rmdeps \
--syncdeps \
--nosign \
@bokunodev
bokunodev / convert.sh
Created May 6, 2021 21:43
Batch convert flac to mp3 using ffmpeg with configurable quality
#!/bin/bash
if [ $MP3_QUALTY -eq "" ] ; then
MP3_QUALTY=3
fi
if [ $MP3_COMPRESSION -eq "" ] ; then
MP3_COMPRESSION=0
fi