Skip to content

Instantly share code, notes, and snippets.

View pennya's full-sized avatar

Ji Hoon Kim (Kade) pennya

View GitHub Profile
@pennya
pennya / info.txt
Last active August 23, 2023 05:21
SHA-1 -> Base64 String in terminal
Android Studio IDE를 통해 Release Signing Key를 생성한다.
아래 명령어를 통해 사이닝키 SHA-1 값을 Base64로 인코딩한 값을 출력하여 페이스북, 카카오 API에 해시를 등록할 수 있다.
keytool -exportcert -alias allcommunity -keystore /Users/kim/Desktop/allcommunity.jks | openssl sha1 -binary | openssl base64
만약 구글 플레이 개발자 콘솔에서 Google play app signing 기능을 활성화시키셨다면
구글 플레이에 앱이 릴리즈되기 전에 개발자의 로컬 개발 환경에서 릴리즈 키스토어의 시그너쳐가 삭제되고
구글 서버에 저장되어 있는 사이닝키의 시그너쳐로 교체됩니다. 그렇기 때문에 이 사이닝키로 생성한 키해시 또한 등록해줘야 합니다.
google play console > 해당 앱 선택 > 메뉴에서 출시관리 > 앱서명
@pennya
pennya / bottom_sheet_shadow.xml
Created May 26, 2020 08:35
BottomSheet Shadow
<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item>
<shape android:shape="rectangle">
<gradient
android:startColor="#66000000"
android:centerColor="#33000000"
android:centerY="0.2"
android:endColor="@android:color/transparent"
android:angle="90" />
@pennya
pennya / constraint.xml
Created February 10, 2020 09:06
(마진)텍스트 Full... 텍스트(마진) 처리
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
xmlns:app="http://schemas.android.com/apk/res-auto">
<TextView
android:id="@+id/tv1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
@pennya
pennya / MaxCounters.java
Last active April 17, 2019 05:12
[Codility-Counting Elements] - MaxCounters
// N을 넘을때마다 max를 찾아서 일괄 적용후 진행하는 방식은 O(n^2) 만큼의 시간소요
// N을 넘을때마다 임시로 저장된 값으로 max를 설정해 적용하고 나중에 max 적용안된 부분을 일괄적으로 적용하는 방법 O(N+M)
class Solution {
public int[] solution(int N, int[] A) {
// write your code in Java SE 8
int answer[] = new int[N];
int max = 0, temp = 0;
@pennya
pennya / PassingCars.java
Last active April 17, 2019 05:11
[Codility-Prefix Sums(접두사 합계?)] - PassingCars
/*
A non-empty array A consisting of N integers is given. The consecutive elements of array A represent consecutive cars on a road.
Array A contains only 0s and/or 1s:
0 represents a car traveling east,
1 represents a car traveling west.
The goal is to count passing cars. We say that a pair of cars (P, Q), where 0 ≤ P < Q < N, is passing when P is traveling to the east and Q is traveling to the west.
For example, consider array A such that:
@pennya
pennya / readme.txt
Last active April 14, 2019 16:58
flutter 설치
1. 설치
https://flutter.dev/docs/get-started/install/macos
위 경로로 들어가서 mac 버전 flutter를 다운로드 받는다
home에 develepment 폴더(자유) 만들고 압축해제하면 flutter 폴더가 생긴다
export PATH="$PATH:`pwd`/flutter/bin"
터미널로 위 명령어를 실행하여 flutter를 환경변수에 세팅해야 하지만 이렇게하면 터미널을 껏다가 킬때마다 실행해야한다.
.bash_profile ( home에 숨겨져있음) 에서 값을 수정해야 한다.
@pennya
pennya / readme.xml
Last active March 24, 2019 17:11
ProgressBar Style 쉽게 변경하는 방법
style.xml 파일에서
<resources>
<!-- Base application theme. -->
<style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
<!-- Customize your theme here. -->
<item name="colorPrimary">@color/colorPrimary</item>
<item name="colorPrimaryDark">@color/colorPrimaryDark</item>
<item name="colorAccent">@color/colorAccent</item>
@pennya
pennya / SwipeDismissBaseActivity.java
Created March 20, 2019 09:40
밀어서 액티비티 종료
public abstract class SwipeDismissBaseActivity extends AppCompatActivity {
private static final int SWIPE_MIN_DISTANCE = 120;
private static final int SWIPE_MAX_OFF_PATH = 250;
private static final int SWIPE_THRESHOLD_VELOCITY = 200;
private GestureDetector gestureDetector;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
gestureDetector = new GestureDetector(new SwipeDetector());
@pennya
pennya / gist:9ec556e4c3addeaaddc4113b5ffe0796
Created March 7, 2019 08:42
Rendering Problems NOTE: One or more layouts are missing the layout_width or layout_height attributes. These are required in most layouts
The issue is resolved by these changes:
Close Android Studio
Go to C:\Users\UserName.android and rename the build-cache folder to buildcache.bak
Go to C:\Users\UserName.AndroidStudio3.2\system and rename these folders
(1) caches to caches.bak
(2) compiler to compiler.bak
(3) compile-server to compile-server.bak
(4) conversion to conversion.bak
@pennya
pennya / DonutView.java
Created February 19, 2019 05:17
How to draw custom donut progress programmatically in Android !
public class DonutView extends View {
Context context;
int value = 0;
int size;
int strokeSize;
int textSize;
int width;
int height;