Skip to content

Instantly share code, notes, and snippets.

View windwp's full-sized avatar
💭
I may be slow to respond.

windwp

💭
I may be slow to respond.
  • VietNam
View GitHub Profile
@windwp
windwp / media_preview.lua
Last active April 25, 2023 21:00
telescope media preview
local utils = require('telescope.utils')
local defaulter = utils.make_default_callable
local actions = require('telescope.actions')
local finders = require('telescope.finders')
local make_entry = require('telescope.make_entry')
local pickers = require('telescope.pickers')
local previewers = require('telescope.previewers')
local builtin = require('telescope.builtin')
local conf = require('telescope.config').values
local flatten = vim.tbl_flatten
@windwp
windwp / i3-swallow.py
Last active January 4, 2023 11:27
i3-swallow used to swallow a terminal window in i3
#!/usr/bin/env python3
#-----------------------------------------------
# used to swallow a terminal window in i3
#
# INSTALL
# Install python 3 and install i3ipc libary
# pip3 install i3ipc
# download this scrript and put it to your i3 config folder and run
@windwp
windwp / livereload.lua
Created April 18, 2021 06:34
livereload for plugin development on lua
#Neovim Trick
Live Reload on plugin development and init.lua
# Demo
# How
* [ ] code
@windwp
windwp / i3-swallow-restore.py
Created June 11, 2020 10:03
update i3 swallow
#!/usr/bin/env python3
#-----------------------------------------------
# used to swallow a terminal window in i3
#
# INSTALL
# Install python 3 and install i3ipc libary
# pip3 install i3ipc
# download this scrript and put it to your i3 config folder and run
# chmod +x $HOME/.config/i3/i3-swallow.py
@windwp
windwp / animation js
Last active May 4, 2021 07:26 — forked from ilblog/README.md
Create mp4 video from set of images in the browser client side, using ffmpeg.js in worker thread
# Inspiration
* https://semisignal.com/tag/ffmpeg-js/
* https://github.com/antimatter15/whammy
ffmeg as worker can be found at https://github.com/Kagami/ffmpeg.js/
Final build can be obtained via `wget https://unpkg.com/ffmpeg.js@3.1.9001/ffmpeg-worker-mp4.js`
@windwp
windwp / run_tmux.sh
Created March 12, 2021 01:36
run_tmux.sh
#! /bin/sh
docker-compose up &
sleep 4
echo "running"
panel_1=$(tmux split-window -P -F "#{pane_id}")
tmux send -t ${panel_1} "cd ./pi1/" C-m
tmux send -t ${panel_1} "python3 main.py" C-m
@windwp
windwp / iterm.plist
Created September 8, 2020 11:34
tmux.theme.conf
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>AllowClipboardAccess</key>
<true/>
<key>AlternateMouseScroll</key>
<true/>
<key>AppleAntiAliasingThreshold</key>
<integer>1</integer>
@windwp
windwp / vim_preview.sh
Last active September 4, 2020 02:10
vim_preview.sh
#!/bin/bash
path=$@
IFS=':' read -r -a array <<< "$path"
file=${array[0]}
start=$((${array[1]} - 1 ))
end=$((${array[1]} + 5))
file=${file/\~/$HOME}
line=${array[2]}
bat $file -r $start:$end -H ${array[1]} --color always --decorations never
@windwp
windwp / m_runner.sh
Last active August 17, 2020 18:15
m_runner.sh
#!/bin/bash
# use it for continue running application
# similar entr
# if you want to use swallow function you need to install
# https://github.com/windwp/i3-master-stack
# https://github.com/windwp/i3-master-stack/blob/master/swallow
#┌──────────┐
#│vim script│
@windwp
windwp / keybinding.json
Last active July 16, 2020 03:44
auto code
// Place your key bindings in this file to override the defaultsauto[]
[
{
"key": "alt+b",
"command": "workbench.action.navigateToLastEditLocation"
},
{
"key": "ctrl+k ctrl+q",
"command": "-workbench.action.navigateToLastEditLocation"
},