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
#!/bin/zsh | |
# @author: Mahfuzul Hasan <[email protected]> | |
# setwp function download and extract wordpress from https://wordpress.org | |
# To execute this function run this commands: | |
# chmod +x setwp.sh | |
# ./setwp.sh | |
# or add this file as a source in your .zshrc / .bashrc file " source ~/bin/zsh/setwp.sh " | |
# | |
setwp(){ | |
echo "Downloading....." |
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
#!/bin/zsh | |
# @author: Mahfuzul Hasan <[email protected]> | |
# setdrupal function download and extract Drupal from https://www.drupal.org | |
# To execute this function run this commands: | |
# chmod +x setwp.sh | |
# ./setwp.sh | |
# or add this file as a source in your .zshrc / .bashrc file " source ~/bin/zsh/setdrupal.sh " | |
# | |
setdrupal(){ | |
echo -n "Which version you want to download (ex. 7.34) ? " |
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
# Make a file named virtualhost and place it in /usr/local/bin folder. | |
# Give +x permission to the file. | |
# use as | |
# virtualhost sitename.tld relative_path_to/var/www/ | |
# i.e virtualhost d7.san d7 | |
#!/bin/bash | |
### Set default parameters | |
action='create' | |
domain=$1 |
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
<!-- Save this snippet in Packages/User/wpbaseurl.sublime-snippet --> | |
<snippet> | |
<content><![CDATA[ | |
define('WP_HOME', 'http://${1}.mh/'); | |
define('WP_SITEURL', 'http://${1}.mh/'); | |
]]></content> | |
<!-- Optional: Set a tabTrigger to define how to trigger the snippet --> | |
<tabTrigger>wpbaseurl</tabTrigger> | |
<description>WordPress Base URL</description> | |
<!-- Optional: Set a scope to limit where the snippet will trigger --> |
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 | |
/** | |
* Get posts year | |
* @return [type] [description] | |
*/ | |
function get_post_years() { | |
global $wpdb; | |
$sql = "SELECT YEAR(STR_TO_DATE(p.post_date, '%Y')) as year | |
FROM $wpdb->posts as p | |
WHERE p.post_type = 'post' AND p.post_status = 'publish' |
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 | |
/** | |
* Print WordPress Taxonomy Terms as list | |
* @param [type] $terms_array [description] | |
* @param [type] $first_item [description] | |
* @return [type] [description] | |
*/ | |
function print_terms($terms_array, &$first_item) { | |
if(!$terms_array || count($terms_array) < 1) return; | |
foreach($terms_array as $term) { |
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
$us_states = array( | |
'AL' => 'Alabama', | |
'AK' => 'Alaska', | |
'AZ' => 'Arizona', | |
'AR' => 'Arkansas', | |
'CA' => 'California', | |
'CO' => 'Colorado', | |
'CT' => 'Connecticut', | |
'DE' => 'Delaware', | |
'DC' => 'District of Columbia', |
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
var us_states_lat_lng = [ | |
{lat: 32.806671, lng: -86.791130}, | |
{lat: 61.370716, lng: -152.404419}, | |
{lat: 33.729759, lng: -111.431221}, | |
{lat: 34.969704, lng: -92.373123}, | |
{lat: 36.116203, lng: -119.681564}, | |
{lat: 39.059811, lng: -105.311104}, | |
{lat: 41.597782, lng: -72.755371}, | |
{lat: 39.318523, lng: -75.507141}, | |
{lat: 38.897438, lng: -77.026817}, |
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 URL: https://www.sitepoint.com/web-foundations/mime-types-complete-list/ | |
$mime_types = array ( | |
'3dm' => 'x-world/x-3dmf', | |
'3dmf' => 'x-world/x-3dmf', | |
'a' => 'application/octet-stream', | |
'aab' => 'application/x-authorware-bin', | |
'aam' => 'application/x-authorware-map', | |
'aas' => 'application/x-authorware-seg', | |
'abc' => 'text/vnd.abc', |
OlderNewer