Skip to content

Instantly share code, notes, and snippets.

View Goridev's full-sized avatar

Igor François Goridev

View GitHub Profile
@Goridev
Goridev / Installation-site-base.md
Last active March 7, 2020 08:45
Projet - Quick Start - Webpack-React-Typescript
$ npm i --save webpack webpack-cli webpack-dev-server bootstrap firebase jest history jquery react react-bootstrap react-dom react-helmet react-icons react-loadable react-router-dom redux redux-thunk sass
$ npm i --save-dev @types/node @types/react @types/react-dom @types/react-redux @types/react-router-dom @babel/core @babel/preset-env @babel/preset-es2017 babel-loader babel-plugin-transform-runtime css-loader file-loader mini-css-extract-plugin node-sass react-redux sass-loader style-loader ts-loader typescript
@Goridev
Goridev / cusmb.sh
Created September 22, 2021 10:25
Create user + samba user
#!/bin/bash
# --del <USERNAME> -g <GROUPNAME>
# --add <USERNAME> -p <PASSWORD> -g <GROUPNAME> -d <DIR>
echo -e "\e[1;35m########################\e[0m Outil de création d'utilisateur \e[1;35m########################\e[0m"
actionAddUser(){
sudo adduser --disabled-password --gecos "" $1
echo -e "$1:$2" | chpasswd
sudo mkdir /home/$1/$4
sudo groupadd $3
sudo usermod -aG $3 $1
@Goridev
Goridev / .bash_prompt
Last active September 23, 2021 07:29
Bash Prompt color
PS1='[\[\033[01;36m\]\u \[\033[00m\]](\[\033[01;31m\]\h\[\033[00m\] [\t])-> \[\033[01;36m\] \w \[\033[00m\] '
export PS1
@Goridev
Goridev / setup_smb.md
Created September 23, 2021 07:30
Setup Samba

Installation de Samba

Installation de base

  1. sudo apt-get install samba -y
@Goridev
Goridev / Utils.md
Last active June 3, 2022 13:47
Usefull commands

Commande Linux

Move to

$ cd <PATH>

List content directory

$ ls <PATH>
@Goridev
Goridev / SSLPinning.swift
Created October 26, 2021 22:20
Pinning SSL Swift iOS
//
// SSLPinningManager.swift
//
import Foundation
import Security
import CommonCrypto
class SSLPinningManager: NSObject,URLSessionDelegate {
static let shared = SSLPinningManager()
@Goridev
Goridev / Article.kt
Last active November 25, 2021 14:14
Example of Hilt injection + ViewModel "by lazy" initialisation
package test.example.store.models
import android.os.Parcelable
import kotlinx.parcelize.Parcelize
@Parcelize
data class Article(var title: String,var url: String,var type: Category):Parcelable
@Goridev
Goridev / ReadByte.c
Last active March 22, 2022 09:46
Read byte by byte
#include "ReadByte.h"
int main(int argc, const char * argv[]) {
reader read;
read.file_ptr = fopen(argv[1], "rb");
if(read.file_ptr == NULL)
{
fprintf(stderr, "cannot open input file\n");
return 1;
}
@Goridev
Goridev / ListenerImpl.kt
Last active May 10, 2022 21:48
Setup a listener throught app -> Use a framework with a listener and implement him on another module as an dependance injection with Dagger Hilt
class ListenerImpl @Inject constructor(
val otherModule: OtherModule
) : Listener {
override onClick(params: WhateverClass.Params){
super.onClick(params)
otherModule.someCall(params)
}
}
@Goridev
Goridev / Bundle+.swift
Last active June 16, 2022 21:46
Get Bundle info from specific pod lib in different way
public extension Bundle {
// 1
static var apiKey: String? = {
return Bundle.for(for: SpecificPodLib.self).infoDictionnary?[.apiKey] as? String
}()
// 2
static var apiKey: String? {
return Bundle.for(for: SpecificPodLib.self).infoDictionnary?[.apiKey] as? String
}
// 3