Skip to content

Instantly share code, notes, and snippets.

@hn4002
hn4002 / schwab_api_bugs_temp_fix.py
Created November 5, 2025 23:51
Workaround fix for the bugs in the Schwab Streaming API because of the lot vs share size changes
l2_quote["service"] = event["service"]
if l2_quote["service"].upper() == "NYSE_BOOK":
# Apply the volume fix - divide volume by 100 for all asks and bids for all exchanges
bidLevelContainer = l2_quote["BIDS"]
for bidLevel in bidLevelContainer:
bidLevelVolume = 0
for bidRow in bidLevel["BIDS"]:
bidRow["BID_VOLUME"] = bidRow["BID_VOLUME"] / 100.0
bidLevelVolume += bidRow["BID_VOLUME"]
@roddds
roddds / remove_empty_dirs.py
Last active September 20, 2021 12:36
Recursively delete all empty directories
import os
for dirpath, dirnames, files in os.walk('.'):
if not (files or dirnames):
os.rmdir(dirpath)
@timvisee
timvisee / falsehoods-programming-time-list.md
Last active January 26, 2026 06:13
Falsehoods programmers believe about time, in a single list

Falsehoods programmers believe about time

This is a compiled list of falsehoods programmers tend to believe about working with time.

Don't re-invent a date time library yourself. If you think you understand everything about time, you're probably doing it wrong.

Falsehoods

  • There are always 24 hours in a day.
  • February is always 28 days long.
  • Any 24-hour period will always begin and end in the same day (or week, or month).
@discostu105
discostu105 / cropAndStraightenBatch.jsx
Last active September 1, 2024 08:23 — forked from cyberrob-zz/cropAndStraightenBatch.jsx
An photoshop batch script for crop & straighten photo from Jeffrey Tranberry
// cropAndStraightenBatch.jsx
// Copyright 2006-2008
// Written by Jeffrey Tranberry
// Photoshop for Geeks Version 2.0
/*
Description:
This script demonstates how to batch process
a folder of images using the crop and straighten command
*/
@cyberrob-zz
cyberrob-zz / cropAndStraightenBatch.jsx
Created May 20, 2014 03:37
An photoshop batch script for crop & straighten photo from Jeffrey Tranberry
// cropAndStraightenBatch.jsx
// Copyright 2006-2008
// Written by Jeffrey Tranberry
// Photoshop for Geeks Version 2.0
/*
Description:
This script demonstates how to batch process
a folder of images using the crop and straighten command
*/
@jacobtomlinson
jacobtomlinson / remove_empty_folders.py
Last active December 22, 2025 16:23
Python Recursively Remove Empty Directories
#! /usr/bin/env python
'''
Module to remove empty folders recursively. Can be used as standalone script or be imported into existing script.
'''
import os, sys
def removeEmptyFolders(path, removeRoot=True):
'Function to remove empty folders'
if not os.path.isdir(path):