Skip to content

Instantly share code, notes, and snippets.

View gaboesquivel's full-sized avatar
👾
buidl

Gabo Esquivel gaboesquivel

👾
buidl
View GitHub Profile
@gaboesquivel
gaboesquivel / my-component.spec.js
Created November 6, 2017 21:20 — forked from thevangelist/my-component.spec.js
The only React.js component test you'll ever need (Enzyme + Chai)
import React from 'react';
import { shallow } from 'enzyme';
import MyComponent from '../src/my-component';
const wrapper = shallow(<MyComponent/>);
describe('(Component) MyComponent', () => {
it('renders without exploding', () => {
expect(wrapper).to.have.length(1);
});
@gaboesquivel
gaboesquivel / keybase.md
Created September 30, 2017 00:29
Keybase.md

Keybase proof

I hereby claim:

  • I am gaboesquivel on github.
  • I am gaboesquivel (https://keybase.io/gaboesquivel) on keybase.
  • I have a public key ASDygR9c6uP0ptFi_geMIVHaWut8caJbrkpf3QcmSk1Tqwo

To claim this, I am signing this object:

@gaboesquivel
gaboesquivel / a2dp.py
Created August 21, 2017 19:15 — forked from pylover/a2dp.py
Fixing bluetooth stereo headphone/headset problem in ubuntu 16.04, 16.10 and also debian jessie, with bluez5.
#! /usr/bin/env python3.5
"""
Fixing bluetooth stereo headphone/headset problem in ubuntu 16.04 and also debian jessie, with bluez5.
Workaround for bug: https://bugs.launchpad.net/ubuntu/+source/indicator-sound/+bug/1577197
Run it with python3.5 or higher after pairing/connecting the bluetooth stereo headphone.
This will be only fixes the bluez5 problem mentioned above .
@gaboesquivel
gaboesquivel / mongoose-connection-options.js
Created June 29, 2017 22:55
mLab recommended mongoose connection options. More supported connections for the underlying Node Native driver can be found here: http://mongodb.github.io/node-mongodb-native/
// mongoose 4.3.x
var mongoose = require('mongoose');
/*
* Mongoose by default sets the auto_reconnect option to true.
* We recommend setting socket options at both the server and replica set level.
* We recommend a 30 second connection timeout because it allows for
* plenty of time in most operating environments.
*/
var options = { server: { socketOptions: { keepAlive: 300000, connectTimeoutMS: 30000 } },
@gaboesquivel
gaboesquivel / clean_sources_list.sh
Created June 21, 2017 00:19
clean your sources lists
cat /etc/apt/sources.list | uniq -u > /tmp/sources.list && sudo mv /tmp/sources.list /etc/apt/sources.list
cat /etc/apt/sources.list.d/sources.list | uniq -u > /tmp/sources.list && sudo mv /tmp/sources.list /etc/apt/sources.list.d/sources.list
@gaboesquivel
gaboesquivel / deleteAllBucketsS3.sh
Created June 9, 2017 21:32
Delete all buckets in S3
aws s3api list-buckets | jq -r ".Buckets[] | .Name" | while read -r line; do aws s3 rb s3://$line --force; done

CloudFormation snippet to create a VPC to be used for lambda functions. Qualities of the VPC:

  • 4 subnets: 2 public, 2 private (lambda functions should be attached to the private ones).
  • 2 Elastic IPs that can be used to identify traffic coming from lambda functions (e.g. for firewall holes).
  • Security group that can be used for lambda functions.

Notes:

  • uses regions us-east-1a, us-east-1b
  • uses ip block of 10.15.0.0/16 for VPC
@gaboesquivel
gaboesquivel / JavaScript-Security-Tooling.md
Created April 2, 2017 15:21
JavaScript Security Tooling

standards

  • Functional Programming ( Pure Functions, Avoid Side Effects )
  • eslint: standardjs

Static Code Analysis

bugs prevention

security vulnerability scans

I just had to set up Jenkins to use GitHub. My notes (to myself, mostly):

Detailed Instructions

For setting up Jenkins to build GitHub projects. This assumes some ability to manage Jenkins, use the command line, set up a utility LDAP account, etc. Please share or improve this Gist as needed.

Install Jenkins Plugins

I just had to set up Jenkins to use GitHub. My notes (to myself, mostly):

Detailed Instructions

For setting up Jenkins to build GitHub projects. This assumes some ability to manage Jenkins, use the command line, set up a utility LDAP account, etc. Please share or improve this Gist as needed.

Install Jenkins Plugins