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 / clean_code.md
Created October 8, 2023 09:33 — forked from wojteklu/clean_code.md
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

@ngima
ngima / Create Windows USB bootable on macOS.md
Created August 23, 2022 11:54 — forked from pavankjadda/Create Windows USB bootable on macOS.md
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
@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.

/*
* Copyright (C) 2006 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
@ngima
ngima / CheatSheet.java
Created March 3, 2017 10:34 — forked from romannurik/CheatSheet.java
Android helper class for showing cheat sheets (tooltips) for icon-only UI elements on long-press. This is already default platform behavior for icon-only action bar items and tabs. This class provides this behavior for any other such UI element.
/*
* Copyright 2012 Google Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
/*
* BottomNavigationLayout library for Android
* Copyright (c) 2016. Nikola Despotoski (http://github.com/NikolaDespotoski).
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software