Skip to content

Instantly share code, notes, and snippets.

View pfernandom's full-sized avatar

Pedro F Marquez pfernandom

View GitHub Profile
<!DOCTYPE html>
<html>
<head>
<meta charset="ISO-8859-1">
</head>
<body>
<h1>OAuth2 Test</h1>
<script type="text/javascript" src="js/jquery-1.8.3.js"></script>
<script type="text/javascript" src="js/jso.js"></script>
@pfernandom
pfernandom / serverless-boilerplate.yml
Last active February 18, 2017 05:21
Serverless Framework definition file
# Welcome to Serverless!
#
# This file is the main config file for your service.
# It's very minimal at this point and uses default values.
# You can always add more config options for more control.
# We've included some commented out config examples here.
# Just uncomment any of them to get that config option.
#
# For full config options, check the docs:
# docs.serverless.com
@pfernandom
pfernandom / handler.js
Created February 18, 2017 05:22
The boilerplate Lambda code generated by Serverless Framework
'use strict';
module.exports.hello = (event, context, callback) => {
const response = {
statusCode: 200,
body: JSON.stringify({
message: 'Go Serverless v1.0! Your function executed successfully!',
input: event,
}),
};
@pfernandom
pfernandom / serverless.yml
Created March 10, 2017 06:46
5 - serverless.yml
service: taco-gallery
provider:
name: aws
runtime: nodejs4.3
resources:
Resources:
TacosDB:
@pfernandom
pfernandom / 5 - TacoGallery.js
Last active March 16, 2017 06:32
5 - TacoGallery.js
var AWS = require("aws-sdk");
var uuid = require('uuid');
var dynamodb = require('serverless-dynamodb-client');
class TacoGallery{
constructor(){
this.db = dynamodb.doc;
}
@pfernandom
pfernandom / 5 - package.json
Created March 10, 2017 06:51
5 - package.json
{
"name": "taco-gallery",
"version": "1.0.0",
"description": "",
"main": "handler.js",
"scripts": {
"install": "docker pull lambci/lambda",
"setup": "./node_modules/.bin/sls config credentials --provider aws --key KEY --secret SECRET",
"start": "./node_modules/.bin/sls offline start -r us-east-1 --noTimeout",
"install:dynamodb": "./node_modules/.bin/sls dynamodb install",
@pfernandom
pfernandom / 6 - TacoGallery.js
Created March 18, 2017 05:16
6 - TacoGallery.js
import uuid from 'uuid';
import dynamodb from 'serverless-dynamodb-client';
import {ValidationUtils} from './Utils';
class TacoGallery{
constructor(){
this.db = dynamodb.doc;
this.v = new ValidationUtils();
}
@pfernandom
pfernandom / react-server-html.js
Last active August 25, 2017 02:33
8 - react-server-html.js
/**
* Created by Pedro Marquez on 6/23/2017.
*/
var path = require('path');
var request = require('request')
var HtmlWebpackPlugin = require('html-webpack-plugin');
require('jsdom-global')()
const jsdom = require("jsdom");
const { JSDOM } = jsdom;
import Ember from 'ember';
export default Ember.Component.extend({
tagName:"p",
classNames: ["x-input"],
attributeBindings: ["camelLabel:data-field-name"],
camelLabel: Ember.computed('label',function(){
var label = this.get("label");
return label ? label.dasherize() : label;
}),
@pfernandom
pfernandom / init.coffee
Last active January 4, 2018 20:14
My Atom configuration
# Your init script
#
# Atom will evaluate this file each time a new window is opened. It is run
# after packages are loaded/activated and after the previous editor state
# has been restored.
#
# An example hack to log to the console when each text editor is saved.
#
# atom.workspace.observeTextEditors (editor) ->
# editor.onDidSave ->