Skip to content

Instantly share code, notes, and snippets.

View channprj's full-sized avatar

Heechan Park channprj

View GitHub Profile
@thesamesam
thesamesam / xz-backdoor.md
Last active April 25, 2024 23:45
xz-utils backdoor situation (CVE-2024-3094)

FAQ on the xz-utils backdoor (CVE-2024-3094)

This is a living document. Everything in this document is made in good faith of being accurate, but like I just said; we don't yet know everything about what's going on.

Background

On March 29th, 2024, a backdoor was discovered in xz-utils, a suite of software that

@levelsio
levelsio / gist:5bc87fd1b1ffbf4a705047bebd9b4790
Last active April 13, 2024 17:00
Secret of Monkey Island: Amsterdam (by @levelsio) or how to create your own ChatGPT image+text-based adventure game
# 2023-11-27 MIT LICENSE
Here's the open source version of my ChatGPT game MonkeyIslandAmsterdam.com.
It's an unofficial image+text-based adventure game edition of Monkey Island in Amsterdam, my home town.
Please use it however you want. It'd be nice to see more ChatGPT-based games appear from this. If you get inspired by it, please link back to my X https://x.com/levelsio or this Gist so more people can do the same!
Send me your ChatGPT text adventure game on X, I'd love to try it!
@amw
amw / pillow-vs-vips.py
Last active September 19, 2023 10:48
Performance comparison of image resizing methods in Pillow and PyVIPS
#!/usr/bin/env python
# Script for comparing Pillow vs PyVIPS used for this issue:
# https://github.com/libvips/pyvips/issues/148
import sys
import timeit
import pyvips
@tatsuyasusukida
tatsuyasusukida / !README-javascript-media-audio.md
Last active September 5, 2023 12:22
🎤 How to record audio using the MediaStream Recording API in JavaScript

🎤 How to record audio using the MediaStream Recording API in JavaScript

@tatsuyasusukida
tatsuyasusukida / !README-javascript-audio.md
Last active April 20, 2024 11:46
🎵 How to record audio using the Web Audio API in JavaScript

🎵 How to record audio using the Web Audio API in JavaScript

Demo video: How to record audio using the Web Audio API in JavaScript

About this article

This article describes how to record audio using the Web Audio API in JavaScript. The related resources are shown below.

@jvacek
jvacek / Remove unused python imports on save in VSCode.md
Last active June 18, 2023 10:20
Remove unused python imports on save in VSCode

Auto-remove unused python imports in VSCode on save

I could not find a proper full configuration for this online, and I know I'll need this again in the future.

There are two ways to achieve this with some plugins; one via hitting the shell and doing an in-place replace, the other is by doing it with extensions configurable in vscode. Both should give you the same results.

Install VSCode extensions needed:

If running via bash:

@matiaskorhonen
matiaskorhonen / ffmpeg-pad-and-overlay.sh
Last active March 12, 2024 08:57
Add a device frame to an iOS screen recording (specifically an iPhone 12 Pro)
# Record screen from simulator:
xcrun simctl io booted recordVideo appVideo.mov
# Full size screen recording
ffmpeg -i screen-recording.mp4 -i iPhone12ProOverlay.png \
-filter_complex "scale=-1:2532,pad=width=3656:height=2057:x=(ow-iw)/2:y=(oh-ih)/2,overlay=x=0:y=0" \
output.mp4
# Screen recording resized to 1920px height
ffmpeg -i screen-recording.mp4 -i iPhone12ProOverlay-3656.png \
@kaichao
kaichao / log-http-headers.md
Last active March 7, 2024 18:43
nginx: Log complete request/response with all headers

1. switch nginx image to openresty/openresty

2. add the following to server/location (/etc/nginx/conf.d/default.conf)

   set $req_header "";
   set $resp_header "";
   header_filter_by_lua_block{ 
      local h = ngx.req.get_headers();
      for k, v in pairs(h) do
         ngx.var.req_header = ngx.var.req_header .. k.."="..v.." ";
# Read more about setting it up
# https://medium.com/@ljmocic/deploying-react-application-to-aws-s3-using-github-actions-85addacaeace
on:
push:
tags:
- '*'
jobs:
build: