Skip to content

Instantly share code, notes, and snippets.

@jkfrancis06
jkfrancis06 / README.md
Created October 5, 2023 19:20 — forked from lsv/README.md
KNP Menu Bundle - Bootstrap 4 and Font Awesome 4
@jkfrancis06
jkfrancis06 / formatBytes.dart
Created January 4, 2022 11:30 — forked from zzpmaster/formatBytes.dart
convert bytes to kb mb in dart
static String formatBytes(int bytes, int decimals) {
if (bytes <= 0) return "0 B";
const suffixes = ["B", "KB", "MB", "GB", "TB", "PB", "EB", "ZB", "YB"];
var i = (log(bytes) / log(1024)).floor();
return ((bytes / pow(1024, i)).toStringAsFixed(decimals)) +
' ' +
suffixes[i];
}
@jkfrancis06
jkfrancis06 / main.dart
Created December 8, 2021 19:50 — forked from eduardoflorence/main.dart
GetX - Sample GetMiddleware
import 'package:flutter/material.dart';
import 'package:get/get.dart';
class GlobalMiddleware extends GetMiddleware {
final authController = Get.find<AuthController>();
@override
RouteSettings redirect(String route) {
return authController.authenticated || route == '/login'
? null
@jkfrancis06
jkfrancis06 / main.dart
Created October 14, 2021 15:13 — forked from eduardoflorence/main.dart
Getx - Sample Form
import 'package:flutter/material.dart';
import 'package:get/get.dart';
void main() {
runApp(GetMaterialApp(
initialRoute: '/login',
getPages: [
GetPage(
name: '/login',
page: () => LoginPage(),
@jkfrancis06
jkfrancis06 / loadCSV.php
Created May 8, 2021 20:05 — forked from josephspurrier/loadCSV.php
Parse a CSV file in PHP, remove hidden characters, escape fields to prepare for MySQL, and return an associative array.
// Auto detect line endings
ini_set('auto_detect_line_endings', true);
function loadCSV($file)
{
// Create an array to hold the data
$arrData = array();
// Create a variable to hold the header information
$header = NULL;