- Servidor Mysql
- Instalar Python 3+
- Instalar dependencias de python, pandaz, mysql, alive-progress
$> pip install mysql-connector-python
$> pip install pandas
$> pip install alive-progress
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import android.annotation.TargetApi; | |
import android.content.Context; | |
import android.graphics.Canvas; | |
import android.graphics.Paint; | |
import android.os.Build; | |
import android.util.AttributeSet; | |
import android.view.Gravity; | |
import android.widget.TextView; | |
/** | |
* Simple version used in the article: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
from sty import fg, bg, ef, rs | |
from pytube import YouTube | |
from pathlib import Path | |
import re | |
import inquirer | |
def cError(text): return fg.red + text + fg.rs | |
def cWarging(text): return fg.da_yellow + text + fg.rs |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import datetime | |
from dateutil.tz import gettz | |
class RegionTZ: | |
def __init__(self, name, tz, flag=None): | |
self.name = name | |
self.tz = gettz(tz.strip()) | |
if flag is None: | |
flag = self.name | |
self.flag = flag |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from datetime import datetime, timedelta | |
from datetime import date | |
class AppGplay: | |
def __init__(self, name, startDate, endDate=None): | |
self.name = name | |
self.startDate = startDate | |
if endDate is None: | |
endDate = self.startDate + timedelta(days=7) | |
self.endDate = endDate |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.kotlin.utils.singleton | |
/** | |
* What if you need pass some arguments for initialization jus like parameterized constructor? | |
* Since we can't use constructor with the object keyword. So, we need to find some other way of | |
* doing the same. | |
* | |
* We can archive this by using a SingletonHolder class. | |
* Also, to make it thread-safe, we need to have a way of synchronized a double check locking principle. | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Foundation | |
enum PokemonType : Int { | |
case Water = 0 | |
case Fire | |
case Plant | |
case Electro | |
static var count: Int { return PokemonType.Electro.rawValue + 1} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sealed class AuthState { | |
object Idle : AuthState() | |
object Authenticating : AuthState() | |
class Authenticated(val user: FirebaseUser? = null) : AuthState() | |
object Unauthenticated : AuthState() | |
class AuthError(val message: String? = null) : AuthState() | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class MainActivity : AppCompatActivity() { | |
private lateinit var appBarConfiguration: AppBarConfiguration | |
private lateinit var binding: ActivityMainBinding | |
private val mViewModel by viewModels<AuthViewModel> { | |
AuthViewModelFactory(this.application) | |
} | |
private val auth by lazy { | |
FirebaseAuth.getInstance() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class FirstFragment : Fragment() { | |
private var _binding: FragmentFirstBinding? = null | |
private val binding get() = _binding!! | |
val viewModel by activityViewModels<MyViewModel>() | |
override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View { |