Skip to content

Instantly share code, notes, and snippets.

View say8425's full-sized avatar
🐧
We are away

Penguin say8425

🐧
We are away
View GitHub Profile
const HandlerRunner = require("serverless-offline/dist/lambda/handler-runner/index").default;
class OfflineInvalidate {
constructor(serverless, options) {
this.serverless = serverless;
this.hooks = {
"before:offline:start:init": (opts) => this.inject()
};
this.lastRunner = {};
}
@chwnam
chwnam / kt_starbucks_2019.py
Last active May 3, 2024 02:10
스타벅스 와이파이 자동 인증 파이썬3 스크립트
#!/usr/bin/env python3
import time
from http.cookiejar import Cookie
from re import search, findall
from urllib.parse import urlencode
from urllib.request import (
HTTPCookieProcessor,
HTTPRedirectHandler,
Request,
@satendra02
satendra02 / app.DockerFile
Last active March 3, 2024 10:13
docker+rails+puma+nginx+postgres (Production ready)
FROM ruby:2.3.1
# Install dependencies
RUN apt-get update -qq && apt-get install -y build-essential libpq-dev nodejs
# Set an environment variable where the Rails app is installed to inside of Docker image:
ENV RAILS_ROOT /var/www/app_name
RUN mkdir -p $RAILS_ROOT
# Set working directory, where the commands will be ran:
@osulyanov
osulyanov / config.yml
Last active November 30, 2022 23:58
Circle CI workflows config to test and deploy Ruby on Rails application with PostgreSQL database. Test with Rspec, precompile assets then deploy with Capistrano.
# Ruby CircleCI 2.0 configuration file
#
# Check https://circleci.com/docs/2.0/language-ruby/ for more details
#
defaults: &defaults
working_directory: ~/repo
docker:
- image: circleci/ruby:2.4.1-node-browsers
environment:
@duluca
duluca / awc-ecs-access-to-aws-efs.md
Last active December 9, 2023 11:36
Step-by-step Instructions to Setup an AWS ECS Cluster

Configuring AWS ECS to have access to AWS EFS

If you would like to persist data from your ECS containers, i.e. hosting databases like MySQL or MongoDB with Docker, you need to ensure that you can mount the data directory of the database in the container to volume that's not going to dissappear when your container or worse yet, the EC2 instance that hosts your containers, is restarted or scaled up or down for any reason.

Don't know how to create your own AWS ECS Cluster? Go here!

New Cluster

Sadly the EC2 provisioning process doesn't allow you to configure EFS during the initial config. After your create your cluster, follow the guide below.

New Task Definition for Web App

If you're using an Alpine-based Node server like duluca/minimal-node-web-server follow this guide:

@redism
redism / kr_won_to_backquote.sh
Created April 26, 2017 16:20
macOS Sierra에서 원화(₩) 대신 백 쿼트(`) 입력하기
#!/bin/bash
if [ -f ~/Library/KeyBindings/DefaultkeyBinding.dict ]; then
echo "~/Library/KeyBindings/DefaultkeyBinding.dict already exists"
exit -1
fi
mkdir -p ~/Library/KeyBindings
cat << EOF > ~/Library/KeyBindings/DefaultkeyBinding.dict
{
"₩" = ("insertText:", "\`");
@davidderus
davidderus / .dockerignore
Last active March 3, 2024 10:15
Docker + Rails + Puma + Postgres + Nginx
.git
.gitignore
/doc
.yardoc
coverage
jsdoc
/tmp
/log
Dockerfile
Dockerfile.prod
@ChuckJHardy
ChuckJHardy / example_activejob.rb
Last active March 3, 2024 20:10
Example ActiveJob with RSpec Tests
class MyJob < ActiveJob::Base
queue_as :urgent
rescue_from(NoResultsError) do
retry_job wait: 5.minutes, queue: :default
end
def perform(*args)
MyService.call(*args)
end
@iangreenleaf
iangreenleaf / gist:b206d09c587e8fc6399e
Last active May 5, 2024 14:52
Rails naming conventions

Rails naming conventions

General Ruby conventions

Class names are CamelCase.

Methods and variables are snake_case.

Methods with a ? suffix will return a boolean.