Skip to content

Instantly share code, notes, and snippets.

@ruyut
ruyut / Taiwan_Official_Calendar_2022.json
Created Mar 23, 2022
2022中華民國(臺灣)政府行政機關辦公日曆表 R.O.C Taiwan
View Taiwan_Official_Calendar_2022.json
[
{
"date": "20220101",
"week": "",
"isHoliday": true,
"description": "開國紀念日"
},
{
"date": "20220102",
"week": "",
@ruyut
ruyut / UtilityTest.java
Created Jan 23, 2022
Java LocalDate/Date input and output example
View UtilityTest.java
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;
View 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 Jan 11, 2022
C# NLog示範
View Program.cs
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 Jan 11, 2022
Java 鏈式賦值
View ChainDto.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 Dec 27, 2021
C# Dynamically generated DataGridView example
View Program.cs
using System.Data;
using System.Windows.Forms;
namespace RuyutWinFormsApp
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
@ruyut
ruyut / Program.cs
Created Dec 27, 2021
C# json settings read and write example
View Program.cs
using System;
using System.IO;
using Newtonsoft.Json;
namespace RuyutConsoleApp
{
internal class Program
{
private static void Main(string[] args)
{
@ruyut
ruyut / Program.cs
Created Dec 27, 2021
C# ini settings read and write example
View Program.cs
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 Dec 26, 2021
C# ConfigurationManager example
View Program.cs
using System;
using System.Configuration;
namespace RuyutConsoleApp
{
class Program
{
static void Main(string[] args)
{
Console.WriteLine("WriteSettings");
@ruyut
ruyut / MainActivity.kt
Created Dec 23, 2021
Android Jetpack Compose Checkbox example
View MainActivity.kt
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.*