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
Backup Realm Database Android | |
Este processo é útil para telefones que requerem permissões de acesso aos dados, apresentando o erro: | |
error run-as: Could not set capabilities: Operation not permitted. | |
Obs.: Para funcionar a variavel do AndroidManifest [android:allowBackup] tem estar igual a true, habilitando backup do aplicativo. | |
1- Comando para efetuar o backup: | |
adb backup -f /Users/CS4/Desktop/data.ab <nome_do_package> |
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
public function skipWeekend($dt) { | |
if ($dt->isWeekend()) { | |
$dw = $dt->dayOfWeek; | |
if ($dw == 6) { | |
return $dt->addDay(2); | |
} else if ($dw == 0) { | |
return $dt->addDay(); | |
} |
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
@extends('layouts.adminlte') | |
@section('css') | |
<!-- Pace style --> | |
<link rel="stylesheet" href="/bower_components/AdminLTE/plugins/pace/pace.min.css"> | |
@endsection | |
@section('header') | |
<meta name="_token" content="{!! csrf_token() !!}" /> | |
@endsection | |
@section('content') |
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
<?php | |
class User extends Authenticatable implements Transformable | |
{ | |
use TransformableTrait; | |
use Notifiable; | |
use HasApiTokens; | |
protected $fillable = [ | |
"registry", |
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
Autenticar usuario no Laravel por outros campos da tabela users: | |
No arquivo LoginController: | |
- Sobrescrever o metodo: username() | |
- Sobrescrever o metodo: validateLogin() | |
- Sobrescrever o metodo: credentials() | |
* Esses metodos estão na trait AuthenticatesUsers.php |
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
Instalação e configuração do Supervisor para gerenciar os Jobs do Laravel no servidor linux. | |
1- Instalação: | |
sudo apt-get install supervisor | |
2- Acesse o diretório: | |
cd /etc/supervisor/conf.d | |
3- Crie novo arquivo de configuração. Ex: queue-work.conf |
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
Instalação Wordpress via Easy Engine DO | |
1- Criar usuario: | |
adduser nomedousuario | |
2- Adicionar ao grupo de administradores: | |
usermod -aG sudo nomedousuario |
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
# Valid field serial_number from model Product as unique as an example; | |
# Note if we are updating the record, and the value of record field is equals to value of request (received from form submit), | |
it's necessary ignore because didn't have alterations in this field. Otherwise, it will validate as unique field. | |
class ProductRequest extends FormRequest | |
{ | |
public function authorize() | |
{ |
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
# select database | |
USE database_name; | |
# disable relationships | |
SET foreign_key_checks=off; | |
# this command will retreive the drop command for all tables from database. So just copy the result and execute |
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
1- Insert this code in styles.xml: | |
<style name="SpinnerStyle"> | |
<item name="android:background">@drawable/spinner_style</item> | |
</style> | |
2- Create a new Vector Asset called ic_arrow_drop_down_black_18dp with size: 18x18dp. | |
3- Modify file /drawable/spinner_style.xml like: |
OlderNewer