Skip to content

Instantly share code, notes, and snippets.

View saitoxu's full-sized avatar

Yosuke Saito saitoxu

View GitHub Profile
@saitoxu
saitoxu / Client.js
Created May 9, 2017 08:27
2017-05-09
onSubmit(e) {
e.preventDefault()
const fd = new FormData()
fd.append('user[name]', this.state.name)
fd.append('user[email]', this.state.email)
fetch('http://example.com/users', {
method: 'POST',
body: fd
}).then(response =>
response.json()
@saitoxu
saitoxu / AppDelegate.m
Created July 29, 2017 03:59
2017-07-29
/**
* Copyright (c) 2015-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*/
#import "AppDelegate.h"
@saitoxu
saitoxu / WebViewSample.js
Last active August 6, 2017 03:24
2017-08-06
// 外部ブラウザで開く例
import React, { Component } from 'react'
import { Alert, Linking, WebView } from 'react-native'
const ATS_ERROR_CODE = -1022
export default class WebViewSample extends Component {
constructor(props) {
super(props)
@saitoxu
saitoxu / commands.sh
Last active March 22, 2018 04:09
how to install node_exporter (CentOS 7.4)
$ sudo su -
$ cd /opt
$ wget https://github.com/prometheus/node_exporter/releases/download/v0.15.2/node_exporter-0.15.2.linux-amd64.tar.gz
$ tar xzvf node_exporter-0.15.2.linux-amd64.tar.gz
$ mv node_exporter-0.15.2.linux-amd64.tar.gz /usr/local/src/
$ mv node_exporter-0.15.2.linux-amd64 node_exporter
$ vim /etc/systemd/system/node_exporter.service
$ vim /etc/default/node_exporter
$ systemctl daemon-reload
$ systemctl enable node_exporter.service
@saitoxu
saitoxu / index.ios.js
Last active July 4, 2018 05:35
2017-09-30
import React, { Component } from 'react'
import {
ART,
AppRegistry,
StyleSheet,
View,
Text,
Dimensions,
Button
} from 'react-native'