This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// YouTubePlayerView.swift | |
// | |
// Created by Ken Itakura on 2024/11/16. | |
// | |
import SwiftUI | |
import WebKit | |
struct YouTubePlayerView: UIViewRepresentable { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
<title>Example</title> | |
</head> | |
<body> | |
<h1>WKWebView Example</h1> | |
<p>HTML content loaded!</p> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// Arrow.swift | |
// | |
// Created by Ken Itakura on 2024/02/29. | |
// | |
import SwiftUI | |
struct Arrow: View { | |
var start: CGPoint |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sub RunAllRules() | |
On Error Resume Next | |
Dim accounts As Outlook.accounts | |
Set accounts = Application.Session.accounts | |
Dim account As Outlook.account | |
rulesDone = "" | |
rulesError = "" | |
For Each account In accounts | |
rulesDone = rulesDone & account.DisplayName & "(" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Function MMMDDYYY_to_DATE(datestr As String) As Date | |
Parts = Split(datestr, "/") | |
datestr = Parts(2) & "/" & Parts(0) & "/" & Parts(1) | |
MMMDDYYY_to_DATE = DateValue(datestr) | |
End Function |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import android.content.Context | |
import android.graphics.Canvas | |
import android.graphics.Paint | |
import android.view.View | |
import android.view.animation.Animation | |
/* How to use | |
Call as follows in an Activity | |
val circleView = CircleView(this) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# | |
# helper function to matplotlib subplots make pretty and easy to handle. | |
# | |
from matplotlib import pyplot as plt | |
plt.style.use('default') # To avoid chart invisible, due to browser theme etc. | |
# Create raws x cols square subplots, fits to given width | |
# returned axes is 1D array, so that easily handle with simple loop |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import pickle | |
import os | |
# Helper functions | |
def pickle_them(pickle_file, *objs): | |
print(f"saving to {pickle_file}") | |
with open(pickle_file, 'wb') as f: | |
for obj in objs: | |
pickle.dump(obj, f) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import com.google.common.truth.Truth.assertThat // https://truth.dev/ | |
import junit.framework.TestCase | |
import kotlinx.coroutines.* | |
import org.junit.Test | |
class SampleAsyncTest : TestCase() { | |
suspend fun sampleFunctionToTest(): String { | |
delay(1000) | |
return "failure" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import {Firestore} from "@google-cloud/firestore"; | |
import fs from "fs"; | |
const firestore = new Firestore(); | |
const keyOriginalPath = "__originalPath__"; | |
const keyDocumentContent = "__documentContent__"; | |
const keyCollectionPath = "__collectionPath__"; | |
const keyCollections = "__collections__"; | |
const keyDocument= "__document__"; | |
if(process.argv.length !== 5){ |
NewerOlder