Skip to content

Instantly share code, notes, and snippets.

View opencoca's full-sized avatar
😅
Trapped working in paradise!

OpenCo opencoca

😅
Trapped working in paradise!
View GitHub Profile
#!/bin/sh
while inotifywait -e modify .; do
lessc style.less > style.css
NOW=(date +"%T")
echo "$NOW : compiled style.less"
done
@opencoca
opencoca / django-filer-backup.py
Created March 31, 2017 23:26
A simple little script that exports django filer files.
import os
import filer
from shutil import copyfile
def ensure_dir(file_path):
if not os.path.exists(file_path):
os.makedirs(file_path)
backup_dir = "/backup_dir"
@opencoca
opencoca / search.py
Last active February 12, 2022 21:43
Python Sqlite search for string
import sqlite3
import os
filename = "simple.db"
search = "search"
with sqlite3.connect(filename) as conn:
conn.row_factory = sqlite3.Row
cursor = conn.cursor()
cursor.execute("SELECT name FROM sqlite_master WHERE type='table'")
for tablerow in cursor.fetchall():