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 / GitUnity-Readme.md
Last active April 1, 2022 16:52
Créer un répertoire git propre pour Unity

Instruction pour un repertoire Git propre pour Unity

Basé en partie sur cet article : https://thoughtbot.com/blog/how-to-git-with-unity

Remote - Site de Github

  1. Créer un répertoire Git sur Github pour votre groupe

En local - sur votre ordinateur (1 seul développeur à besoin de le faire, une seule fois)

Optionnel si vous avez eu un problème

  • Retirez tous les dossiers .git dans le dossier de projet (cela permettra de retirer l'historique qui contient les compilations à ne pas envoyer) -> Dans un terminal $ rm -fr .git sur Mac / Linux
@Akhu
Akhu / Svelte-Dockerfile
Last active February 8, 2022 10:37
Svelte Deployment via Docker with PGSSQL
# Svelte DockerFile
FROM node:14.17.6-alpine
#To fix the node-gyp rebuild error
RUN apk add --no-cache --virtual .gyp python make g++
# install dependencies
WORKDIR /app
COPY package.json package-lock.json ./
@Akhu
Akhu / Future.kt
Last active December 24, 2021 10:51
🎄 New Year Code 2022
/**
* You can edit, run, and share this code.
* play.kotlinlang.org
*/
import kotlin.random.Random
class Celebration(val year: Int, val stillWithCovid: Boolean = false) {
override fun toString(): String {
return "Bonnes fêtes & bonne année ${this.year} ! 🎉 " + (if (stillWithCovid) "On va encore avoir pas mal de covid 🦠" else "⛑ Ca va aller mieux !")
}
@Akhu
Akhu / network_call_sample.dart
Last active November 19, 2021 15:24
Simple Http Query with Dart and Unsplash
Future<List<UnsplashImage>> getRecentPhotos({
int perPage = 10,
int pageNumber = 0,
String? searchQuery
}) async {
var parameters = {
"client_id": "$apiKey",
"per_page": "$perPage",
"page": "$pageNumber"
//
// BindingBlurSampleView.swift
// InstaFilter
// Credit to Paul Hudson
// Created by Anthony Da cruz on 05/10/2021.
//
import SwiftUI
struct BindingBlurSampleView: View {
<!DOCTYPE html>
<!--[if lt IE 7]> <html class="no-js lt-ie9 lt-ie8 lt-ie7"> <![endif]-->
<!--[if IE 7]> <html class="no-js lt-ie9 lt-ie8"> <![endif]-->
<!--[if IE 8]> <html class="no-js lt-ie9"> <![endif]-->
<!--[if gt IE 8]> <html class="no-js"> <!--<![endif]-->
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title></title>
@Akhu
Akhu / MapActivity.kt
Created July 26, 2021 09:00
Sealed Class for UI State sample Kotlin + Android
package com.pickle.theendormap.map
import android.Manifest
import android.content.Intent
import android.content.pm.PackageManager
import android.content.res.Resources
import android.net.Uri
import android.os.Bundle
import android.view.Menu
import android.view.MenuItem
@Akhu
Akhu / coroutines.md
Created December 21, 2020 07:57
Understanding Kotlin Coroutines

KotlinExplorer

Playground and sample for mastering Kotlin

Concurrent

Coroutines are concurrent. And can run in parallel.

class MainActivity : AppCompatActivity() {
private lateinit var navController: NavController
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_main)
/**
* We assign the navController from the XML interface.
@Akhu
Akhu / DialogFragment.kt
Created November 7, 2020 13:06
A simple Dialog Fragment in Kotlin
import android.app.AlertDialog
import android.app.Dialog
import android.os.Bundle
import android.text.InputType
import android.widget.EditText
import androidx.fragment.app.DialogFragment
class RegisterDialogFragment : DialogFragment() {
var onPositiveClick: ((userName: String) -> Unit)? = null
var onNegativeClick: (() -> Unit)? = null