I changed the following using angular js
Just use $first and $last combined with ng-class:
<a ng-repeat="sMedia in socialMedia" ng-class="{'first': $first, 'last': $last}" href="#" >
See here how they work: https://docs.angularjs.org/api/ng/directive/ngRepeat
You can use:
#social a:first-child{ /* your first css code */ }
#social a:last-child{ /* your last css code */ }