Skip to content

Instantly share code, notes, and snippets.

View chanphiromsok's full-sized avatar
🎯
Focusing

Chanphirom Sok chanphiromsok

🎯
Focusing
  • Cambodia
View GitHub Profile
@chanphiromsok
chanphiromsok / deploy.yml
Created May 12, 2023 09:18 — forked from tfwright/deploy.yml
Ansible Phoenix deployment playbook
---
# ansible 2.9.0
- name: Deploy to production
hosts: production
remote_user: user
vars:
app_root: /home/user/apps/my_app
tasks:
import android.annotation.SuppressLint;
import android.annotation.TargetApi;
import android.app.AppOpsManager;
import android.content.Context;
import android.content.Intent;
import android.text.TextUtils;
import java.lang.reflect.Method;
// MIUI. Redefining Android.
import android.app.AlertDialog;
import android.content.ComponentName;
import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
import android.content.SharedPreferences;
import android.content.pm.ApplicationInfo;
import android.content.pm.PackageManager;
import android.os.Build;
@chanphiromsok
chanphiromsok / PermissionUtil.java
Created June 16, 2023 00:17 — forked from thoinv/PermissionUtil.java
Permission Util #android #utils #permission
@SuppressLint("WrongConstant")
public static boolean canDrawOverlays(Context context) {
if (Build.VERSION.SDK_INT >= 23) {
return Settings.canDrawOverlays(context);
} else {
if (Build.MANUFACTURER.equalsIgnoreCase("xiaomi")) {
return true;
}
AppOpsManager appOpsManager = (AppOpsManager) context.getSystemService("appops");
Method method = null;
import android.provider.Settings;
import com.facebook.react.bridge.ReactApplicationContext;
import com.facebook.react.bridge.ReactContext;
import com.facebook.react.bridge.ReactContextBaseJavaModule;
import com.facebook.react.bridge.ReactMethod;
import android.util.Log;
import android.net.Uri;
defmodule Snowflake do
use Application
def start(_type, _args) do
import Supervisor.Spec
children = [
worker(:riak_core_vnode_master, [Snowflake.VNode]),
]
@chanphiromsok
chanphiromsok / picker
Created August 3, 2023 04:09 — forked from dungkaka/picker
Convert wheel picker to reanimated 2
import React from "react";
import { Dimensions, StyleSheet, Text, View } from "react-native";
import { PanGestureHandler } from "react-native-gesture-handler";
import Animated, {
Easing,
Extrapolate,
interpolate,
useAnimatedGestureHandler,
useAnimatedReaction,
useAnimatedStyle,
@chanphiromsok
chanphiromsok / README.md
Created August 11, 2023 04:02 — forked from cskeppstedt/README.md
Modify proguard rules in a managed expo project

Modify proguard rules in a managed expo project

If you ever need to modify the proguard rules for the Android-part of your Expo managed workflow, you can achieve this by using a config plugin.

  1. Make a folder for config-plugins called ./plugins in the project root folder.
  2. Place the withProguardRules.js and my-proguard-rules.pro in the folder
  3. Add the config plugin to the plugins array of your app.config.js (or app.json if you're using that instead).

NOTE: if you rename your .pro file, don't forget to change the two occurrences of my-proguard-rules in withProguardRules.js as well.

@chanphiromsok
chanphiromsok / AStepIndicator.swift
Created December 11, 2023 03:50 — forked from Dev1an/AStepIndicator.swift
Simple step indicator view for iOS using UIStackView, IBDesignable, IBInspectable, Auto Layout
//
// Stepper.swift
// Stepperindicator
//
// Created by Damiaan on 13/01/2019.
// Copyright © 2019 Devian. All rights reserved.
//
import UIKit
@chanphiromsok
chanphiromsok / Readme.md
Created December 20, 2023 14:08 — forked from PierreThiollent/Readme.md
iTerm2 and Oh-my-zsh config

Setup iTerm2 and oh-my-zsh

Enjoy ! 😄

Install iTerm 2

Download iTerm2 here.