Skip to content

Instantly share code, notes, and snippets.

View yrezgui's full-sized avatar

Yacine Rezgui yrezgui

View GitHub Profile
@yrezgui
yrezgui / gist:c01f76f39e46b954aad1cc5dce34638a
Created August 2, 2024 13:46 — forked from levelsio/gist:5bc87fd1b1ffbf4a705047bebd9b4790
Secret of Monkey Island: Amsterdam (by @levelsio) or how to create your own ChatGPT image+text-based adventure game
# 2023-11-27 MIT LICENSE
Here's the open source version of my ChatGPT game MonkeyIslandAmsterdam.com.
It's an unofficial image+text-based adventure game edition of Monkey Island in Amsterdam, my home town.
Please use it however you want. It'd be nice to see more ChatGPT-based games appear from this. If you get inspired by it, please link back to my X https://x.com/levelsio or this Gist so more people can do the same!
Send me your ChatGPT text adventure game on X, I'd love to try it!
@yrezgui
yrezgui / HomeViewModel.kt
Created November 30, 2022 22:46
ViewModel with Factory
package com.example.app
import android.app.Application
import android.content.Context
import androidx.lifecycle.AndroidViewModel
import androidx.lifecycle.SavedStateHandle
import androidx.lifecycle.ViewModel
import androidx.lifecycle.ViewModelProvider
import androidx.lifecycle.ViewModelProvider.AndroidViewModelFactory.Companion.APPLICATION_KEY
import androidx.lifecycle.createSavedStateHandle
@yrezgui
yrezgui / gist:2a710cbd32a29133cb31f575fbbaee2d
Created October 7, 2022 16:20 — forked from phhusson/gist:662af3573ad4fc91bb62e5fe7cde7250
Add rickroll Dialer option. Add rick.webm in assets
From f07ca2a26dcb0cc797dcc6fc0d2d4f16b89c481e Mon Sep 17 00:00:00 2001
From: Pierre-Hugues Husson <phh@phh.me>
Date: Mon, 14 Mar 2022 09:09:28 -0400
Subject: [PATCH] Add a rickroll button in heads-up notification to rickroll
caller
Change-Id: Ibe72535fb3e93f69a531723dc96ede05663ee251
---
assets/rick.webm | Bin 0 -> 1232413 bytes
.../NotificationBroadcastReceiver.java | 145 ++++++++++++++++++
@yrezgui
yrezgui / Storage.kt
Created November 19, 2020 17:45
Storage utilities for Android
package com.yrezgui.videoplayer
import android.annotation.SuppressLint
import android.content.Context
import android.os.Build.VERSION
import android.os.Build.VERSION_CODES
import android.os.Environment
import android.os.storage.StorageManager
import android.os.storage.StorageVolume
import androidx.annotation.RequiresApi
@yrezgui
yrezgui / MainActivity.kt
Created June 2, 2020 18:51
FileProvider for Meghan
package com.android.samples.fileprovidertest
import android.os.Bundle
import androidx.activity.viewModels
import androidx.appcompat.app.AppCompatActivity
import com.android.samples.fileprovidertest.databinding.ActivityMainBinding
import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.launch
import okhttp3.OkHttpClient
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.text.SpannableString;
import android.text.Spanned;
import android.text.method.LinkMovementMethod;
import android.text.style.ClickableSpan;
import android.view.View;
import android.widget.TextView;
import android.widget.Toast;
public class MainActivity extends AppCompatActivity {
@yrezgui
yrezgui / execute.sh
Created May 1, 2020 16:14
Android 11 Wifi debugging
# 🤖Android 11 WiFi debugging
# Connect your device to the same WiFi as your computer
# Enable WiFi debugging in developer settings of your device
# Disable USB debugging if it's already enabled
# Plug your device to computer via USB
# You may have to kill adb server
adb kill-server
adb tcpip 5555
@yrezgui
yrezgui / clients.json
Last active February 14, 2018 14:17
Redux Mock data
[
{
"id": 1,
"name": "Lucas"
},
{
"id": 2,
"name": "Jérôme"
},
{
import React, { Component } from 'react'
import classnames from 'classnames'
import TaskItem from './TaskItem'
import { addTask } from './actions/tasks-actions'
import { connect } from 'react-redux'
class TasksList extends Component {
constructor(props) {
super(props)
# Setting PATH for Python 2.7
# The orginal version is saved in .bash_profile.pysave
export PATH="/Library/Frameworks/Python.framework/Versions/2.7/bin:${PATH}"
export NVM_DIR="/Users/yacinerezgui/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh" # This loads nvm
export PATH=/opt/local/bin:/opt/local/sbin:${PATH}
export PS1="\W \$ "