Skip to content

Instantly share code, notes, and snippets.

View cjamcu's full-sized avatar
🏠
Working from home

Carlos Javier cjamcu

🏠
Working from home
View GitHub Profile
@roipeker
roipeker / main.dart
Created August 27, 2020 13:28
GetX minimal sample bottom navbar.
import 'package:flutter/material.dart';
import 'package:get/get.dart';
class SampleBottomNavDemo extends StatelessWidget {
@override
Widget build(BuildContext context) {
return GetMaterialApp(
themeMode: ThemeMode.dark,
debugShowCheckedModeBanner: false,
theme: ThemeData.light(),
@zzpmaster
zzpmaster / formatBytes.dart
Last active June 4, 2024 23:11
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];
}
@Klerith
Klerith / plugins.md
Last active June 28, 2024 16:42
Flutter: Curso de Flutter - Instalaciones recomendadas

Programas

git config --global user.name "Tu nombre"
git config --global user.email "Tu correo"
@florina-muntenescu
florina-muntenescu / BaseDao.kt
Last active September 28, 2023 15:01
Use Dao inheritance to reduce the amount of boilerplate code - https://medium.com/google-developers/7-pro-tips-for-room-fbadea4bfbd1
/*
* Copyright (C) 2017 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
@ocReaper
ocReaper / install-emby.sh
Created May 11, 2016 10:25
Install Emby Server on Debian (or Raspbian)
# we need root permission
sudo su
# run the required commands
wget http://download.opensuse.org/repositories/home:emby/Debian_8.0/Release.key
apt-key add - < Release.key
echo 'deb http://download.opensuse.org/repositories/home:/emby/Debian_8.0/ /' >> /etc/apt/sources.list.d/emby-server.list
apt-get update
apt-get install emby-server
@ftvs
ftvs / PhonecallReceiver.java
Last active October 11, 2023 10:05
Detecting an incoming call coming to an Android device. Remember to set the appropriate permissions in AndroidManifest.xml as suggested in the Stackoverflow link. Usage example in comments. Source: Gabe Sechan http://stackoverflow.com/a/15564021/264619 Explanation: http://gabesechansoftware.com/is-the-phone-ringing/#more-8
package com.gabesechan.android.reusable.receivers;
import java.util.Date;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.telephony.TelephonyManager;
public abstract class PhonecallReceiver extends BroadcastReceiver {