Skip to content

Instantly share code, notes, and snippets.

View FujiHaruka's full-sized avatar
💭
Just because

Fuji Haruka FujiHaruka

💭
Just because
View GitHub Profile
@voluntas
voluntas / open_momo.rst
Last active March 1, 2024 13:51
OpenMomo プロジェクト
@oukayuka
oukayuka / FlashMessage.tsx
Last active August 6, 2020 12:39
Recompose withStateHandlers with TypeScript
import * as React from 'react';
import { compose, lifecycle, pure, StateHandler, StateHandlerMap, withStateHandlers } from 'recompose';
import { Message, Transition } from 'semantic-ui-react';
import './FlashMessage.css';
export interface FlashMessageProps {
message: string;
isWarning?: boolean;
}
@naokirin
naokirin / Dockerコンテナ上のログ集約に関するまとめ.md
Last active August 5, 2023 18:41
Dockerコンテナ上のログ集約に関するまとめ

検討するための情報

Dockerコンテナ上のログを集約する方法

  • コンテナの内部で集約する
    • e.g. fluentd、rsyslog等を各コンテナ内に立てる
    • e.g. 単純にファイルに保存する
  • コンテナの外部で集約する
    • e.g. ホスト側にfluentd、rsyslog等を起動して、各コンテナがマウントしたログファイルをtail等で読む
  • e.g. ホスト側にマウントしてファイルに保存する
@royshil
royshil / AndroidCamera2TouchToFocus.java
Last active May 4, 2024 02:51
How to implement Touch-to-Focus in Android using Camera2 APIs
//Override in your touch-enabled view (this can be differen than the view you use for displaying the cam preview)
@Override
public boolean onTouch(View view, MotionEvent motionEvent) {
final int actionMasked = motionEvent.getActionMasked();
if (actionMasked != MotionEvent.ACTION_DOWN) {
return false;
}
if (mManualFocusEngaged) {
Log.d(TAG, "Manual focus already engaged");
return true;
@kazuhiro4949
kazuhiro4949 / PickerKeyboard.swift
Last active January 4, 2019 04:10
Show UIPickerView as "Custom Keyboard"
import UIKit
class PickerKeyboard: UIControl {
var data: [String] = ["Mon.", "Tue.", "Wed.", "Thu.", "Fri.", "Sut.", "Sun."]
fileprivate var textStore: String = ""
override func draw(_ rect: CGRect) {
UIColor.black.set()
UIRectFrame(rect)
@y-takagi
y-takagi / DOCUMENT.md
Last active April 29, 2024 16:36
iOSでデータを永続化する方法

How to save data in iOS

この投稿では、iOSのファイルシステムについて理解し、データを永続化(iCloud含む)する方法を紹介する。尚、サンプルコードは動かない可能性もあるので参考程度にして下さい。

iOS File System

アプリがファイルシステムとやり取り出来る場所は、ほぼアプリのサンドボックス内のディレクトリに制限されている。新しいアプリがインストールされる際、インストーラーはサンドボックス内に複数のコンテナを作成し、図1に示す構成をとる。各コンテナには役割があり、Bundle Containerはアプリのバンドルを保持し、Data Containerはアプリとユーザ両方のデータを保持する。Data Containerは用途毎に、さらに複数のディレクトリに分けられる。アプリは、例えばiCloud Containerのように、実行時に追加のコンテナへのアクセスをリクエストすることもある。

IMG_0017_RESIZE.png

図1. An iOS app operating within its own sandbox

@satoshin2071
satoshin2071 / new_gist_file.md
Created June 13, 2016 07:36
TestFlightへのアップロード手順

TestFlightへのアップロード手順

前提条件

  • iTunes Connectへサインイン可
  • テスト対象アプリとアカウントの紐付けが完了している
  • Distribution用の証明書がキーチェーンのログイン項目に登録されていること
  • Distribution用のプロビジョニングが追加されていること
@tejacques
tejacques / HOCBaseRender.tsx
Last active May 2, 2022 13:05
React Higher Order Components in TypeScript
import * as React from 'react';
import { Component } from 'react';
export default function HOCBaseRender<Props, State, ComponentState>(
Comp: new() => Component<Props & State, ComponentState>) {
return class HOCBase extends Component<Props, State> {
render() {
return <Comp {...this.props} {...this.state}/>;
}
}
@voluntas
voluntas / webrtc.rst
Last active January 23, 2024 06:57
WebRTC の未来
@justinwoo
justinwoo / using-rxjs-instead-of-flux-with-react.md
Last active October 21, 2023 10:16
Using RxJS instead of Flux with React to organize data flow

Reposted from Qiita

For almost a year now, I've been using this "flux" architecture to organize my React applications and to work on other people's projects, and its popularity has grown quite a lot, to the point where it shows up on job listings for React and a lot of people get confused about what it is.

Why I'm tired of using and teaching flux

There are a billion explainations on the internet, so I'll skip explaining the parts. Instead, let's cut to the chase -- the main parts I hate about flux are the Dispatcher and the Store's own updating mechanism.

If you use a setup similar to the examples in facebook/flux, and you use flux.Dispatcher, you probably have this kind of flow: