Skip to content

Instantly share code, notes, and snippets.

@ivawzh
ivawzh / DefaultKeyBinding.dict
Created July 9, 2020 18:09 — forked from trusktr/DefaultKeyBinding.dict
My DefaultKeyBinding.dict for Mac OS X
/* ~/Library/KeyBindings/DefaultKeyBinding.Dict
This file remaps the key bindings of a single user on Mac OS X 10.5 to more
closely match default behavior on Windows systems. This makes the Command key
behave like Windows Control key. To use Control instead of Command, either swap
Control and Command in Apple->System Preferences->Keyboard->Modifier Keys...
or replace @ with ^ in this file.
Here is a rough cheatsheet for syntax.
Key Modifiers
# ---- Base Node ----
FROM mhart/alpine-node:10 AS base
# install node
RUN apk add --no-cache nodejs-current
# set working directory
WORKDIR /root/nextApp
# copy project file
COPY package.json .
COPY tsconfig.server.json .
COPY .npmrc .
@ivawzh
ivawzh / findManyCursor.test.ts
Created May 20, 2020 12:34 — forked from ctrlplusb/findManyCursor.test.ts
Utility to provide Relay Cursor Connection Specification support to Prisma Framework
import { Country, Photon } from '@prisma/photon';
import { findManyCursor } from './findManyCursor';
const photon = new Photon();
let data: Country[];
const createCountry = async (id: string) => photon.countries.create({
data: {
id,
@ivawzh
ivawzh / list.txt
Created May 3, 2020 14:06 — forked from shortjared/list.txt
List of AWS Service Principals
acm.amazonaws.com
alexa-appkit.amazon.com
apigateway.amazonaws.com
application-autoscaling.amazonaws.com
appstream.application-autoscaling.amazonaws.com
appsync.amazonaws.com
athena.amazonaws.com
autoscaling.amazonaws.com
batch.amazonaws.com
channels.lex.amazonaws.com
@ivawzh
ivawzh / alias_matchers.md
Created April 18, 2020 22:15 — forked from JunichiIto/alias_matchers.md
List of alias matchers in RSpec 3

This list is based on aliases_spec.rb.

You can see also Module: RSpec::Matchers API.

matcher aliased to description
a_truthy_value be_truthy a truthy value
a_falsey_value be_falsey a falsey value
be_falsy be_falsey be falsy
a_falsy_value be_falsey a falsy value
@ivawzh
ivawzh / alias_matchers.md
Created April 18, 2020 22:15 — forked from JunichiIto/alias_matchers.md
List of alias matchers in RSpec 3

This list is based on aliases_spec.rb.

You can see also Module: RSpec::Matchers API.

matcher aliased to description
a_truthy_value be_truthy a truthy value
a_falsey_value be_falsey a falsey value
be_falsy be_falsey be falsy
a_falsy_value be_falsey a falsy value
module SpecSupport
module GraphHelper
def execute_mutation(current_user: nil, context: {}, **inputs)
context = Graph::Context.new(
query: OpenStruct.new(schema: YourSchema),
values: context.merge(current_user: current_user),
object: nil,
)
described_class.new(object: nil, context: context, field: nil).resolve(inputs)
end
require 'active_record/connection_adapters/abstract/schema_definitions'
class ActiveRecord::ConnectionAdapters::TableDefinition
def publishing(*args)
options = args.extract_options!
column(:publish_up, :datetime, options)
column(:publish_down, :datetime, options)
end
end
@ivawzh
ivawzh / connect-heroku-app-to-postgres-rds-with-ssl.md
Created December 18, 2018 10:13 — forked from glarrain/connect-heroku-app-to-postgres-rds-with-ssl.md
How to connect a Heroku application to an Amazon RDS PostgreSQL instance, forcing SSL and certificate chain verification

1 - Download the RDS certificates (root plus region-specific intermediate ones) bundle:

wget -O config/rds-combined-ca-bundle.pem https://s3.amazonaws.com/rds-downloads/rds-combined-ca-bundle.pem

2 - Add config/rds-combined-ca-bundle.pem to the repository and redeploy to Heroku.

3 - Update the DATABASE_URL env var:

@ivawzh
ivawzh / render-promise-in-react.js
Created April 10, 2018 11:03 — forked from hex13/render-promise-in-react.js
how to render promises in React
//License CC0 1.0: https://creativecommons.org/publicdomain/zero/1.0/
class Deferred extends React.Component {
constructor(props) {
super(props);
this.state = {
value: ''
};
}
componentDidMount() {