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
| %H - Hour of the day, 24-hour clock, zero-padded (00..23) | |
| %k - Hour of the day, 24-hour clock, blank-padded ( 0..23) | |
| %I - Hour of the day, 12-hour clock, zero-padded (01..12) | |
| %l - Hour of the day, 12-hour clock, blank-padded ( 1..12) | |
| %P - Meridian indicator, lowercase (``am'' or ``pm'') | |
| %p - Meridian indicator, uppercase (``AM'' or ``PM'') | |
| %M - Minute of the hour (00..59) | |
| 12:00PM = %I:%M%p |
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
| git add -u | |
| Additional info: | |
| git add -A (stages All) | |
| git add . (stages new and modified, without deleted) | |
| git add -u (stages modified and deleted, without new) |
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 | |
| $source = "/path/to/your/file/"; | |
| $files = scandir("$source"); | |
| foreach($files as $file) { | |
| // inside this loop, we strip the information from the CSV file | |
| $arrLines = file($source . $file); | |
| foreach($arrLines as $lines) { | |
| // display each element |
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
| # Create Database | |
| CREATE DATABASE `database_name`; | |
| # Create Table | |
| CREATE TABLE `table_name` ( | |
| contact_id INT(10) NOT NULL AUTO_INCREMENT, | |
| name VARCHAR(40), | |
| birthdate DATE, | |
| PRIMARY KEY (contact_id) | |
| ); |
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
| server { | |
| server_name www.yourdomain.com | |
| rewrite ^(.*) http://yourdomain.com | |
| } |
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
| # Format that we want to output: 20140813101546 | |
| date "+%Y%m%d%I%M%S" |
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
| #backup all databases in one file (eventually add the option --add-locks): | |
| mysqldump -u [username] -p[root_password] [database_name] > file.sql | |
| #backup all databases in one gzipped file: | |
| mysqldump -u [username] -p[password] -–all-databases | gzip > file.sql.gz | |
| #restore all databases: | |
| mysql -u [username] -p[password] < file.sql |
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
| find <path> -name "*.<file_extension>" -delete |
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
| mail -s "Subject goes here" [email protected] < path_to_file_with_contents.txt |
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
| #Mounting the share is a 2 stage process: | |
| # 1. Create a directory that will be the mount point | |
| # 2. Mount the share to that directory | |
| #Create the mount point: | |
| mkdir share_name | |
| #Mount the share (edited for Mac OS X): | |
| #The -t flag is to indicate the file system type. In this case, it is smbfs. | |
| mount -t smbfs //username:[email protected]/share_name share_name/ |