Skip to content

Instantly share code, notes, and snippets.

View afandiyusuf's full-sized avatar

yusuf afandi afandiyusuf

View GitHub Profile
@afandiyusuf
afandiyusuf / Common Command Git
Created January 30, 2017 03:50
Git add commit
git status
git add .
git commit -m "initial commit"
git push -u origin master
@afandiyusuf
afandiyusuf / FocusManager.cs
Created October 22, 2017 16:07
Script untuk pengaturan focus manager pada unity3d dan vuforia. Add script ini di focus button yang ada collidernya
using UnityEngine;
using Vuforia;
public class FocusManager : MonoBehaviour {
private void Start()
{
BackToAuto();
}
@afandiyusuf
afandiyusuf / cheatsheet.md
Last active November 22, 2017 06:00
Laravel cheatsheet

First Step

Requirement of laravel

  • PHP >= 5.6.4
  • OpenSSL PHP Extension
  • PDO PHP Extension
  • Mbstring PHP Extension
  • Tokenizer PHP Extension
  • XML PHP Extension
@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();
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 / 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)
{
@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 / 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 / start_emulator_memu.sh
Created September 2, 2020 14:43
starting adb for memu emulator
adb connect localhost:21503
@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