Skip to content

Instantly share code, notes, and snippets.

View galihlprakoso's full-sized avatar
⌨️
When you see a good move, look for a better one.

Galih Laras Prakoso galihlprakoso

⌨️
When you see a good move, look for a better one.
View GitHub Profile
@galihlprakoso
galihlprakoso / the-chsh-game-winning-or-losing-table.csv
Created June 14, 2024 02:06
The CHSH Game: Winning or Losing Table
X Y WIN LOSE
0 0 (A=B) (A≠B)
0 1 (A=B) (A≠B)
1 0 (A=B) (A≠B)
1 1 (A≠B) (A=B)
/* eslint-disable no-undef */
import React, { useEffect, useState } from 'react';
import PropTypes from 'prop-types';
import { useSelector } from 'react-redux';
import icLocation from '~/public/assets/icons/ic_location.png';
import icMyLocation from '~/public/assets/icons/ic_my_location.png';
import { getCurrentLocation } from '~/lib/domUtil';
import styles from './styles.json';
const GoogleMapView = ({ width, height, lat, lng, zoom,
...
import Head from 'next/head';
...
const AddressPage = () => {
return (
<App>
<Head>
<script async defer src={constants.GOOGLE_MAP_API_URL} />
</Head>
<!DOCTYPE html>
<html>
<head>
<title>Here is the title</title>
<!-- Contoh css internal -->
<style>
/* Styling untuk semua tag h1 */
h1 {
color: red;
text-decoration: underline;
<!DOCTYPE html> <!-- Deklarasi yang menunjukkan bahwa ini adalah dokumen HTML 5 -->
<html> <!-- Root dari sebuah halaman HTML -->
<head> <!-- Elemen yang mengandung semua informasi meta dari sebuah Halaman Web -->
<title>Here is the title</title> <!-- Judul dari sebuah dokumen web -->
</head>
<body> <!-- Elemen yang mengandung isi yang akan tampil di browser -->
<h1>This is a sample heading.</h1> <!-- Elemen judul dengan ukuran terbesar -->
<p>This is a sample <b>paragraph</b>.</p> <!-- Elemen paragraf -->
import React, { Component } from 'react'
import TagsInput from 'reactjs-tags-input'
class SomeParentComponent extends Component {
state = {
tags: []
}
render() {
"ios": {
"supportsTablet": true,
"bundleIdentifier": "galihlprakoso.com.reactnativedasar"
},
"android": {
"package": "galihlprakoso.com.reactnativedasar"
}
import React from 'react';
//Mengimport TextInput, FlatList, TouchableHighlight, KeyboardAvoidingView
import { StyleSheet,Text, View, TextInput,
FlatList, TouchableHighlight, KeyboardAvoidingView } from 'react-native';
class Pahlawan extends React.Component {
//Hapus inisialisasi state dan kode untuk membuat teks tidak berkedip lagi
render(){
const styles = StyleSheet.create({
container: {
flex: 1,
flexDirection:'row',// <-- 1
alignItems: 'center',// <-- 2
justifyContent: 'center',// <-- 3
backgroundColor: '#fff'
},
namaPahlawan:{
color:'red',
import React from 'react';
import { StyleSheet, Text, View } from 'react-native';
//Custom Component bernama Pahlawaan
class Pahlawan extends React.Component {
state = { tampil:true };//Menginisialisasi state tampil=true sebagai nilai awal
componentDidMount(){
setInterval(() => ( //Berfungsi untuk memanggil fungsi secara berulang-ulang