Skip to content

Instantly share code, notes, and snippets.

View chansuke's full-sized avatar
🎯
Focusing

Yusuke Abe chansuke

🎯
Focusing
  • Tokyo
  • 02:56 (UTC +09:00)
View GitHub Profile
@chansuke
chansuke / servoCodeReading.md
Last active May 31, 2022 17:58
Servo全コミットログリーディング

ルール

  • 一日で、一ヶ月分のコミットを読む。わからないことや気になったことをメモしていく。

リスト

  • 2012/03
  • 2012/04
  • 2012/05 f84067889bacc9d2df29cf0405918eaaac30ccbf ~ 7f8573243b156ee2189381a559c066377a7dca74
  • 2012/06 023745210f493390ea0267ba197d2173a7a061f6 ~ 55d8fc332a1beec7c8941e7c59bd5978fdea472a
  • 2012/07 8861aba3ec9a75c7d4706655ecdac5ea1c6741f9 ~ fa122b2a786c439c959716be6d204d2f6750db6b
  • 2012/08 b9b68a72b7dd6b035a5458b3b4c27059fc3ea19d ~ 1503e7dd1a8a69a133f14be40862c17f1c3305a6

Keybase proof

I hereby claim:

  • I am chansuke on github.
  • I am chansukeabe (https://keybase.io/chansukeabe) on keybase.
  • I have a public key whose fingerprint is 0614 0DDF 79C5 41A7 524B D313 5732 0091 63F9 C335

To claim this, I am signing this object:

@chansuke
chansuke / takePhoto.js
Created February 5, 2018 08:59
Take a photo & save to camera roll.
import { CameraRoll } from 'react-native'
_takePhoto = async () => {
const result = await ImagePicker.launchCameraAsync({
allowEditing: false,
exif: true
});
if (!result.cancelled) {
this.setState({ image: result.uri });
// @flow
const chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=';
const Base64 = {
btoa: (input:string = '') => {
let str = input;
let output = '';
for (let block = 0, charCode, i = 0, map = chars;
str.charAt(i | 0) || (map = '=', i % 1);
{
"Id": "Policy1509325053683",
"Version": "2012-10-17",
"Statement": [
{
"Sid": "Allow Public Access to All Objects",
"Action": [
"s3:GetObject"
],
"Effect": "Allow",

Name

Overview

Description

Demo

VS.

@chansuke
chansuke / square_sum.rs
Last active October 9, 2017 05:30
Rust basics
fn square_sum(n: isize) -> isize {
(0..n)
.filter(|i| i % 2 == 0)
.map(|i| i * i)
.sum()
}
fn main() {
println!("{}", square_sum(10));
}
@chansuke
chansuke / googleCurrentLocation.js
Last active September 30, 2017 11:27
Show GoogleMyMap and My current location with geolocation
import React, {PropTypes} from 'react'
import GoogleMap from 'google-map-react';
import navigator from 'navigator';
class HogeCourseMap extends React.Component{
constructor(props) {
super(props);
this.state = {
latitude: null,
longitude: null,
@chansuke
chansuke / generate-googlemap.js
Last active September 28, 2017 11:25
Generate GoogleMap.fitBound & set `setZoom`.
import {loadGoogleMaps} from '../actions/googleMaps';
currentMarkers = [];
map = null;
generateGoogleMaps(){
const maps = this.props.gm.googleMaps;
const div = this.googlemapref;
if(div === undefined){
console.warn('div is undefined');
@chansuke
chansuke / form-validation.js
Last active September 30, 2017 11:29
redux-formでclient validation
import React, {Component} from 'react';
import {reduxForm} from 'redux-form';
class LoginForm extends Component {
onSubmit(props) {
//do your submit stuff
}
render() {