Skip to content

Instantly share code, notes, and snippets.

View Akhu's full-sized avatar
🏠
Working from home

Anthony Da Cruz Akhu

🏠
Working from home
View GitHub Profile
@Akhu
Akhu / CoreData + Codable.swift
Created May 11, 2018 09:46
Mixing Codable and Core Data in Swift
//
// Article.swift
// Veille
//
// Created by Anthony Da Cruz on 26/01/2018.
// Copyright © 2018 Anthony Da Cruz. All rights reserved.
//
import Foundation
import CoreData
@Akhu
Akhu / env.yml
Last active November 19, 2018 22:13
Env for ML
name: machineLearning
channels:
- defaults
dependencies:
- pip
- python=3.6.6
- pip:
- keras
- tensorflow
- numpy

Le refactoring c'est repasser sur son code pour le rendre bien plus robuste, simple à lire et standard.

C'est la qu'est l'intelligence du développeur, on différenciera le bon développeur du "mec qui suit les tuto sur openclassroom" avec ce genre de connaissance.

Exemple 1:

Du code pris sur un projet, qui est vraiment pas mauvais :

        /**
         * Get the data from the elastic search and convert the GeoNamesPlace to a Place
@Akhu
Akhu / LeJOS2019.md
Created September 7, 2019 15:07
LeJOS with a modern stack and tools

Connecting to a brick with PAN

  1. Assign an IP Address to the PAN connection type you want (USB, Bluetooth, Wifi)
IP : 192.168.1.2
NetMask: 255.255.255.0
  1. In MacOS go to Network and search for the Pan connection
  2. Enter the same Network mask and a different IP for your Mac on the Brick network
implementation 'joda-time:joda-time:2.10.5'
//Navigation
def nav_version = "2.2.0"
implementation "androidx.navigation:navigation-fragment-ktx:$nav_version"
implementation "androidx.navigation:navigation-ui-ktx:$nav_version"
// coroutines for getting off the UI thread
def coroutines = "1.0.1"
@Akhu
Akhu / DatabaseHelper.java
Created December 23, 2019 21:46
SQLiteHell on Android
import android.content.Context;
import android.database.Cursor;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteOpenHelper;
import android.util.Log;
public class DatabaseHelper extends SQLiteOpenHelper {
public static final int DATABASE_VERSION = 8; //version en prod : 6 // version pre brand: 7 // add brand to shoppingProduct: 8
private static final String TAG = "DatabaseHelper";
@Akhu
Akhu / User.java
Created December 23, 2019 21:48
SQLite Hell on Android
import android.content.ContentValues;
import android.database.Cursor;
import android.database.sqlite.SQLiteDatabase;
import android.util.Log;
import java.util.ArrayList;
import java.util.List;
public class UserTable {
@Akhu
Akhu / SimpleDialogFragment.kt
Created January 21, 2020 09:57
Dialog Fragment with closure to get the content of EditText
class RegisterDialogFragment : DialogFragment() {
var onPositiveClick: ((userName: String) -> Unit)? = null
var onNegativeClick: (() -> Unit)? = null
override fun onCreateDialog(savedInstanceState: Bundle?): Dialog {
val editText = EditText(context)
editText.inputType = InputType.TYPE_CLASS_TEXT
return with(AlertDialog.Builder(context)) {
setView(editText)
@Akhu
Akhu / imageDataSetBuilder.md
Last active January 30, 2020 12:18
Quick Image Dataset building from Google image
  1. Go to google search and search for what you want
  2. Press alt+command+I to open developer tools
  3. In the developer tools select network tab
  4. In the file types select “img”
  5. Refresh the page
  6. In the filter box write “images?q=”
  7. Scroll down to the bottom to get as many pictures as you like
  8. On the “Name” pane right click an image
  9. Expand Copy
  10. Select Copy All as cURL
@Akhu
Akhu / DevelopersWises-FR.md
Created January 31, 2020 10:44
Bonnes pratiques de programmation et de comportement en tant que développeur