Skip to content

Instantly share code, notes, and snippets.

@brazilbean
brazilbean / Gist - Creating reports using Jupyter Notebooks.ipynb
Last active July 20, 2022 09:12
Create a report using a Jupyter Notebook
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@drosenstark
drosenstark / everwatch-turbo.rb
Last active September 2, 2015 23:55
Everwatch :: Show Evernote Markdown in Marked
#!/usr/bin/env ruby
# encoding: UTF-8
# everwatch.rb by Brett Terpstra, 2011
# Watch Evernote for updates and put the current content of the editor into a preview file for Marked.app
# <http://markedapp.com>
# Modified by dan@rosenstark.com, 2015-08-24, Evernote 6.0.16
# TO LAUNCH USE (if in ~/scripts):
# ~/scripts/everwatch-turbo.rb &
require 'digest/sha2'
require 'fileutils'

Last updated: 2017-03-18

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

/*
* This script goes through your Gmail Inbox and finds recent emails sent
* to you where you are not the last respondent. These may be emails that
* are awaiting your reply. It applies a label to them, so you can search
* for them easily.
*
* To remove and ignore an email thread, just remove the email from inbox
* or remove the unrespondedLabel and apply the ignoreLabel.
*
* This is most effective when paired with a time-based script trigger.
@bsweger
bsweger / useful_pandas_snippets.md
Last active April 19, 2024 18:04
Useful Pandas Snippets

Useful Pandas Snippets

A personal diary of DataFrame munging over the years.

Data Types and Conversion

Convert Series datatype to numeric (will error if column has non-numeric values)
(h/t @makmanalp)

@cliss
cliss / organize-photos.py
Created October 6, 2013 14:43
Photo management script. This script will copy photos from "~/Pictures/iPhone Incoming" into a tree the script creates, with folders representing month and years, and photo names timestamped. Completely based on the work of the amazing Dr. Drang; see here: http://www.leancrew.com/all-this/2013/10/photo-management-via-the-finder/ You can see more…
#!/usr/bin/python
import sys
import os, shutil
import subprocess
import os.path
from datetime import datetime
######################## Functions #########################
@jed
jed / how-to-set-up-stress-free-ssl-on-os-x.md
Last active February 25, 2024 17:35
How to set up stress-free SSL on an OS X development machine

How to set up stress-free SSL on an OS X development machine

One of the best ways to reduce complexity (read: stress) in web development is to minimize the differences between your development and production environments. After being frustrated by attempts to unify the approach to SSL on my local machine and in production, I searched for a workflow that would make the protocol invisible to me between all environments.

Most workflows make the following compromises:

  • Use HTTPS in production but HTTP locally. This is annoying because it makes the environments inconsistent, and the protocol choices leak up into the stack. For example, your web application needs to understand the underlying protocol when using the secure flag for cookies. If you don't get this right, your HTTP development server won't be able to read the cookies it writes, or worse, your HTTPS production server could pass sensitive cookies over an insecure connection.

  • Use production SSL certificates locally. This is annoying

@pwc3
pwc3 / Exchange Sync.applescript
Last active February 1, 2024 12:34
AppleScript to copy all of the events from an Exchange calendar to an iCloud calendar.
tell application "Calendar"
-- delete everything from the destination calendar
-- TODO: Change "Destination Calendar" to be the name of your destination calendar
repeat with anEvent in (get events of calendar "Destination Calendar")
delete anEvent
end repeat
-- copy all events from the source calendar to the destination
-- TODO: Change "Source Calendar" to be the name of your source calendar
-- TODO: Change "Destination Calendar" to be the name of your destination calendar
@brettkelly
brettkelly / oauth_example.py
Created February 26, 2013 18:55
Authenticate with the Evernote Cloud API using OAuth and Python
# Python OAuth example
import evernote.edam.userstore.constants as UserStoreConstants
import evernote.edam.type.ttypes as Types
from evernote.api.client import EvernoteClient
##
# Helper function to turn query string parameters into a
# Python dictionary
##
@pithyless
pithyless / gist:1208841
Created September 10, 2011 21:49
Install Python 2.7 (homebrew + pip + virtualenv) on Mac OS X Lion

Install Python

$ brew install readline sqlite gdbm
$ brew install python --universal --framework
$ python --version
Python 2.7

Symlinks...