Skip to main content

Posts

Showing posts from 2014

Completely Remove a Commit in a Github Branch

I had a hard time trying to find a straight forward way  to completely remove a commit in Github.  I installed a plug-n that was suppose to make my life easier, but did the complete opposite. With no further adieu, here's the commands: git reset --hard <the commit you want as HEAD> git push origin HEAD --force Done and done. More reading: http://stackoverflow.com/questions/1338728/delete-commits-from-a-branch-in-git

Resolved Sitecore "If you publish now, the selected version will not be visible on the web site" warning

The Problem:   Unable to publish any Sitecore item within a particular site, even out of the workflow. Rather, a warning reads " If you publish now, the selected version will not be visible on the web site " What I've Discovered: I couldn't publish any item in the site, not just one or two I viewed all parent items of the items in question The main home page displayed a different warning " This item will never be published because it's publishable option is disabled " Another sitecore developer reminded me of the standard fields option View --> check standard fields to show all standard page fields Found out that somebody checked Never Publish within the publishing section The Fix: After I unchecked the checkbox and saved the change, I was able to publish again.  :) Conclusion: Looks like another Sitecore user thought the children items would not be affected by this change.  Lesson  learned.

Resolving Sitecore's Telerik Assembly Errors When Running the Content Editor

Problem:  Sitecore 6.5 Content Editor breaks with exception “ Could not load file or assembly 'Telerik.Web.UI, Version=...” My Troubleshooting Steps:  1.       I searched via Visual Studio, Grepwin, etc. for the assembly settings with no results 2.        Manually c hecked all config files for Telerik data, but didn't find anything useful 3.       Checked all project files for Telerik settings, and didn't find anything 4.       Tried adding the DLL references back again, which gave me the same error (this was the dll in question) 5.       I cleaned and built all projects many times The Fix: I deleted all bin folders in every project, and then rebuilt the solution.  PROBLEM SOLVED! What I learned: The Visual Studio "Clean" function doesn't delete all bin files like I thought. Normally, I would clean the project first and then ...

Reverse an Array while considering Memory Allocation

The Problem: At the company I work for, we interview for front-end developer positions quite frequently. One of my coworkers always asked the interviewee how to reverse an array in JavaScript.  Just for fun, I decided to to take on the challenge since .net makes it too easy (array.Reverse()). Originally, my answer to the question was this: var stringArray = [" Joey!", " Is", " Name", "my", " Hello,"]; var temp = new Array(); for(i = 0; i <  stringArray .length; i++) temp.push(actual[( stringArray . length - 1) - i]); console.log(temp); My coworker said my solution would definitely work, but he then asked how I can improve the answer by saving on memory.  What I learned: I didn't know how to improve the answer until I learned about JavaScript's  splice  method.  Here's my improved script using splice : var stringArray = [" Joey!", " Is", " Name", "my"...

Static Classes can be Shared by Multiple Threads!

My Mistake: I created a static class for a particular project with the sole purpose of storing session data (user full name, user name).  I could have stored the data in a session object, but I guess I wanted to try something different.  When I deployed the project, I noticed that when multiple users logged into the site, the display name would be inconsistent.  I couldn't figure out the reason for this until I had a discussion with a coworker (thanks Clark) What I Learned: A static class scope lasts as long as a process is running.   Many threads can share an instance, so whenever a user would log in, the existing data would be overwritten by the person that just logged in .  The user that logged in before the latest person that logged in would show a different name than their own.  I should probably use static classes for development tools (like a utility class), not for storing session data.  Good thing I didn't show a...