Skip to content

Instantly share code, notes, and snippets.

View ruyut's full-sized avatar
🤪

Ruyut ruyut

🤪
View GitHub Profile
@ruyut
ruyut / Taiwan_Official_Calendar_2022.json
Created March 23, 2022 04:54
2022中華民國(臺灣)政府行政機關辦公日曆表 R.O.C Taiwan
[
{
"date": "20220101",
"week": "六",
"isHoliday": true,
"description": "開國紀念日"
},
{
"date": "20220102",
"week": "日",
@ruyut
ruyut / UtilityTest.java
Created January 23, 2022 08:45
Java LocalDate/Date input and output example
package app.ruyut.ruyutdemo;
import org.junit.jupiter.api.Test;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.time.LocalDate;
import java.time.ZoneId;
import java.time.format.DateTimeFormatter;
import java.util.Date;
@ruyut
ruyut / fork forced sync
Created January 22, 2022 03:39
fork forced sync
git remote add upstream git@github.com:ruyut/ruyut.git
git fetch upstream
git checkout master
git reset --hard upstream/master
git push origin master -f
@ruyut
ruyut / Program.cs
Created January 11, 2022 13:37
C# NLog示範
using System;
using NLog;
using NLog.Config;
using NLog.Targets;
namespace RuyutConsoleApp
{
internal class Program
{
private static void Main(string[] args)
@ruyut
ruyut / ChainDto.java
Created January 11, 2022 07:07
Java 鏈式賦值
package com.ruyut.test;
public class ChainDto {
private int id;
private String name;
public ChainDto setId(int id) {
this.id = id;
return this;
}
@ruyut
ruyut / Program.cs
Created December 27, 2021 16:32
C# Dynamically generated DataGridView example
using System.Data;
using System.Windows.Forms;
namespace RuyutWinFormsApp
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
@ruyut
ruyut / Program.cs
Created December 27, 2021 14:39
C# json settings read and write example
using System;
using System.IO;
using Newtonsoft.Json;
namespace RuyutConsoleApp
{
internal class Program
{
private static void Main(string[] args)
{
@ruyut
ruyut / Program.cs
Created December 27, 2021 12:26
C# ini settings read and write example
using System;
using System.IO;
using System.Runtime.InteropServices;
using System.Text;
namespace RuyutConsoleApp
{
class Program
{
static void Main(string[] args)
@ruyut
ruyut / Program.cs
Created December 26, 2021 07:59
C# ConfigurationManager example
using System;
using System.Configuration;
namespace RuyutConsoleApp
{
class Program
{
static void Main(string[] args)
{
Console.WriteLine("WriteSettings");
@ruyut
ruyut / MainActivity.kt
Created December 23, 2021 15:29
Android Jetpack Compose Checkbox example
package app.ruyut.jetpackcompose
import android.content.res.Configuration
import android.os.Bundle
import androidx.activity.ComponentActivity
import androidx.activity.compose.setContent
import androidx.compose.foundation.clickable
import androidx.compose.foundation.layout.Row
import androidx.compose.foundation.layout.padding
import androidx.compose.material.*