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
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 stuff...you 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
brianz / tech-scratch-pad.md
Last active Aug 11, 2016
brianz's tech scratch pad
View tech-scratch-pad.md

Sum column using awk

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

List open ports

linux: netstat -lnptu
mac: netstat -a -p tcp
View useful_pandas_snippets.md

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
tito / bluetooth.py
Created Nov 12, 2013
Bluetooth example on Android using Python / Pyjnius
View bluetooth.py
'''
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
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
file_roots:
base:
- /srv/salt/base
dev:
- /srv/salt/dev
- /srv/salt/qa
- /srv/salt/base
qa:
@Mins
Mins / mysql_secure.sh
Last active Jan 9, 2020
Automating mysql_secure_installation
View mysql_secure.sh
#!/bin/bash
aptitude -y install expect
// Not required in actual script
MYSQL_ROOT_PASSWORD=abcd1234
SECURE_MYSQL=$(expect -c "
set timeout 10
@evildmp
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:

http://uwsgi-docs.readthedocs.org/en/latest/tutorials/Django_and_nginx.html

Set up Django, nginx and uwsgi

Steps with explanations to set up a server using:

@marktheunissen
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
afternoon / git-slim.py
Created Dec 5, 2011
Remove large objects from a git repository
View git-slim.py
#!/usr/bin/python
#
# git-slim
#
# Remove big files from git repo history.
#
# Requires GitPython (https://github.com/gitpython-developers/GitPython)
#
# References:
# - http://help.github.com/remove-sensitive-data/
@cwestin
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.