Skip to content

Instantly share code, notes, and snippets.

View Hiestaa's full-sized avatar

Romain G Hiestaa

View GitHub Profile
@Hiestaa
Hiestaa / iterm2_switch_automatic.md
Created May 5, 2020 19:20 — forked from FradSer/iterm2_switch_automatic.md
Switch iTerm2 color preset automatic base on macOS dark mode.
  1. Add switch_automatic.py to ~/Library/ApplicationSupport/iTerm2/Scripts/AutoLaunch with:
#!/usr/bin/env python3

import asyncio
import iterm2

async def main(connection):
    async with iterm2.VariableMonitor(connection, iterm2.VariableScopes.APP, "effectiveTheme", None) as mon:
@Hiestaa
Hiestaa / mongorestore-per-collection.sh
Last active June 21, 2017 20:15
mongorestore too many open files error workaround with per collection restore
#!/bin/bash
if [ $# -eq 0 ]; then
echo "usage: `basename $0` pathToDb [dbName]"
exit 1
fi
pathToDb=$1
if [ $# -eq 1 ]; then