Skip to content

Instantly share code, notes, and snippets.

View afandiyusuf's full-sized avatar

yusuf afandi afandiyusuf

View GitHub Profile
@afandiyusuf
afandiyusuf / report_based_on_commit.md
Last active March 25, 2025 00:12
Report based on the commit.

git log --since="2 months ago" --author="[email protected]" --pretty=format:"%h - %an, %ar : %s%n%b" > commit_report.txt

@afandiyusuf
afandiyusuf / Flutter error build notes.md
Last active March 25, 2025 00:12
Several reminders for me about error that happened to flutter

Flutter JAVA ERROR

Just a reminder that Flutter has the --jdk-dir configuration. If you encounter a Java compatibility error and are certain that you've changed your Java version, make sure to also set the --jdk-dir configuration in Flutter. This happened to me when I installed Android Studio, which comes bundled with Java 21. I received a Java compatibility error despite being sure I had set Java to version 17. I verified it by running the command java --version, which showed that I was using JRE and JDK version 17.

It turns out (I'm not sure why) that Flutter was using Java 21, which comes with the Android SDK, even though I had set my $JAVA_HOME to my local Java installation. It's really strange, though.

You can run flutter config --jdk-dir=$JAVA_HOME to make sure that flutter use java from your JAVA_HOME

@afandiyusuf
afandiyusuf / heroku-make default app command.md
Last active December 6, 2020 19:33
Set default app for heroku
cd /path/to/git
heroku git:remote -a <name-of-the-app>

after that you should can run heroku run [your command] without using --apps [name apps]

@afandiyusuf
afandiyusuf / flask_server_v2.py
Created October 8, 2020 08:06 — forked from peterjpxie/flask_server_v2.py
flask_server_v2.py
from flask import Flask, request
import re, json
from face_util import compare_faces, face_rec
app = Flask(__name__)
@app.route('/face_match', methods=['POST'])
def face_match():
if request.method == 'POST':
# check if the post request has the file part
@afandiyusuf
afandiyusuf / start_emulator_memu.sh
Created September 2, 2020 14:43
starting adb for memu emulator
adb connect localhost:21503
@afandiyusuf
afandiyusuf / download.js
Created May 5, 2020 04:53
Download file from javascript
let a = document.createElement('a');
a.href = "data:application/octet-stream,"+encodeURIComponent([url_image_or_document]);
a.download = 'myFile.json';//filename
a.click();
//source
//https://stackoverflow.com/questions/2897619/using-html5-javascript-to-generate-and-save-a-file
@afandiyusuf
afandiyusuf / git_command.md
Last active April 20, 2020 07:51
push and make merge request trough console panel (gitlab)

git push origin [local-branch] -o merge_request.create -o merge_request.target=[target-branch]

@afandiyusuf
afandiyusuf / levelling_discount.js
Created October 4, 2019 14:37
Levelling Discount
function getRealDiscount(stringDiscount){
var real_discount = 0;
var a = stringDiscount.split('+');
for(var i=0;i<a.length;i++)
{
var x = 100;
if(i != 0)
{
function cekDiskonAsli(string){
var diskon_asli = 0;
var a = string.split('+');
for(var i=0;i<a.length;i++)
{
var x = 100;
if(i != 0)
{
@afandiyusuf
afandiyusuf / QuitOnBack.cs
Created December 14, 2017 08:24
Quit On Back Button Unity3d
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class QuitOnBack : MonoBehaviour {
// Update is called once per frame
void Update () {
if (Input.GetKeyDown(KeyCode.Escape))
Application.Quit();