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
/* Within container */ | |
.Absolute-Center { | |
width: 50%; | |
height: 50%; | |
overflow: auto; | |
margin: auto; | |
position: absolute; | |
top: 0; left: 0; bottom: 0; right: 0; | |
} |
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
server { | |
listen 80; | |
server_name example.com; | |
root /var/www/example.com; | |
error_log /var/log/example.com/error.log; | |
access_log /var/log/example.com/access.log; | |
location / { | |
try_files $uri @silverstripe; | |
} |
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 | |
function the_date_range($args) { | |
global $post; | |
$default = array( | |
'start_field' => 'start_date', | |
'end_field' => null, | |
'base_format' => 'Ymd', | |
'post_id' => $post->ID, | |
'separator' => '<span class="date-separator">–</span>', | |
'month_format' => 'F', |
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 | |
// This file assumes that you have included the nav walker from https://github.com/twittem/wp-bootstrap-navwalker | |
// somewhere in your theme. | |
?> | |
<header class="banner navbar navbar-default navbar-static-top" role="banner"> | |
<div class="container"> | |
<div class="navbar-header"> | |
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target=".navbar-collapse"> | |
<span class="sr-only"><?= __('Toggle navigation', 'sage'); ?></span> |
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 | |
//---------------------------------------------------------------------- | |
// Step 1: Create a Post Dynamically | |
//---------------------------------------------------------------------- | |
// Register Post Data | |
$post = array(); | |
$post['post_status'] = 'publish'; | |
$post['post_type'] = 'post'; // can be a CPT too | |
$post['post_title'] = 'My New Post'; | |
$post['post_content'] = 'My new post 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 | |
/** | |
* Created by PhpStorm. | |
* User: hafiq | |
* Date: 03/11/2019 | |
* Time: 11:36 PM | |
*/ | |
use Illuminate\Support\Facades\Schema; |
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
#!/bin/bash | |
if [ "$EUID" -ne 0 ] | |
then echo "Please run as root" | |
exit | |
fi | |
apt-get install pkg-config libmagickwand-dev -y | |
cd /tmp | |
wget https://pecl.php.net/get/imagick-3.4.4.tgz | |
tar xvzf imagick-3.4.4.tgz |