Skip to content

Instantly share code, notes, and snippets.

View ozgurkalan's full-sized avatar
🏭
at the office

OzInClouds ozgurkalan

🏭
at the office
View GitHub Profile
@ozgurkalan
ozgurkalan / Open with Sublime
Last active February 18, 2018 18:26
Terminal Open with Sublime in Mac Terminal.app
# very helpful for altering files with Sublime...
# Terminal Open with Sublime
# copy and paste in Terminal.app
Sudo su
cd /usr/local/bin
ln -s "/Applications/Sublime Text.app/Contents/SharedSupport/bin/subl" /usr/local/bin/sublime
echo "that's all..."
@ozgurkalan
ozgurkalan / git_restart
Created February 18, 2018 18:47
Git start-over and clean everything backwards
# detele .git file and start over with initial commit
# copy and paste in terminal
# or include it in Terminal.app with a function...
rm -rf .git
git init
git add .
git commit -am "initial commit"
echo "git restarted..."
@ozgurkalan
ozgurkalan / .gitignore
Last active January 21, 2023 08:22
.gitignore sandbox
# Ignore dynaconf secret files
*secrets*
# archive folder
__archive__/
__archive/
# tmp folders
tmp/
@ozgurkalan
ozgurkalan / Kobo Reader Highlights & Annotations
Last active August 5, 2022 11:08
Kobo eReader - KoboReader.sqlite - SQL statement for listing books, highlights and annotations per chapter
'''''list highlights and annotations by ISBN and book:
select
ISBN, title,
text, annotation
from bookmark
left outer join content
on (content.contentID=bookmark.VolumeID and content.ContentType=6)
where
text is not null;
@ozgurkalan
ozgurkalan / vscode.code-workspace
Last active January 21, 2023 08:34
VSCode Workspace Awesomeness
{
"folders": [
{"path": "."},
],
"settings": {
"files.exclude": {
"**/.git": true,
"**/.svn": true,
"**/.hg": true,
@ozgurkalan
ozgurkalan / xlw
Last active September 27, 2022 07:25
XLwings goodies
import xlwings as xw
import pandas as pd
class xlw:
"""
xlwings Excel helper class
parameters:
file: excel file as posixpath path
@ozgurkalan
ozgurkalan / bash actions
Last active January 21, 2023 09:46
BASH Profile
#reload this profile ** required after bash changes
alias reloadme="source ~/.zshrc"
# ..or
alias reloadme=zsh
# open bash profile in sublime
alias subash="sublime ~/.bashrc"
@ozgurkalan
ozgurkalan / Docx helper.py
Last active February 2, 2023 14:03
MS Office Python Helpers
""" Microsoft docx files helper class
requiremensts:
- python-docx
- docxcompose
- ozcore
"""
import os
from pathlib import PosixPath
from typing import Union, List
@ozgurkalan
ozgurkalan / base.py
Last active January 29, 2023 13:39
qgrid
"""
Base class for qgrid settings
"""
import pandas as pd
import qgrid
import ipywidgets as widgets
from IPython.display import display, Javascript
import time
from zipfile import ZipFile, ZIP_DEFLATED
from ozcore import core
def backup_db():
"""Backup the database and py file"""
with ZipFile(
path.joinpath("Backup_" + core.utils.now_prefix("_") + "_db.zip"),
"w",
ZIP_DEFLATED,