Skip to content

Instantly share code, notes, and snippets.

View chornthorn's full-sized avatar
🏠
Working from home

Thorn Chorn chornthorn

🏠
Working from home
View GitHub Profile
@chornthorn
chornthorn / password-input.tsx
Created December 28, 2023 16:23 — forked from mjbalcueva/password-input.tsx
shadcn ui custom password input
"use client"
import { forwardRef, useState } from "react"
import { EyeIcon, EyeOffIcon } from "lucide-react"
import { Button } from "@/components/ui/button"
import { Input, InputProps } from "@/components/ui/input"
import { cn } from "@/lib/utils"
const PasswordInput = forwardRef<HTMLInputElement, InputProps>(
({ className, ...props }, ref) => {
@chornthorn
chornthorn / calendar.tsx
Created December 28, 2023 16:07 — forked from mjbalcueva/calendar.tsx
shadcn ui calendar custom year and month dropdown
"use client"
import * as React from "react"
import { buttonVariants } from "@/components/ui/button"
import { ScrollArea } from "@/components/ui/scroll-area"
import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from "@/components/ui/select"
import { cn } from "@/lib/utils"
import { ChevronLeft, ChevronRight } from "lucide-react"
import { DayPicker, DropdownProps } from "react-day-picker"
@chornthorn
chornthorn / BalsamiqForever.py
Created April 8, 2022 17:22 — forked from HoussemNasri/BalsamiqForever.py
Extend your trial period for Balsamiq Wireframes on Windows and macOS Forever!
import json
import os
import time
import webbrowser
import sys
import re
def handleWindows(extra_seconds):
print("OS : Windows")
@chornthorn
chornthorn / node_nginx_ssl.md
Created January 5, 2022 03:20 — forked from bradtraversy/node_nginx_ssl.md
Node app deploy with nginx & SSL

Node.js Deployment

Steps to deploy a Node.js app to DigitalOcean using PM2, NGINX as a reverse proxy and an SSL from LetsEncrypt

1. Sign up for Digital Ocean

If you use the referal link below, you get $10 free (1 or 2 months) https://m.do.co/c/5424d440c63a

2. Create a droplet and log in via ssh

I will be using the root user, but would suggest creating a new user

@chornthorn
chornthorn / translate.dart
Created November 17, 2021 04:38
Flutter Transtale Function
void main() {
Map<String, dynamic> map = {
"hello": {
"thorn": "Bong Thorn",
"second": {
"sala": "OneSala"
}
}
};
import 'dart:async';
import 'package:flutter/material.dart';
void main() => runApp(new MyApp());
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return new MaterialApp(
import 'package:flutter/material.dart';
final ThemeData lightTheme = ThemeData(
primarySwatch: Colors.blue,
brightness: Brightness.light,
primaryColor: Color( 0xff2196f3 ),
primaryColorBrightness: Brightness.dark,
primaryColorLight: Color( 0xffbbdefb ),
primaryColorDark: Color( 0xff1976d2 ),
accentColor: Color( 0xff2196f3 ),
accentColorBrightness: Brightness.dark,
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
void main()=>runApp(MyApp());
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(