Skip to content

Instantly share code, notes, and snippets.

View brownsoo's full-sized avatar
🐢
Step by step

brownsoo brownsoo

🐢
Step by step
View GitHub Profile
@perlguy99
perlguy99 / KeyboardAwareModifier.swift
Last active October 23, 2020 04:22
SwiftUI Keyboard Aware Modifier
//
// KeyboardAwareModifier.swift
// KeyboardTest
//
import SwiftUI
import Combine
struct KeyboardAwareModifier: ViewModifier {
@State private var keyboardHeight: CGFloat = 0
//
// BottomSheetView.swift
//
// Created by Majid Jabrayilov
// Copyright © 2019 Majid Jabrayilov. All rights reserved.
//
import SwiftUI
fileprivate enum Constants {
static let radius: CGFloat = 16
@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 > 해당 앱 선택 > 메뉴에서 출시관리 > 앱서명
@saber-solooki
saber-solooki / SimpleRecyclerView.java
Created July 7, 2018 18:40
Sticky Header RecyclerView
package com.saber.customstickyheader;
import android.graphics.Color;
import android.support.annotation.NonNull;
import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;
@nferruzzi
nferruzzi / ReSwift+select.swift
Last active February 28, 2018 05:56
My own ReSwift multi observer extension with support for equatable types and optionals of equatable types
// Promise like subscriber, works with Equatable types and Optionals of Equatable types
// ie:
// let observer = document.mainStore
// .select { (state) -> UIState in state.ui }
// .then { _ in called += 1 }
// or
// let observer = document.mainStore
// .select { (state) -> String? in state.ui.selection }
// .then { _ in called += 1 }
//
@romanroibu
romanroibu / RSSFeed.swift
Last active April 9, 2021 15:28 — forked from kharrison/RSSFeed.swift
Swift Decodable With Multiple Custom Dates (https://useyourloaf.com/blog/swift-codable-with-custom-dates)
import Foundation
extension DateFormatter {
static let iso8601Full: DateFormatter = {
let formatter = DateFormatter()
formatter.dateFormat = "yyyy-MM-dd'T'HH:mm:ss.SSSZZZZZ"
formatter.calendar = Calendar(identifier: .iso8601)
formatter.timeZone = TimeZone(secondsFromGMT: 0)
formatter.locale = Locale(identifier: "en_US_POSIX")
return formatter
@dani-mp
dani-mp / AsyncReSwift.swift
Last active November 14, 2017 08:52
Swift Playground showcasing the use of ReSwift middleware to perform asynchronous operations, in contrast of other possible approaches.
import UIKit
import PlaygroundSupport
import ReSwift
// API
protocol API {
func loadUsers(completion: @escaping (([User]) -> Void))
}
public class FunalyticsTracker {
private final Analytics analytics;
private DisposableObserver<FunalyticsEvent> eventsDisposable;
public FunalyticsTracker(Context context) {
analytics = Analytics.getInstance(context);
if (isInterestedInEvents()) {
subscribeToEvents();
@trilliwon
trilliwon / makeI18N.sh
Last active January 11, 2022 08:03
makeI18N
#!/bin/sh
echo "generating I18N.swift"
touch tempI18N.swift
echo "struct I18N {" >> tempI18N.swift
inputfile=${SRCROOT}/Pomodoro/Resources/en.lproj/Localizable.strings
while IFS= read -r line
public class SingletonClass implements Serializable {
private static volatile SingletonClass sSoleInstance;
//private constructor.
private SingletonClass(){
//Prevent form the reflection api.
if (sSoleInstance != null){
throw new RuntimeException("Use getInstance() method to get the single instance of this class.");