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 | |
/** | |
* Wraps a given string with a specified HTML tag and optional attributes. | |
* | |
* @param string $tag The HTML tag to wrap the string with. | |
* @param string $str The string to be wrapped. | |
* @param array $attributes Optional attributes to be added to the tag. | |
* @return string The wrapped string. | |
* @throws Exception If either the tag or the string is not a string. | |
*/ |
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
/** | |
* Capitalizes the first letter of each word in a string, with exceptions for certain words and prefixes. | |
* This function is particularly useful for formatting names and addresses. | |
* | |
* @param {string} input The input string to be capitalized. | |
* @param {boolean} isName Optional. Specifies whether the input string is a name. Default is true. | |
* @returns {string} The capitalized string. | |
*/ | |
function capitalizeString(input, isName = true) { | |
const str = input.trim(); |
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
{ | |
"basics": { | |
"name": "David England", | |
"summary": "Very versatile worker with extensive experience in many diverse areas. Able to adapt to almost any work environment. Especially enjoy working with data, programming and statistics.", | |
"website": "http://about.me/DavidEngland", | |
"email": "DavidEEngland@Outlook.com", | |
"picture": "data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%20width%3D%22508.834%22%20height%3D%22508.834%22%20viewBox%3D%220%200%20134.62898%20134.62898%22%3E%3Ctitle%3EDavid%20England%3C%2Ftitle%3E%3Cg%20transform%3D%22translate%28-149.644%20-194.156%29%22%3E%3Cimage%20y%3D%22194.156%22%20x%3D%22149.644%22%20xlink%3Ahref%3D%22data%3Aimage%2Fpng%3Bbase64%2CiVBORw0KGgoAAAANSUhEUgAAAJYAAACWCAYAAAA8AXHiAAAABHNCSVQICAgIfAhkiAAAIABJREFU%20eJzMvVmTJMmR5%2FdTM%2FMrIvKqzDq7G2gAMwPO7K6s8BCuUIQUfkO%2B8jPwnY8UfoTlkntygMFgBphG%20o6%2BqyiPCDzNTPpiZu0dkVh%2BDnuVaS3VGePht6qp%2F%2FevhAq3yJw05%2BW4%2B8 |
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 | |
/** | |
* Add custom detail | |
* | |
* @see wp-content/plugins/wpcasa/includes/class-wpsight-general.php | |
*/ | |
add_filter( 'wpsight_details', 'custom_details', 50 ); |
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 string_to_slug = function (str) | |
{ | |
str = str.replace(/^\s+|\s+$/g, ''); // trim | |
str = str.toLowerCase(); | |
// remove accents, swap ñ for n, etc | |
var from = "àáäâèéëêìíïîòóöôùúüûñç·/_,:;"; | |
var to = "aaaaeeeeiiiioooouuuunc------"; | |
for (var i=0, l=from.length ; i<l ; i++) |
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 | |
echo "<h3>Share current page</h3>"; | |
echo '<a href="" class="" ' . socialLink( 'facebook' ) . '>Share on Facebook</a><br/>'; | |
echo '<a href="" class="" ' . socialLink( 'twitter' ) . '>Share on Twitter</a><br/>'; | |
echo '<a href="" class="" ' . socialLink( 'google' ) . '>Share on Google</a><br/>'; | |
echo "<h3>Share specific url</h3>"; | |
echo '<a href="" class="" ' . socialLink( 'facebook', 'www.worthers.com' ) . '>Share on Facebook</a><br/>'; | |
echo '<a href="" class="" ' . socialLink( 'twitter' , 'www.worthers.com' ) . '>Share on Twitter</a><br/>'; |
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
<script type="text/javascript"> | |
function fbs_click(width, height) { | |
var leftPosition, topPosition; | |
//Allow for borders. | |
leftPosition = (window.screen.width / 2) - ((width / 2) + 10); | |
//Allow for title and status bars. | |
topPosition = (window.screen.height / 2) - ((height / 2) + 50); | |
var windowFeatures = "status=no,height=" + height + ",width=" + width + ",resizable=yes,left=" + leftPosition + ",top=" + topPosition + ",screenX=" + leftPosition + ",screenY=" + topPosition + ",toolbar=no,menubar=no,scrollbars=no,location=no,directories=no"; | |
u=location.href; | |
t=document.title; |
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
$(document).ready(function() { | |
$('.story-small img').each(function() { | |
var maxWidth = 100; // Max width for the image | |
var maxHeight = 100; // Max height for the image | |
var ratio = 0; // Used for aspect ratio | |
var width = $(this).width(); // Current image width | |
var height = $(this).height(); // Current image height | |
// Check if the current width is larger than the max | |
if(width > maxWidth){ |
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
ul.bar | |
list-style: none | |
margin: 0 | |
padding: 0 | |
li | |
display: inline | |
&:after | |
content: " |" | |
&:last-child:after | |
content: "" |
NewerOlder