Skip to content
Permalink
Browse files

Blog fix (#12)

* unescaped file

* code highlighting cleanup

* tool i used to fix wp exporter escapaing

* cleanup orcle

* css updates and section verbage

* link to theme, not site code in gh
  • Loading branch information
eddiewebb committed Feb 12, 2020
1 parent 8c2ee37 commit 9336e4dc9f371f3c1dab89dd88c94aafb7f45c5d
Showing with 1,468 additions and 1,366 deletions.
  1. +16 −0 .circleci/unescape_blog.bash
  2. +13 −2 src/config.toml
  3. +1 −1 src/content/_index.md
  4. +1 −1 src/content/blog/{_index/index.md → _index.md}
  5. +42 −34 src/content/blog/add-rss-feed-cakephp-models/index.md
  6. +2 −2 src/content/blog/automatically-choose-database-connections-cakephp/index.md
  7. +6 −6 src/content/blog/automatically-subscribe-users-dreamhost-announce-lists/index.md
  8. +48 −48 src/content/blog/backup-subdirectories-bash-array-loop/index.md
  9. +45 −22 src/content/blog/bluegreen-cloud-foundry-deployments-in-circle-ci/index.md
  10. +13 −13 src/content/blog/cell-phone-favorites-aka-free-calls/index.md
  11. +5 −5 src/content/blog/clickheat-cakephp/index.md
  12. +2 −2 src/content/blog/clickheat-plugin-phpmyvisites/index.md
  13. +15 −15 src/content/blog/complex-data-model-jpa-inheritance-stateful-join-tables/index.md
  14. +16 −16 src/content/blog/complex-validation-cakephp-12/index.md
  15. +17 −17 src/content/blog/create-nested-trees-expand-collapse-cakephp/index.md
  16. +11 −11 src/content/blog/create-subdomains-apache-easy/index.md
  17. +6 −6 src/content/blog/custom-jsf-input-validation-styling-component/index.md
  18. +5 −5 src/content/blog/disable-page-show-translucent-progress-bar/index.md
  19. +2 −2 src/content/blog/drop-tables-mysql-database-deletion/index.md
  20. +19 −19 ...t/blog/escaping-ibm-rational-products-simple-java-ee-web-application-development-eclipse/index.md
  21. +94 −94 src/content/blog/facebook-login-modx-sites/index.md
  22. +3 −4 src/content/blog/fedore-13-beta-impressions/index.md
  23. +3 −3 src/content/blog/forcing-visits-ssl/index.md
  24. +1 −1 src/content/blog/free-google-phone-arrived/index.md
  25. +6 −6 src/content/blog/generating-dynamic-sitemaps-cakephp/index.md
  26. +8 −8 src/content/blog/global-site-settings-component-cakephp/index.md
  27. +1 −1 src/content/blog/google-nexus-one-forty-nine-dollars-49/index.md
  28. +1 −1 src/content/blog/google-offer-phone-direct-consumers-2010/index.md
  29. +2 −2 src/content/blog/google-tv-logitech-revue-thoughts/index.md
  30. +1 −1 src/content/blog/google-voice-gmail-play-nice-deliver-telephone-pc-calls/index.md
  31. +13 −13 src/content/blog/heavy-duty-password-validation-cakephp/index.md
  32. +1 −1 src/content/blog/inbox-clean-email-aliases/index.md
  33. +10 −10 src/content/blog/ip-addresses-remote-nodes/index.md
  34. +88 −65 src/content/blog/keys-putty-cygwin-passwordless-login-ssh-scp/index.md
  35. +1 −1 src/content/blog/link-element-ids-jquery-tabs-read-stateless/index.md
  36. +95 −95 src/content/blog/log-recycler-script/index.md
  37. +33 −33 src/content/blog/logical-bot-check-cakephp-captcha/index.md
  38. +4 −4 src/content/blog/manual-update-nexus/index.md
  39. +3 −3 src/content/blog/migrate-apache-nginx-rewrites-intact/index.md
  40. +2 −2 src/content/blog/modx-revolution-bring-change/index.md
  41. +3 −3 src/content/blog/netflix-on-android-g1-droid/index.md
  42. +3 −3 src/content/blog/netflix-queue-manager-android-phones/index.md
  43. +1 −1 src/content/blog/open-source-project-piwik-puts-google-analytics-notice/index.md
  44. +4 −4 src/content/blog/passing-parameters-hcommandlink-jsf/index.md
  45. +5 −5 src/content/blog/performance-tip-boost-sax-life/index.md
  46. +1 −1 src/content/blog/perks-pains-google-voice/index.md
  47. +15 −15 src/content/blog/piwik-analyze-visits-cakephp-site/index.md
  48. +10 −10 src/content/blog/plugins-full-featured-wordpress-content-manager/index.md
  49. +2 −2 src/content/blog/prevent-image-sites/index.md
  50. +1 −1 src/content/blog/queueman-netflix-manager-android-major-updates/index.md
  51. +7 −7 src/content/blog/redirecting-users-sitedown-message/index.md
  52. +10 −10 src/content/blog/rename-cakephp-template-files/index.md
  53. +34 −34 src/content/blog/reset-lost-passwords-cakephp/index.md
  54. +360 −360 src/content/blog/running-pligg-nginx-rewrite-rules/index.md
  55. +3 −3 src/content/blog/running-rails-dreamhost/index.md
  56. +5 −5 src/content/blog/scope-issue-bash-loops/index.md
  57. +9 −9 src/content/blog/script-backup-edit-files-version-history/index.md
  58. +7 −7 src/content/blog/serving-files-cakephp/index.md
  59. +34 −34 src/content/blog/simple-email-component-cakephp/index.md
  60. +17 −17 src/content/blog/simple-feedburner-ticker-php/index.md
  61. +50 −50 src/content/blog/simple-shell-script-backup-multiple-mysql-databases/index.md
  62. +36 −36 src/content/blog/started-acl-cakephp/index.md
  63. +57 −63 src/content/blog/sysdate-determine-start-previous-month-year-oracle-sql/index.md
  64. +3 −3 src/content/blog/the-greenlife-list-goes-alpha/index.md
  65. +4 −5 src/content/blog/transferring-files-between-hosting-providers/index.md
  66. +20 −20 src/content/blog/using-cakephp-pagination-with-habtm-tables/index.md
  67. +7 −7 src/content/blog/validating-complex-passwords/index.md
  68. +26 −26 src/content/blog/validating-optional-fields-cakephp-dreaded-scenario/index.md
  69. +5 −5 src/content/blog/verify-file-checksum-windows-context-menu/index.md
  70. +3 −3 src/content/blog/web-hosting-deal-celebration-julygustember-495-free-domain/index.md
  71. +1 −1 src/content/blog/wireless-tethering-android-phones/index.md
  72. +7 −7 src/content/blog/writing-custom-widget-google-calendars/index.md
  73. +1 −1 src/content/projects/contributions/_index.md
  74. +16 −4 src/content/projects/contributions/deploy-triggers.md
  75. +1 −1 src/content/projects/creations/_index.md
  76. +16 −1 src/content/projects/creations/bitbucket-enterprise-ssh.md
  77. +0 −24 src/content/projects/creations/homebrew-circleci-cli.md
  78. +1 −1 src/content/publications/_index.md
  79. +1 −1 src/data/education.json
  80. +26 −0 src/static/css/resume-override.css
  81. +1 −1 src/themes/resume
@@ -0,0 +1,16 @@
#! /bin/bash


DIR=${1:-"src/content/blog"}
for file in ${DIR}/*/index.md; do
path=${file%/*}
echo $path
mv "$file" "${path}/unescaped.md"
while IFS= read line;do
echo "$line"
done < "${path}/unescaped.md" > "$file"
rm "${path}/unescaped.md"
done


#grep -oh "\(https://blog.edwardawebb.com/wp-content/uploads/[A-Za-z0-9/_-]*\.png\)" src/content/blog/keys-putty-cygwin-passwordless-login-ssh-scp.md
@@ -4,8 +4,19 @@ title = "Eddie Webb"
theme = "resume"
enableGitInfo = true

pygmentsCodeFences = true
pygmentsCodeFencesGuessSyntax = true
[markup]
[markup.highlight]
codeFences = true
guessSyntax = true
hl_Lines = ""
lineNoStart = 1
lineNos = false
lineNumbersInTable = true
tabWidth = 4
style = "tango"




[taxonomies]
tag = "tags"
@@ -8,6 +8,6 @@ sitemap:

Eddie has over a decade of experience enabling agile, CI/CD and DevOps culture in the enterprise. Previously the Director of Enterprise Software Delivery Platforms at a Fortune 100 company, Eddie now leverages his experience influencing culture and technology to help CircleCI customers of all sizes adopt the best technologies and practices along their journey.

This site was generated using [HUGO](https://gohugo.io/) from an [open source theme](https://github.com/eddiewebb/json-resume) via a [CircleCI](https://circleci.com/gh/eddiewebb/json-resume).
This site was generated using [HUGO](https://gohugo.io/) from an [open source theme](https://github.com/eddiewebb/hugo-resume) via a [CircleCI](https://circleci.com/gh/eddiewebb/json-resume).

![CircleCI Status Badge](https://circleci.com/gh/eddiewebb/json-resume.svg?style=svg)
@@ -4,5 +4,5 @@ sitemap:
priority : 0.9
---
This section contains articles migrated from my old Wordpress site. Forgive the formatting please :)

<!--more-->
The "featured" articles are those with highest comment count from WP.
@@ -32,54 +32,61 @@ No need to over complicate things here. Imagine you have a standard Model, oh le

#### app/controllers/posts_controller.php -snippet

/\*\*
\* Returns an array of all public posts less than one month old, orderd by date
\*
\* @return unknown
*/
function newsfeed($count=null) {
if(!$count) $count=5;
$this->Post->recursive = 0;
$posts=$this->Post->findAll('is_public = 1
AND is_published = 1
AND Post.date_modified >= now() - INTERVAL 1 MONTH'
,null,'Post.date_modified DESC',$count);
if(isset($this->params\['requested'\])) {
return $posts;
}
$this->set('posts',$posts );
}
```php
<?
/**
* Returns an array of all public posts less than one month old, orderd by date
*
* @return unknown
*/
function newsfeed($count=null) {
if(!$count) $count=5;
$this->Post->recursive = 0;
$posts=$this->Post->findAll('is_public = 1
AND is_published = 1
AND Post.date_modified >= now() - INTERVAL 1 MONTH'
,null,'Post.date_modified DESC',$count);
if(isset($this->params['requested'])) {
return $posts;
}
$this->set('posts',$posts );
}
```
It would be really helpful if CakePHP provided an RSS helper. Zoot alors !  They do!

#### app/controllers/posts_controller.php -snippet

```php
<?
var $helpers = array('Rss');
var $components = array ('RequestHandler');
```
### The XML Generating View

Just like any other view, all we need to do is transform some provided data into a formatted page. This time it will be strict XML without all the html clutter.

#### app/views/posts/rss/newsfeed.ctp
$item\['Post'\]\['title'\],
'link' => array('controller' => 'posts', 'action' => 'view', $item\['Post'\]\['id'\]),
'guid' => array('controller' => 'posts', 'action' => 'view', $item\['Post'\]\['id'\]),
'description' => strip_tags($item\['Post'\]\['body'\]),
'pubDate' => $item\['Post'\]\['date_added'\],
```php
<?
$item['Post']['title'],
'link' => array('controller' => 'posts', 'action' => 'view', $item['Post']['id']),
'guid' => array('controller' => 'posts', 'action' => 'view', $item['Post']['id']),
'description' => strip_tags($item['Post']['body']),
'pubDate' => $item['Post']['date_added'],
);
}
$this->set('items', $rss->items($posts, 'rss_transform'));
$this->set('channelData', $channelData);
?>
```
And of course sticking with format we should want to add an RSS layout.

#### app/views/layouts/rss/default.ctp

```php
<?
header();
$channelData = array('title' => 'Recent News | Digital Business',
'link' => array('controller' => 'posts', 'action' => 'index', 'ext' => 'rss'),
@@ -89,24 +96,25 @@ header();
);
$channel = $rss->channel(array(), $channelData, $items);
echo $rss->document(array(), $channel);
?>
```
### The RSS compliant URL

You only need to add 2 lines to your routes configuration file for CakePHP to catch and handle the url to pint to your RSS feed. You might use feed.rss, I choice live.rss.

#### app/config/routes.php -snippet
/\*\*
\* ...allow rssextensions
\* and send live.rss to the rss feed
```php
<?
/**
* ...allow rssextensions
* and send live.rss to the rss feed
*/
Router::connect('/live', array('controller' => 'posts', 'action' => 'newsfeed'));
// see my posts on sitemaps to use this next line ;)
Router::connect('/sitemap', array('controller' => 'sitemaps', 'action' => 'index'));
// see my posts on sitemaps to use this next line ;)
Router::connect('/sitemap', array('controller' => 'sitemaps', 'action' => 'index'));
Router::parseExtensions('rss','xml');
```
Yes, you'll notice an additional route there for [dynamic sitemaps](https://blog.edwardawebb.com/programming/php-programming/cakephp/generating-dynamic-sitemaps-cakephp), very useful as well. Sweet! Now just visit http://example.com/live.rss, or throw that url in your favorite Feed Reader to see the results.

#### http://example.com/live.rss
@@ -58,8 +58,8 @@ class DATABASE_CONFIG
function __construct ()
{
//check to see if server name is set (thanks Frank)
if(isset($\_SERVER\['SERVER\_NAME'\])){
switch($\_SERVER\['SERVER\_NAME'\]){
if(isset($_SERVER['SERVER_NAME'])){
switch($_SERVER['SERVER_NAME']){
case 'digbiz.localhost':
$this->default = $this->dev;
break;
@@ -20,20 +20,20 @@ So it goes like this; Your user registers a new account, or sends you a contact

The red boundary denotes new code for the announce submission

Since every cms, site and blog are different, I am unable to provide specifics, but yu should be able to track down the code for your form and find the portion that handles the submission. (Most obviously denoted with $\_POST or $\_GET variable use.)  I will also assume your email field is named 'email' and your name field is two fields; 'firstName', 'lastName';
Since every cms, site and blog are different, I am unable to provide specifics, but yu should be able to track down the code for your form and find the portion that handles the submission. (Most obviously denoted with $_POST or $_GET variable use.)  I will also assume your email field is named 'email' and your name field is two fields; 'firstName', 'lastName';
### Details on the API command
Below is a link to details on the command, needed parameters and possible responses. [Add Subscriber API Command](http://wiki.dreamhost.com/Application_programming_interface#announcement_list-add_subscriber)
### The Announce Submission Code
if(isset($\_POST\['subscribeMe'\]) && $\_POST\['subscribeMe'\] == 1)
if(isset($_POST['subscribeMe']) && $_POST['subscribeMe'] == 1)
{
//get the values we need from form(this should in aprt already be somewhere in the code your editing)
$email=$_POST\['email'\];
$fullName=$\_POST\['firstName'\]." ".$\_POST\['lastName'\];
$email=$_POST['email'];
$fullName=$_POST['firstName']." ".$_POST['lastName'];
//set values we shoudl know, and are constant
$domain="domain of this form";
@@ -45,8 +45,8 @@ if(isset($\_POST\['subscribeMe'\]) && $\_POST\['subscribeMe'\] == 1)
$ch = curl_init('https://api.dreamhost.com/');
curl\_setopt ($ch, CURLOPT\_POST, 1);
curl\_setopt ($ch, CURLOPT\_POSTFIELDS, "key=$apiKey&cmd=announcement\_list-add\_subscriber&listname=$listname&domain=$domain&email=$email&name=$fullName");
curl_setopt ($ch, CURLOPT_POST, 1);
curl_setopt ($ch, CURLOPT_POSTFIELDS, "key=$apiKey&cmd=announcement_list-add_subscriber&listname=$listname&domain=$domain&email=$email&name=$fullName");
$result=curl_exec ($ch);
curl_close ($ch);

0 comments on commit 9336e4d

Please sign in to comment.
You can’t perform that action at this time.