Skip to content

Instantly share code, notes, and snippets.

View lexicalunit's full-sized avatar
🏳️‍🌈
Keeper of balance

Amy Troschinetz lexicalunit

🏳️‍🌈
Keeper of balance
View GitHub Profile
# .bashrc
################################################################################
# python environment control
################################################################################
export PYTHON_ENV=""
function entervirtualenv
{
if type virtualenvwrapper.sh >/dev/null 2>&1; then
@lexicalunit
lexicalunit / schema_validate.cpp
Created March 24, 2015 19:02
Use libvariant to validate JSON schema against JSON data
// c++ -I/usr/local/include -L/usr/local/lib -lVariant schema_validate.cpp
#include <cstdio>
#include <iostream>
#include <iomanip>
#include <algorithm>
#include <fstream>
#include <sstream>
#include <iterator>
#include <memory>
@lexicalunit
lexicalunit / GIF-Screencast-OSX.md
Created January 20, 2016 16:33 — forked from dergachev/GIF-Screencast-OSX.md
OS X Screencast to animated GIF

OS X Screencast to animated GIF

This gist shows how to create a GIF screencast using only free OS X tools: QuickTime, ffmpeg, and gifsicle.

Screencapture GIF

Instructions

To capture the video (filesize: 19MB), using the free "QuickTime Player" application:

{
"document": {
"document_id": "1",
"documentType": "Nomina Normal",
"document": "Nomina",
"documentName": "Nomina 325",
"documentNumber": "320",
"date": "2016-01-13",
"company": "SHMEX",
"currency": "Pesos",
1 Blue Mana Battery
2 Arena of the Ancients
1 Fire Diamond
2 Library of Leng
1 Feroz's Ban
1 Kormus Bell
3 Sunstone
1 Bubble Matrix
1 Horn of Greed
1 Predator, Flagship
@lexicalunit
lexicalunit / zoom_is_running
Created February 23, 2021 20:55
Detect if Zoom is running on macOS.
#!/bin/bash
APP="zoom.us"
OP="osascript -e 'tell application \"System Events\" to (name of processes) contains \"$APP\"'"
test "$(eval "$OP")" = "true"
@lexicalunit
lexicalunit / firefox-tabs
Last active February 23, 2021 21:02
Print out the URLs in the tabs currently in Firefox on macOS.
#!/usr/bin/env python3
import argparse
import json
import pathlib
# You'll need to install python-lz4: https://pypi.org/project/lz4/
import lz4.block
parser = argparse.ArgumentParser(description="List open urls in Firefox tabs")
@lexicalunit
lexicalunit / google_meet_is_running
Last active February 23, 2021 21:15
Detect if Firefox is running meet.google.com on macOS.
#!/usr/bin/bash
# See https://gist.github.com/lexicalunit/db01dbb0c1c1dc81f54cf31a825d0920 for firefox-tabs.
firefox-tabs | grep -q "meet.google.com"
@lexicalunit
lexicalunit / blickstick_utilities
Last active February 23, 2021 21:41
Some bash script utilities for working with BlinkStick
#!/bin/bash
# Source this file to import these utilites into your scripts.
BLINK_LOCK="/tmp/.blinkstick-toggle"
touch "$BLINK_LOCK"
# Choose the python needed for blinkstick and the path to blinkstick
BS="/usr/bin/python /usr/local/bin/blinkstick"
@lexicalunit
lexicalunit / meeting_detector
Created February 23, 2021 21:47
Runs forever and detects when you're in a meeting, updating BlinkStick as needed.
#!/bin/bash
source "$HOME/.blickstick_utilities"
APP="zoom.us"
OP="osascript -e 'tell application \"System Events\" to (name of processes) contains \"$APP\"'"
FIREFOX_TABS="firefox-tabs"
is_running() {
TABS="$($FIREFOX_TABS | grep 'meet.google.com')"