<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Code Snippets Archives - Sully Syed</title>
	<atom:link href="https://yllus.com/category/code-snippets/feed/" rel="self" type="application/rss+xml" />
	<link>https://yllus.com/category/code-snippets/</link>
	<description>Management executive, software developer and cyclist hailing from Toronto, Canada.</description>
	<lastBuildDate>Sun, 17 Aug 2025 13:54:52 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.9</generator>
	<item>
		<title>Fixing AWS Elastic Beanstalk&#8217;s &#8220;could not parse environment variables&#8221; error for /opt/elasticbeanstalk/bin/get-config</title>
		<link>https://yllus.com/2025/08/16/fixing-aws-elastic-beanstalks-could-not-parse-environment-variables-error-for-opt-elasticbeanstalk-bin-get-config/</link>
					<comments>https://yllus.com/2025/08/16/fixing-aws-elastic-beanstalks-could-not-parse-environment-variables-error-for-opt-elasticbeanstalk-bin-get-config/#respond</comments>
		
		<dc:creator><![CDATA[Sully Syed]]></dc:creator>
		<pubDate>Sat, 16 Aug 2025 20:48:41 +0000</pubDate>
				<category><![CDATA[All Entries]]></category>
		<category><![CDATA[Code Snippets]]></category>
		<category><![CDATA[WordPress]]></category>
		<guid isPermaLink="false">https://yllus.com/?p=3872</guid>

					<description><![CDATA[When deploying Laravel and WordPress to AWS Elastic Beanstalk, creating an .env file or just making use of environment variables is a common practice; however, Elastic Beanstalk tends to choke on string values of &#8220;null&#8221; and often returns the error <a href="https://yllus.com/2025/08/16/fixing-aws-elastic-beanstalks-could-not-parse-environment-variables-error-for-opt-elasticbeanstalk-bin-get-config/"><div class="read-more"><p>Read more &#8250;</p></div><!-- end of .read-more --></a>]]></description>
										<content:encoded><![CDATA[<p>When deploying Laravel and WordPress to AWS Elastic Beanstalk, creating an .env file or just making use of environment variables is a common practice; however, Elastic Beanstalk tends to choke on string values of &#8220;null&#8221; and often returns the error message <em>could not parse environment variables</em>.</p>
<p>To resolve this issue, run the following command:</p>
<pre class="brush: plain; title: ; notranslate">
/opt/elasticbeanstalk/bin/get-config optionsettings
</pre>
<p>Look for any string values that seem like they would cause an issue, but especially string values that look like &#8220;null&#8221;; if found, run using your eb CLI command (assuming REDIS_PASSWORD is at fault):</p>
<pre class="brush: plain; title: ; notranslate">
eb setenv REDIS_PASSWORD=&#039;&#039;
</pre>
<p>Reference:</p>
<ul>
<li><a href="https://lightrun.com/answers/aws-aws-elastic-beanstalk-cli-could-not-parse-environment-variables">Lightrun: could not parse environment variables</a></li>
</ul>
]]></content:encoded>
					
					<wfw:commentRss>https://yllus.com/2025/08/16/fixing-aws-elastic-beanstalks-could-not-parse-environment-variables-error-for-opt-elasticbeanstalk-bin-get-config/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Use Amazon S3 and CloudFront to create a proper HTTP and HTTPS redirect for a domain name</title>
		<link>https://yllus.com/2025/02/25/use-amazon-s3-and-cloudfront-to-create-a-proper-http-and-https-redirect-for-a-domain-name/</link>
					<comments>https://yllus.com/2025/02/25/use-amazon-s3-and-cloudfront-to-create-a-proper-http-and-https-redirect-for-a-domain-name/#respond</comments>
		
		<dc:creator><![CDATA[Sully Syed]]></dc:creator>
		<pubDate>Tue, 25 Feb 2025 14:18:46 +0000</pubDate>
				<category><![CDATA[Code Snippets]]></category>
		<category><![CDATA[Software Development]]></category>
		<guid isPermaLink="false">https://yllus.com/?p=3820</guid>

					<description><![CDATA[Fairly often we purchase a new domain or decommission an existing one and need to redirect all queries to it to a specific URL on a wholly different domain and website. Practically all services where you can register domain like <a href="https://yllus.com/2025/02/25/use-amazon-s3-and-cloudfront-to-create-a-proper-http-and-https-redirect-for-a-domain-name/"><div class="read-more"><p>Read more &#8250;</p></div><!-- end of .read-more --></a>]]></description>
										<content:encoded><![CDATA[<p>Fairly often we purchase a new domain or decommission an existing one and need to redirect all queries to it to a specific URL on a wholly different domain and website. Practically all services where you can register domain like GoDaddy, name.com and Namecheap <a href="https://www.namecheap.com/support/knowledgebase/article.aspx/385/2237/how-to-set-up-a-url-redirect-for-a-domain/">offer a redirect function</a>, but nearly all fail to work if the user attempts to go to a HTTPS URL on the domain you are redirecting.</p>
<p>If you&#8217;re already making use of Amazon AWS Cloud, a very low cost and foolproof solution is to utilize Amazon S3&#8217;s static website hosting feature along with Amazon CloudFront to handle the redirect:</p>
<ol>
<li><strong>Create a new Amazon S3 bucket</strong> (eg. domain-redirect-olddomaincom) with ACLs disabled, the checkbox to block all public access unchecked (as we wish to allow public access) and bucket versioning disabled; create the bucket.</li>
<li>Edit the newly created S3 bucket; under the Properties tab, edit the <strong>Static Website Hosting</strong> properties.</li>
<li>In the Static Website Hosting properties page:
<ul>
<li><em>Static website hosting:</em> Enable</li>
<li><em>Hosting type:</em> Host a static website</li>
<li><em>Index document:</em> index.html</li>
<li><em>Redirection rules:</em> Copy/paste the following, with the appropriate changes made to the values of HostName and ReplaceKeyPrefixWith:
<pre><code>[
    {
        "Redirect": {
            "HostName": "www.newdomain.com",
            "HttpRedirectCode": "301",
            "Protocol": "https",
            "ReplaceKeyPrefixWith": "path/to/redirect/to/"
        }
    }
]</code></pre>
</li>
</ul>
</li>
<li>Hit the <strong>Save Changes</strong> button to finalize the redirect using the S3 bucket; it should work immediately and allow you to test it via the Bucket Website Endpoint URL shown on the page.</li>
<li>Create a new Amazon CloudFront distribution, making sure to:
<ol>
<li><em>Create Origin:</em> Ensure that it points to the static website endpoint of your new S3 bucket (eg. domain-redirect-olddomaincom.s3-website.ca-central-1.amazonaws.com, not the default of domain-redirect-olddomaincom.s3.ca-central-1.amazonaws.com)</li>
<li><em>Alternate domain name (CNAME):</em> Enter all versions of the domain you wish to be handled and redirected (eg. olddomain.com and www.olddomain.com)</li>
<li><em>Custom SSL certificate:</em> Request a certificate that handles the domains you entered above; this is the (free) option that allows your newly set up domain redirect to respond properly to both HTTP and HTTPS requests</li>
</ol>
</li>
<li>Add the Amazon CloudFront domain (eg. d1gyvh82u10kd6.cloudfront.net) to your domain name&#8217;s DNS records for the root and subdomains you wish to redirect.</li>
</ol>
<p>You&#8217;re done! While a bit long-winded as a process, this appears to be the cheapest and most foolproof way to set up a domain redirect for the long term.</p>
<p><a href="https://pumpinglemmacompany.nyc3.digitaloceanspaces.com/yllus/wp-content/uploads/2025/02/25092931/aws-s3-static-website-hosting-domain-redirect.png" rel='magnific'><img fetchpriority="high" class="aligncenter size-large wp-image-3826" src="https://pumpinglemmacompany.nyc3.digitaloceanspaces.com/yllus/wp-content/uploads/2025/02/25092931/aws-s3-static-website-hosting-domain-redirect-1024x895.png" alt="" width="550" height="481" srcset="https://pumpinglemmacompany.nyc3.digitaloceanspaces.com/yllus/wp-content/uploads/2025/02/25092931/aws-s3-static-website-hosting-domain-redirect-1024x895.png 1024w, https://pumpinglemmacompany.nyc3.digitaloceanspaces.com/yllus/wp-content/uploads/2025/02/25092931/aws-s3-static-website-hosting-domain-redirect-300x262.png 300w, https://pumpinglemmacompany.nyc3.digitaloceanspaces.com/yllus/wp-content/uploads/2025/02/25092931/aws-s3-static-website-hosting-domain-redirect-150x131.png 150w, https://pumpinglemmacompany.nyc3.digitaloceanspaces.com/yllus/wp-content/uploads/2025/02/25092931/aws-s3-static-website-hosting-domain-redirect-768x672.png 768w, https://pumpinglemmacompany.nyc3.digitaloceanspaces.com/yllus/wp-content/uploads/2025/02/25092931/aws-s3-static-website-hosting-domain-redirect-1536x1343.png 1536w, https://pumpinglemmacompany.nyc3.digitaloceanspaces.com/yllus/wp-content/uploads/2025/02/25092931/aws-s3-static-website-hosting-domain-redirect-2048x1791.png 2048w" sizes="(max-width: 550px) 100vw, 550px" /></a></p>
<p>&nbsp;</p>
]]></content:encoded>
					
					<wfw:commentRss>https://yllus.com/2025/02/25/use-amazon-s3-and-cloudfront-to-create-a-proper-http-and-https-redirect-for-a-domain-name/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Get your MySQL table sizes in MB via a SQL query</title>
		<link>https://yllus.com/2023/11/27/get-your-mysql-table-sizes-in-mb-via-a-sql-query/</link>
					<comments>https://yllus.com/2023/11/27/get-your-mysql-table-sizes-in-mb-via-a-sql-query/#respond</comments>
		
		<dc:creator><![CDATA[Sully Syed]]></dc:creator>
		<pubDate>Mon, 27 Nov 2023 17:48:33 +0000</pubDate>
				<category><![CDATA[All Entries]]></category>
		<category><![CDATA[Code Snippets]]></category>
		<category><![CDATA[Software Development]]></category>
		<guid isPermaLink="false">http://yllus.com/?p=3472</guid>

					<description><![CDATA[Figuring out what tables are making your database excessively large can be really helpful when working with production database exports and keeping various environments up to date. This SQL query outputs that information for all databases on a given server: <a href="https://yllus.com/2023/11/27/get-your-mysql-table-sizes-in-mb-via-a-sql-query/"><div class="read-more"><p>Read more &#8250;</p></div><!-- end of .read-more --></a>]]></description>
										<content:encoded><![CDATA[<p>Figuring out what tables are making your database excessively large can be really helpful when working with production database exports and keeping various environments up to date. This SQL query outputs that information for all databases on a given server:</p>
<pre class="brush: plain; title: ; notranslate">
SELECT
	table_schema AS `Database`,
	table_name AS `Table`,
	ROUND(((data_length + index_length) / 1024 / 1024), 2) AS `Size in MB`
FROM information_schema.TABLES
ORDER BY table_schema, (data_length + index_length) DESC;
</pre>
<p>Reference:</p>
<ul>
<li><a href="https://stackoverflow.com/a/9620273">How to get the sizes of the tables of a MySQL database?</a></li>
</ul>
]]></content:encoded>
					
					<wfw:commentRss>https://yllus.com/2023/11/27/get-your-mysql-table-sizes-in-mb-via-a-sql-query/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Generate MySQL INSERT statements for a few existing records</title>
		<link>https://yllus.com/2023/10/31/generate-mysql-insert-statements-for-a-few-existing-records/</link>
					<comments>https://yllus.com/2023/10/31/generate-mysql-insert-statements-for-a-few-existing-records/#comments</comments>
		
		<dc:creator><![CDATA[Sully Syed]]></dc:creator>
		<pubDate>Tue, 31 Oct 2023 19:23:51 +0000</pubDate>
				<category><![CDATA[All Entries]]></category>
		<category><![CDATA[Code Snippets]]></category>
		<category><![CDATA[Software Development]]></category>
		<guid isPermaLink="false">http://yllus.com/?p=3464</guid>

					<description><![CDATA[Occasionally, you&#8217;ll want to duplicate a couple of records from your production MySQL database for local use without dumping the entire table (which could be huge). As a solution, the mysqldump command allows you to specify a table and a <a href="https://yllus.com/2023/10/31/generate-mysql-insert-statements-for-a-few-existing-records/"><div class="read-more"><p>Read more &#8250;</p></div><!-- end of .read-more --></a>]]></description>
										<content:encoded><![CDATA[<p>Occasionally, you&#8217;ll want to duplicate a couple of records from your production MySQL database for local use without dumping the entire table (which could be huge). As a solution, the <strong>mysqldump</strong> command allows you to specify a table and a WHERE query for that table, allowing you to select specific record ID #s and retrieve only those records as INSERT statements:</p>
<pre class="brush: plain; title: ; notranslate">
mysqldump -h {host} -P {port} -u {username} -p{password} {database_name} {table_name} --where=&quot;ID = 1&quot; --no-create-info --no-create-db
</pre>
<p>Reference:</p>
<ul>
<li><a href="https://stackoverflow.com/a/13760493/1290232">Stack Overflow: Get Insert Statement for existing row in MySQL</a></li>
</ul>
]]></content:encoded>
					
					<wfw:commentRss>https://yllus.com/2023/10/31/generate-mysql-insert-statements-for-a-few-existing-records/feed/</wfw:commentRss>
			<slash:comments>1</slash:comments>
		
		
			</item>
		<item>
		<title>Import Environics demographics data into a SQL database via Laravel CLI command</title>
		<link>https://yllus.com/2023/04/17/import-environics-demographics-data-into-a-sql-database/</link>
					<comments>https://yllus.com/2023/04/17/import-environics-demographics-data-into-a-sql-database/#respond</comments>
		
		<dc:creator><![CDATA[Sully Syed]]></dc:creator>
		<pubDate>Mon, 17 Apr 2023 16:06:17 +0000</pubDate>
				<category><![CDATA[All Entries]]></category>
		<category><![CDATA[Code Snippets]]></category>
		<guid isPermaLink="false">http://yllus.com/?p=3431</guid>

					<description><![CDATA[Environics Analytics provides incredibly useful demographics, psychographics and segmentation data for Canada, but the raw data is challenging if the goal is to use it in a general SQL query: The raw data is in one file, the meanings of <a href="https://yllus.com/2023/04/17/import-environics-demographics-data-into-a-sql-database/"><div class="read-more"><p>Read more &#8250;</p></div><!-- end of .read-more --></a>]]></description>
										<content:encoded><![CDATA[<p><a href="https://environicsanalytics.com/en-ca">Environics Analytics</a> provides incredibly useful demographics, psychographics and segmentation data for Canada, but the raw data is challenging if the goal is to use it in a general SQL query: The raw data is in one file, the meanings of the columns are in a &#8216;metadata&#8217; file, and the data provided doesn&#8217;t necessarily just list postal codes but other geographic areas as well.</p>
<p>Linked below is a Laravel CLI command that outputs a .SQL file that will handle the creation and insertion of data and definitions for you. The CLI command is invoked as follows:</p>
<pre class="brush: plain; title: ; notranslate">
php artisan environics_demographics:import {csv_demographics_definitions} {csv_demographics_data} {year_demographics_data} {dir_output_data}
</pre>
<p>Find the full script <a href="https://gist.github.com/yllus/3fabc5e2597c7f452290f27330ac4feb">on GitHub Gist</a>, or below:</p>
<p><script src="https://gist.github.com/yllus/3fabc5e2597c7f452290f27330ac4feb.js"></script></p>
]]></content:encoded>
					
					<wfw:commentRss>https://yllus.com/2023/04/17/import-environics-demographics-data-into-a-sql-database/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Merge a PHP array without duplicates (array_merge_recursive_distinct)</title>
		<link>https://yllus.com/2023/01/05/merge-a-php-array-without-duplicates/</link>
					<comments>https://yllus.com/2023/01/05/merge-a-php-array-without-duplicates/#respond</comments>
		
		<dc:creator><![CDATA[Sully Syed]]></dc:creator>
		<pubDate>Thu, 05 Jan 2023 18:03:50 +0000</pubDate>
				<category><![CDATA[All Entries]]></category>
		<category><![CDATA[Code Snippets]]></category>
		<guid isPermaLink="false">http://yllus.com/?p=3391</guid>

					<description><![CDATA[Often enough in PHP, you&#8217;ll grab objects from a variety of sources and want to merge them into a single array of results. To merge without duplicates, add the following function to your codebase and make use of array_merge_recursive_distinct the <a href="https://yllus.com/2023/01/05/merge-a-php-array-without-duplicates/"><div class="read-more"><p>Read more &#8250;</p></div><!-- end of .read-more --></a>]]></description>
										<content:encoded><![CDATA[<p>Often enough in PHP, you&#8217;ll grab objects from a variety of sources and want to merge them into a single array of results. To merge without duplicates, add the following function to your codebase and make use of <strong>array_merge_recursive_distinct</strong> the same way you would <a href="https://www.php.net/manual/en/function.array-merge-recursive.php"><strong>array_merge_recursive</strong></a>:</p>
<pre class="brush: plain; title: ; notranslate">
// From: https://www.php.net/manual/en/function.array-merge-recursive.php#92195
if (! function_exists('array_merge_recursive_distinct')) {
    /**
     * @param array&lt;int|string, mixed&gt; $array1
     * @param array&lt;int|string, mixed&gt; $array2
     *
     * @return array&lt;int|string, mixed&gt;
     */
    function array_merge_recursive_distinct(array &amp;$array1, array &amp;$array2): array
    {
        $merged = $array1;
        foreach ($array2 as $key =&gt; &amp;$value) {
            if (is_array($value) &amp;&amp; isset($merged&#x5B;$key]) &amp;&amp; is_array($merged&#x5B;$key])) {
                $merged&#x5B;$key] = array_merge_recursive_distinct($merged&#x5B;$key], $value);
            } else {
                $merged&#x5B;$key] = $value;
            }
        }

        return $merged;
    }
}
</pre>
<p>Reference:</p>
<ul>
<li><a href="https://www.php.net/manual/en/function.array-merge-recursive.php#92195">https://www.php.net/manual/en/function.array-merge-recursive.php#92195</a></li>
</ul>
]]></content:encoded>
					
					<wfw:commentRss>https://yllus.com/2023/01/05/merge-a-php-array-without-duplicates/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Git pull in a remote branch and accept all incoming changes</title>
		<link>https://yllus.com/2022/01/22/git-pull-in-a-remote-branch-and-accept-all-incoming-changes/</link>
					<comments>https://yllus.com/2022/01/22/git-pull-in-a-remote-branch-and-accept-all-incoming-changes/#respond</comments>
		
		<dc:creator><![CDATA[Sully Syed]]></dc:creator>
		<pubDate>Sat, 22 Jan 2022 22:04:52 +0000</pubDate>
				<category><![CDATA[Code Snippets]]></category>
		<guid isPermaLink="false">http://yllus.com/?p=3346</guid>

					<description><![CDATA[Do a git pull that overwrites local conflicts and accepts all remote changes via: git pull -s recursive -X theirs &#60;remoterepo or other repo&#62; For example, overwrite your local master branch with the remote origin&#8216;s master branch: git pull -s <a href="https://yllus.com/2022/01/22/git-pull-in-a-remote-branch-and-accept-all-incoming-changes/"><div class="read-more"><p>Read more &#8250;</p></div><!-- end of .read-more --></a>]]></description>
										<content:encoded><![CDATA[<p>Do a git pull that overwrites local conflicts and accepts all remote changes via:</p>
<p><code>git pull -s recursive -X theirs &lt;remoterepo or other repo&gt;</code></p>
<p>For example, overwrite your local <strong>master</strong> branch with the remote <strong>origin</strong>&#8216;s <strong>master</strong> branch:</p>
<p><code>git pull -s recursive -X theirs origin master</code></p>
<p>If it&#8217;s just a single file you need to overwrite, use git checkout:</p>
<p><code>git checkout --theirs path/to/file</code></p>
]]></content:encoded>
					
					<wfw:commentRss>https://yllus.com/2022/01/22/git-pull-in-a-remote-branch-and-accept-all-incoming-changes/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Regular expressions: Find instances when the string does not equal a certain value</title>
		<link>https://yllus.com/2021/11/20/regular-expressions-find-instances-when-the-string-does-not-equal-a-certain-value/</link>
					<comments>https://yllus.com/2021/11/20/regular-expressions-find-instances-when-the-string-does-not-equal-a-certain-value/#respond</comments>
		
		<dc:creator><![CDATA[Sully Syed]]></dc:creator>
		<pubDate>Sat, 20 Nov 2021 16:14:33 +0000</pubDate>
				<category><![CDATA[All Entries]]></category>
		<category><![CDATA[Code Snippets]]></category>
		<guid isPermaLink="false">http://yllus.com/?p=3340</guid>

					<description><![CDATA[Another typical regex scenario: You&#8217;re looking through some data (like a JSON object) and are looking for when a value is actually being set. Let&#8217;s say our string contains: &#34;puttLength&#34;: null, Typically, you&#8217;d write a regular expression to capture the <a href="https://yllus.com/2021/11/20/regular-expressions-find-instances-when-the-string-does-not-equal-a-certain-value/"><div class="read-more"><p>Read more &#8250;</p></div><!-- end of .read-more --></a>]]></description>
										<content:encoded><![CDATA[<p>Another typical regex scenario: You&#8217;re looking through some data (like a JSON object) and are looking for when a value is actually being set. Let&#8217;s say our string contains:</p>
<pre class="brush: plain; title: ; notranslate">
&quot;puttLength&quot;: null, 
</pre>
<p>Typically, you&#8217;d write a regular expression to capture the &lt;em&gt; tag by writing this:&lt;/em&gt;</p>
<pre class="brush: plain; title: ; notranslate">
&quot;puttLength&quot;: ((?!null).)*$
</pre>
<p>The use of ?! is the instruction to make a negative lookahead match, ensuring null does not exist before the line can be returned as a match. A terrific example / tool to test in your browser exists at https://www.regextester.com/15 .</p>
]]></content:encoded>
					
					<wfw:commentRss>https://yllus.com/2021/11/20/regular-expressions-find-instances-when-the-string-does-not-equal-a-certain-value/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Getting a recursive list of files sorted by last modified date in Linux</title>
		<link>https://yllus.com/2021/08/06/getting-a-recursive-list-of-files-sorted-by-last-modified-date-in-linux/</link>
					<comments>https://yllus.com/2021/08/06/getting-a-recursive-list-of-files-sorted-by-last-modified-date-in-linux/#respond</comments>
		
		<dc:creator><![CDATA[Sully Syed]]></dc:creator>
		<pubDate>Fri, 06 Aug 2021 18:59:37 +0000</pubDate>
				<category><![CDATA[All Entries]]></category>
		<category><![CDATA[Code Snippets]]></category>
		<category><![CDATA[Software Development]]></category>
		<guid isPermaLink="false">https://yllus.com/?p=3331</guid>

					<description><![CDATA[Here&#8217;s a quick way to get a recursive list of files, sorted in descending order by the last modified date, from any folder in *nix: find . -type f -printf &#34;%T@ %p&#92;&#48;&#34; &#124; sort -zk1nr &#124; xargs -0 printf &#34;%s\n&#34;]]></description>
										<content:encoded><![CDATA[<p>Here&#8217;s a quick way to get a recursive list of files, sorted in descending order by the last modified date, from any folder in *nix:</p>
<pre class="brush: plain; title: ; notranslate">
find . -type f -printf &quot;%T@ %p&#92;&#48;&quot; | sort -zk1nr | xargs -0 printf &quot;%s\n&quot;
</pre>
]]></content:encoded>
					
					<wfw:commentRss>https://yllus.com/2021/08/06/getting-a-recursive-list-of-files-sorted-by-last-modified-date-in-linux/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Making scheduled posts in WordPress public so they can be scheduled / scraped on social media</title>
		<link>https://yllus.com/2017/05/18/making-scheduled-posts-in-wordpress-public-so-they-can-be-scheduled-scraped-on-social-media/</link>
					<comments>https://yllus.com/2017/05/18/making-scheduled-posts-in-wordpress-public-so-they-can-be-scheduled-scraped-on-social-media/#respond</comments>
		
		<dc:creator><![CDATA[Sully Syed]]></dc:creator>
		<pubDate>Thu, 18 May 2017 13:48:53 +0000</pubDate>
				<category><![CDATA[All Entries]]></category>
		<category><![CDATA[Code Snippets]]></category>
		<category><![CDATA[WordPress]]></category>
		<guid isPermaLink="false">http://yllus.com/?p=2935</guid>

					<description><![CDATA[The basics of scheduling in WordPress are quite simple: If you give a WordPress post a published date set in the future, it&#8217;ll remain &#8220;hidden&#8221; on your website until that date and time arrives. It&#8217;ll then appear, right on time, at <a href="https://yllus.com/2017/05/18/making-scheduled-posts-in-wordpress-public-so-they-can-be-scheduled-scraped-on-social-media/"><div class="read-more"><p>Read more &#8250;</p></div><!-- end of .read-more --></a>]]></description>
										<content:encoded><![CDATA[<p>The basics of scheduling in WordPress are quite simple: If you give a WordPress post a published date set in the future, it&#8217;ll remain &#8220;hidden&#8221; on your website until that date and time arrives. It&#8217;ll then appear, right on time, at the top of your list of public posts.</p>
<p>But here&#8217;s an interesting problem: Social media is now a major driver (maybe <em>the</em> driver) of traffic to digital media websites. When you schedule your post in WordPress, you&#8217;ll also naturally want to schedule that post to appear on Facebook and Twitter &#8211; but that would require the WordPress post to be public, which in its &#8220;future&#8221; post status isn&#8217;t yet.</p>
<p>The code snippet below can be placed in your theme&#8217;s functions.php file, and allows non-logged-in website visitors to view posts in the &#8220;future&#8221; post status as well as merely &#8220;publish&#8221;ed posts.</p>
<pre class="brush: plain; title: ; notranslate">
// Allow site visitors (people not logged in to WordPress) to view posts in the &quot;future&quot; post status.
function show_future_posts_pre_get_posts($query) {
    if ( is_single() &amp;&amp; !is_admin() &amp;&amp; $query-&gt;is_main_query() ) { 
        if ( !is_user_logged_in() ) {
            $query-&gt;set(&quot;post_status&quot;, array(&quot;publish&quot;, &quot;future&quot;)); 
        }
    } 
}
add_filter('pre_get_posts', 'show_future_posts_pre_get_posts');
</pre>
<p>Reference:</p>
<ul>
<li><a href="http://stackoverflow.com/questions/12572703/allow-anyone-to-view-future-posts-of-a-certain-post-type-events-in-wordpress">StackOverflow: Allow anyone to view future posts of a certain post type (events) in WordPress</a></li>
</ul>
]]></content:encoded>
					
					<wfw:commentRss>https://yllus.com/2017/05/18/making-scheduled-posts-in-wordpress-public-so-they-can-be-scheduled-scraped-on-social-media/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>How to drop a MS SQL Server database</title>
		<link>https://yllus.com/2017/02/10/how-to-drop-a-ms-sql-server-database/</link>
					<comments>https://yllus.com/2017/02/10/how-to-drop-a-ms-sql-server-database/#respond</comments>
		
		<dc:creator><![CDATA[Sully Syed]]></dc:creator>
		<pubDate>Fri, 10 Feb 2017 17:19:51 +0000</pubDate>
				<category><![CDATA[Code Snippets]]></category>
		<guid isPermaLink="false">http://yllus.com/?p=2919</guid>

					<description><![CDATA[Dropping a database in MS SQL Server is not a one-step process; you&#8217;ll need to do the following: USE master; ALTER DATABASE &#x5B;databasename] SET SINGLE_USER WITH ROLLBACK IMMEDIATE; DROP DATABASE &#x5B;databasename]; Reference: StackExchange &#8211; How to force drop database in <a href="https://yllus.com/2017/02/10/how-to-drop-a-ms-sql-server-database/"><div class="read-more"><p>Read more &#8250;</p></div><!-- end of .read-more --></a>]]></description>
										<content:encoded><![CDATA[<p>Dropping a database in MS SQL Server is not a one-step process; you&#8217;ll need to do the following:</p>
<pre class="brush: plain; title: ; notranslate">
USE master;
ALTER DATABASE &#x5B;databasename] SET SINGLE_USER WITH ROLLBACK IMMEDIATE;
DROP DATABASE &#x5B;databasename];
</pre>
<p>Reference:</p>
<ul>
<li><a href="http://dba.stackexchange.com/a/34265">StackExchange &#8211; How to force drop database in SQL Server 2008</a></li>
</ul>
]]></content:encoded>
					
					<wfw:commentRss>https://yllus.com/2017/02/10/how-to-drop-a-ms-sql-server-database/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>How to disable WordPress&#8217;s internal search system (while still using its search page templates)</title>
		<link>https://yllus.com/2015/11/14/how-to-disable-wordpresss-internal-search-system-while-still-using-its-search-page-templates/</link>
					<comments>https://yllus.com/2015/11/14/how-to-disable-wordpresss-internal-search-system-while-still-using-its-search-page-templates/#respond</comments>
		
		<dc:creator><![CDATA[Sully Syed]]></dc:creator>
		<pubDate>Sat, 14 Nov 2015 22:59:07 +0000</pubDate>
				<category><![CDATA[All Entries]]></category>
		<category><![CDATA[Code Snippets]]></category>
		<guid isPermaLink="false">http://yllus.com/?p=2869</guid>

					<description><![CDATA[On websites like Sportsnet.ca ( http://www.sportsnet.ca/ ) and Maclean&#8217;s ( http://www.macleans.ca/ ), the amount of content on those WordPress websites long ago exceeded the level that the built-in WordPress search system can capably handle. Third-party search solutions such as Google CSE (Custom Search Engine) are <a href="https://yllus.com/2015/11/14/how-to-disable-wordpresss-internal-search-system-while-still-using-its-search-page-templates/"><div class="read-more"><p>Read more &#8250;</p></div><!-- end of .read-more --></a>]]></description>
										<content:encoded><![CDATA[<p>On websites like Sportsnet.ca ( <strong><a class="external-link" href="http://www.sportsnet.ca/" rel="nofollow">http://www.sportsnet.ca/</a></strong> ) and Maclean&#8217;s ( <strong><a class="external-link" href="http://www.macleans.ca/" rel="nofollow">http://www.macleans.ca/</a></strong> ), the amount of content on those WordPress websites long ago exceeded the level that the built-in WordPress search system can capably handle.</p>
<p>Third-party search solutions such as <strong><a class="external-link" href="https://www.google.com/cse/" rel="nofollow">Google CSE (Custom Search Engine)</a></strong> are being utilized instead, but there is a momentary slowdown before the page loads that is caused by the WordPress site executing its own internal search query before it displays the search results page. In order to remove this delay (and the unnecessary database request), add the following code to the theme&#8217;s <strong>functions.php</strong> file:</p>
<pre class="brush: plain; title: ; notranslate">
// Disable WordPress's internal search query (as much as we can), letting Google CSE handle that.
function internal_search_disable( $query ) {
    if ( !is_admin() &amp;&amp; $query-&gt;is_main_query() ) {
        if ( $query-&gt;is_search ) {
            // Add a filter that effectively returns no results ever.
            add_filter('posts_where', 'internal_search_filter_where');
        }
    }
    return $query;
}
add_action('pre_get_posts', 'internal_search_disable');
 
// The WHERE search filter for disabling the internal search system.
function internal_search_filter_where( $where = '' ) {
    $where = &quot; AND 0 = 1&quot;;
 
    // Once added, remove the filter to stop affecting other queries on the page.
    remove_filter('posts_where', 'internal_search_filter_where');
    return $where;
}
</pre>
]]></content:encoded>
					
					<wfw:commentRss>https://yllus.com/2015/11/14/how-to-disable-wordpresss-internal-search-system-while-still-using-its-search-page-templates/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>How to add an AJAX function / URL to WordPress</title>
		<link>https://yllus.com/2015/11/14/add-ajax-function-url-wordpress/</link>
					<comments>https://yllus.com/2015/11/14/add-ajax-function-url-wordpress/#respond</comments>
		
		<dc:creator><![CDATA[Sully Syed]]></dc:creator>
		<pubDate>Sat, 14 Nov 2015 22:56:13 +0000</pubDate>
				<category><![CDATA[All Entries]]></category>
		<category><![CDATA[Code Snippets]]></category>
		<guid isPermaLink="false">http://yllus.com/?p=2866</guid>

					<description><![CDATA[Put this function in your theme&#8217;s functions.php (or even better, in an ajax.php file in the theme that is require&#8217;d in): /* The function ajax_read_more() will be called when the following URL is requested * from WordPress: * * http://www.yoursite.com/wp-admin/admin-ajax.php?action=read_more&#38;limit=5 <a href="https://yllus.com/2015/11/14/add-ajax-function-url-wordpress/"><div class="read-more"><p>Read more &#8250;</p></div><!-- end of .read-more --></a>]]></description>
										<content:encoded><![CDATA[<p>Put this function in your theme&#8217;s <strong>functions.php</strong> (or even better, in an ajax.php file in the theme that is require&#8217;d in):</p>
<pre class="brush: plain; title: ; notranslate">
/* The function ajax_read_more() will be called when the following URL is requested
 * from WordPress:
 *
 * http://www.yoursite.com/wp-admin/admin-ajax.php?action=read_more&amp;limit=5
 */
function ajax_read_more() {
    // Take in a few input parameters from $_GET or $_POST (depending on how you're passing the values) about
    // what data to retrieve and display.
    $num_limit = (int) $_POST&#x5B;'limit'];
    $str_category_name = filter_var($_POST&#x5B;'category_name'], FILTER_SANITIZE_STRING);
  
    // Call some built-in WordPress functions just to demonstrate that we can.
    $user_id = get_current_user_id();
  
    // Now let's return some JSON data to whatever called this URL (we can return HTML, XML or whatever else too,
    // just make sure to set the appropriate Content-Type header).
    $arr_sample_data = array('key' =&gt; 'value');
    echo json_encode($arr_sample_data);
    exit; // You must use exit to end an AJAX function in WordPress, or it'll append a 0 to the output.
}
add_action( 'wp_ajax_read_more', 'ajax_read_more' ); // This action exposes the AJAX action &quot;read_more&quot; to logged-in WordPress users.
add_action( 'wp_ajax_nopriv_read_more', 'ajax_read_more' ); // This action exposes the AJAX action &quot;read_more&quot; to anonymous (not logged in) WordPress users.
</pre>
<p>Then all you need to do is write a jQuery or even just a regular HTML form that submits a request to your new AJAX URL:</p>
<pre class="brush: plain; title: ; notranslate">
jQuery.ajax({
    type: 'get',
    url: '/wp-admin/admin-ajax.php?action=read_more&amp;limit=5',
    dataType: 'json'
})
.done( function( response ) {
    console.log(response);
});
</pre>
<p>One last thing &#8211; visit your WordPress site&#8217;s Permalinks page in order to rebuild the list of URLs WordPress will respond to. This will make your new URL (for the AJAX function) active.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://yllus.com/2015/11/14/add-ajax-function-url-wordpress/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Forcing images to conform to a 16:9 aspect ratio</title>
		<link>https://yllus.com/2015/11/14/forcing-images-to-conform-to-a-169-aspect-ratio/</link>
					<comments>https://yllus.com/2015/11/14/forcing-images-to-conform-to-a-169-aspect-ratio/#respond</comments>
		
		<dc:creator><![CDATA[Sully Syed]]></dc:creator>
		<pubDate>Sat, 14 Nov 2015 22:47:24 +0000</pubDate>
				<category><![CDATA[All Entries]]></category>
		<category><![CDATA[Code Snippets]]></category>
		<guid isPermaLink="false">http://yllus.com/?p=2861</guid>

					<description><![CDATA[In the Bootstrap front-end framework, you can add the classes embed-responsive embed-responsive-16by9 or embed-responsive embed-responsive-4by3 on a DIV that wraps an IFRAME, EMBED or OBJECT element to ensure that video players always conform to a 16:9 aspect ratio on your responsive website (more <a href="https://yllus.com/2015/11/14/forcing-images-to-conform-to-a-169-aspect-ratio/"><div class="read-more"><p>Read more &#8250;</p></div><!-- end of .read-more --></a>]]></description>
										<content:encoded><![CDATA[<p>In the Bootstrap front-end framework, you can add the classes <strong>embed-responsive</strong> <strong>embed-responsive-16by9</strong> or <strong>embed-responsive</strong> <strong>embed-responsive-4by3</strong> on a DIV that wraps an IFRAME, EMBED or OBJECT element to ensure that video players always conform to a 16:9 aspect ratio on your responsive website (<strong><a class="external-link" href="http://getbootstrap.com/components/#responsive-embed" rel="nofollow">more info</a></strong>).</p>
<p>But what about images? In cases where content has been migrated onto a WordPress site, re-creating all thumbnails in the proper aspect ratio may just not be doable &#8211; or you may simply not have the controls in place to ensure that all images are of the correct aspect ratio. Luckily there appears to be a trick in CSS that can force aspect ratios. To get it to work, you&#8217;ll need to write CSS for a DIV that wraps the actual IMG tag like so:</p>
<pre class="brush: plain; title: ; notranslate">
.img-responsive-16by9 {
    display: block;
    height: 0;
    padding-bottom: 56.25%;
    overflow: hidden;
}
</pre>
<p>That&#8217;ll force the image output with the HTML illustrated below to respect a 16:9 aspect ratio:</p>
<pre class="brush: plain; title: ; notranslate">
&lt;div class=&quot;img-responsive-16by9&quot;&gt;
    &lt;img src=&quot;http://www.570news.com/wp-content/blogs.dir/sites/3/2015/04/1429827607_NSD502266764_low.jpg&quot;&gt;
&lt;/div&gt;
</pre>
]]></content:encoded>
					
					<wfw:commentRss>https://yllus.com/2015/11/14/forcing-images-to-conform-to-a-169-aspect-ratio/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Regular expressions: Greedy regex versus lazy regex</title>
		<link>https://yllus.com/2014/12/05/regular-expressions-greedy-regex-versus-lazy-regex/</link>
					<comments>https://yllus.com/2014/12/05/regular-expressions-greedy-regex-versus-lazy-regex/#respond</comments>
		
		<dc:creator><![CDATA[Sully Syed]]></dc:creator>
		<pubDate>Fri, 05 Dec 2014 14:32:53 +0000</pubDate>
				<category><![CDATA[Code Snippets]]></category>
		<guid isPermaLink="false">http://yllus.com/?p=2771</guid>

					<description><![CDATA[Here&#8217;s a typical regex scenario: You&#8217;ve got a string in which you need to find/capture the HTML tags from. Let&#8217;s say our string is: This is a &#60;em&#62;first&#60;/em&#62; test Typically, you&#8217;d write a regular expression to capture the tag by <a href="https://yllus.com/2014/12/05/regular-expressions-greedy-regex-versus-lazy-regex/"><div class="read-more"><p>Read more &#8250;</p></div><!-- end of .read-more --></a>]]></description>
										<content:encoded><![CDATA[<p>Here&#8217;s a typical regex scenario: You&#8217;ve got a string in which you need to find/capture the HTML tags from. Let&#8217;s say our string is:</p>
<pre class="brush: plain; title: ; notranslate">
This is a &lt;em&gt;first&lt;/em&gt; test
</pre>
<p>Typically, you&#8217;d write a regular expression to capture the <em> tag by writing this:</em></p>
<pre class="brush: plain; title: ; notranslate">
var re = new RegExp(&quot;&lt;(.+)&gt;&quot;, &quot;&quot;);
</pre>
<p>Unexpectedly, however, the result you&#8217;re going to get matched back is:</p>
<pre class="brush: plain; title: ; notranslate">
&quot;em&gt;first&lt;/em&quot;
</pre>
<p>The reason for this is explained on the Regex Tutorial website:</p>
<blockquote><p>The first token in the regex is . You should see the problem by now. The dot matches the &gt;, and the engine continues repeating the dot. The dot will match all remaining characters in the string. The dot fails when the engine has reached the void after the end of the string. Only at this point does the regex engine continue with the next token: &gt;.</p></blockquote>
<p>What we need to do instead is force the dot character to be lazy by adding a question mark after the plus sign (or a star, or numbers in curly braces):</p>
<pre class="brush: plain; title: ; notranslate">
var re = new RegExp(&quot;&lt;(.+?)&gt;&quot;, &quot;&quot;);
</pre>
<p>This time, we&#8217;ll get back:</p>
<pre class="brush: plain; title: ; notranslate">
&quot;em&quot;
</pre>
<p>Reference: <a href="http://www.regular-expressions.info/repeat.html">Regex Tutorial &#8211; Repetition with Star and Plus</a></p>
]]></content:encoded>
					
					<wfw:commentRss>https://yllus.com/2014/12/05/regular-expressions-greedy-regex-versus-lazy-regex/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>When &#8220;compass compile&#8221; leads to an &#8216;Invalid UTF-8 character &#8220;\xCA&#8221;&#8216; error</title>
		<link>https://yllus.com/2014/08/01/compass-compile-leads-invalid-utf-8-character-xca-error/</link>
					<comments>https://yllus.com/2014/08/01/compass-compile-leads-invalid-utf-8-character-xca-error/#respond</comments>
		
		<dc:creator><![CDATA[Sully Syed]]></dc:creator>
		<pubDate>Fri, 01 Aug 2014 19:08:48 +0000</pubDate>
				<category><![CDATA[Code Snippets]]></category>
		<guid isPermaLink="false">http://yllus.com/?p=2630</guid>

					<description><![CDATA[We&#8217;ve got some pretty large CSS files to work with on a few projects I work on, and use SCSS plus the Compass tool to make management of the styles a bit easier. Recently, though, Compass has been throwing us <a href="https://yllus.com/2014/08/01/compass-compile-leads-invalid-utf-8-character-xca-error/"><div class="read-more"><p>Read more &#8250;</p></div><!-- end of .read-more --></a>]]></description>
										<content:encoded><![CDATA[<p>We&#8217;ve got some pretty large CSS files to work with on a few projects I work on, and use SCSS plus the <a href="http://compass-style.org/">Compass</a> tool to make management of the styles a bit easier. Recently, though, Compass has been throwing us this error:</p>
<pre class="brush: plain; title: ; notranslate">
    error scss/sportsnet.scss (Line 969 of scss/_inc-controls.scss: Invalid UTF-8 character &quot;\xCA&quot;)
</pre>
<p>The root cause appears to be non-ASCII characters in a SCSS file. That&#8217;s easy enough to root out by hand if the file is a manageable size, but if you need an automated filter instead, try the following:</p>
<pre class="brush: plain; title: ; notranslate">
iconv -t ASCII//IGNORE -f UTF8 &lt; _inc-controls.scss &gt; _inc-controls.ascii
</pre>
<p>This pipes the offending SCSS file through iconv, and spits out the file _inc-controls.ascii which should contain differing lines where non-ASCII lines are found.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://yllus.com/2014/08/01/compass-compile-leads-invalid-utf-8-character-xca-error/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Overwriting a branch in Git with remote results (and bypassing merge conflicts)</title>
		<link>https://yllus.com/2014/07/21/overwriting-branch-git-remote-results-bypassing-merge-conflicts/</link>
					<comments>https://yllus.com/2014/07/21/overwriting-branch-git-remote-results-bypassing-merge-conflicts/#respond</comments>
		
		<dc:creator><![CDATA[Sully Syed]]></dc:creator>
		<pubDate>Tue, 22 Jul 2014 01:32:27 +0000</pubDate>
				<category><![CDATA[Code Snippets]]></category>
		<guid isPermaLink="false">http://yllus.com/?p=2627</guid>

					<description><![CDATA[If you&#8217;ve ever tried to do a git pull to get a branch up to date and have run into conflicts that you just want to bypass and go with the contents of the remote branch, do the following: # <a href="https://yllus.com/2014/07/21/overwriting-branch-git-remote-results-bypassing-merge-conflicts/"><div class="read-more"><p>Read more &#8250;</p></div><!-- end of .read-more --></a>]]></description>
										<content:encoded><![CDATA[<p>If you&#8217;ve ever tried to do a git pull to get a branch up to date and have run into conflicts that you just want to bypass and go with the contents of the remote branch, do the following:</p>
<pre class="brush: bash; title: ; notranslate">
# Fetch from the default remote of origin.
git fetch origin
# Check out the branch you want to override the conflicts upon.
git checkout master
# Reset your current branch of master to origin's master.
git reset --hard origin/master
</pre>
<p>Reference: <a href="http://stackoverflow.com/questions/4785107/git-pull-from-remote-can-i-force-it-to-overwrite-rather-than-report-conflicts">Stack Overflow: Git pull from remote.. Can I force it to overwrite rather than report conflicts?</a></p>
]]></content:encoded>
					
					<wfw:commentRss>https://yllus.com/2014/07/21/overwriting-branch-git-remote-results-bypassing-merge-conflicts/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Get a list of files added, removed and modified in Git between two branches</title>
		<link>https://yllus.com/2014/07/11/get-list-files-added-removed-modified-git-two-branches/</link>
					<comments>https://yllus.com/2014/07/11/get-list-files-added-removed-modified-git-two-branches/#respond</comments>
		
		<dc:creator><![CDATA[Sully Syed]]></dc:creator>
		<pubDate>Fri, 11 Jul 2014 18:01:03 +0000</pubDate>
				<category><![CDATA[Code Snippets]]></category>
		<guid isPermaLink="false">http://yllus.com/?p=2622</guid>

					<description><![CDATA[It&#8217;s sometimes useful to know exactly what files you&#8217;ve made changes to in your feature branch as you&#8217;re getting ready to merge back into your trunk code. Git&#8217;s diff option allows for this to be done quick easily: git diff <a href="https://yllus.com/2014/07/11/get-list-files-added-removed-modified-git-two-branches/"><div class="read-more"><p>Read more &#8250;</p></div><!-- end of .read-more --></a>]]></description>
										<content:encoded><![CDATA[<p>It&#8217;s sometimes useful to know exactly what files you&#8217;ve made changes to in your feature branch as you&#8217;re getting ready to merge back into your trunk code. Git&#8217;s diff option allows for this to be done quick easily:</p>
<pre class="brush: bash; title: ; notranslate">
git diff --name-status master..newfeature
</pre>
<p>The output looks like the following:</p>
<pre class="brush: bash; title: ; notranslate">
M       .gitmodules
A       plugins/backplane.php
A       plugins/multiple-post-thumbnails
M       themes/sportsnet/css/scss/_inc-controls.scss
M       themes/sportsnet/functions.php
M       themes/sportsnet/header.php
M       themes/sportsnet/single-sn-article.php
M       themes/sportsnet/single-sn-blog-entry.php
M       themes/sportsnet/single-sn-signing.php
M       themes/sportsnet/single-sn-trade.php
A       themes/sportsnet/zones/articles-comment-form.php
A       themes/sportsnet/zones/global/user-account-links.php
(END)
</pre>
<p>Reference: <a href="http://stackoverflow.com/questions/822811/showing-which-files-have-changed-between-git-branches">Stack Overflow &#8211; Showing which files have changed between git branches</a></p>
]]></content:encoded>
					
					<wfw:commentRss>https://yllus.com/2014/07/11/get-list-files-added-removed-modified-git-two-branches/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Checking Akamai cache expiry times on your website&#8217;s pages</title>
		<link>https://yllus.com/2013/09/28/checking-akamai-cache-expiry-times-websites-pages/</link>
					<comments>https://yllus.com/2013/09/28/checking-akamai-cache-expiry-times-websites-pages/#respond</comments>
		
		<dc:creator><![CDATA[Sully Syed]]></dc:creator>
		<pubDate>Sat, 28 Sep 2013 13:09:10 +0000</pubDate>
				<category><![CDATA[All Entries]]></category>
		<category><![CDATA[Code Snippets]]></category>
		<guid isPermaLink="false">http://yllus.com/?p=2580</guid>

					<description><![CDATA[This involves sending some custom headers along with your HTTP GET request, so utilize either the wget command line tool: wget -S -O /dev/null --header=&#34;Pragma: akamai-x-cache-on, akamai-x-cache-remote-on, akamai-x-check-cacheable, akamai-x-get-cache-key, akamai-x-get-extracted-values, akamai-x-get-nonces, akamai-x-get-ssl-client-session-id, akamai-x-get-true-cache-key, akamai-x-serial-no&#34; http://www.sportsnet.ca/ Or the curl command line <a href="https://yllus.com/2013/09/28/checking-akamai-cache-expiry-times-websites-pages/"><div class="read-more"><p>Read more &#8250;</p></div><!-- end of .read-more --></a>]]></description>
										<content:encoded><![CDATA[<p>This involves sending some custom headers along with your HTTP GET request, so utilize either the wget command line tool:</p>
<pre class="brush: bash; title: ; notranslate">
wget -S -O /dev/null --header=&quot;Pragma: akamai-x-cache-on, akamai-x-cache-remote-on, akamai-x-check-cacheable, akamai-x-get-cache-key, akamai-x-get-extracted-values, akamai-x-get-nonces, akamai-x-get-ssl-client-session-id, akamai-x-get-true-cache-key, akamai-x-serial-no&quot; http://www.sportsnet.ca/
</pre>
<p>Or the curl command line tool:</p>
<pre class="brush: bash; title: ; notranslate">
curl -H &quot;Pragma: akamai-x-cache-on, akamai-x-cache-remote-on, akamai-x-check-cacheable, akamai-x-get-cache-key, akamai-x-get-extracted-values, akamai-x-get-nonces, akamai-x-get-ssl-client-session-id, akamai-x-get-true-cache-key, akamai-x-serial-no&quot; -IXGET http://www.sportsnet.ca/
</pre>
<p>The X-Cache-Key setting will contain the amount of time the URL is cached for; in this example, the time is 1 minute (&#8220;1m&#8221;):</p>
<pre class="brush: bash; title: ; notranslate">
X-Cache-Key: /L/370/77322/1m/www.sportsnet.ca/
</pre>
<p>Running Windows? No problem &#8211; grab a compiled version of <a href="http://gnuwin32.sourceforge.net/packages/wget.htm">wget for Windows</a>.</p>
<p>Source: <a href="http://stackoverflow.com/questions/8811741/whats-the-best-way-to-troubleshoot-akamai-headers-these-days">Stack Overflow &#8211; What&#8217;s the best way to troubleshoot Akamai headers these days?</a></p>
]]></content:encoded>
					
					<wfw:commentRss>https://yllus.com/2013/09/28/checking-akamai-cache-expiry-times-websites-pages/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Selectively taking commits out of a GitHub pull request</title>
		<link>https://yllus.com/2013/02/09/selectively-taking-commits-out-of-a-github-pull-request/</link>
					<comments>https://yllus.com/2013/02/09/selectively-taking-commits-out-of-a-github-pull-request/#respond</comments>
		
		<dc:creator><![CDATA[Sully Syed]]></dc:creator>
		<pubDate>Sat, 09 Feb 2013 16:00:46 +0000</pubDate>
				<category><![CDATA[Code Snippets]]></category>
		<guid isPermaLink="false">http://yllus.com/?p=2537</guid>

					<description><![CDATA[Once in a while it&#8217;s necessary to get picky and only accept one or more commits from a bundle sent over in a GitHub pull request &#8211; or maybe someone&#8217;s been working on a fork of a repository of yours <a href="https://yllus.com/2013/02/09/selectively-taking-commits-out-of-a-github-pull-request/"><div class="read-more"><p>Read more &#8250;</p></div><!-- end of .read-more --></a>]]></description>
										<content:encoded><![CDATA[<p>Once in a while it&#8217;s necessary to get picky and only accept one or more commits from a bundle sent over in a GitHub pull request &#8211; or maybe someone&#8217;s been working on a fork of a repository of yours and you want to pull a change or two in. The git command <strong>cherry-pick</strong> is there for this purpose.</p>
<p>To start, you&#8217;ll need to run git fetch on the forked repository:</p>
<pre class="brush: bash; title: ; notranslate">
git fetch git@github.com:hakimel/Fokus.git
</pre>
<p>Next, take the hash of the commit you want to retrieve files for and run the <strong>cherry-pick</strong> command on it:</p>
<pre class="brush: bash; title: ; notranslate">
git cherry-pick 00988a520bda3e365c74033a44a96941d77be86f
</pre>
<p>That should do it! Check your <strong>git log</strong> to see the commit pulled into your repository.</p>
<p>Source: <a href="http://stackoverflow.com/questions/4581740/pull-in-changes-from-a-github-fork">StackOverflow &#8211; Pull in changes from a Github fork</a></p>
]]></content:encoded>
					
					<wfw:commentRss>https://yllus.com/2013/02/09/selectively-taking-commits-out-of-a-github-pull-request/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
