Skip to content

Instantly share code, notes, and snippets.


Chris Mendez chrisjmendez

View GitHub Profile
chrisjmendez / email_builder.rb
Created Apr 17, 2018
Create and parse XML into JSON
View email_builder.rb
#!/usr/bin/env ruby
require "faker"
require 'nokogiri'
require File.join(File.dirname(__FILE__), 'lib', 'file_manager')
class EmailUtil
include FileManager
chrisjmendez / vpc_w_public_ips_and_dns.yaml
Created Apr 2, 2018
How to create a VPC with DNS and Public IPs enabled.
View vpc_w_public_ips_and_dns.yaml
AWSTemplateFormatVersion: '2010-09-09'
Description: 'AWS CloudFormation Sample Template VPC_with_PublicIPs_And_DNS: Sample
template showing how to create a VPC with DNS and Public IPs enabled. You will be
billed for the AWS resources used if you create a stack from this template.'
Description: Name of an existing EC2 KeyPair to enable SSH access to the bastion
Type: AWS::EC2::KeyPair::KeyName
chrisjmendez / Rakefile
Created May 1, 2017
Converting a WAV file to FLAC with customization.
View Rakefile
namespace :convert do
desc %Q{ ›› Convert from WAC to FLAC to 16-bit and 44.1 kHz. }
task :low_res, [:wav, :flac] do |task, args|
wav = args.wav
flac = args.flac
bit_rate = 16
sample_rate = 44100
sh %{ ffmpeg -i #{wav} -af aformat=s#{bit_rate}:#{sample_rate} #{flac} }

What I Wish I'd Known About Equity Before Joining A Unicorn

Disclaimer: This piece is written anonymously. The names of a few particular companies are mentioned, but as common examples only.

This is a short write-up on things that I wish I'd known and considered before joining a private company (aka startup, aka unicorn in some cases). I'm not trying to make the case that you should never join a private company, but the power imbalance between founder and employee is extreme, and that potential candidates would

chrisjmendez / app.js
Last active Apr 8, 2016
Simple NodeJS Server to use in conjunction with Let's Encypt
View app.js
const http = require('http'),
fs = require('fs'),
path = require('path'),
contentTypes = require('./utils/content-types'),
sysInfo = require('./utils/sys-info'),
env = process.env;
let server = http.createServer(function (req, res) {
let url = req.url;
if (url == '/') {
chrisjmendez /
Created Mar 24, 2016 — forked from dannguyen/
Using Google Cloud Vision API to OCR scanned documents to extract structured data

Using Google Cloud Vision API's OCR to extract text from photos and scanned documents

Just a quickie test in Python 3 (using Requests) to see if Google Cloud Vision can be used to effectively OCR a scanned data table and preserve its structure, in the way that products such as ABBYY FineReader can OCR an image and provide Excel-ready output.

The short answer: No. While Cloud Vision provides bounding polygon coordinates in its output, it doesn't provide it at the word or region level, which would be needed to then calculate the data delimiters.

On the other hand, the OCR quality is pretty good, if you just need to identify text anywhere in an image, without regards to its physical coordinates. I've included two examples:

####### 1. A low-resolution photo of road signs

chrisjmendez / ClassicaKUSC.csv
Last active Mar 22, 2016
Classical KUSC audit in JSON format prepared by
View ClassicaKUSC.csv
We can make this file beautiful and searchable if this error is corrected: Unclosed quoted field in line 2.
"article","Membership - Donate Your Car",,,"article|3|-1611848369",,,,"en",,,,,"",,,"","KUSC",,,,,,,,,,,,,,,,,,,,,,,,,,,,,"Do you have a vehic
chrisjmendez /
Last active Sep 2, 2019
Triton Audio streams for Classical KUSC and Classical KDFC

Stream URL's for Classical KUSC and Classical KDFC

New URL Pattern:

http://[bit rate].[encoder format].[file format].[call letters].live

Old URL Pattern:

chrisjmendez / gist:5083093
Last active Dec 14, 2015
MongoDB Conference - Strategies
View gist:5083093


multi-key indexing allows for indexing properties within an array. It makes things fast [ red, blue, green ]

On the way out Is red in the colors array? Is red not in the colors array? Scalar: $ne, $mod, $exists, $type, $lt, $gt, $gte, $ne Vector: $in, $nin, $all, $size