Skip to content

Instantly share code, notes, and snippets.

View saraducks's full-sized avatar

saranya dhakshina saraducks

View GitHub Profile
"detect and conceal credit card info"
import boto3
client = boto3.client('comprehend', 'us-west-2')
text = "1234 5678 9012 3456 05/24 CVV 123"
print("detected text with credit card information", text)
get_pii_indices = client.detect_pii_entities(Text=text, LanguageCode="en")
replace_pii = None
for i in get_pii_indices['Entities']:
if i.get('Type') == 'CREDIT_DEBIT_NUMBER':
credit_card_number_from_text = text[i.get('BeginOffset'): i.get('EndOffset')]
@saraducks
saraducks / jinja2_file_less.py
Created October 18, 2016 06:47 — forked from wrunk/jinja2_file_less.py
python jinja2 examples
#!/usr/bin/env/python
#
# More of a reference of using jinaj2 without actual template files.
# This is great for a simple output transformation to standard out.
#
# Of course you will need to "sudo pip install jinja2" first!
#
# I like to refer to the following to remember how to use jinja2 :)
# http://jinja.pocoo.org/docs/templates/
#
@saraducks
saraducks / The Technical Interview Cheat Sheet.md
Created August 15, 2016 21:27 — forked from tsiege/The Technical Interview Cheat Sheet.md
This is my technical interview cheat sheet. Feel free to fork it or do whatever you want with it. PLEASE let me know if there are any errors or if anything crucial is missing. I will add more links soon.

Studying for a Tech Interview Sucks, so Here's a Cheat Sheet to Help

This list is meant to be a both a quick guide and reference for further research into these topics. It's basically a summary of that comp sci course you never took or forgot about, so there's no way it can cover everything in depth. It also will be available as a gist on Github for everyone to edit and add to.

Data Structure Basics

###Array ####Definition:

  • Stores data elements based on an sequential, most commonly 0 based, index.
  • Based on tuples from set theory.