This file contains hidden or 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 SwiftUI | |
struct TabView: View { | |
var views: [TabBarItem] | |
@State var selectedIndex: Int = 0 | |
init(_ views: [TabBarItem]) { | |
self.views = views | |
} | |
This file contains hidden or 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 | |
namespace Tests; | |
use Illuminate\Foundation\Testing\RefreshDatabase; | |
use Illuminate\Foundation\Testing\TestCase; | |
abstract class ModelTestCase extends TestCase | |
{ | |
use CreatesApplication; |
This file contains hidden or 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 | |
$uuid = Uuid::uuid(); | |
$monolog = Log::getMonolog(); | |
$monolog->pushProcessor(function ($record) use ($uuid) { | |
$record['extra']['request-id'] = $uuid; | |
$record['extra']['user'] = (Auth::user() ? Auth::user()->id : null); | |
$record['extra']['ip'] = \Request::getClientIp(); | |
return $record; |
This file contains hidden or 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
val installer = context.packageManager.getInstallerPackageName(context.packageName) | |
val validInstallers = ArrayList(Arrays.asList("com.android.vending", "com.google.android.feedback")) | |
var check: Boolean = (installer != null && validInstallers.contains(installer) |
This file contains hidden or 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
#!/bin/bash | |
# Install dependencies | |
composer install --no-interaction --prefer-dist --optimize-autoloader --no-dev | |
# Generate env file | |
cp -p .env.example .env | |
# Generate key | |
php artisan key:generate |
This file contains hidden or 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
# .bashrc | |
# User specific aliases and functions | |
alias rm='rm -i' | |
alias cp='cp -i' | |
alias mv='mv -i' | |
alias ls='ls -lh' | |
alias vi='vim' | |
# Source global definitions |
This file contains hidden or 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 UIKit | |
class CustomView: UIView { | |
init() { | |
super.init(frame: .zero) | |
setup() | |
} | |
required init?(coder aDecoder: NSCoder) { |
This file contains hidden or 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 | |
function digito_verificador($ci, $baseMax = 11) | |
{ | |
$resultado = 0; | |
$index = 0; | |
for ($rucIndex = strlen($ci) - 1; $rucIndex >= 0; $rucIndex--) { | |
$resultado += (int) $ci[$rucIndex] * ($index + 2); | |
$r = $resultado % $baseMax; | |
$index++; |
This file contains hidden or 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 | |
namespace App\Console\Commands; | |
use Illuminate\Console\GeneratorCommand; | |
use Symfony\Component\Console\Input\InputArgument; | |
class MakeContract extends GeneratorCommand | |
{ | |
/** |
This file contains hidden or 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 | |
namespace App\Contracts; | |
interface DummyContract | |
{ | |
public function handle(); | |
} |
NewerOlder