This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
apiVersion: batch/v1 | |
kind: Job | |
metadata: | |
name: image-pull | |
spec: | |
template: | |
metadata: | |
name: image-pull | |
spec: | |
volumes: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
# 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/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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: |