What's new?!

Sep 25

[video]

[video]

Aug 18

Source Code + Continuous Integration

I took the last few days of this week to do some cool things which I’ll be blogging about in the upcoming weeks.

First, we moved our source control for our main solution from a local SVN repository to Git. Git usage is growing on an amazing rate. Facebook, Mozilla, Linkedin, Twitter… most open-source libraries like nodejs, linux (core) and so forth!

I’m no expert in git but have been learning things quickly. Some things I do like: branching and merging is very easy. All can be done locally, which makes it crazy fast. Doing branches in SVN makes you end up with a bunch of directories (/trunk, /tags, /branches). Git makes it a breeze to change from a branch to another.

Second, we are using GitHub now. GitHub is THE BEST place for you to host your source code. We have a private repository there now. The system provides an easy way to visualize the code files, diffs, has awesome reporting, allows for issue tracking and linking them back to commits, etc… I can go on and on listing all awesome things GitHub provides. I guess that’s why all major OSS projects are hosted there and why they have some heavy duty software clients there as well. Their Windows App is awesome as well.

We also decided to follow this branching strategy from now on. 

In a nutshell:

The final step was go to implement Continuous Integration. I used Jenkins to set it up and will write some blog posts about lessons learned.

Jenkins is working great. If I check-in a code into the develop repo the build server will detect it and build the code. If there are any errors the ASTD developers will be notified. This makes the “develop” built to be always in good state. 

Having the code in Git + GitHub will increase our efficiency if we start having more resources working on the same projects as we are as they can easily branch out into a feature branch and we can merge back these changes into develop (and later to master).

Down the road, my hope is that if I push to master the production servers will update all  files, rebuild the solution and deploy. 


Aug 09

Powershell Snippet

This powershell snippet is very helpful before copying files to the web.

I’ll rename your files removing spaces and underlines favoring spaces. Also, the names will be set to title case (“An Example Can be Seen Here”)

I might add more things to it at some point but it might help some people out there.

https://gist.github.com/3308418

Jul 06

Bronto Excel Widget

It’s common that you might want to integrate your Email Management System with lists you pull out from your CRM or virtually anywhere.

Most often, you will be required to save your Excel List to a text file (of emails) and upload it to your EMS.In this post I’ll detail a work done to create a widget that will create this custom lists for you.

We can start by creating an Excel Add-In project and adding a ribbon to it.

Then we will add a button to our ribbon called “Create Segment”. For this demo I’ve called the Group “Operations” (maybe we will have more items down the road).

Ribbon

Now let’s add code to our button.

Notice I’ve used a background worker. The reason for this is to not block the UI thread. In case of an exception, the message and trace will be shown in order to help diagnose the issue.

On completed, we show the resulting message.

https://gist.github.com/3062626

Now, as part of my BrontoIntegration class I have a simple form that captures the desired Segment Name:

To get a list of emails to be sent I basically just do a Application.Selection (so all selected emails in the range will go to the Static Segment).

The CreateList method and AddContactsToList use the standard bronto Api v.4 methods (more in http://api.bronto.com)

I’ve made use of a cool Extension method so I group the contacts in groups of 30 when calling the bronto API. This ensures things go smoothly specially when the user selected a range with lots of email addresses.

Hope that helps people and also gives some ideas on cool integrations that can be done between Office and platforms with a sound REST api.

https://gist.github.com/3062716

Below a sample YouTube video of how it works:

May 24

PDF Stamping and Online Content Piracy

Like most organizations that deal with online content we face challenges with content piracy.

I personally haven’t seen a tool that protects  the organization and keeps DRM under tight control. Without a doubt, the company that solved this problem was Amazon.  They manage multiple devices (Kindles, iPhones and iPads) with a great user experience.

Nevertheless, customers expect to be able to print, add their notes and so things that usually point towards PDF files as a the optimal solution (considering time & budgeting constraints).

This is what we’ve been using for the past few years and is also followed by multiple organizations.

Now, how to protect the content? A great alternative that deter piracy is PDF stamping. What that means is that you add a statement to all pages containing either the customer number or name. If he shares it, he knows he can be easily tracked and - as we all know - piracy and anonymity go hand in hand together.

Technical Solution:

To implement dynamic PDF stamping to ASTD’s PDF files.

Implementation:

We are lucky we had opted long ago for Generic Handlers to server our download files. During the download request, we were already logging the activity in our CMS and all that good stuff. 

In order to add the stamping we’ve decided to go with iTextSharp. iTextSharp is an open-source library dedicated to interact with PDF’s. It’s really great.

If you want to use i’d advise always going for the Nuget reference:

Install-Package iTextSharp

I’ve been a big fan of GitHub (for their UX) and am trying to go towards Git for newer projects.

Note: I’ve decided to use Gist for code snippets as I’m sure it will be easier for you (reading this post) and for me (adding code to blogs and keeping line breaks and syntax highlighting had been time consuming). If you are also using Tumblr check out this link :https://gist.github.com/1395926

https://gist.github.com/2782997

Apr 20

Contact Us

We decided to add a Contact Us link to our header. It’s a simple Mailto to our customer care department (it opens a support ticket that can be tracked). This should make it easier for customers to ask questions and make operation more efficient.

Next planned step is perhaps add a Chat feature.

I’ve looked into multiple chat widget (our support software offers one).

A couple free options include Yahoo, Microsoft (MSN) and I’ve seen a very interesting offer through Microsoft Lync, which is a more corporate option.

It might be interesting to have a “Chat” option for Community Members.

See a demo here for the Lync Option:

http://www.orbitone.com/en/CodePlex/Pages/LyncPresenceChatWidget.aspx

Performance Optimization Part 4: Amazon CloudFront

We decided to use Amazon S3 to store most of our larger files (mp3s, videos) rather than using the Sitecore Media Library.

Part of the performance optimization task was to create a new bucket on S3 called “cdn”. We then enabled Amazon’s CloudFront on that bucket.

This means that our static files (background images, scripts, css files) will all be served from a CDN, making the site faster for our domestic and specially international customers.

Apr 16

Performance Optimization Part 3: Memcached

I’m really happy with our implementation of memcached.

The version I’m using is from couchbase (http://www.couchbase.com/)

Memcached is a in-memory distributed caching. What this means? speed.

I like memcached because it doesn’t take much of the IIS host web servers memory. Also, if you have lots of web front-end servers, they can all share the same in-memory cache, making your application more scalable.

Who uses memcached? According to wikipedia, YouTube, Facebook, Twitter, Reddit… 

Performance Optimization Part 2: JS and CSS minification

Second piece of optimizing the performance was trying to reduce HTTP Requests. 

Before optimizing, our home page comprised of 105 HTTP requests. 22 of those were javascript files. 6 of them, CSS.

What we’ve done is combine the CSS and Javascript files and minify them.

Yahoo provides great resources for developers.

http://yuicompressor.codeplex.com/

Make sure to use the Nuget package if you want to use it.

Using it is extremly simple:

 var compressedCss = CssCompressor.Compress(combined.ToString());
Console.WriteLine(compressedCss);
var version = DateTime.Now.ToString("yyyyMMdd", CultureInfo.InvariantCulture);
using (var outfile = new StreamWriter(string.Format("combined-{0}.css", version))) {
outfile.Write(compressedCss);
}