Skip to content

Instantly share code, notes, and snippets.

View idwagner's full-sized avatar

Isaac Wagner idwagner

  • North Carolina
View GitHub Profile
import re
lower = lambda x: 1 if re.search(r'[a-z]', x) else 0
upper = lambda x: 1 if re.search(r'[A-Z]', x) else 0
numeric = lambda x: 1 if re.search(r'[0-9]', x) else 0
symbol = lambda x: 1 if re.search(r'[~!@#$%^&*]', x) else 0
invalid = lambda x: 1 if not re.search(r'[a-zA-Z0-9~!@#$%^&*]', x) else 0
@idwagner
idwagner / timesheet.py
Created January 26, 2022 13:40
Superproductivity timesheet report
#!/usr/bin/env python3
import os
import json
from datetime import datetime, timedelta
BACKUP_PATH=os.path.expanduser('~/Library/Application Support/superProductivity/backups')
fname = sorted(os.listdir(BACKUP_PATH))[-1]
dates = {}
@idwagner
idwagner / simple_python_datasource.py
Created September 30, 2017 01:08 — forked from linar-jether/simple_python_datasource.py
Grafana python datasource - using pandas for timeseries and table data. inspired by and compatible with the simple json datasource
from flask import Flask, request, jsonify, json, abort
from flask_cors import CORS, cross_origin
import pandas as pd
app = Flask(__name__)
cors = CORS(app)
app.config['CORS_HEADERS'] = 'Content-Type'
@idwagner
idwagner / codepipeline_job.py
Created September 13, 2017 00:53
codepipeline external job
"""
doesn't work with >v0.2.. but not used either
"""
import sys
import traceback
import signal
import json
from threading import Thread
require 'aws-sdk'
Puppet::Functions.create_function(:ssm_param) do
#sensitive = Puppet::Pops::Types::PSensitiveType::Sensitive rescue String
#send(:define_method, :sensitive) { sensitive }
dispatch :ssm_param do
param 'String', :x
end