Skip to content

Instantly share code, notes, and snippets.

Avatar

Sbe-ng ThePredators

View GitHub Profile
@ThePredators
ThePredators / AndroidWorkerInjection.java
Last active Jan 5, 2021
[Dagger] integration with workers (For Java People)
View AndroidWorkerInjection.java
public class AndroidWorkerInjection {
public static void inject(Worker worker) {
checkNotNull(worker, "worker");
Object application = worker.getApplicationContext();
if (!(application instanceof HasWorkerInjector)) {
throw new RuntimeException(
String.format(
"%s does not implement %s",
application.getClass().getCanonicalName(),
@ThePredators
ThePredators / readme.md
Last active Apr 5, 2021
iOS zsh alias to deploy CocoaPods Magic
View readme.md

ZSH Aliases for CocoaPods/Ruby/Fastlane CLI

  1. Add this to your ".bash_profile" or ".zshrc" :
PROXY="http://localhost:1234"
piu() {
  kill $(ps aux | grep 'Xcode' | awk '{print $2}');
  pod deintegrate;
  pod repo update;
  pod install;
@ThePredators
ThePredators / makeBootableIMG.md
Last active May 7, 2021
Make Bootable macOS Image
View makeBootableIMG.md

☀️ Making macOS bootable Image

Run This Script

MACOS="Catalina" # ex. "Big\ Sure"
VOLUME="Toto"
sudo /Applications/Install\ macOS\ $MACOS.app/Contents/Resources/createinstallmedia --volume /Volumes/$VOLUME/
@ThePredators
ThePredators / rasp-tm.md
Last active May 7, 2021
[macOS] Turn Raspberry to a TimeMachine
View rasp-tm.md

☀️ Turn RaspberryPi to Apple Time Machine

Install requirements

sudo apt-get update && sudo apt-get upgrade -y
sudo apt install samba avahi-daemon hfsutils hfsprogs hfsplus
sudo apt-get install netatalk -y

Prepare HDD for TM

@ThePredators
ThePredators / macos-cli.md
Last active Apr 5, 2021
[macOS] usefull CLI
View macos-cli.md

macOS Usefull CLI

Enable in Security / Confidentiality the Install From everywhere Button

sudo spctl --master-disable

Show Hidden Files

defaults write com.apple.finder AppleShowAllFiles -boolean true; killall Finder
@ThePredators
ThePredators / ruby.md
Last active May 7, 2021
[macOS] Ruby Install
View ruby.md

🔥 Ruby Version Manager (CheatSheet)

💥 Ruby Upgrade or Install :

  • Run the following script on your mac :
# without proxy
curl -L https://get.rvm.io | bash -s stable
@ThePredators
ThePredators / readme.md
Last active Apr 27, 2021
How to make a Clean Code ?
View readme.md

How to make a Clean Code ?

OOD Principles :

- Encapsulation
- Abstraction
- Inheritance
- Polymorphism 

DRY principle :

- "Don't Repeat Your self - Code duplication"
@ThePredators
ThePredators / readme.md
Last active Apr 5, 2021
Git CLI Usefull
View readme.md

Git+Gitflow CLI (Usefull Aliases)

  1. Add this to your ".bash_profile" or ".zshrc" :
## Git 
alias gi='git init'
alias gc="git clone"
alias grao="git remote add origin "
alias grro="git remote rm origin "
@ThePredators
ThePredators / readme.md
Last active May 5, 2021
Mobile Env Setup
View readme.md

Setup Mobile Development Environment

Install HomeBrew

## Install xcode utils
xcode-select --install
## Install Brew
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
## Check that everything is Ok
brew doctor
@ThePredators
ThePredators / readme.md
Last active Apr 5, 2021
HomeBrew Aliases
View readme.md

HomeBrew Alias

  1. Add this to ".zshrc" or ".bash_profile"
PROXY="define it"
# brew install
brui() {
  brew update;
  brew install $@ --verbose;
}