Skip to content

Instantly share code, notes, and snippets.

View sjeon87's full-sized avatar

Seokseong Jeon sjeon87

  • Samsung Electronics
  • Korea, Republic Of
  • LinkedIn in/sjeon87
View GitHub Profile
@sjeon87
sjeon87 / hide-amplenote-subscription-banner.tampermonkey.js
Created April 22, 2025 00:10
Tampermoneky script to hide Amplenote subscription banner
// ==UserScript==
// @name Hide Amplenote Subscription banner
// @namespace http://tampermonkey.net/
// @version 2024-12-18
// @description try to take over the world!
// @author You
// @match https://www.amplenote.com/notes*
// @icon https://www.google.com/s2/favicons?sz=64&domain=amplenote.com
// @grant none
// ==/UserScript==
@sjeon87
sjeon87 / 00-how-to.md
Last active July 20, 2024 13:04
CSS snippets for folder and file icons on Obsidian file explorer

How to:

  1. Visit https://lucide.dev/icons/
  2. Pick and click an icon you like
  3. Click 'Copy SVG' button
  4. Replace <svg ...></svg> with copied code
  5. Adjust size (width="24" height="24")
  6. Adjust stroke color (stroke="currentColor")
  7. Adjust margin-inline-start. It determines indentation level of file entry
  8. Adjust margin-right. It is space between icon and text
@sjeon87
sjeon87 / obsidian-code-block-scroll.css
Last active March 21, 2024 23:30
Stop Obsidian wrapping code and enable scrolling
/* same article on [dev.to](https://dev.to/somidad/stop-obsidian-wrapping-code-and-enable-scrolling-47oo) */
/* it only works on Reading view */
/* https://forum.obsidian.md/t/horizontal-scrolling-in-the-code-block/55789/2 */
.markdown-rendered code {
white-space: pre;
}
@sjeon87
sjeon87 / README.md
Last active March 21, 2024 13:13
Enable a link to a block in a note using Obsidian GitHub Publisher

Same article on dev.to

TL;DR

Here's my configuraiton (in data.json):

    "censorText": [
      {
 "entry": "/ (\\^\\w+)$/gm",
@sjeon87
sjeon87 / README.md
Last active March 20, 2024 15:05
GitHub adds `user-content-` prefix to custom ID
@sjeon87
sjeon87 / file-saver.jsx
Last active November 6, 2023 12:47
Simple FileSaver.js (https://www.npmjs.com/package/file-saver) example
import { saveAs } from "file-saver";
function DownloadContent() {
const download = () => {
const blob = new Blob(["Hello, world!"], {type: "text/plain;charset=utf-8"});
saveAs(blob, "hello, world.txt");
}
return (
<button onClick={download}>Download</button>
)
@sjeon87
sjeon87 / read-file.jsx
Created June 7, 2023 14:20
Read a file on React
function Component() {
const onChange = (e) => {
const file = e.target.files?.[0];
if (!file) {
return;
}
const reader = new FileReader();
reader.addEventListener('load', () => {
console.log(reader.result);
});
@sjeon87
sjeon87 / workflow.yml
Last active January 15, 2025 08:43
GitHub Workflow to check any change on git repository and do something if any
# https://docs.github.com/en/actions/using-workflows/workflow-commands-for-github-actions#environment-files
- name: Check if there is any change
id: get_changes
# deprecated. see https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/
#run: echo "::set-output name=changed::$(git status --porcelain | wc -l)"
run: echo "changed=$(git status --porcelain | wc -l)" >> $GITHUB_OUTPUT
- name: Do something if there is any change
if: steps.get_changes.outputs.changed != 0
run: do something
@sjeon87
sjeon87 / decode_jwt.js
Created April 10, 2022 02:42
Decode JWT (without verification)
const [header, payload, signature] = jwt.split('.');
const buffer = Buffer.from(payload, 'base64');
const decoded = JSON.parse(buffer);
@sjeon87
sjeon87 / gist:4089050d49230df1920a9001516fa241
Created January 2, 2018 12:38
Remove YouTube Red logo for 'Enhancer for YouTube'
var idLogoContainer = document.getElementById('logo-container')
var classLogoRed = idLogoContainer.getElementsByClassName('logo-red')
console.log(classLogoRed)
if (classLogoRed.length) {
var tag = classLogoRed[0]
console.log(tag)
tag.style.backgroundImage = 'none'
console.log(tag.style.background)
}