Skip to content

Instantly share code, notes, and snippets.

View zephiransas's full-sized avatar

Takafumi Yoshida zephiransas

View GitHub Profile
@zephiransas
zephiransas / main.go
Created November 20, 2023 04:54
OpenAI Function calling sample with go-openai
package main
import (
"context"
"encoding/json"
"fmt"
"os"
"github.com/sashabaranov/go-openai"
"github.com/sashabaranov/go-openai/jsonschema"
@zephiransas
zephiransas / Gemfile
Created June 10, 2022 05:41
Move photos downloaded from flickr to a directory by date taken
# frozen_string_literal: true
source "https://rubygems.org"
gem 'exif', '~> 2.2', '>= 2.2.3'%
@zephiransas
zephiransas / audioHandler.js
Created December 13, 2017 04:38
Alexa Audio Player problem with Promise
let handlers = {
'PlayAudio_NG': function() {
let get_url = () => {
return new Promise((resolve) => {
...
resolve(url); // S3のObjectのURLを返す
});
}
let self = this;
@zephiransas
zephiransas / replace.rb
Created October 6, 2017 05:04
Replace Timecop to travel_to
Dir.glob('spec/**/*.rb').each do |file|
puts file
buff = IO.read(file)
[
/Timecop.(freeze|travel)\(Time.new\((?<year>[0-9]*), ?(?<month>[0-9]*), ?(?<day>[0-9]*), ?(?<hour>[0-9]*), ?(?<min>[0-9]*), ?(?<sec>[0-9]*)\)\)/,
/Timecop.(freeze|travel)\(Time.parse\(("|')(?<year>[0-9])*-(?<month>[0-9])*-(?<day>[0-9])* (?<hour>[0-9])*:(?<min>[0-9])*:(?<sec>[0-9])*("|')\)\)/,
/Timecop.(freeze|travel)\(Time.zone.local\((?<year>[0-9]*), ?(?<month>[0-9]*), ?(?<day>[0-9]*), ?(?<hour>[0-9]*), ?(?<min>[0-9]*), ?(?<sec>[0-9]*)\)\)/,
@zephiransas
zephiransas / class1.java
Last active July 30, 2017 14:49 — forked from yum45f/class1.java
パッケージ名がわからないクラスにあるメソッドを呼び出すプログラム。(一部抜粋)
package cl1;
public class class1{
public static void start(){
System.out.println("成功!2");
}
}
import java.time.Duration;
import java.time.LocalDateTime;
import java.time.Period;
import java.time.ZoneId;
public class Tarai {
public static int tarai(int x, int y, int z) {
if(x <= y) {
return y;
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building springboot 0.0.1-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ springboot ---
[INFO] Deleting /Users/zephiransas/Dropbox/springboot/target
[INFO]
[INFO] >>> spring-boot-maven-plugin:1.2.3.RELEASE:run (default-cli) > test-compile @ springboot >>>
<html>
<head>
<script type="text/javascript">
function toggle_button(id) {
var obj = document.getElementById(id);
obj.style.display = obj.style.display == "none" ? "" : "none";
}
</script>
</head>
<body>
package controllers
import play.api._
import play.api.mvc._
import oauth.signpost.{OAuth, OAuthProvider, OAuthConsumer}
import oauth.signpost.basic.{DefaultOAuthProvider, DefaultOAuthConsumer}
import oauth.signpost.http.HttpParameters
object Application extends Controller {
・好きな言語は?
・好きなメソッドは?
・好きなアニメは?
・好きなガンダムシリーズは?
・githubアカウントは?
・英語しゃべれる?
・最近気になるテクノロジーは?
・最近行った勉強会は?
・最近登壇した勉強会は?
・iPhone落とした事ある?