Skip to content

Instantly share code, notes, and snippets.

@TETRA2000
TETRA2000 / Image - Duplicate as HEIC.scpt
Created February 20, 2022 02:14
Folder Action Script to convert images to HEIC. This is based on Apple's sample code.
(*
Image - Duplicate as HEIC
This Folder Action handler is triggered whenever items are added to the attached folder.
The script creates a HEIC version of the file, but leaves a copy of the file
in its original format. If the original file is already in JPEG format, the script does
not duplicate the file.
Copyright © 2002–2007 Apple Inc.
@TETRA2000
TETRA2000 / util.ts
Created November 10, 2019 09:55
Wait till page stopped with puppeteer
// tslint:disable: no-console
import * as BlinkDiff from "blink-diff";
import { Page } from "puppeteer";
export function sleep(ms: number) {
return new Promise((resolve) => setTimeout(resolve, ms));
}
export async function waitTillPageStoped(
page: Page,
@TETRA2000
TETRA2000 / README.md
Last active July 3, 2019 23:43
AWS S3 Lifecycle Management

How to configure

You must enable versioning to use this configuration.

aws s3api put-bucket-lifecycle-configuration  \
--bucket bucket  \
--lifecycle-configuration file://config.json
@TETRA2000
TETRA2000 / index.html
Created March 25, 2019 14:21
hello-lit-html
<!DOCTYPE html>
<head>
<meta charset="UTF-8"/>
</head>
<body>
<script type="module">
import {html, render} from './node_modules/lit-html/lit-html.js';
const myTemplate = (name) => html`<p>Hello ${name}</p>`;
render(myTemplate('World'), document.body);
</script>
@TETRA2000
TETRA2000 / .dockerignore
Last active February 15, 2017 17:54 — forked from nassy274/.dockerignore
Ruby on Rails on Docker
.bundle
tmp
vendor/bundle
@TETRA2000
TETRA2000 / gist:8778140
Created February 3, 2014 02:42
Windowsで削除出来ない深いディレクトリツリーを削除する
#test.py
import os
import shutil
import random
while True:
dir_list = os.listdir('.')
for d in dir_list:
if not os.path.isdir(d):