Skip to content

Instantly share code, notes, and snippets.

View peteWT's full-sized avatar

Peter Tittmann peteWT

View GitHub Profile
@peteWT
peteWT / pandas_dbms.py
Created August 21, 2012 01:19 — forked from catawbasam/pandas_dbms.py
Python PANDAS : load and save Dataframes to sqlite, MySQL, Oracle, Postgres
# -*- coding: utf-8 -*-
"""
example use of pandas with oracle mysql postgresql sqlite
lightly tested.
to do:
save/restore index (how to check table existence? just do select count(*)?),
finish odbc,
add booleans?,
sql_server?
@peteWT
peteWT / .emacs
Created May 13, 2016 17:32
emacs config file
;; Melpa
(require 'package)
(add-to-list 'package-archives
'("melpa" . "http://melpa.milkbox.net/packages/") t)
(package-initialize)
(when (memq window-system '(mac ns))
(exec-path-from-shell-initialize))
(exec-path-from-shell-copy-env "PYTHONPATH")
@peteWT
peteWT / # gdal - 2016-08-04_10-44-02.txt
Created August 4, 2016 18:03
gdal on Mac OS X 10.11.6 - Homebrew build logs
Homebrew build logs for gdal on Mac OS X 10.11.6
Build date: 2016-08-04 10:44:02
insert into ag_biomass({treeID},
{standID},
{Year},
boleKG,
barkKG,
branchKG,
biomassKG)
with foo as (select fvs.Species FIA_code,
xw.Species as CARB_code,
{DBH},
(require 'package) ;; You might already have this line
(let* ((no-ssl (and (memq system-type '(windows-nt ms-dos))
(not (gnutls-available-p))))
(url (concat (if no-ssl "http" "https") "://melpa.org/packages/")))
(add-to-list 'package-archives (cons "melpa" url) t))
(when (< emacs-major-version 24)
;; For important compatibility libraries like cl-lib
(add-to-list 'package-archives '("gnu" . "http://elpa.gnu.org/packages/")))
(package-initialize) ;; You might already have this line
(require 'ox-reveal)
(require 'package)
(let* ((no-ssl (and (memq system-type '(windows-nt ms-dos))
(not (gnutls-available-p))))
(proto (if no-ssl "http" "https")))
;; Comment/uncomment these two lines to enable/disable MELPA and MELPA Stable as desired
(add-to-list 'package-archives (cons "melpa" (concat proto "://melpa.org/packages/")) t)
;;(add-to-list 'package-archives (cons "melpa-stable" (concat proto "://stable.melpa.org/packages/")) t)
(when (< emacs-major-version 24)
;; For important compatibility libraries like cl-lib
(add-to-list 'package-archives '("gnu" . (concat proto "://elpa.gnu.org/packages/")))))
(require 'package)
(let* ((no-ssl (and (memq system-type '(windows-nt ms-dos))
(not (gnutls-available-p))))
(proto (if no-ssl "http" "https")))
;; Comment/uncomment these two lines to enable/disable MELPA and MELPA Stable as desired
(add-to-list 'package-archives (cons "melpa" (concat proto "://melpa.org/packages/")) t)
;;(add-to-list 'package-archives (cons "melpa-stable" (concat proto "://stable.melpa.org/packages/")) t)
(when (< emacs-major-version 24)
;; For important compatibility libraries like cl-lib
(add-to-list 'package-archives '("gnu" . (concat proto "://elpa.gnu.org/packages/")))))
@peteWT
peteWT / # qgis - 2019-03-27_15-39-05.txt
Created March 28, 2019 19:24
qgis (osgeo/osgeo4mac/qgis) on macOS 10.14.4 - Homebrew build logs
Homebrew build logs for osgeo/osgeo4mac/qgis on macOS 10.14.4
Build date: 2019-03-27 15:39:05
.mode csv
.header on
--CREATE INDEX tl_caseid_idx ON FVS_TreeList(caseid);
--CREATE INDEX tl_standid_idx ON FVS_TreeList(standid);
--CREATE INDEX tl_year_idx ON FVS_TreeList(year);
--CREATE INDEX tl_treeid_idx ON FVS_TreeList(treeid);
--CREATE INDEX tl_species_idx ON FVS_TreeList(species);
#!/bin/bash
# Inspired by
# https://www.codeenigma.com/community/blog/using-mdbtools-nix-convert-microsoft-access-mysql
# USAGE
# Rename your MDB file to migration-export.mdb
# run ./mdb2sqlite.sh migration-export.mdb
# wait and wait a bit longer...
mdb-schema migration-export.accdb sqlite > schema.sql