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){ |
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 cv2 | |
import matplotlib.pyplot as plt | |
import ipywidgets as widgets | |
# from IPython.core.debugger import set_trace | |
# To run in JuptyerLab, you need to run following in console to enable interactive | |
# jupyter labextension install @jupyter-widgets/jupyterlab-manager | |
class PhotoCapture(): | |
""" | |
Catpture image by camera |
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 boto3 | |
from boto3.session import Session | |
import time | |
from datetime import datetime | |
import calendar | |
def get_log_events(log_group): | |
"""Generate all the log events from a CloudWatch group. | |
thanks to https://alexwlchan.net/2017/11/fetching-cloudwatch-logs/ | |
:param log_group: Name of the CloudWatch log group. |
NewerOlder