Skip to content

Instantly share code, notes, and snippets.

View f1dz's full-sized avatar
☺️
Keep writing and learning

Khofidin f1dz

☺️
Keep writing and learning
View GitHub Profile
@f1dz
f1dz / AppSession.php
Last active November 9, 2017 08:06
SSO Yii2
<?php
namespace app\components;
use yii\base\Component;
use app\models\Session as SessionModel;
/**
* Created by PhpStorm.
* User: ofid
@f1dz
f1dz / Fleetmon.php
Created June 8, 2018 06:51
Fleetmon
<?php
/**
* Created by PhpStorm.
* User: ofid
* Date: 04/06/18
* Time: 15.35
*
* @author Khofidin <offiedz@gmail.com>
*/
@f1dz
f1dz / README.md
Created September 14, 2018 01:35 — forked from mbleigh/README.md
Automate the deletion of old Firebase Hosting versions.

Firebase Hosting Version Cleanup

This is a simple utility script for cleaning up Firebase Hosting versions, leaving a specified number of versions remaining. This is primarily done to conserve storage usage, but may have other uses.

USE AT YOUR OWN RISK. NO WARRANTY IS PROVIDED. THIS SCRIPT DOES DELETE STUFF PERMANENTLY

Usage

node cleanupVersions.js [commit]

@f1dz
f1dz / Awatermark.kt
Created February 8, 2021 08:52
Image Watermark
class Watermark {
/**
* Put watermark into the photo
*/
private fun watermark() {
doAsync {
val photoDir = scanViewModel!!.session.name
val maxResolution = 1024
val bmp = MediaStore.Images.Media.getBitmap(contentResolver, fileUri)
var height = maxResolution
@f1dz
f1dz / temptron.ino
Created March 28, 2021 12:09
RSS #20 Demo IoT in Action Using MQTT
/**
* Written by offiedz@gmail.com
* 28 March 2021
* To use this script you should using ESP32, DHT22 sensor and LCD SSD1306
* Please comment when you got any issue
*/
#include <WiFi.h>
#include <PubSubClient.h>
#include "DHT.h"
@f1dz
f1dz / esp8266_mqtt_client.ino
Created March 29, 2021 15:15
ESP8266 MQTT PubSub Client
#include <ESP8266WiFi.h>
#include <PubSubClient.h>
#ifndef STASSID
#define STASSID ""
#define STAPSK ""
#endif
const char* ssid = STASSID;
const char* password = STAPSK;
@f1dz
f1dz / esp32_mqtt_client.ino
Created March 29, 2021 15:21
ESP32 MQTT PubSub Client
#include <Wifi.h>
#include <PubSubClient.h>
#ifndef STASSID
#define STASSID ""
#define STAPSK ""
#endif
const char* ssid = STASSID;
const char* password = STAPSK;
@f1dz
f1dz / favorite_button.dart
Last active August 5, 2022 08:57
Favorite Button
import 'package:flutter/material.dart';
class FavoriteButton extends StatefulWidget {
const FavoriteButton({Key? key, required this.favorite}) : super(key: key);
final bool favorite;
@override
State<FavoriteButton> createState() => _FavoriteButtonState();
}
import 'package:flutter/material.dart';
class OrderButton extends StatefulWidget {
const OrderButton({Key? key}) : super(key: key);
@override
State<OrderButton> createState() => _OrderButtonState();
}
class _OrderButtonState extends State<OrderButton> {
@f1dz
f1dz / main.dart
Created September 22, 2022 04:06
enchanted-jungle-5471
import 'package:flutter/material.dart';
const Color darkBlue = Color.fromARGB(255, 18, 32, 47);
void main() {
runApp(MyApp());
}
class MyApp extends StatelessWidget {
@override