Skip to content

Instantly share code, notes, and snippets.

View fobidlim's full-sized avatar
🇰🇷

Sungtae 'James' Lim fobidlim

🇰🇷
View GitHub Profile
@fvilarino
fvilarino / ticker_final.kt
Last active February 9, 2024 16:04
Ticker Final
private val TickerCycleMillis = 150
private object AlphabetMapper {
private val Alphabet = " ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789•".toList()
val size: Int = Alphabet.size
fun getLetterAt(index: Int): Char = Alphabet[index % size]
fun getIndexOf(letter: Char, offset: Int = 0): TickerIndex {
@ChangJoo-Park
ChangJoo-Park / update_checker.dart
Created June 4, 2020 03:26
Flutter version checker from google play, app store
import 'dart:convert';
import 'dart:io';
import 'package:html/dom.dart';
import 'package:html/parser.dart';
import 'package:dio/dio.dart';
import 'package:pub_semver/pub_semver.dart';
/// 안드로이드 버전을 가져옵니다
///
/// 구글은 API를 제공하지 않습니다
@ChangJoo-Park
ChangJoo-Park / strong-params.js
Last active May 17, 2018 05:47
Strong Parameter for Express
exports.parameterPermitter = function ({ params = [] }) {
if (!Array.isArray(params)) throw new Error(`Request Parameter ${params} is invalid parameters array`)
return function (req, res, next) {
res.locals.permitted = {}
params.forEach((param) => {
if (!req.body.hasOwnProperty(param)) throw new Error(`${param} is required`)
res.locals.permitted[param] = req.body[param]
})
@ChangJoo-Park
ChangJoo-Park / MaskString.Java
Last active March 8, 2018 02:07
처음 일부분만 보여주고 나머지는 * 로 마스킹
public class Main {
public static void main(String[] args) {
System.out.println(maskString("ChangJoo Park", 3, '*'));
}
public static String maskString(String targetString, int numberOfPrefix, char maskCharacter) {
int stringLength = targetString.length();
int postfixLength = stringLength - numberOfPrefix;
if (stringLength < numberOfPrefix) {
@kassim
kassim / RxBottomSheetDialogFragment.kt
Created November 23, 2017 09:39
an addition to RxLifecycle for a BottomSheetDialogFragment
import android.os.Bundle
import android.support.annotation.CallSuper
import android.support.annotation.CheckResult
import android.support.design.widget.BottomSheetDialogFragment
import android.view.View
import com.trello.rxlifecycle2.LifecycleProvider
import com.trello.rxlifecycle2.LifecycleTransformer
import com.trello.rxlifecycle2.RxLifecycle
import com.trello.rxlifecycle2.android.FragmentEvent
import com.trello.rxlifecycle2.android.RxLifecycleAndroid
@polbins
polbins / Fastfile
Created October 3, 2017 03:25
Fastlane script for Uploading to Slack and Play Store Alpha
default_platform :android
platform :android do
before_all do
ENV["SLACK_URL"] = "https://hooks.slack.com/services/ABC/123/XYZ"
end
######################### PUBLIC LANES #########################
desc "Deploy a new Prod APK version to Play Store Alpha"
@mandiwise
mandiwise / Count lines in Git repo
Last active April 19, 2024 02:22
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