coding, mobile

Xcode 8 brought a bit of annoyance

Extra logging can be easily hidden by adding this to plist

 

<EnvironmentVariables>
<EnvironmentVariable
key = “OS_ACTIVITY_MODE”
value = “${DEBUG_ACTIVITY_MODE}”
isEnabled = “YES”>
</EnvironmentVariable>
</EnvironmentVariables>

Share This:

coding, javascript, nodejs

Parse Server – providing ip of a client

Very handy code that can be used for analytics (reversing to approximate location)

let ip = request.headers[‘x-forwarded-for’] || request.connection.remoteAddress || request.socket.remoteAddress || request.connection.socket.remoteAddress;

This is for cloud defined functions for your custom rest API

Share This:

coding, rambling

CoffeeScript is gone, what do recruiters think about this?

CoffeeScript emerged years ago in an alternative to spaghetti code written by tired/junior/bored/rushed developers. Javascript can become messy very quickly and there are many ways of creating modules, classes and attempting to have clear expression of callbacks. Not to mention handling errors , encapsulating classes, etc.

CoffeeScript solved a lot of those issues. It provided a shorter syntax to e.g. Checking if variable is null and undefined in one short syntax. It created an easy to understand structure of creating classes and a ton of helper methods. It took inspiration from Ruby language and it worked.

It required a few tools but it wasn’t very hard to integrate into team’s development cycle. In fact some would argue (i did) that it created a value through more structure.

A lot of job posts started to include CoffeeScript which may be perceived as a separate technology by recruiters (granted it does require a bit of learning but not much).

Today ES6 generation of javascript renders CoffeeScript redundant and because its basically a hack , it never meant to stick around. TypeScript promoted by microsoft and others provides amazing type checking , casting and many valuable features .

A short lived technology (i personally have developed a few things using it ) will leave some confused .

 

Share This:

cloud, coding, mobile, nodejs

Mobile app built in 24 hours for banking

I have participated individually in a hackathon organized by a bank and had a concept in mind that would help bank customers chat with an advisor competent in their field.

I’ve built a platform that had a real time chat, a browser based web app that would be more suitable for Customer Support or Advisor (also a mobile app was available if they were on the go).

The pitch:

Simplifying issue resolution for customers by matching them to advisors and saving time for both sides.

 

I have open sourced my solution with screenshots.

Available here

Share This:

coding

VisualStudio online doesnt use ssh, here is a tip

MS Visual Studio online was something new to me. It definitely is targeted for those using Visual Studio as product, however for those of us that us Atom or Sublime we’re a bit stuck.

VSS online doesn’t support ssh , so don’t bother looking for it.

What you’ll need to do is:

1. Setup alternate credentials (username and password ) This can be done in profile window

2. git clone http://<yourproject>.visualstudio.com/….

3.  git config credential.helper store

4. Make changes and push, it will prompt you for credentials but they will be saved and you won’t be prompted again

ps. keep in mind that credentials are saved in a file (hidden) and shouldn’t be exposed, hence the alternate credentials so that your MS account isnt exposed.

Voila

Share This:

architecture, coding

Open sourcing my lottery server

2007 project involving Message Driven Beans (EJB) running on Enterprise Java container (Jboss or Glassfish) where games are processed and “played” as they come in through the Queue allowing scalability and consistency.

 

Source code for both game logic and EJB server can be found on github:

Github to Lottery Server

Share This:

coding, mongodb, nodejs, Uncategorized

Recently open sourced project – toronto open data

The motivation behind this project is

 

  • Building a very capable api with geo lookups
  • Toronto Open Data api -specifically city services is very slow
  • User interface as a proof of concept which exploits the use of new API
  • Open sourced for others to use and improve

Technology stack:

 

  • MongoDB
  • NodeJS, rest api, mongoose
  • AngularJS (bootstrap, routes)

 

GiHub link

Share This:

coding, Uncategorized

GO lang is getting unofficial support from GCC compiler

Support for the Go programming language has been added to GCC. It is not enabled by default when you build GCC; use the –enable-languages configure option to build it. The driver program for compiling Go code is gccgo.

Go is currently known to work on GNU/Linux and RTEMS. Solaris support is in progress. It may or may not work on other platforms.

Reference: https://gcc.gnu.org/gcc-4.6/changes.html#go

Share This:

coding, javascript

Creating great looking UI with bootstrap – wizard

Creating friendly and intuitive UI is paramount in web development.

Here is a tip for an angular App that uses bootstrap.ui (angular directives for bootstrap) and bootstrap:

 

Accordion

 

The above UI uses this easy CSS for styling that number:

 

.number {
    background: #69C8C7;
    display: inline-block;
    width: 25px;
    height: 25px;
    border-radius: 30px;
    text-align: center;
    color: #fff;
    line-height: 25px;
    margin-right: 8px;
}

 

And html for the controller and a route contains this markup:

 

<accordion >
	<accordion-group >
	<accordion-heading>
	<p><span class="number">1</span>
		<span class="fa fa-check-circle" ng-show='false'></span> Headline</p>

	</accordion-heading>
	Fill out some information
</accordion-group>

<accordion-group >
<accordion-heading>
<p><span class="number">2</span>
	<span class="fa fa-check-circle" ng-show='false'></span> More options</p>

</accordion-heading>
Fill out some information and select options.
</accordion-group>

</accordion>

 

Notice the check circle can be replaced  when for example you’ve filled out all the data indicating to the user they are done with that section. Implemention and logic is up to you.

 

For more information on Bootstrap UI (these are directives for your angular app)

 

 

 

 

 

Share This:

coding, javascript

EmberJS – ongoing – part 3

Here is a situation:

API – Build on Rails , follows ActiveModel pattern (e.g. first_name)

EmberJS App – model uses camelized style for properties (e.g. firstName)

EmberJS requires an adapter for pulling data from some source (e.g. an API)
We have to use adapter that will deal with ActiveModel pattern

ApplicationAdapter = DS.ActiveModelAdapter.extend

Here is the caveat: Upgrading to Ember 1.8.1 will cause this error:

TypeError: undefined is not a function
at Object.func (http://localhost:4200/assets/vendor.js:49499:18)
at Object.Cache.get (http://localhost:4200/assets/vendor.js:25100:38)
at decamelize (http://localhost:4200/assets/vendor.js:49541:31)
at RESTSerializer.extend.keyForAttribute (http://localhost:4200/assets/vendor.js:63962:16)
at apply (http://localhost:4200/assets/vendor.js:32847:27)
at superWrapper [as keyForAttribute] (http://localhost:4200/assets/vendor.js:32419:15)
at null. (http://localhost:4200/assets/vendor.js:66421:31)
at null. (http://localhost:4200/assets/vendor.js:68910:20)
at cb (http://localhost:4200/assets/vendor.js:29082:22)
at OrderedSet.forEach (http://localhost:4200/assets/vendor.js:28880:13)

You might have to override an ActiveModelSerializer to handle the issue, however stick to Ember 1.7 and it’ll work.

Not loving the experience with Ember/EmberCLI

Share This: