Skip to content

Instantly share code, notes, and snippets.

@rhyek
rhyek / main.ts
Last active March 28, 2022 00:09
Pulumi, AWS API Gateway (HTTP API V2), AWS Lambda, Node.js
import * as pulumi from '@pulumi/pulumi';
import * as aws from '@pulumi/aws';
const functionName = 'createOrder';
const compiledAppPath = '../src/backend/create-order-lambda/dist';
const projectTag = { Project: 'some-project-name-1' };
const lambdaRole = new aws.iam.Role(`${functionName}LambdaRole`, {
assumeRolePolicy: {
Version: '2012-10-17',
@rhyek
rhyek / jsx
Created May 21, 2018 18:35
sentry error boundary
import React from 'react'
import { connect } from 'react-redux'
import Raven from 'raven-js';
Raven.config(process.env.SENTRY_URL).install()
type Props = {
children: any,
user: any
}
<template>
<div>
<img/>
<table class="table">
<thead>
<tr>
<th>Campo</th>
<th>Nombre</th>
<th>Descripción</th>
<th style="width: 1%; text-align: right">
<template>
<div class="tab-pane" id="productos">
<buscar-producto
style="margin-bottom: 10px"
ref="buscarProducto"
v-show="!readOnly"
:categorias="categorias"
:solo-producto="true"
@productoSeleccionado="productoSeleccionado"
:handler="handler"
const path = require('path');
module.exports = {
devtool: 'source-map',
resolve: {
extensions: ['.js', '.vue'],
modules: [
path.resolve('./resources/assets/js'),
path.resolve('./node_modules')
]
@rhyek
rhyek / components.c-b.js
Last active September 26, 2016 06:19
New Twiddle
import Ember from 'ember';
export default Ember.Component.extend({
init() {
this._super();
this.set('model', 3);
}
});
@rhyek
rhyek / components.level-one.js
Last active January 29, 2020 11:59
broadcast
import Ember from 'ember';
export default Ember.Component.extend({
actions: {
ohai(val) {
console.log(`on ${this.constructor.toString()} recieved: ${val}`);
return true;
}
}
});
@rhyek
rhyek / controllers.application.js
Last active August 24, 2016 21:56
ember-power-select bug
import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'rhyek',
valueA: null,
optionsA: ['a', 'b', 'c']
});
@rhyek
rhyek / application.js
Last active May 28, 2016 09:09
OAuth2 authenticator for use with Ember Simple Auth with several features added
/** @module app/authenticators/application */
import Ember from 'ember';
import OAuth2PasswordGrant from 'ember-simple-auth/authenticators/oauth2-password-grant';
const { isEmpty, RSVP, run, assign } = Ember;
/** need ember-browserify */
import UUID from 'npm:node-uuid';
const refreshTokenTabKey = 'refresh-token-tab';
const shouldInvalidateRefreshTokenTabKey = 'should-invalidate-refresh-token-tab';
@rhyek
rhyek / MyRushObject.java
Last active December 3, 2015 21:44
RushOrm @IdentityColumn annotation
@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.FIELD)
public @interface IdentityColumn {}
public class MyRushObject extends RushObject {
@RushIgnore
public transient boolean _didRegisterObjectId = false;
@RushIgnore
private transient String _identityValue;