Skip to content

Instantly share code, notes, and snippets.

View cakcak27's full-sized avatar
🌴
On vacation

Ikbal Chahyadi cakcak27

🌴
On vacation
View GitHub Profile
@cakcak27
cakcak27 / sample_convertprojection.js
Last active October 8, 2021 17:03
Menconversi Projection ke Epsg:23835
import Map from 'ol/Map';
import View from 'ol/View';
import OSM from 'ol/source/OSM';
import TileLayer from 'ol/layer/Tile';
import {fromLonLat} from 'ol/proj';
import Point from 'ol/geom/Point';
import LineString from 'ol/geom/LineString';
import MultiLineString from 'ol/geom/MultiLineString';
import {Fill, Stroke, Circle, Style} from 'ol/style';
class Spesification extends Component {
state = {
value:''
}
render(){
const{ data, caption , sendItem, name, initialProp } = this.props
const initial=initialProp?initialProp:"Pilih Option"
return(
@cakcak27
cakcak27 / PickerModal.jsx
Last active May 12, 2019 19:35
PickerModal
export default class PickerModal extends Component {
state={
loading:false,
option:[],
selectedItem:{},
selected:false,
modalVisible:false,
}
loadOptions=()=>{
@cakcak27
cakcak27 / TokenComponent.jsx
Last active May 8, 2019 03:54
ngejalanin token
import React, {Component} from 'react';
import { Text, View } from 'react-native';
//api.localTokenKey require
class TokenComponent extends Component {
state={
tokens:{}
}
loadAsyncStorage=()=>{
const testModule=(()=>{
var aLocal=''
function setA(a){
aLocal=a
}
return{
a:function(){return aLocal},
setA
}
})(testModule)
@cakcak27
cakcak27 / PickerDemo.jsx
Last active April 30, 2019 15:06
MinimizePickerOption
import React, { Component } from 'react';
import {View,Text,Picker} from 'react-native';
export default class PickerDemo extends Component {
state={
quality:'',
size:''
}
getValueFromPicker=(val)=>{
// Memparse array ke bentuk array lain
render(){
let bentukSatu=[
{id:'1', nama:'AA',alamat:'alamat1'},
{id:'2', nama:'DD',alamat:'alamat2'},
{id:'3', nama:'CC',alamat:'alamat3'}
]
let bentukDua=[] // misalnya kita ingin mengubah field object (id, nama, alamat) menjadi field (userId,userNama,userAlamat)
let itemBentukDua={}
//Bentuk ke satu pakai map
<View>
{
[0,1,2,3,4,5,6,7,8,9].map(
(item,key)=>(<Text key={key}>{item}</Text>)
)
}
</View>
// Bentuk ke dua pakai operator looping for di dalam render