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 | |
function shailan_filter_terms( $exclusions, $args ){ | |
// IDs of terms to be excluded | |
$exclude = "3,257"; // CHANGE THIS TO IDs OF YOUR TERMS | |
// Generation of exclusion SQL code | |
$exterms = wp_parse_id_list( $exclude ); | |
foreach ( $exterms as $exterm ) { |
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
import os, frontmatter, re, unicodedata | |
tag_page_dir='_pages/tag' # set correct directory | |
cur_path = os.path.dirname(os.path.realpath(__file__)) | |
tags = [] | |
def slugify(value): | |
value = unicodedata.normalize('NFKD', value).encode('ascii', 'ignore').decode('ascii') | |
value = re.sub('[^\w\s-]', '', value.replace('.','-')).strip().lower() |
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 class="post-loop"> | |
{% assign post_exp = "post.tags contains '" | append: include.tag | append: "'" %} | |
{% assign posts = site.posts | where_exp: "post", post_exp %} | |
{% for post in posts %} | |
<li><a class="post-title" href="{{ site.baseurl }}{{ post.url }}">{{ post.title }} <small class="post-date">{{ post.date | date_to_string }}</small></a></li> | |
{% endfor %} | |
</ul> |
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"> | |
// Track 404 errors with Universal Analytics | |
if($('body').hasClass('error404')) { | |
ga('send', 'event', 'error', '404', 'page: ' + document.location.pathname + document.location.search + ' ref: ' + document.referrer, {'nonInteraction': 1}); | |
} | |
</script> |
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 | |
/** | |
* @link Escape post content in META Attributes, http://codex.wordpress.org/Data_Validation | |
* @link Complete List of HTML Meta Tags, https://gist.github.com/kevinSuttle/1997924 | |
* @example get_template_part('meta'); | |
*/ | |
?> | |
<meta name="twitter:card" content="summary"> | |
<!--<meta name="twitter:site" content="@YOUR_TWITTER_HANDLE">--> |
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
Imports System.Globalization | |
Imports System.Runtime.CompilerServices | |
Public Module StringExtensions | |
''' <summary> | |
''' This extension function converts a string to TitleCase. | |
''' </summary> | |
''' <param name="inputString">String to convert.</param> | |
''' <returns>Converted string.</returns> | |
<Extension()> |
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
nse sym tg | |
x(ise) nof(ise) ngap gap(1:ngap) | |
yof(ise,1:nof(ise)) | |
zof(ise,1:nof(ise)) |
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
npres lsect ltrans lsign | |
text | |
g rho zwl zbot zdrift | |
nmu angles(nmu) | |
geometry_filename | |
ls | |
mass(is),xg(is),yg(is),zg(is),thxx,thyy,thzz,thxy,thyz,thxz | |
(iab(ise),ise=1,nse) |
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
<Extension()> | |
Public Function GenerateSlug(ByVal this As String) | |
Dim str As String = this.RemoveAccent().ToLower() | |
' invalid chars | |
str = Regex.Replace(str, "[^a-z0-9\s-]", "", RegexOptions.IgnoreCase) | |
' convert multiple spaces into one space | |
str = Regex.Replace(str, "\s+", " ", RegexOptions.IgnoreCase).Trim() | |
' cut And trim | |
str = str.Substring(0, IIf(str.Length <= 45, str.Length, 45)).Trim() | |
str = Regex.Replace(str, "\s", "-", RegexOptions.IgnoreCase) ' hyphens |
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
Public Shared Function ConvertDataTableToHTML(ByVal dt As DataTable, Attributes As String, Optional IncludeHeaders As Boolean = True) As String | |
Dim TableStart As String = "<table " & Attributes & ">" | |
Dim TableHeader As String = | |
<thead> | |
<tr> | |
<%= | |
From col As DataColumn In dt.Columns.Cast(Of DataColumn)() | |
Select <th><%= col.ColumnName %></th> | |
%> | |
</tr> |