Skip to content

Instantly share code, notes, and snippets.

View jefftriplett's full-sized avatar
Living the dream

Jeff Triplett jefftriplett

Living the dream
View GitHub Profile
@RainJayTsai
RainJayTsai / minimize_docker_python_application
Last active May 26, 2022 06:25
using docker BUILDKIT example, cache pip and mount temp whl to install. tensorflow python3.6
# syntax = docker/dockerfile:experimental
FROM python:3.6 as base
######################################
FROM base as builder
ENV PYTHONPATH=$PYTHONPATH:/install/lib/python3.6/site-packages/
# bind a wheel and install it
@tonyarnold
tonyarnold / CompareTools.plist
Created March 6, 2019 22:35
Git Tower & Sublime Merge Integration
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<array>
<dict>
<key>ApplicationIdentifier</key>
<string>com.sublimemerge</string>
<key>ApplicationName</key>
<string>Sublime Merge</string>
<key>DisplayName</key>
@munificent
munificent / generate.c
Last active January 27, 2025 18:14
A random dungeon generator that fits on a business card
#include <time.h> // Robert Nystrom
#include <stdio.h> // @munificentbob
#include <stdlib.h> // for Ginny
#define r return // 2008-2019
#define l(a, b, c, d) for (i y=a;y\
<b; y++) for (int x = c; x < d; x++)
typedef int i;const i H=40;const i W
=80;i m[40][80];i g(i x){r rand()%x;
}void cave(i s){i w=g(10)+5;i h=g(6)
+3;i t=g(W-w-2)+1;i u=g(H-h-2)+1;l(u
# Create pubsub topics for cron regular tasks
gcloud pubsub topics create cron-minute
gcloud pubsub topics create cron-hour
gcloud pubsub topics create cron-day
# Create minute, hour, daily heartbeat events
gcloud alpha scheduler jobs create pubsub minute-task --topic cron-minute --schedule="* * * * *" --message-body="OK"
gcloud alpha scheduler jobs create pubsub hour-task --topic cron-hour --schedule="0 * * * *" --message-body="OK"
gcloud alpha scheduler jobs create pubsub day-task --topic cron-day --schedule="0 2 * * *" --message-body="OK"
@FlipperPA
FlipperPA / virtualenvwrapper-venv-aliases.sh
Last active June 14, 2023 16:56
Shortcuts for Python 3's venv for virtualenvwrapper users.
export VENV_HOME=~/.venvs
export VENV_PYTHON=/usr/bin/python3.6
fn_workon() {
if [ -f "${VENV_HOME}/${1}/bin/activate" ]; then
export VENV_CURRENT="${VENV_HOME}/${1}"
# Run commands before activation
if [ -f "${VENV_CURRENT}/pre_activate.sh" ]; then
. "${VENV_CURRENT}/pre_activate.sh"
fi
@AnthonyBriggs
AnthonyBriggs / joystick_demo.py
Created September 10, 2018 13:32
Mu/PygameZero/Kenney.nl demo code
"""
Demo code for Mu/PygameZero using kenney.nl graphics.
There's a short video demo at https://www.youtube.com/watch?v=b2IPNCJtUL4.
NOTE: this relies on two patches to Mu which aren't yet in
the main PgZero repository, one which adds joystick
support, and another which adds a flip property to
the Actor class.
"""

In a terminal start a server.

$ python -m SimpleHTTPServer 8000

In another terminal set up the cgroups freezer.

#!/usr/bin/env python
# -*- coding: utf-8 -*-
""" Use in i3wm with:
Save as screeshot.py somewhere into your PATH
bindsym --release Print exec --no-startup-id screenshot.py
"""
import os

Hello █████,

Thanks for getting in touch and for this tremendous invitation. I'm flattered and excited by the offer.

Representation matters to me. I'm curious: How are you aiming to build a diverse speaker line-up this year? Last years's conference only had 1 female and 1 person of color.

My inclusion rider: I'll join as a speaker if the line-up includes at least ██ women and ██ POC.

I realize putting together a diverse line-up is difficult. As a white male, I'd rather not take up a slot that could better feature someone not like me. Here's a list of people I can recommend.

activate application "SystemUIServer"
tell application "System Events"
tell process "SystemUIServer"
-- Working CONNECT Script. Goes through the following:
-- Clicks on Bluetooth Menu (OSX Top Menu Bar)
-- => Clicks on SX-991 Item
-- => Clicks on Connect Item
set btMenu to (menu bar item 1 of menu bar 1 whose description contains "bluetooth")
tell btMenu
click