Skip to content

Instantly share code, notes, and snippets.

View ngima's full-sized avatar
🎯
Focusing

Ngima Sherpa ngima

🎯
Focusing
View GitHub Profile
@ngima
ngima / README.md
Last active May 19, 2022 04:18 — forked from lopspower/README.md
Hexadecimal color code for transparency

Hexadecimal color code for transparency

Twitter

How to set transparency with hex value ?

In Android Native Development

For example, you want to set 40% alpha transparence to #000000 (black color), you need to add 66 like this #66000000.

@catalinmiron
catalinmiron / index.js
Created October 28, 2020 20:37
Dynamic tabs underline - Starter boilerplate
import { StatusBar } from 'expo-status-bar';
import React from 'react';
import { StyleSheet, Text, View } from 'react-native';
const images = {
man:
'https://images.pexels.com/photos/3147528/pexels-photo-3147528.jpeg?auto=compress&cs=tinysrgb&dpr=2&w=500',
women:
'https://images.pexels.com/photos/2552130/pexels-photo-2552130.jpeg?auto=compress&cs=tinysrgb&dpr=2&w=500',
kids:
@pavankjadda
pavankjadda / Create Windows USB bootable on macOS.md
Last active July 10, 2023 11:53
Create Windows USB bootable drive on macOS

Create Windows bootable drive on macOS

  1. Download Windows ISO (Windows 7 or latest) from Official Windows store
  2. Once download finished, double click on ISO image. Mac will mount this ISO images in Volumes.
  3. Skip to step 5 if you like command line options. Open 'Disk Utility' application, select your USB device under 'external' category. Look for field Device and copy that value (ex. disk4)
  4. Right click on your device and select Erase then use following information to fill popup window
Name => WINDOWS10
Format => MS-DOS (FAT)
Scheme => GUID Partition Map
@hrules6872
hrules6872 / CustomLayout.java
Created February 23, 2017 23:01
Custom Viewgroup: onSaveInstanceState - onRestoreInstanceState http://trickyandroid.com/saving-android-view-state-correctly/
public class CustomLayout extends LinearLayout {
@SuppressWarnings("unchecked") @Override public Parcelable onSaveInstanceState() {
Parcelable saveInstanceState = super.onSaveInstanceState();
SavedState savedState = new SavedState(saveInstanceState);
savedState.childrenStates = new SparseArray();
for (int i = 0; i < getChildCount(); i++) {
getChildAt(i).saveHierarchyState(savedState.childrenStates);
}
return savedState;
@wojteklu
wojteklu / clean_code.md
Last active June 28, 2024 08:58
Summary of 'Clean code' by Robert C. Martin

Code is clean if it can be understood easily – by everyone on the team. Clean code can be read and enhanced by a developer other than its original author. With understandability comes readability, changeability, extensibility and maintainability.


General rules

  1. Follow standard conventions.
  2. Keep it simple stupid. Simpler is always better. Reduce complexity as much as possible.
  3. Boy scout rule. Leave the campground cleaner than you found it.
  4. Always find root cause. Always look for the root cause of a problem.

Design rules

@adamawolf
adamawolf / Apple_mobile_device_types.txt
Last active June 28, 2024 08:58
List of Apple's mobile device codes types a.k.a. machine ids (e.g. `iPhone1,1`, `Watch1,1`, etc.) and their matching product names
i386 : iPhone Simulator
x86_64 : iPhone Simulator
arm64 : iPhone Simulator
iPhone1,1 : iPhone
iPhone1,2 : iPhone 3G
iPhone2,1 : iPhone 3GS
iPhone3,1 : iPhone 4
iPhone3,2 : iPhone 4 GSM Rev A
iPhone3,3 : iPhone 4 CDMA
iPhone4,1 : iPhone 4S