Skip to content

Instantly share code, notes, and snippets.

Avatar
🇰🇷

Sungtae 'James' Lim fobidlim

🇰🇷
View GitHub Profile
View toggleViewed.js
// 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 }
@fobidlim
fobidlim / Count lines in Git repo
Created Jan 29, 2021 — forked from mandiwise/Count lines in Git repo
A command to calculate lines of code in all tracked files in a Git repo
View Count lines in Git repo
// Reference: http://stackoverflow.com/questions/4822471/count-number-of-lines-in-a-git-repository
$ git ls-files | xargs wc -l
View I'm an early 🐤
🌞 Morning 219 commits ████▊░░░░░░░░░░░░░░░░ 22.7%
🌆 Daytime 439 commits █████████▌░░░░░░░░░░░ 45.4%
🌃 Evening 248 commits █████▍░░░░░░░░░░░░░░░ 25.7%
🌙 Night 60 commits █▎░░░░░░░░░░░░░░░░░░░ 6.2%
@fobidlim
fobidlim / RetrofitHelper.java
Last active Nov 21, 2018
Retrofit SSLHandShakeException
View RetrofitHelper.java
public class RetrofitHelper {
private static final String TAG = "RetrofitHelper";
private static RetrofitHelper mInstance;
private Retrofit mRetrofit;
private RetrofitHelper() {
}
public static RetrofitHelper getInstance() {
@fobidlim
fobidlim / .travis.yml
Last active Jun 5, 2018
ci-android(travis-setup)
View .travis.yml
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/
@fobidlim
fobidlim / ImageUtils.java
Created Mar 12, 2017
Crop bitmap as circular
View ImageUtils.java
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 / MainActivity.java
Created Mar 12, 2017
Loading image with Glide
View MainActivity.java
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 / MainActivity.java
Created Mar 12, 2017
Creating NotificaitonCompat.Builder
View MainActivity.java
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");
View string_dev.xml
<resources>
<string name="app_name">FlavorExample(DEV)</string>
</resources>
@fobidlim
fobidlim / AppConstants_dev.java
Created Oct 7, 2016
explain for gradle flavor
View AppConstants_dev.java
public interface AppConstants {
String FLAVOR = "DEV";
}