Skip to content

Instantly share code, notes, and snippets.

View uphoon's full-sized avatar
🏠
Working

uphoon

🏠
Working
View GitHub Profile
@uphoon
uphoon / singleton_timer.dart
Created February 16, 2024 05:28
how to make singleton on dart : one instance
import 'dart:async';
class SingletonTimer {
static final SingletonTimer _singleton = SingletonTimer._internal();
factory SingletonTimer() {
return _singleton;
}
Timer _timer;
@uphoon
uphoon / ImageWithTextToBase64.java
Created January 27, 2024 04:03
Combine image and text with Base64 encoding
import java.awt.*;
import java.awt.image.BufferedImage;
import java.io.ByteArrayOutputStream;
import javax.imageio.ImageIO;
import java.util.Base64;
public class ImageWithTextToBase64 {
public static void main(String[] args) {
String imagePath = "path/to/your/image.jpg";
@uphoon
uphoon / server.js
Created January 27, 2024 03:31
Static File Server
const http = require('http');
const fs = require('fs');
const path = require('path');
const hostname = '127.0.0.1';
const port = 3000;
const rootDirectory = './www';
const server = http.createServer((req, res) => {
const urlPath = path.join(rootDirectory, req.url);
@uphoon
uphoon / equlizer.dart
Last active January 28, 2024 11:54
Interactive Equalizer Animation
/*
* Author: Yi Sanghoon
* Email: uphoon@gmail.com
* Created Date: 2024-01-25
* Last Modified: 2024-01-28
* Description:
* This file is used for creating the Equalizer animation
* using CustomPainter and AnimationController
*/