Skip to content

Instantly share code, notes, and snippets.

View AIOSYM's full-sized avatar

David Pich AIOSYM

  • Loglass Inc.
  • Tokyo, Japan
View GitHub Profile
<button id="load-button">Load Image</button>
<div id="image-container"></div>
const loadButton = document.getElementById("load-button");
const imageContainer = document.getElementById("image-container");
loadButton.addEventListener("click", function() {
const image = new Image();
image.src = "data:image/jpeg;base64,/9j/4AAQSkZJRgABAQAAAQABAAD/2wCEAAkGBxITEhUTEhIVFRUVFRUVFRUVEBAVFRUVFRUWFhUVFRUYHSggGBolGxUVITEhJSkrLi4uFx8zODMtNygtLisBCgoKDg0OGhAQGyslHyUtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLf/AABEIAKgBLAMBEQACEQEDEQH/xAAbAAABBQEBAAAAAAAAAAAAAAAFAAIDBAYBB//EAEQQAAIBAgQCBwQHBgQFCQAAAAECAwAEEQUSITFBUQYTImFxkaEUQlKxwQcjM0NSYnLh8AcUYoKi8SMzNHOSorL/xAAYAQEBAQEBAAAAAAAAAAAAAAAAAQIDBP/EAB0RAQEBAAMBAAMBAAAAAAAAAAABEQIDEiExQWH/2gAMAwEAAhEDEQA/ALxREQEREBERAREQEREBERAREQEREBERAREQEREBERAREQEREBERAREQEREBERAREQEREBERAREQEREBERAREQEREBERAREQEREBERAREQEREBERAREQEREBERAREQEREBERAREQEREBERAREQEREBERAREQEREBERAREQEREBERAREQEREBERAREQf/9k=";
imageContainer.appendChild(image);
@AIOSYM
AIOSYM / detail.html
Created February 2, 2023 13:25
Pass the param to new page
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Document</title>
</head>
<body>
<div id="detail-container">
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8" />
<title>JSON to HTML Table</title>
</head>
<body>
<h1>JSON to HTML Table</h1>
<input type="text" name="search" id="search" placeholder="Search..." />
<p>Enter the new value: <input type="text" id="replaceValue" /></p>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>JSON to HTML Table</title>
</head>
<body>
<h1>JSON to HTML Table</h1>
<table id="jsonTable">
<!-- Table will be populated here -->
//https://www.youtube.com/watch?v=UDBrC6pt854&t=324s
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>JS Filter</title>
</head>
<style>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8" />
<title>Search and Replace in JSON</title>
</head>
<body>
<h1>Search and Replace in JSON</h1>
<p>
Enter the value of col1 to search: <input type="text" id="searchValue" />
@AIOSYM
AIOSYM / screenshot.html
Last active January 29, 2023 14:11
Generate img screenshot from video
<video id="video" src="example.mp4"></video>
<canvas id="canvas"></canvas>
<script>
const video = document.getElementById("video");
const canvas = document.getElementById("canvas");
const context = canvas.getContext("2d");
const timestamps = [2, 5, 8];
timestamps.forEach(timestamp => {
@AIOSYM
AIOSYM / copyJson.js
Created January 29, 2023 13:58
Copy object with exclude property
const originalObject = {
name: "John Doe",
age: 30,
location: "New York",
places: [
{ name: "A", imageURL: "https://example.com/image.jpg" },
{ name: "B", imageURL: "https://example.com/image2.jpg" }
]
};
@AIOSYM
AIOSYM / option.html
Created January 29, 2023 13:50
Add option to select and localstorage
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Document</title>
</head>
<body>
<select id="options-select"></select>
{
"extends": [
"eslint:recommended",
"plugin:import/errors",
"plugin:react/recommended",
"plugin:jsx-a11y/recommended",
"prettier"
],
"rules": {
"react/prop-types": 0,