Some useful date hacks
- Display only date when receiving full datetime type from MySQL
echo date('Y-m-d',strtotime($mysql_datetime)); |
2. Add or subtract x days or months to a date.
link
Some useful date hacks
echo date('Y-m-d',strtotime($mysql_datetime)); |
2. Add or subtract x days or months to a date.
link
After you select a dropdown, you might want the next dropdown to be filtered.
Some resources:
Quick notes (I’m using a Mac)
composer dump-autoload – to regenerate autoload files. especially when error run migrate or db seed.
Steps to set up
A. Setting up the forwarding (example below is from another gmail. If from other emails may be differeent. e.g. from zoho mail)
B. Setting up to reply via gmail
This is my notes on digital ocean.
Click here to register with DigitalOcean and get free USD10 to start using the service.
I used to install Ubuntu 14.04 with LAMP on it. With this also get SFTP ready.
Change root password. If logged in as root
Add new user
Manage groups for user
Connect to server via SSH, in terminal type the following:
To get default MySQL root password, write this in terminal. Remove the file once done change the MySQL root password.
To enter mysql console
Secure MySQL server. Run following command and answer all the questions.
To change MySQL root password:
To only allow certain IP to access directly to database
Enable .htaccess (mod rewrite)
To restart services (can also use stop and start)
Install sendmail service (used by PHP mail function)
Change permission for directory (especially for ‘upload’ directory)
Change the timezone. By default using US time zone
To turn off server
find / -size +50M -ls
To update/upgrade OS
Disable root login on SSH
Block IP’s from accessing certain services
Other measures:
vi, vim, nano
Click here to register with DigitalOcean and get free USD10 to start using the service.
2 simple steps.
1. Create or update the .htaccess as follow
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L]
OR
RewriteEngine On
RewriteBase /app/
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /app/index.php [L]
OR
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?/$1 [L]
ErrorDocument 404 /index.php
2. Update the config/config.php file to this
$config[‘index_page’] = ”;
Below are the list. Haven’t had time to review in details. Some for Malaysia, some other from outside but used by many countries including Malaysia.
Old players
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<!-- The above 3 meta tags *must* come first in the head; any other head content must come *after* these tags -->
<meta name="description" content="">
<meta name="author" content="">
<title>Title here</title>
<!-- Bootstrap core CSS -->
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css" rel="stylesheet">
<!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
<![endif]-->
</head>
<body>
<div class="container">
<div>
<h1>Heading here</h1>
<p>Content here</p>
</div>
</div><!-- /.container -->
<!-- Bootstrap core JavaScript
================================================== -->
<!-- Placed at the end of the document so the pages load faster -->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/js/bootstrap.min.js"></script>
</body>
</html> |
Try to open the unsigned program, if it failed do the following.
Go to System Preferences > Security & Privacy
Click on “Open Anyway” on the app that can’t be launched.