Skip to content

Instantly share code, notes, and snippets.

@cse031sust02
cse031sust02 / Dockerfile
Last active October 9, 2023 12:57
Basic Dockerfile for Django using Pipenv
# My Django Project
# Version: 1.0
# FROM - Image to start building on.
FROM python:3
# PROJECT SETUP
# ----------------
@alexcasalboni
alexcasalboni / decode.js
Created June 17, 2019 16:34
How to decode CloudWatch Logs events
const zlib = require('zlib');
exports.decode = async (data) => {
const compressedPayload = Buffer.from(data, 'base64');
const jsonPayload = zlib.gunzipSync(compressedPayload).toString('utf8');
return JSON.parse(jsonPayload);
}
@BenSampo
BenSampo / deploy.sh
Last active April 30, 2024 03:41
Laravel deploy script
# Change to the project directory
cd $FORGE_SITE_PATH
# Turn on maintenance mode
php artisan down || true
# Pull the latest changes from the git repository
# git reset --hard
# git clean -df
git pull origin $FORGE_SITE_BRANCH
@tsrivishnu
tsrivishnu / gitignore_already_tracked_file.md
Last active February 23, 2024 08:09
Git: Ignore already checked in file

Git: How can I ignore a file that is already committed to the repo?

You have a repo and quite some developers have cloned the repo and working on it. Now you want to add a file to gitignore which is already checked-in or tracked by Git.(The file is already commited into the repo)

Below are the steps on how to ignore this file (lets say the filename is config.py):

  • Add it to .gitignore:

$ echo "config.py" >> .gitignore