Skip to content

Instantly share code, notes, and snippets.

View hwshim0810's full-sized avatar

Hyunwoo Shim hwshim0810

View GitHub Profile
hwshim0810 / .manifest
Created November 1, 2023 10:16 — forked from devjin0617/.manifest
chrome extension using a content script to access the `window` object
"content_scripts": [
"matches": ["http://*/*", "https://*/*"],
"js": ["inject.js"],
"all_frames": true
"web_accessible_resources": [

How to setup AWS lambda function to talk to the internet and VPC

I'm going to walk you through the steps for setting up a AWS Lambda to talk to the internet and a VPC. Let's dive in.

So it might be really unintuitive at first but lambda functions have three states.

  1. No VPC, where it can talk openly to the web, but can't talk to any of your AWS services.
  2. VPC, the default setting where the lambda function can talk to your AWS services but can't talk to the web.
  3. VPC with NAT, The best of both worlds, AWS services and web.
hwshim0810 / .eslintrc.js
Created December 15, 2019 10:53 — forked from manjula-dube/.eslintrc.js
// use this format since .eslintrc is deprecated.
// You can logically derive this format.
module.exports = {
parser: 'babel-eslint',
extends: [
hwshim0810 / hideOnScroll.js
Created August 10, 2019 16:12 — forked from kkkevinnn/hideOnScroll.js
react-native-action-button hide on scroll
// 1. Define a state variable for showing/hiding the action-button
state = {
isActionButtonVisible: true
// 2. Define variables those will keep track of the current scroll position, height and content height
_listViewOffset = 0
_listViewHeight = 0
_listViewContentHeight = 0
hwshim0810 /
Last active February 10, 2020 04:09
Get ec2 private ip
import os
def is_ec2_linux():
"""Detect if we are running on an EC2 Linux Instance
if os.path.isfile("/sys/hypervisor/uuid"):
with open("/sys/hypervisor/uuid") as f:
uuid =
hwshim0810 /
Last active December 31, 2018 05:25
Create temporary imagefile
import tempfile
from io import BytesIO
from PIL import Image
def get_test_image():
file = BytesIO()
image ='RGBA', size=(50, 50), color=(155, 0, 0)), 'png')
hwshim0810 / pre-commit
Created October 21, 2018 04:39 — forked from acdha/pre-commit
Git pre-commit hook which runs various code linters. Install this to .git/hooks/pre-commit inside your favorite repos
#!/usr/bin/env PYTHONIOENCODING=utf-8 python
# encoding: utf-8
"""Git pre-commit hook which lints Python, JavaScript, SASS and CSS"""
from __future__ import absolute_import, print_function, unicode_literals
import os
import subprocess
import sys
hwshim0810 /
Created October 11, 2018 06:04
Password init
# Views
from rest_framework.generics import CreateAPIView
from rest_framework.response import Response
class PasswordInitializeAPIView(CreateAPIView):
serializer_class = serializers.PasswordInitSerializer
def create(self, request, *args, **kwargs):
serializer = self.get_serializer(
hwshim0810 /
Created July 6, 2018 02:33
Restframework custom timestamp field
from django.utils import timezone
from rest_framework import serializers
class DateToTimestampField(serializers.Field):
def to_representation(self, value):
epoch = timezone.datetime(1970, 1, 1)
value = timezone.datetime.fromordinal(value.toordinal())
return int((value - epoch).total_seconds()) * 1000
hwshim0810 / blur.kt
Created July 3, 2018 15:56
android image blur
import android.content.Context
import android.os.Build
import android.renderscript.Allocation
import android.renderscript.Element
import android.renderscript.RenderScript
import android.renderscript.ScriptIntrinsicBlur
fun blur(context: Context, sourceBitmap: Bitmap, radius: Float): Bitmap {