- Create and a local branch from origin
git branch -t origin/branch-name
- Create and swap the branch
| sudo apt -o Dpkg::Options::="--force-overwrite" --fix-broken install |
| using UnityEngine; | |
| public class PrefabToIcon | |
| { | |
| private float _distanceThreshold; | |
| private readonly int _iconWidth = 512; | |
| private readonly int _iconHeight = 512; | |
| private readonly Vector3 _scale = new Vector3(1, 1, 1); |
| " remap escape key to jk | |
| imap jk <Esc> | |
| " when possible cursor is in center of screen | |
| nnoremap j jzz | |
| nnoremap k kzz | |
| nnoremap `` ``zz | |
| " general settings | |
| set rnu et ts=4 sw=4 sts=4 ai cindent nowrap noswapfile cursorline splitbelow splitright |
| fun convertLongToTime(time: Long): String { | |
| val date = Date(time) | |
| val format = SimpleDateFormat("yyyy.MM.dd HH:mm") | |
| return format.format(date) | |
| } | |
| fun currentTimeToLong(): Long { | |
| return System.currentTimeMillis() | |
| } |
| // In your Activity or Fragment create a function as: | |
| fun View.hideKeyboard() { | |
| val inputManager = context.getSystemService(Context.INPUT_METHOD_SERVICE) as InputMethodManager | |
| inputManager.hideSoftInputFromWindow(windowToken, 0) | |
| } | |
| // suppose you have a button with an id your_button_id in XML file related to this Activity or Fragment, so, on button click event: | |
| your_button_id.setOnClickListener{ |
| // Configure o SimpleDateFormat no onCreate ou onCreateView | |
| String pattern = "dd/MM/yyyy"; | |
| SimpleDateFormat sdf = new SimpleDateFormat(pattern); | |
| sdf.setLenient(false); | |
| // Durante a confirmacao de cadastro, faça a validacao | |
| String data = NascimentoUsu.getText().toString(); |
| package br.uea.transirie.mypay.mylaundry.util | |
| import android.text.Editable | |
| import android.text.TextWatcher | |
| import android.widget.EditText | |
| class MaskBrMonetaryValue { | |
| companion object { | |
| fun mask(editableText: EditText): TextWatcher { | |
| return object : TextWatcher { |
| // https://www.dicio.com.br/lista-de-palavras/ | |
| function download(filename, text) { | |
| var element = document.createElement('a'); | |
| element.setAttribute('href', 'data:text/plain;charset=utf-8,' + encodeURIComponent(text)); | |
| element.setAttribute('download', filename); | |
| element.style.display = 'none'; | |
| document.body.appendChild(element); |
| function download(filename, text) { | |
| var element = document.createElement('a'); | |
| element.setAttribute('href', 'data:text/plain;charset=utf-8,' + encodeURIComponent(text)); | |
| element.setAttribute('download', filename); | |
| element.style.display = 'none'; | |
| document.body.appendChild(element); | |
| element.click(); |