Skip to content

Instantly share code, notes, and snippets.

joepie91 /
Last active Mar 15, 2017
Quick reference for `checkit` validators


  • 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 / circle.yml
Created Dec 29, 2016
How to use Postgres 9.6.1 on circleci 14.04 image
View circle.yml
# Other settings have been omitted, the below changes are relevant
- 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 / test.js
Created Nov 15, 2016
react-apollo testing
View test.js
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 /
Last active Aug 24, 2016
Dataloader Problem

(See example query below)

Sequence of HTTP requests (with naive dataloader usage):

  1. Fetch a page of article IDs


  2. Batch fetch the articles represented by each ID

RobertoSchneiders /
Last active Jan 20, 2021
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:

    The aws user must have the right permissions. This can be hard, maybe, this can help you.
RobertoSchneiders /
Last active Mar 16, 2021
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 / gist:8b274f1c5d05230bfade
Last active Feb 19, 2019
Basic GraphQL example using the GitHub API
View gist:8b274f1c5d05230bfade
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')
samselikoff /
Last active Sep 25, 2020
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 / gist:b859cee4b5f41af37ffd
Created Aug 1, 2014
Rough notes for setting up elastic beanstalk on CircleCI
View gist:b859cee4b5f41af37ffd

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


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:

kevin-smets /
Last active Apr 17, 2021
iTerm2 + Oh My Zsh + Solarized color scheme + Source Code Pro Powerline + Font Awesome + [Powerlevel10k] - (macOS)