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
| function getIndianCurrency(float $number) | |
| { | |
| $decimal = round($number - ($no = floor($number)), 2) * 100; | |
| $hundred = null; | |
| $digits_length = strlen($no); | |
| $i = 0; | |
| $str = array(); | |
| $words = array(0 => '', 1 => 'one', 2 => 'two', | |
| 3 => 'three', 4 => 'four', 5 => 'five', 6 => 'six', | |
| 7 => 'seven', 8 => 'eight', 9 => 'nine', |
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
| sudo add-apt-repository -y -r ppa:chris-lea/node.js | |
| sudo rm -f /etc/apt/sources.list.d/chris-lea-node_js-*.list |
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
| du -sh /var/cache/apt/archives | |
| //clean the apt cache | |
| sudo apt-get clean | |
| //way to remove old kernels in Ubuntu | |
| sudo apt-get autoremove --purge | |
| //To remove a specific app by name | |
| sudo apt-get remove package-name1 package-name2 | |
| //packages and dependencies which are newer versions have replaced them | |
| sudo apt-get autoremove |
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
| RewriteEngine On | |
| RewriteCond %{HTTPS} off | |
| RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} |
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
| // lock scroll position, but retain settings for later | |
| var scrollPosition = [ | |
| self.pageXOffset || document.documentElement.scrollLeft || document.body.scrollLeft, | |
| self.pageYOffset || document.documentElement.scrollTop || document.body.scrollTop | |
| ]; | |
| var html = jQuery('html'); // it would make more sense to apply this to body, but IE7 won't have that | |
| html.data('scroll-position', scrollPosition); | |
| html.data('previous-overflow', html.css('overflow')); | |
| html.css('overflow', 'hidden'); | |
| window.scrollTo(scrollPosition[0], scrollPosition[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
| function special_nav_class ($classes, $item) { | |
| if (in_array('current-menu-item', $classes) ){ | |
| $classes[] = 'active '; | |
| } | |
| return $classes; | |
| } |
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 | |
| Vc_Manager::getInstance()->vc()->addShortcodesCustomCss($page_id); | |
| $the_post = get_post($page_id); | |
| echo apply_filters('the_content', $the_post->post_content); | |
| ?> |
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
| add_filter( 'submit_job_form_fields', 'make_location_field_required' ); | |
| function make_location_field_required( $fields ) { | |
| $fields['job']['job_location']['required'] = true; | |
| return $fields; | |
| } |
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 | |
| // Now you can have (3 possibilities): | |
| // 1) The saving price: | |
| add_filter( 'woocommerce_get_price_html', 'change_displayed_sale_price_html', 10, 2 ); | |
| function change_displayed_sale_price_html( $price, $product ) { | |
| // Only on sale products on frontend and excluding min/max price on variable products | |
| if( $product->is_on_sale() && ! is_admin() && ! $product->is_type('variable')){ | |
| // Get product prices |
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 | |
| ?> | |
| <!DOCTYPE html> | |
| <html lang="en"> | |
| <head> | |
| <meta charset="UTF-8"> | |
| <title> Create a Zip with contents in the current Direcory (php script)</title> | |
| <style type="text/css"> | |
| body{ | |
| font-family: arial; |