Skip to content

Instantly share code, notes, and snippets.

View teramuza's full-sized avatar
🏠
Stay Code

Teuku Raja teramuza

🏠
Stay Code
View GitHub Profile
@teramuza
teramuza / rnlayoututils.js
Created January 26, 2024 10:29
Responsive Layout Utils for React Native
// packages
import { Dimensions, PixelRatio, Platform, StatusBar } from 'react-native';
import Constants from '@constants';
import { isIphoneX } from '@utils/platform.utils';
const {
GUIDELINE: { WIDTH, HEIGHT },
} = Constants;
@teramuza
teramuza / countries.json
Created December 4, 2023 17:33
Countries Flag, dial code, iso code (3 letter)
[
{
"name": "Afghanistan",
"flag": "🇦🇫",
"dial_code": "+93",
"iso_code": "AFG"
},
{
"name": "Albania",
"flag": "🇦🇱",
@teramuza
teramuza / clean-cache-react-native.sh
Created December 12, 2020 12:35
React-native clean cache, Copy this command to execute
#Win
cd android && gradlew clean && cd .. && react-native start --reset-cache
# then ctrl + x (or c) to stop after reset cache
#osX
cd android && ./gradlew clean && cd .. && react-native start --reset-cache
# then control + c to stop after reset cache
@teramuza
teramuza / Avatar.component.jsx
Created November 14, 2020 10:46
Avatar Component. Make an avatar image (rounded) using Image component.
// @flow
import React from 'react';
import { Image } from 'react-native';
import type ImageStylePropTypes from 'react-native/Libraries/DeprecatedPropTypes/DeprecatedImageStylePropTypes';
import { Styles } from './Avatar.component.style';
type Props = {
source: {uri: string} | number,
size: number,
@teramuza
teramuza / ExampleScreen.component.jsx
Last active November 14, 2020 10:10
ScrollableScreenComponent. Create a scrollable screen using a FlatList component.
// How to use ScrollableScreen (Screen Component)
//@flow
import React from 'react';
import { View } from 'react-native';
import { Styles } from './Example.screen.style';
import { ScrollableScreen } from '../Components';
type ScreenProps = {}
@teramuza
teramuza / anim_enter_from_bottom.xml
Created September 23, 2020 17:19
Animation Android
<?xml version="1.0" encoding="utf-8"?>
<set xmlns:android="http://schemas.android.com/apk/res/android"
android:shareInterpolator="false">
<translate
android:fromXDelta="0%" android:toXDelta="0%"
android:fromYDelta="100%" android:toYDelta="0%"
android:duration="700" />
</set>
@teramuza
teramuza / per2_Engine.java
Last active September 19, 2020 17:52
Contoh penggunaan Constructor, Inheritance, dan Encapsulation
package per2;
public class Engine {
private String manufacturer;
private double engineDisplacement;
private String fuelType;
private int yearProduction;
public Engine (
String manufacturer,
@teramuza
teramuza / lat9_1.cpp
Created May 9, 2020 13:54
per8 - struktur data
#include <iostream>
#include <iomanip>
using namespace std;
int main() {
int Nilai[20];
int i, k, N;
int temp, jarak, s;
cout << "Masukan banyak bilangan: ";
@teramuza
teramuza / semantic-commit-messages_id-ID.md
Last active January 15, 2020 08:46 — forked from joshbuchea/semantic-commit-messages.md
Semantic Commit Messages

Semantic Commit Messages

Perubahan kecil pada cara penulisan Commit yang menjadikan kalian seorang developer yang lebih baik.

Format: <type>(<scope>): <subject>

<scope> bersifat optional

Contoh

@teramuza
teramuza / sincirlink.cpp
Last active December 16, 2019 08:23
Singly Circular Linked List (id-ID)