Install Supervisor
brew install supervisor
<?php | |
namespace App\Http\Middleware; | |
use Closure; | |
class PreventBackHistory | |
{ | |
/** | |
* Handle an incoming request. |
export function sleep(ms) { | |
const DEF_DELAY = 1000; | |
return new Promise(resolve => setTimeout(resolve, ms || DEF_DELAY)); | |
} |
Place this code in android/build.gradle
subprojects {
afterEvaluate {project ->
if (project.hasProperty("android")) {
android {
compileSdkVersion 27 // <-- match this to your project's compileSdkVersion
buildToolsVersion '27.0.3' // <-- match this to your project's buildToolsVersion
}
randomKeyFromObject: function(obj) { | |
return Object.keys(obj)[Math.floor(Math.random()*Object.keys(obj).length)]; | |
} |
function randomString($length = 13) | |
{ | |
// uniqid gives 13 chars, but you could adjust it to your needs. | |
if (function_exists("random_bytes")) { | |
$bytes = random_bytes(ceil($length / 2)); | |
} elseif (function_exists("openssl_random_pseudo_bytes")) { | |
$bytes = openssl_random_pseudo_bytes(ceil($length / 2)); | |
} else { | |
throw new Exception("no cryptographically secure random function available"); | |
} |
Error caused by:
AAPT: error: resource android:attr/fontVariationSettings not found.
Add below in android/gradle.properties
on top of it.
googlePlayServicesVersion=12.0.1
Don't forget to include /usr/local/etc/nginx/servers
folder in /usr/local/etc/nginx/nginx.conf
with syntax: include servers/*;
MacOS location /usr/local/etc/nginx/servers/sub.domain.dv.conf
<?php | |
$items_per_page = 2; | |
$page = isset( $_GET['cpage'] ) ? abs( (int) $_GET['cpage'] ) : 1; | |
$offset = ( $page * $items_per_page ) - $items_per_page; | |
$query = 'SELECT * FROM '.$table_name; | |
$total_query = "SELECT COUNT(1) FROM (${query}) AS combined_table"; | |
$total = $wpdb->get_var( $total_query ); | |
$results = $wpdb->get_results( $query.' ORDER BY id DESC LIMIT '. $offset.', '. $items_per_page, OBJECT ); | |
/* | |
* |
<?php | |
function get_image_id_from_url($image_url) | |
{ | |
global $wpdb; | |
$attachment = $wpdb->get_col($wpdb->prepare("SELECT ID FROM $wpdb->posts WHERE guid='%s';", $image_url )); | |
return $attachment[0]; | |
} |