Skip to content

Instantly share code, notes, and snippets.

Avatar

Daniel Lewan TeddyDD

View GitHub Profile
View ocr.sh
#!/bin/sh
# Source https://github.com/sdushantha/dotfiles/blob/master/bin/bin/utils/ocr
TEXT_FILE="/tmp/ocr.txt"
IMAGE_FILE="/tmp/ocr.png"
# Check if the needed dependencies are installed
dependencies="tesseract-ocr
maim
notify-send
@TeddyDD
TeddyDD / fts-fdir.sql
Created Mar 13, 2021
Full text seach on files imported from fsdir in SQLite
View fts-fdir.sql
CREATE virtual table file_search using fts5 (path, file, tokenize = 'unicode61');
INSERT into file_search
SELECT name,
data
FROM fsdir('some/path')
WHERE name like "%.md";
SELECT path,
snippet(file_search, 1, '', '', '...', 5) AS snippet
@TeddyDD
TeddyDD / kak-lsp.toml
Created Mar 22, 2020
kak lsp gopls settings
View kak-lsp.toml
[language.go]
filetypes = ["go"]
roots = ["Gopkg.toml", "go.mod", ".git", ".hg"]
command = "gopls"
args = ["serve"]
offset_encoding = "utf-8"
[language.go.initialization_options]
usePlaceholders = false
hoverKind = "SynopsisDocumentation"
@TeddyDD
TeddyDD / options.go
Created Feb 24, 2020
Go option funcs pattern
View options.go
package main
import "fmt"
type Person struct {
Name string
Age int
}
type personOption func(*Person)
View raylib.lua
local ffi = require('ffi')
--local lib = ffi.load('libraylib.2.0.0.dylib')
local lib = ffi.load('libraylib')
ffi.cdef[[
// Vector2 type
typedef struct Vector2 {
float x;
float y;
} Vector2;
@TeddyDD
TeddyDD / mozyt.cr
Last active Sep 4, 2018
most viewed yt wideos from firefox history
View mozyt.cr
#!/usr/bin/env crun
# ---
# sqlite3:
# github: crystal-lang/crystal-sqlite3
# ...
# Lists most visited youtube wideos from Firefox history
# Example: Backup videos watched > 10 times
# youtube-dl $(mozyt.cr -p ~/.mozilla/firefox/PROFILEID.default/)
require "option_parser"
@TeddyDD
TeddyDD / plug.kak
Created Sep 2, 2018
plugin manager for Kakoune
View plug.kak
define-command plug -params 1..2 %{
%sh{
plugdir="/$HOME/.config/kak/src"
[ -d $plugdir ] || mkdir -p "$plugdir"
repo=$(basename $1)
if [ ! -d "$plugdir/$repo" ]; then
git clone "https://github.com/$1" "$plugdir/$repo"
fi
if [ ! -z "$2" ]; then
View dotfiles solarized light
i3 https://github.com/khamer/base16-i3/blob/master/themes/base16-solarized-light.config
xresources https://github.com/solarized/xresources/blob/master/Xresources.light
Firefox (require Color experiment)
https://color.firefox.com/?theme=XQAAAAL7AAAAAAAAAABBqYhm849SCiazH1KEGccwS-xNVAWBvuCXoU-oppwsBPRygLYBkMG1E2vhIyoJN9awg1HxriPdSQBKr3z8eJDdEo1EJW9RHCMPU04e4tjV2LZdCxc5uLqcwFh-u3j9LM7TCP4lMhoy2LBdlZOeznYZaBhbrVCEaTemWVJYHyWLUo7dHpXGUCop2ED7K7kLh16sz6WdhMVAzYPdJFbV0L6xYn66_X-V1lvbkmSRzv_q8ngA
Userstyles: https://github.com/alphapapa/solarized-everything-css
Kakoune - custom theme based on https://github.com/jan-warchol/selenized
alternative: https://github.com/robertmeta/nofrils
@TeddyDD
TeddyDD / jap.java
Created Jan 11, 2018
processing sketch with japaneese-like charachters
View jap.java
int grid = 24;
void setup() {
size(1600, 900);
frameRate(0.3);
//noLoop();
}
void draw_letter(int strokes, float size, float x, float y) {
for (int p = 0; p < strokes; p++) {
View freeorion
-- Boost version: 1.60.0
-- Found the following Boost libraries:
-- chrono
-- date_time
-- filesystem
-- regex
-- signals
-- system
-- thread
-- log