Skip to content

Instantly share code, notes, and snippets.

View jbinto's full-sized avatar

Jesse Buchanan jbinto

View GitHub Profile
@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
@joepie91
joepie91 / checkit-reference.md
Last active March 15, 2017 21:17
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
@jnwheeler44
jnwheeler44 / circle.yml
Created December 29, 2016 19:34
How to use Postgres 9.6.1 on circleci 14.04 image
# Other settings have been omitted, the below changes are relevant
machine:
pre:
- sudo service postgresql stop
- sudo apt-get purge -y postgresql*
- sudo apt-get update
- sudo apt-get install postgresql
- sudo service postgresql start
- sudo su - postgres -c "echo \"create user ubuntu with password 'ubuntu';\" | psql"
- sudo su - postgres -c "echo \"alter user ubuntu with superuser;\" | psql"
@jbaxleyiii
jbaxleyiii / test.js
Created November 15, 2016 19:43
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 "../";
@AndrewIngram
AndrewIngram / Problem.md
Last active August 24, 2016 19:35
Dataloader Problem

(See example query below)

Sequence of HTTP requests (with naive dataloader usage):

  1. Fetch a page of article IDs

    /article-ids/?first=10

  2. Batch fetch the articles represented by each ID

@RobertoSchneiders
RobertoSchneiders / deploy_with_ebcli3_on_circleci.md
Last active December 4, 2023 09:07
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 1.0.

If you are using the Circle CI 2.0, take a look at this article from ryansimms

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.
@RobertoSchneiders
RobertoSchneiders / elasticbeanstalk_deploy_iam_policy.md
Last active October 11, 2023 11:35
IAM Policy for deploy on Elastic Beanstalk

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": [
        {
@devknoll
devknoll / gist:8b274f1c5d05230bfade
Last active June 13, 2022 00:07
Basic GraphQL example using the GitHub API
import { graphql, GraphQLString, GraphQLInt } from 'graphql';
import { objectType, enumType, schemaFrom, listOf } from 'graphql-schema';
import request from 'promisingagent';
const repositorySortEnum = enumType('RepositorySort')
.value('CREATED', 'created')
.value('UPDATED', 'updated')
.value('PUSHED', 'pushed')
.value('FULL_NAME', 'full_name')
.end();
@samselikoff
samselikoff / future-proof.md
Last active April 21, 2023 17:14
Future-proofing your Ember 1.x code

This post is also on my blog, since Gist doesn't support @ notifications.


Components are taking center stage in Ember 2.0. Here are some things you can do today to make the transition as smooth as possible:

  • Use Ember CLI
  • In general, replace views + controllers with components
  • Only use controllers at the top-level for receiving data from the route, and use Ember.Controller instead of Ember.ArrayController or Ember.ObjectController
  • Fetch data in your route, and set it as normal properties on your top-level controller. Export an Ember.Controller, otherwise a proxy will be generated. You can use Ember.RSVP.hash to simulate setting normal props on your controller.
@dwwoelfel
dwwoelfel / gist:b859cee4b5f41af37ffd
Created August 1, 2014 21:05
Rough notes for setting up elastic beanstalk on CircleCI

In your repo's root directory, check in a requirements.txt with

boto==2.30.0

Then, from the project's Project Settings > Environment Variables page, add the two env vars: AWS_ACCESS_KEY_ID and AWS_SECRET_KEY, with an IAM key that can deploy to eb.

Then create a bash script to set up eb: