Skip to content

Instantly share code, notes, and snippets.

View jisungbin's full-sized avatar
🌴
언어의 정원사

Ji Sungbin jisungbin

🌴
언어의 정원사
  • 여의도 (South Korea)
  • South Korea, Seoul
  • 03:21 (UTC +09:00)
View GitHub Profile
@jisungbin
jisungbin / 01: basic types.ts
Created April 22, 2023 13:45 — forked from dimitardanailov/01: basic types.ts
Typescript in action
/**
* Boolean
*
* The most basic datatype is the simple true/false value,
* which JavaScript and TypeScript (as well as other languages) call a 'boolean' value.
*/
var isDone: boolean = false;
/**
* Number
@jisungbin
jisungbin / coroutines
Created April 12, 2022 19:21 — forked from ryszardmakuch/coroutines
Coroutines
# Coroutines:
How do Kotlin coroutines work internally?
- https://medium.com/@elizarov/blocking-threads-suspending-coroutines-d33e11bf4761,
- https://medium.com/androiddevelopers/coroutines-on-android-part-i-getting-the-background-3e0e54d20bb,
- https://medium.com/androiddevelopers/coroutines-on-android-part-ii-getting-started-3bff117176dd,
- https://medium.com/androiddevelopers/coroutines-on-android-part-iii-real-work-2ba8a2ec2f45,
- https://medium.com/@patson.luk/learning-kotlin-coroutines-as-a-java-dev-part-i-a04029b6214b,
- https://medium.com/@patson.luk/learning-kotlin-coroutines-as-a-java-dev-part-ii-dfe0d468b65e,
- https://medium.com/@esocogmbh/coroutines-in-pure-java-65661a379c85.
@jisungbin
jisungbin / README.md
Created February 6, 2022 12:27 — forked from Farbklex/README.md
Android: Create a signed universal APK with all dynamic feature modules included with gradle wrapper via commandline

Android Studio doesn't automatically include dynamic feature modules when building signed release APKs. But universal APKs can be created via the bundletool and signed later.

The gradle wrapper has a task for this already. This makes creating universal APKs easier since APK creation and signing are executed with one command and no separate download of bundletool is required.

You can use packageReleaseUniversalApk with the name of your base application module (e.g.: app) to create a universal APK:

./gradlew :app:packageReleaseUniversalApk

This will however only create an unsigned APK unless you specify the signing informations in your gradle file or pass the information through the command line as shown below.

@jisungbin
jisungbin / FadingEdge.kt
Created January 17, 2022 14:21 — forked from dovahkiin98/FadingEdge.kt
A Jetpack Compose implementation of the `fadingEdge` effect.
import androidx.compose.foundation.ScrollState
import androidx.compose.material.MaterialTheme
import androidx.compose.ui.Modifier
import androidx.compose.ui.composed
import androidx.compose.ui.draw.drawWithContent
import androidx.compose.ui.geometry.Offset
import androidx.compose.ui.geometry.Size
import androidx.compose.ui.graphics.Brush
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.platform.debugInspectorInfo
@jisungbin
jisungbin / README.MD
Created January 5, 2022 15:28 — forked from gabrielemariotti/README.MD
How to use the ShapeableImageView.

The Material Components Library introduced with the 1.2.0-alpha03 the new ShapeableImageView.

In your layout you can use:

 <com.google.android.material.imageview.ShapeableImageView
      android:id="@+id/image_view"
      app:srcCompat="@drawable/..." />

Then in your code apply the ShapeAppearanceModel to define your custom corners:

import androidx.compose.animation.*
import androidx.compose.animation.core.tween
import androidx.compose.material.*
import androidx.compose.runtime.Composable
import androidx.compose.runtime.onCommit
import androidx.compose.ui.Modifier
@OptIn(ExperimentalAnimationApi::class, ExperimentalMaterialApi::class)
@Composable
fun <T> AnimatedSwipeDismiss(
@jisungbin
jisungbin / GridSpacingItemDecoration.md
Created October 16, 2020 02:16 — forked from cxyxlxdm/GridSpacingItemDecoration.md
Add column spacing in RecyclerView with GridLayoutManager

Android Recyclerview GridLayoutManager column spacing Here is the question, the first answer does not work well in my project,and it makes the spacing bigger between item and item. the second answer is quite perfect.But if RecyclerView has headers,it does not work well. Then I fixed it.

import android.graphics.Rect;
import android.support.v7.widget.RecyclerView;
import android.view.View;

/**
@jisungbin
jisungbin / Data+PrettyPrint.swift
Created September 22, 2020 02:15 — forked from cprovatas/Data+PrettyPrint.swift
Pretty print JSON string from Data in Swift 4.1 (especially useful printing to Xcode console)
import Foundation
extension Data {
var prettyPrintedJSONString: NSString? { /// NSString gives us a nice sanitized debugDescription
guard let object = try? JSONSerialization.jsonObject(with: self, options: []),
let data = try? JSONSerialization.data(withJSONObject: object, options: [.prettyPrinted]),
let prettyPrintedString = NSString(data: data, encoding: String.Encoding.utf8.rawValue) else { return nil }
return prettyPrintedString
}
importPackage(android.content);
importPackage(android.app);
importClass(android.widget.Toast);
const CHANNEL_ID = "call_owner";
const ignoreActionName = "msgbot.call_owner.ignore";//그냥 시스템 전반적으로 유니크하게 하시면 됩니다.
const replyActionName="msgbot.call_owner.reply";
const replyKey="key_reply";
const bot = BotManager.getCurrentBot();
let repliers={};
<?xml version="1.0" encoding="utf-8"?>
<resources>
<!-- google's material design colours from
http://www.google.com/design/spec/style/color.html#color-ui-color-palette -->
<!--reds-->
<color name="md_red_50">#FFEBEE</color>
<color name="md_red_100">#FFCDD2</color>
<color name="md_red_200">#EF9A9A</color>