Skip to content

Instantly share code, notes, and snippets.

View fobidlim's full-sized avatar
🇰🇷

Sungtae 'James' Lim fobidlim

🇰🇷
View GitHub Profile
@fobidlim
fobidlim / TextFragment.java
Created September 28, 2016 12:18
TextFragment extends BaseFragment
public class TextFragment extends BaseFragment {
private TextView mTextView;
private ArrayList<String> mTexts;
@Override
public void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
mTexts = new ArrayList<>();
@fobidlim
fobidlim / AppConstants_dev.java
Created October 7, 2016 18:37
explain for gradle flavor
public interface AppConstants {
String FLAVOR = "DEV";
}
@fobidlim
fobidlim / string_dev.xml
Created October 7, 2016 19:00
explain for flavor
<resources>
<string name="app_name">FlavorExample(DEV)</string>
</resources>
@fobidlim
fobidlim / MainActivity.java
Created March 12, 2017 16:28
Creating NotificaitonCompat.Builder
final NotificationCompat.Builder builder = new NotificationCompat.Builder(this)
.setColor(ResourcesCompat.getColor(getResources(), R.color.red, null))
.setSmallIcon(R.drawable.ic_stat_name)
.setDefaults(Notification.DEFAULT_ALL)
.setPriority(Notification.PRIORITY_MAX)
.setContentTitle(getString(R.string.app_name))
.setContentText(getString(R.string.app_name) + " TEST");
@fobidlim
fobidlim / MainActivity.java
Created March 12, 2017 16:28
Loading image with Glide
Glide.with(MainActivity.this)
.load(IMAGE_URL)
.asBitmap()
.into(new SimpleTarget<Bitmap>() {
@Override
public void onResourceReady(Bitmap resource, GlideAnimation<? super Bitmap> glideAnimation) {
Bitmap bitmap = ImageUtils.getCircularBitmap(resource);
builder.setLargeIcon(bitmap);
@fobidlim
fobidlim / ImageUtils.java
Created March 12, 2017 16:29
Crop bitmap as circular
public static Bitmap getCircularBitmap(@NonNull Bitmap bitmap) {
Bitmap output = Bitmap.createBitmap(bitmap.getWidth(),
bitmap.getHeight(), Bitmap.Config.ARGB_8888);
Canvas canvas = new Canvas(output);
final int color = 0xff424242;
final Paint paint = new Paint();
final Rect rect = new Rect(0, 0, bitmap.getWidth(),
bitmap.getHeight());
@fobidlim
fobidlim / .travis.yml
Last active June 5, 2018 11:07
ci-android(travis-setup)
language: android
before_cache:
- rm -f $HOME/.gradle/caches/modules-2/modules-2.lock
- rm -fr $HOME/.gradle/caches/*/plugin-resolution/
cache:
directories:
- $HOME/.gradle/caches/
- $HOME/.gradle/wrapper/
🌞 Morning 219 commits ████▊░░░░░░░░░░░░░░░░ 22.7%
🌆 Daytime 439 commits █████████▌░░░░░░░░░░░ 45.4%
🌃 Evening 248 commits █████▍░░░░░░░░░░░░░░░ 25.7%
🌙 Night 60 commits █▎░░░░░░░░░░░░░░░░░░░ 6.2%
@fobidlim
fobidlim / Count lines in Git repo
Created January 29, 2021 01:17 — forked from mandiwise/Count lines in Git repo
A command to calculate lines of code in all tracked files in a Git repo
// Reference: http://stackoverflow.com/questions/4822471/count-number-of-lines-in-a-git-repository
$ git ls-files | xargs wc -l
// toggle all to viewed
document.querySelectorAll('.js-reviewed-checkbox').forEach((elem => {
if (elem.checked) { return }
var clickEvent = new MouseEvent('click');
elem.dispatchEvent(clickEvent);
}))
// toggle all to not-viewed
document.querySelectorAll('.js-reviewed-checkbox').forEach((elem => {
if (!elem.checked) { return }