Skip to content

Instantly share code, notes, and snippets.

View timothyclemansinsea's full-sized avatar

Tim Clemans timothyclemansinsea

View GitHub Profile
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Original script (kept up to date): https://github.com/robincamille/bot-tutorial/blob/master/mybot.py
# Twitter Bot Starter Kit: Bot 1
# This bot tweets three times, waiting 15 seconds between tweets.
# If you haven't changed credentials.py yet with your own Twitter
import tweepy
import os
import json
def get_api(cfg):
auth = tweepy.OAuthHandler(cfg['consumer_key'], cfg['consumer_secret'])
auth.set_access_token(cfg['access_token'], cfg['access_token_secret'])
return tweepy.API(auth)
def main():
# Fill in the values noted in previous step here
// This script is free open source code copyright by Timothy A. Clemans 2016 licensed under AGPL
app.addToolButton({cName: "RedactStuffMarkedForRedaction", cLabel: "Redact Stuff Marked for Redaction", cEnable: "event.rc = (app.doc != null);", cExec: "redact(this);" });
var redact = app.trustedFunction( function(doc){
app.beginPriv();
var isRedact = false;
for(var page=0;page<doc.numPages;page++){
for (var i=0;i<doc.getPageNumWords(page);i++){
if (doc.getPageNthWord(page,i)=='startredact'){
isRedact = true;
#!/usr/bin/env python
######################################################################
# Copyright (c) 2013, William Stein, Ondrej Certik, All rights reserved.
# 2-clause BSD:
# Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
# 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
# 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEM
@timothyclemansinsea
timothyclemansinsea / botos3upload.py
Last active September 17, 2015 13:57 — forked from SavvyGuard/botos3upload.py
Use boto to upload directory into s3
import boto
import boto.s3
import os.path
import sys
# Fill these in - you get them when you sign up for S3
AWS_ACCESS_KEY_ID = ''
AWS_ACCESS_KEY_SECRET = ''
# Fill in info on data to upload
import cv2
import sys
import os
from datetime import datetime
startTime = datetime.now()
plusminus = 60
#os.system('rm frames/*')
#os.system('ffmpeg -threads 0 -i ihop.mp4 -f image2 frames/%05d.png')
number_of_frames = len(os.listdir('frames'))
print number_of_frames