Code Tips

Originally published on medium.com I don’t think there is a faster way to build a web app than firebase and ember. The awesomeness of Firebase’s real-time database, no server, no backend, instant deployment, hosting and user authentication makes it an incredibly productive choice. Ember’s conventions and best practices and incredibly productive CLI makes it an excellent choice for your front-end. Let’s see how fast we can get a working app together. Create a Firebase App Go to your firebase console and create a new app [caption id="" align="aligncenter" width="1600"] Firebase Console[/caption] Create a Firebase Database [caption id="" align="aligncenter" width="1680"] Create…

Read More

What follows is an edited down version of a chat conversation in the Operation Code slack. The context is that of someone studying up on .Net but, patterns being what they are, this applies elsewhere as well. The question was over explaining the repository pattern. I have strong opinions here and differentiate between how repository is defined, how it might be implemented in a manner true to it’s intent, and how it is often (mis)implemented with unfortunate consequences. The best opinions are changed opinions and this is one that I admit to having been wrong about. I used to be…

Read More

Every programmer has a language they prefer to work in. Whether it’s because it’s the one they’re most used to or the one that best meets their coding needs, they’re not shy about telling you which is their favorite and why. But man cannot live on Perl alone. No matter how versatile or easy to use your favorite programming language, it’s important to be able to use others just as fluently. Here are a few reasons why. Job Opportunities Google programming is done using Python. Say your dream job is to work for Google, and you learned Python for that…

Read More

Programming languages come and go over time, and it always seems there is some new, "hot" language that is all the rage. With things changing all of the time, if you were to start a new project, how would you decide what language your software should be written in? What's Popular First, how do we even know what is popular at the moment? There are a few different methods one can use to determine what is being used in the real world; you can search job boards and see what companies are hiring for; you can follow news sources and get…

Read More

The following tutorial was given by our own Chris Daudier, a senior software engineer at Surge. This is a quick introduction to Web Components, a new set of web standards that allow for reuse of CSS, JavaScript and HTML to design widgets or components in web applications. In this demo we go over these four new standards created by W3C which are HTML Imports, Custom Elements, Shadow DOM and HTML Templates. We'll also utilize each one while creating a demo for a simple calculator.

Read More

The following tutorial was presented by Nich Curtis, a senior software engineer at Surge. This video is an introduction to building Cross Platform HTML5 applications using GitHub’s Electron platform. Learn about the various Electron modules and how they enable cross platform development using web technologies such as Node.js, HTML5, Javascript, and CSS.

Read More

Browser debugging tools have come a long way in a short amount of time. Here are some of our favorites. Firefox Firebug http://getfirebug.com Firebug is the quintessential developer plugin for Firefox. It comes with several powerful sections: Console The console allows you to view requests made to the server. Each can be expanded to view the response/request headers, the raw response, and the parameters sent. View the output from javascript console commands, such as console.log and console.error, which support printing an object that can be clicked on and viewed in the DOM tab. An input console which allows for the…

Read More

There's many ways to do so. You can use the close event and pickup values passed through the .data() method on the dialog, you can use a variable in the window context, but these are all very lacking in structure, however --All jQuery UI elements allow you to pass any value you want in while constructing t [code]yourSelector.dialog({ width: 500, height: 500, title: "Sample", success: function(response) { console.log(response); } // <-- this is non-standard }); [/code] Inside of our dialog, we can now access this success call back by doing yourSelector.dialog("option", "success"); Lets give a real world example. This dialog…

Read More

jQuery UI's autocomplete widget provides no built in functionality to alter the search behavior, but has a static filter method that can be overridden instead, and as such, will be on an application wide basis. "Super search" is a generic term meaning orderless word search, as that "foo bar" and "bar foo" discover the same results. This code can go anytime after jQuery UI library is loaded. [code] $.extend($.ui.autocomplete, { filter: function(array, term) { if (term) { var regexes = $.Enumerable.From(RegExp.escape(term).split(" ")) .Select(function(t) { var regex = new RegExp([".*?", t, ".*?"].join("")); regex.compile(regex.source, "im"); return regex; }).ToArray(); return $.grep(array, function(value) {…

Read More

Nen is  a LINQ provider and as such uses delayed execution. Delayed execution means that whenever a query is written it's not actually performed until the result set is being accessed, which is often by enumeration. Consider the following: [code]var workOrdersQuery = DataContext.Current.Get<EventWorkOrder>() .Where(t => t.WONumber == 3); // No query has been performed yet! var workOrdersCount = workOrdersQuery.Count(); // This runs the query of SELECT COUNT(*)  FROM slx_EventWorkOrder .... var workOrdersList = workOrdersQuery.ToList(); // This runs a query joining in all related tables and selecting all columns foreach (var workOrder in workOrdersQuery) // This is also accessing an enumeration  of the data set! This performs the same query as ToList() Console.WriteLine(workOrder.Subject); [/code] As you see in the comments, 3 queries were performed across what is inevitably the same result set. Rather suboptimal. The best idea is to store an enumerated data set. This way the results are…

Read More

America's Best Software Engineers, On-Demand, at an Affordable Price
Surge Forward With Us