Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@NamekMaster
NamekMaster / Convert milliseconds to human-readable date
Created January 17, 2024 08:40
popclip snippet convert milliseconds to human-readable date
#popclip multi-line script with YAML syntax
name: Convert milliseconds to human-readable date
icon: square filled D
regex: ^\d+$
javascript: |
const timestamp = parseInt(popclip.input.text);
popclip.showText(new Date(timestamp).toISOString());
@NamekMaster
NamekMaster / Color Preview.yml
Last active August 19, 2022 01:32
Popclip Snippet
# popclip abc
name: Color Preview
icon: square filled C
actions:
- title: RGB HEX
icon: square filled RGB
regex: ^#[0-9a-fA-F]{6}$
applescript: tell application "Shortcuts Events" to run the shortcut named "Show color preview" with input "{popclip text}"
- title: RGBA HEX
icon: square filled RGBA
@NamekMaster
NamekMaster / merge.sh
Last active June 30, 2022 02:14
Merge metadata from Google Photos takeout into file.
exiftool -r -d %s -tagsfromfile "%d/%F.json" "-GPSAltitude<GeoDataAltitude" "-GPSLatitude<GeoDataLatitude" "-GPSLatitudeRef<GeoDataLatitude" "-GPSLongitude<GeoDataLongitude" "-GPSLongitudeRef<GeoDataLongitude" "-Keywords<Tags" "-Subject<Tags" "-Caption-Abstract<Description" "-ImageDescription<Description" "-DateTimeOriginal<PhotoTakenTimeTimestamp" "-CreateDate<CreationTimeTimestamp" "-ModifyDate<PhotoLastModifiedTimeTimestamp" -ext "*" -overwrite_original -progress --ext json Google\ Photos
@NamekMaster
NamekMaster / Foo.cs
Created June 21, 2022 05:20
CSharp source template example
using System.Collections.Generic;
using System.Globalization;
using JetBrains.Annotations;
using UnityEngine;
public static class Foo
{
[SourceTemplate]
public static void @for<T>(this int x, string i)
{
@NamekMaster
NamekMaster / ReadOnlyAttribute.cs
Created June 21, 2022 05:20
Unity read-only property on inspector view
using UnityEditor;
using UnityEngine;
public class ReadOnlyAttribute : PropertyAttribute
{
}
@NamekMaster
NamekMaster / FileExtensions.cs
Last active June 21, 2022 05:15
show file extensions in Unity hierarchy view, support one/two column and thumbnail
using System;
using UnityEngine;
using UnityEditor;
using System.IO;
using System.Reflection;
using Object = UnityEngine.Object;
[InitializeOnLoad]
public static class FileExtensions
{