Skip to content

Instantly share code, notes, and snippets.

View jbinto's full-sized avatar

Jesse Buchanan jbinto

View GitHub Profile
<#
Create Unix VM's.
PREREQUISITES:
- A VM that has been installed with an OS that supports cloud-init
- cloud-init is installed on the vm
How it works:
- Asks for a bunch of parameters
- Creates a disk from parent vhdx for speed
@jbinto
jbinto / node_debugging_tricks.md
Last active April 15, 2023 15:59
Some dumb node debugging tricks

Some dumb Node.js debugging tricks

On Nov 15 2022 @cszatmary DM'd me about a flaky test he was having trouble with.

I don't want to get too in the weeds here about the specific problem or the challenges of our codebase, but if you would like a tl;dr of the actual issue we encountered, click show gory details below:

Click here to show gory details
  • A brand new Supertest test would sometimes time out after 60 seconds, but only on CircleCI
  • Turning gzip compression off would make the tests pass reliably, this turned out to be a red herring
@jbinto
jbinto / mkjira.md
Last active November 5, 2021 21:17
mkjira (quickly make JIRA tickets from the command line)
@jbinto
jbinto / input.scss
Created November 9, 2020 22:06
Generated by SassMeister.com.
h2 {
:global([data-theme="fancy"]) :global([[data-color="pineapple"]]) & :global(em) {
display: none;
}
}
// option 1 to override fetch, using cypress built-in facilities (e.g. sinon)
cy
// sinon syntax ⬇️
.stub(win, 'fetch')
.withArgs('/graphql')
// The pseudocode-ish that this generates, kinda like this:
const realFetch = window.fetch
window.fetch = (arg1) => {

I am deploying with this IAM using Codeship and Circle CI to Elastic Beanstalk. I had a lot of trouble with this config. I talked to the aws support for about 6 hours until this worked properly, so, I guess it is worth to share.

UPDATE: In the end, I have to use the AWSElasticBeanstalkFullAccess policy. My custom policy keep breaking every week with some new added permission or some EB internal change. Anyway, the IAM I was using is below.

This works for me with CircleCI and EB Cli.

{
    "Version": "2012-10-17",
    "Statement": [
        {
@jbinto
jbinto / test.js
Created May 10, 2017 01:05 — forked from jbaxleyiii/test.js
react-apollo testing
import { Component } from "react";
import { print } from "graphql-tag/printer";
import { graphql } from "react-apollo";
import { MockedProvider } from "react-apollo/test-utils";
import { addTypenameToDocument } from "apollo-client/queries/queryTransform";
import { mount } from "enzyme";
import { withSavedPayments, SAVED_ACCTS_QUERY } from "../";
@jbinto
jbinto / checkit-reference.md
Created March 15, 2017 21:17 — forked from joepie91/checkit-reference.md
Quick reference for `checkit` validators

Presence

  • exists - The field must exist, and not be undefined.
  • required - The field must exist, and not be undefined, null or an empty string.
  • empty - The field must be some kind of "empty". Things that are considered "empty" are as follows:
    • "" (empty string)
    • [] (empty array)
    • {} (empty object)
    • Other falsey values
@jbinto
jbinto / foo.sh
Created February 7, 2017 00:32
Extract info from npm packages
cat /tmp/packages.txt | while read PACKAGE
do
yarn info $PACKAGE --json |
head -n1 |
jq --raw-output '"\"\(.data.name)\", \"\(.data.version)\", \"\(.data.homepage)\", \"\(.data.license)\", \"\(.data.description)\""' |
tee -a /tmp/output3.txt
done
@jbinto
jbinto / deploy_with_ebcli3_on_circleci.md
Created January 25, 2017 15:03 — forked from RobertoSchneiders/deploy_with_ebcli3_on_circleci.md
Settings to deploy to AWS Elastic Beanstalk on CircleCi (EB Cli 3)

This is how I configured the deploy of my rails apps to AWS Elastic Beanstalk through CircleCI.

Configure Environments Variables

On Project Settings > Environment Variables add this keys:

  • AWS_ACCESS_KEY_ID
  • AWS_SECRET_ACCESS_KEY
    The aws user must have the right permissions. This can be hard, maybe, this can help you.

Create a bash script to create the eb config file