Skip to content

Instantly share code, notes, and snippets.

@sidkang
sidkang / learn_pandas.py
Created November 19, 2017 15:03
New Try
import pandas as pd
for i in range(10):
import win32com.client as win32
@sidkang
sidkang / script.scpt
Last active November 1, 2021 12:14
change IME using AppleScript
launch application "System Events"
delay 0.1
ignoring application responses
tell application "System Events" to tell process "TextInputMenuAgent"
click menu bar item 1 of menu bar 2
end tell
end ignoring
do shell script "killall 'System Events'"
delay 0.1
@sidkang
sidkang / beancount.lua
Created January 29, 2023 03:25
Neovim Beancount Basic Config
-- after/ftplugin/beancount.lua
vim.opt.wrap = false
vim.opt.tabstop = 4
vim.opt.softtabstop = 4
vim.opt.shiftwidth = 4
vim.opt.expandtab = true
vim.g.beancount_separator_col = 55
vim.g.beancount_root = vim.trim(vim.fn.system('pwd')) .. "/" .. "main.bean"
@sidkang
sidkang / resize-pdf.py
Last active May 2, 2023 10:42
Resize PDF Files to Same Page Size Using Python
from PyPDF2 import PdfFileReader, PdfFileWriter
from PyPDF2.pdf import PageObject
from pathlib import Path
pdf_file = Path.home() / 'Downloads' / 'General harmony - practical, analysis and principle.pdf'
pdf_reader = PdfFileReader(str(pdf_file))
writer = PdfFileWriter()
# assume page 0 is the desired size
page0 = pdf_reader.getPage(0)
@sidkang
sidkang / config.lua
Created October 13, 2023 10:30
beancount cmp with nvim
return {
{
"hrsh7th/nvim-cmp",
dependencies = {
"crispgm/cmp-beancount",
"hrsh7th/cmp-nvim-lsp-signature-help",
},
opts = function(_, opts)
local cmp = require "cmp"