Skip to content

Instantly share code, notes, and snippets.

@madindo
madindo / passwordValidation.php
Created Jan 28, 2022 — forked from Michael-Brooks/passwordValidation.php
Laravel Password validation Regex (Contain at least one uppercase/lowercase letters and one number)
View passwordValidation.php
<?php
/*
* Place this with the rest of your rules.
* Doesn't need to be in an array as there are no pipes.
* Password is required with a minimum of 6 characters
* Should have at least 1 lowercase AND 1 uppercase AND 1 number
*/
$rules = [
'password' => 'required|min:6|regex:/^(?=.*[a-z])(?=.*[A-Z])(?=.*\d).+$/'
];
View headings.css
h1 {
display: block;
font-size: 2em;
margin-top: 0.67em;
margin-bottom: 0.67em;
margin-left: 0;
margin-right: 0;
font-weight: bold;
}
h2 {
@madindo
madindo / install-wp.sh
Created Dec 9, 2020 — forked from BFTrick/install-wp.sh
Download & Install WordPress via Curl
View install-wp.sh
curl -O https://wordpress.org/latest.zip
unzip latest.zip
mv wordpress site
rm latest.zip
View index.html
<link rel='manifest' href='/manifest.json'>
<script>
// Check compatibility for the browser we're running this in
if ("serviceWorker" in navigator) {
if (navigator.serviceWorker.controller) {
console.log("[PWA Builder] active service worker found, no need to register");
} else {
// Register the service worker
navigator.serviceWorker
View RouteServiceProvider.php
protected function mapAmpRoutes()
{
Route::group([
'middleware' => 'web',
'namespace' => $this->namespace,
'prefix' => 'amp',
], function ($router) {
require base_path('routes/amp.php');
});
}
View SplashActivity.java
package com.madindo.fotofilio;
import android.content.Intent;
import android.os.Handler;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
public class MainActivity extends AppCompatActivity {
private static int SPLASH_TIME_OUT = 4000;
@madindo
madindo / main_activity.java
Created Jul 11, 2019
Android Material Design Popup Menu
View main_activity.java
@Override
public boolean onCreateOptionsMenu(Menu menu) {
getMenuInflater().inflate(R.menu.menu_main, menu);
return true;
}
@Override
public boolean onOptionsItemSelected(MenuItem item) {
int id = item.getItemId();
@madindo
madindo / menu_main.xml
Last active Jul 11, 2019
Android Material Design Popup Menu
View menu_main.xml
<menu xmlns:android="http://schemas.android.com/apk/res/android">
<item
android:title="@string/item_1"
android:id="@+id/item1_id" />
<item
android:title="@string/item_2"
android:id="@+id/item2_id" />
<item
android:title="@string/item_3"
android:id="@+id/item3_id" />
View env temp
APP_NAME=Muslimadani
APP_ENV=local
APP_KEY=base64:b1Ph6yo9V9DvzUtiFFrtVTZzX0yJPb54L0tKgrOK+KM=
APP_DEBUG=true
APP_LOG_LEVEL=debug
APP_URL=http://localhost:8000
DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
@madindo
madindo / .bash_profile
Last active Nov 28, 2018 — forked from JeffreyWay/.bash_profile
Laravel aliases
View .bash_profile
# laravel new-app
alias laravel="git clone -o laravel -b develop https://github.com/laravel/laravel.git"
alias artisan="php artisan"
alias migrate="php artisan migrate"
alias serve="php artisan serve"
alias dump="php artisan dump"
alias t="phpunit"
# Generators Package