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 / 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 } },

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

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

@gaboesquivel
gaboesquivel / Component.jsx
Created February 6, 2017 19:40 — forked from krambertech/Component.jsx
ReactJS: Input fire onChange when user stopped typing (or pressed Enter key)
import React, { Component } from 'react';
import TextField from 'components/base/TextField';
const WAIT_INTERVAL = 1000;
const ENTER_KEY = 13;
export default class TextSearch extends Component {
constructor(props) {
super();
@gaboesquivel
gaboesquivel / dnsmasq_setup_osx.md
Created January 5, 2017 19:49 — forked from eloypnd/dnsmasq_setup_osx.md
wildcard DNS record on OS X in localhost development with dnsmasq

wildcard DNS in localhost development

$ brew install dnsmasq
   ...
$ cp /usr/local/opt/dnsmasq/dnsmasq.conf.example /usr/local/etc/dnsmasq.conf
  • edit /usr/local/etc/dnsmasq.conf
address=/local/127.0.0.1
@gaboesquivel
gaboesquivel / git-cheatsheet.md
Created September 12, 2016 20:57 — forked from hofmannsven/README.md
My simply Git Cheatsheet
https://github.com/flyway/flyway
https://github.com/mattes/migrate
https://bitbucket.org/liamstask/goose
https://github.com/tanel/dbmigrate
https://github.com/BurntSushi/migration
https://github.com/DavidHuie/gomigrate
https://github.com/rubenv/sql-migrate