Skip to content

Instantly share code, notes, and snippets.

View vanpelt's full-sized avatar
pro

Chris Van Pelt vanpelt

pro
View GitHub Profile
# This should be triggered through a cron job at 6:15 PM on week days.
# Example cron: 15 18 * * 1,2,3,4,5 cd ~/code/jury_duty && ~/.rbenv/shims/ruby call.rb >> ~/code/jury_duty/call-log.txt 2>&1
# It uses Twilio to make a call based on TWILIO_ACCOUNT_SID, TWILIO_AUTH_TOKEN, and TWILIO_PHONE.
# It calls the JURY_PHONE, transcribes it, looks for JURER_NUMBER and texts the result to PERSONAL_PHONE.
require "rubygems"
require "bundler/setup"
Bundler.require(:default)
Dotenv.load
@korakot
korakot / checkbox.py
Last active December 2, 2022 07:00
Custom Colab widget example: Checkbox, ColorPicker, and Slider
from ctypes import cast, py_object
from google.colab import output
def set_var(v_id, value):
obj = cast(v_id, py_object).value
obj.value = value
output.register_callback('set_var', set_var)
class Checkbox:
@unya
unya / image-pull.yml
Created August 7, 2017 16:55
pre-pull images on kubernetes
apiVersion: batch/v1
kind: Job
metadata:
name: image-pull
spec:
template:
metadata:
name: image-pull
spec:
volumes:
@jehna
jehna / import_backup.py
Last active September 11, 2021 04:36
App Engine import data from Datastore Backup to localhost
"""
# App Engine import data from Datastore Backup to localhost
You can use this script to import large(ish) App Engine Datastore backups to your localohst dev server.
## Getting backup files
Follow instructions from Greg Bayer's awesome article to fetch the App Engine backups:
http://gbayer.com/big-data/app-engine-datastore-how-to-efficiently-export-your-data/
@nbari
nbari / chunk_upload.py
Last active October 7, 2024 16:10
python chunk upload files
#!/usr/bin/env python
import os
import requests
import uuid
from random import randint
from uuid import uuid4
def read_in_chunks(file_object, chunk_size=65536):
while True: