Skip to content

Instantly share code, notes, and snippets.

View watanabeyu's full-sized avatar
🥟
餃子

Yu Watanabe watanabeyu

🥟
餃子
View GitHub Profile
@watanabeyu
watanabeyu / MainTabNavigator.js
Created February 9, 2018 06:20
react-navigationのtabNavigatorの背景色を変更する
const tabNavigator = TabNavigator(
{
Home: { screen: HomeScreen },
Search: { screen: HomeScreen }
},
{
tabBarOptions: {
showLabel: false,
activeTintColor: '#333',
inactiveTintColor: '#bbb',
@watanabeyu
watanabeyu / ffmpeg-download.config
Created February 1, 2018 09:25
elastic beanstalkでffmpegをインストールするためのebextensionsコンフィグ(.ebextensions/ffmpeg-download.config)
packages:
yum:
ImageMagick: []
ImageMagick-devel: []
container_commands:
01-wget:
command: "wget -O /tmp/ffmpeg.tar.xz https://johnvansickle.com/ffmpeg/release-source"
02-mkdir:
command: "if [ ! -d /opt/ffmpeg ] ; then mkdir -p /opt/ffmpeg; fi"
03-tar:
@watanabeyu
watanabeyu / main.go
Last active March 30, 2021 04:47
APIフレームワークとしてechoを使い、配列と構造体での吐き出し方法
package main
import (
"github.com/labstack/echo"
"github.com/labstack/echo/middleware"
"hoge/signup"
)
func main() {
@watanabeyu
watanabeyu / App.js
Created August 13, 2019 07:07
performance check test react-native-store / expo-sqlite / expo-sqlite-orm
import React, { useEffect } from 'react';
import { StyleSheet, Text, View, TouchableOpacity } from 'react-native';
import { SQLite } from 'expo-sqlite'
import { BaseModel, types } from 'expo-sqlite-orm';
import DatabaseLayer from 'expo-sqlite-orm/src/DatabaseLayer';
import Store from 'react-native-store';
const DB = {
'foo': Store.model('foo'),
'bar': Store.model('bar')
@watanabeyu
watanabeyu / config.yml
Last active February 26, 2019 06:32
expoの.circleciでブランチごとにOTA
version: 2
references:
container_config: &container_config
docker:
- image: circleci/node:latest
install_expo_cli: &install_expo_cli
run:
name: install-expo-cli
command: sudo npm install -g expo-cli
import { GLView } from 'expo';
import Expo2DContext from 'expo-2d-context';
import React from 'react';
import { View, Button } from 'react-native';
export default class App extends React.Component {
render() {
return [
<GLView
ref={ref => {
this.gl = ref;
@watanabeyu
watanabeyu / config.yml
Created November 22, 2018 09:19
if submitted pr, comment expo qr.
version: 2
references:
container_config: &container_config
docker:
- image: circleci/node:latest
environment:
EXPO_ACCOUNT: "expo_account_name"
EXPO_PASSWORD: "expo_account_password"
APP_SLUG: "expo_app_slug"
#!/bin/bash
max=3000000
maxWidth=2000
maxHeight=1000
for file in `\find ./docs -maxdepth 2 -name '*.png'`; do
hoge=$(identify -format "%w %h" $file)
IFS=' '
import uuid from 'uuid';
import * as firebase from 'firebase';
import 'firebase/firestore';
firebase.initializeApp(config);
firebase.firestore().settings({ timestampsInSnapshots: true });
const uploadFileAsync = async (uri) => {
const ext = uri.split('.').slice(-1)[0];
const path = `file/${this.uid}/${uuid.v4()}.${ext}`;
import * as React from 'react';
import { Text, View, StyleSheet,TouchableOpacity,CameraRoll,Linking } from 'react-native';
import { Constants,FileSystem,Permissions } from 'expo';
export default class App extends React.Component {
onPress = async () => {
const filePath = `${FileSystem.documentDirectory}share-movie.mp4`;
const res = await FileSystem.downloadAsync('http://techslides.com/demos/sample-videos/small.mp4', filePath);
// const i = await FileSystem.getInfoAsync(res.uri);
// console.log(i);