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
| // Allow SVG upload | |
| function my_types($mime_types) | |
| { | |
| $mime_types['svg'] = 'image/svg+xml'; //Adding svg extension | |
| return $mime_types; | |
| } | |
| add_filter('upload_mimes', 'my_types', 1, 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
| // Automatically Protect Emails From Spambots in Wordpress Without a plugin | |
| function remove_plaintext_email($emailAddress) { | |
| $emailRegEx = '/([a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+.[a-zA-Z]{2,4})/i'; | |
| // Hack because wordpress generates break after email, that get encoded together with the email | |
| $emailAddress = str_replace('<br />', ' <br />', $emailAddress); | |
| // END: Hack | |
| return preg_replace_callback($emailRegEx, "encodeEmail", $emailAddress); | |
| } | |
| function encodeEmail($result) { |
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
| $('a[href*="#"]').on('click', function(e) { | |
| e.preventDefault() | |
| $('html, body').animate( | |
| { | |
| scrollTop: $($(this).attr('href')).offset().top, | |
| }, | |
| 500, | |
| 'linear' | |
| ) |
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
| # BEGIN WordPress | |
| <IfModule mod_rewrite.c> | |
| RewriteEngine On | |
| RewriteBase / | |
| RewriteCond %{HTTPS} !=on | |
| RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301] | |
| RewriteRule ^index\.php$ - [L] |
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/bash | |
| sudo kextunload -b com.apple.iokit.BroadcomBluetoothHostControllerUSBTransport | |
| sudo kextload -b com.apple.iokit.BroadcomBluetoothHostControllerUSBTransport |
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
| # fetch the changes from the remote | |
| git fetch origin | |
| # show commit logs of changes | |
| git log master..origin/master | |
| # show diffs of changes | |
| git diff master..origin/master | |
| # apply the changes by merge.. |
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
| // <div id="box">Lorem</div> | |
| // Our goal is to make text color red | |
| var Makered = function(selector) { | |
| this.el = document.querySelector(selector); // for multiple elements use querySelectorAll | |
| } | |
| Makered.prototype.makered=function() { | |
| this.el.style.color="red"; | |
| } |
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
| <?xml version="1.0" encoding="utf-8"?> | |
| <browserconfig> | |
| <msapplication> | |
| <tile> | |
| <square70x70logo src="/mstile-70x70.png"/> | |
| <square144x144logo src="/mstile-144x144.png"/> | |
| <square150x150logo src="/mstile-150x150.png"/> | |
| <square310x310logo src="/mstile-310x310.png"/> | |
| <wide310x150logo src="/mstile-310x150.png"/> | |
| <TileColor>#132935</TileColor> |
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
| /** | |
| * Load favicons | |
| * Place icons in the theme images directory. Want more? http://realfavicongenerator.net/ | |
| */ | |
| function sage_favicons() { | |
| echo '<link rel="apple-touch-icon" sizes="57x57" href="'. get_template_directory_uri() .'/dist/images/apple-touch-icon-57x57.png">';echo "\n"; | |
| echo '<link rel="apple-touch-icon" sizes="60x60" href="'. get_template_directory_uri() .'/dist/images/apple-touch-icon-60x60.png">';echo "\n"; | |
| echo '<link rel="apple-touch-icon" sizes="72x72" href="'. get_template_directory_uri() .'/dist/images/apple-touch-icon-72x72.png">';echo "\n"; | |
| echo '<link rel="apple-touch-icon" sizes="76x76" href="'. get_template_directory_uri() .'/dist/images/apple-touch-icon-76x76.png">';echo "\n"; | |
| echo '<link rel="apple-touch-icon" sizes="114x114" href="'. get_template_directory_uri() .'/dist/images/apple-touch-icon-114x114.png">';echo "\n"; |