Skip to content

Instantly share code, notes, and snippets.

View wenindoubt's full-sized avatar
🎯
Focusing

Jeffrey Wen wenindoubt

🎯
Focusing
  • Autodesk, Inc.
  • Irvine, CA
View GitHub Profile
@wenindoubt
wenindoubt / vagrant-httpd.te
Created November 2, 2015 04:13
Custom SELinux Policy: Vagrant read/open/getattr access to httpd
module vagrant-httpd 1.0;
require {
type httpd_t;
type vmblock_t;
class file { read open getattr };
}
#============= httpd_t ==============
allow httpd_t vmblock_t:file { read open getattr };
@wenindoubt
wenindoubt / bash-template
Created January 21, 2017 16:57 — forked from renzok/bash-template
A template bash script based on google style guide with little improvements
#!/bin/bash
# Here short description of this script
# This is just a template to be used for writing new bash scripts
###
# Based on Google Style Guide: https://google-styleguide.googlecode.com/svn/trunk/shell.xml
# General remarks
# * Executables should have no extension (strongly preferred) or a .sh extension.
# * Libraries must have a .sh extension and should not be executable
<% blogs.each do |blog_item| %>
<%= link_to 'Edit Item', edit_blog_path(blog_item) %>
<%= link_to 'Edit Item', edit_blog_path(blog_item.id) %>
<% end>
@wenindoubt
wenindoubt / curl.md
Created November 22, 2017 18:58 — forked from btoone/curl.md
A curl tutorial using GitHub's API

Introduction

An introduction to curl using GitHub's API.

The Basics

Makes a basic GET request to the specifed URI

curl https://api.github.com/users/caspyin
@wenindoubt
wenindoubt / docker-compose.yml
Created January 30, 2018 02:38
`docker-compose` file for generic nginx configuration
version: "2"
services:
web:
image: jeffreywen/onica-nginx
ports:
- "80:80"
volumes:
- /home/ec2-user/html:/usr/share/nginx/html:ro

Keybase proof

I hereby claim:

  • I am wenindoubt on github.
  • I am wenindoubt (https://keybase.io/wenindoubt) on keybase.
  • I have a public key ASCQm4bhlgiON4itWpi71rcsewtdjBZB3roBnv1mAfcUwQo

To claim this, I am signing this object:

import json
# from your lambda layers
## create two layers
### first layer: store_into_s3.py -> store_into_s3()
### second layer: store_into_db.py -> store_into_db()
from store_into_s3 import store_into_s3
from store_into_db import store_into_db
const { SQS } = require('@aws-sdk/client-sqs');
const sqs = new SQS();
const handler = async (event) => {
console.log('event', event);
const { id, title } = JSON.parse(event.body);
await sqs.sendMessage({
QueueUrl: process.env.QUEUE_URL,
@wenindoubt
wenindoubt / functions.ts
Created June 30, 2021 19:14 — forked from fredericbarthelet/functions.ts
Serverless.ts splitting
export default {
hello: {
handler: 'index.hello'
},
goodbye: {
handler: 'index.goodbye'
}
};