Skip to content

Instantly share code, notes, and snippets.

@DrLulz
DrLulz / pdf_slides.py
Created December 13, 2019 15:17
Make individual slides from pdf with six slides per page.
from PyPDF2 import PdfFileWriter, PdfFileReader
from copy import copy
FNAME = '49-urology'
PATH = '/Users/drlulz/Downloads/ABFM/{}.pdf'.format(FNAME)
NEW_PATH = '/Users/drlulz/Downloads/ABFM/Slides/{}.pdf'.format(FNAME)
outputStream = open(NEW_PATH, 'wb')
def go():
@DrLulz
DrLulz / ThisDocument.vba
Last active March 13, 2018 11:59
New SignOut VBA
Public Sub AutoOpen()
'ThisDocument.Application.ActiveWindow.View.Zoom.PageColumns = 1
'ThisDocument.Application.ActiveWindow.View.Zoom.Percentage = 100
ThisDocument.Application.ActiveWindow.View.Type = wdPrintView
ThisDocument.Application.ActiveWindow.View.Zoom.PageFit = wdPageFitBestFit
ThisDocument.Application.Caption = "SIGNOUT"
'ThisDocument.Application.ActiveWindow.Caption = "SIGNOUT"
With ActiveDocument.Styles(wdStyleNormal).Font
@DrLulz
DrLulz / ThisDocument.vbs
Last active January 19, 2018 17:14
SignOut
Public Sub AutoOpen()
ThisDocument.Application.ActiveWindow.View.Zoom.PageColumns = 1
'ThisDocument.Application.ActiveWindow.View.Zoom.Percentage = 100
ThisDocument.Application.ActiveWindow.View.Zoom.PageFit = wdPageFitBestFit
ThisDocument.Application.ActiveWindow.View.Type = wdPrintView
With ActiveDocument.Styles(wdStyleNormal).Font
.Size = 1
End With
ActiveDocument.ActiveWindow.View.ReadingLayout = False
'MsgBox ThisDocument.Application.UsableWidth
# 10_basic.py
# 15_make_soup.py
# 20_search.py
# 25_navigation.py
# 30_edit.py
# 40_encoding.py
# 50_parse_only_part.py

Last updated: 2015-08-11

Searching for Files

Find images in a directory that don't have a DateTimeOriginal

exiftool -filename -filemodifydate -createdate -r -if '(not $datetimeoriginal) and $filetype eq "JPEG"' .

###Output photos that don't have datetimeoriginal to a CSV### Note this can take a long time if you have a lot of jpgs

from Tkinter import *
import ttk
class MainWindow(Frame):
def __init__(self):
Frame.__init__(self)
self.master.title("ProgressBar example")
#self.master.minsize(400, 100)
self.grid(sticky=E+W+N+S)
#!/usr/local/bin/python
import os, pickle, glob, shutil, subprocess, traceback, errno
from datetime import datetime as dt
TIME = dt.utcnow().strftime('%f')
ABS_DIR = os.path.dirname(os.path.realpath(__file__))
TMP_DIR = os.path.join(ABS_DIR, TIME)
@DrLulz
DrLulz / osx
Created October 8, 2016 18:27
osx defaults
#!/bin/sh
# This is mostly inspired by @mathiasbynens `.osx`. http://mths.be/osx
# Ask for the administrator password upfront
sudo -v
# Keep-alive: update existing `sudo` time stamp until `.osx` has finished
while true; do sudo -n true; sleep 60; kill -0 "$$" || exit; done 2>/dev/null &

##use a lighter text rendering style defaults write -g AppleFontSmoothing -int 1

disable smooth scrolling

defaults write -g NSScrollAnimationEnabled -bool false

remove the animations for opening and closing windows

defaults write -g NSAutomaticWindowAnimationsEnabled -bool false

remove the animations for opening and closing Quick Look windows

@DrLulz
DrLulz / font_variables.scss
Created September 22, 2016 12:23 — forked from jacrook/font_variables.scss
Sass Css Font Stack Variables
//////////////////////////////////////////////////////////////
// Font Variables (http://cssfontstack.com/)
//////////////////////////////////////////////////////////////
//
// Serif font-stacks
//
$baskerville-font-stack: "Big Caslon", "Book Antiqua", "Palatino Linotype", Georgia, serif !default;