Skip to content

Instantly share code, notes, and snippets.

Brian Zambrano brianz

Block or report user

Report or block brianz

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
gabeweaver / react-cognito-auth-js.js
Last active Nov 13, 2019
React + Cognito User Pools + Cognito Identity JS Example
View react-cognito-auth-js.js
This example was built using standard create-react-app out of the box with no modifications or ejections
to the underlying scripts.
In this example, i'm using Google as a social provider configured within the Cognito User Pool.
Each step also represents a file, so you can see how I've chosen to organize can do it however
you'd like so long as you follow the basic flow (which may or may not be the official way....but its what I found that works.
The docs are pretty horrible)
brianz /
Last active Aug 11, 2016
brianz's tech scratch pad

Sum column using awk

cat count.txt | awk '{sum+=$1} END {print sum}'

List open ports

linux: netstat -lnptu
mac: netstat -a -p tcp

Useful Pandas Snippets

A personal diary of DataFrame munging over the years.

Data Types and Conversion

Convert Series datatype to numeric (will error if column has non-numeric values)
(h/t @makmanalp)

tito /
Created Nov 12, 2013
Bluetooth example on Android using Python / Pyjnius
Bluetooth/Pyjnius example
This was used to send some bytes to an arduino via bluetooth.
The app must have BLUETOOTH and BLUETOOTH_ADMIN permissions (well, i didn't
tested without BLUETOOTH_ADMIN, maybe it works.)
Connect your device to your phone, via the bluetooth menu. After the
pairing is done, you'll be able to use it in the app.
SEJeff / gist:5257789
Created Mar 27, 2013
Example salt config for preferencing dev but falling back to prod
View gist:5257789
# This would go in /etc/salt/master
- /srv/salt/base
- /srv/salt/dev
- /srv/salt/qa
- /srv/salt/base
Mins /
Last active Jan 9, 2020
Automating mysql_secure_installation
aptitude -y install expect
// Not required in actual script
SECURE_MYSQL=$(expect -c "
set timeout 10
evildmp / gist:3094281
Last active Jan 17, 2020
Set up Django, nginx and uwsgi
View gist:3094281

This document has now been incorporated into the uWSGI documentation:

Set up Django, nginx and uwsgi

Steps with explanations to set up a server using:

marktheunissen / pedantically_commented_playbook.yml
Created Jun 23, 2012 — forked from phred/pedantically_commented_playbook.yml
Insanely complete Ansible playbook, showing off all the options
View pedantically_commented_playbook.yml
# ^^^ YAML documents must begin with the document separator "---"
#### Example docblock, I like to put a descriptive comment at the top of my
#### playbooks.
# Overview: Playbook to bootstrap a new host for configuration management.
# Applies to: production
# Description:
# Ensures that a host is configured for management with Ansible.
afternoon /
Created Dec 5, 2011
Remove large objects from a git repository
# git-slim
# Remove big files from git repo history.
# Requires GitPython (
# References:
# -
cwestin / aggregate.js
Created May 26, 2011
Mongo shell script and sample documents used for my aggregation talk at MongoSF
View aggregate.js
/* sample aggregate command queries */
// make sure we're using the right db; this is the same as "use mydb;" in shell
db = db.getSisterDB("aggdb");
// just passing through fields
var p1 = db.runCommand(
{ aggregate : "article", pipeline : [
{ $project : {
tags : 1,
pageViews : 1
You can’t perform that action at this time.