This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
selectService( | |
context: StateContext<ServiceDetailDialogModel>, | |
{ payload: { | |
serviceName, | |
doSelect | |
} }: ServiceDetailDialogActions.SelectService) { | |
const { serviceHosts } = context.getState(); | |
// get the index | |
const serviceIndex: number = serviceHosts.findIndex(service_ => service_.serviceName === serviceName); | |
if (serviceIndex < 0) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// HELPER at top of file, or in util | |
const cloneSetAllSelected = (serviceHosts, selected: boolean = false) => { | |
return serviceHosts.map(service => ({ | |
...service, | |
selected, | |
hosts: service.hosts.map(host => ({ | |
..host, | |
selected | |
})) | |
})); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Promise from 'Bluebird'; | |
Promise.join( | |
Product.create({ | |
name: 'MacbookPro', | |
qty: 1232213, | |
price: 10000. | |
}), | |
Order.findOne({ | |
orderNumber: 123 | |
}) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Promise.all([ | |
Product.create({ | |
name: 'MacbookPro', | |
qty: 1232213, | |
price: 10000. | |
}), | |
Order.findOne({ | |
orderNumber: 123 | |
}) | |
]) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
HTML has grown up and so should the way we format it. Despite early objections, nearly every developer and team which has adopted this formatting realizes it is supremely better at: | |
1.) Collaboration and Version Control | |
2.) Reads Easier and Faster | |
3.) Separation of Concerns | |
Under the current standards of html we see a lot of this: | |
<span class="my-class" custom-attribute="an-attribute" id="thing1" inline-js-exec="something===another">Some Content</span> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//////// File MyResolversProvider.js //////// | |
function MyResolversProvider(){ | |
this.$get = function(){ | |
return { | |
myResolver: ($stateParams, $resource){ | |
console.log($stateParams); | |
return {message: "Success"}; | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# download latest libevent2 and tmux sources, and extract them somewhere | |
# (thx bluejedi for tip on latest tmux URL) | |
# | |
# at the time of writing: | |
# https://github.com/downloads/libevent/libevent/libevent-2.0.21-stable.tar.gz | |
# http://sourceforge.net/projects/tmux/files/latest/download?source=files | |
# | |
# install deps | |
yum install gcc kernel-devel make ncurses-devel |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
app = angular.module('lcs.entityViews') | |
# File entity_controller.coffee | |
# The entity controller expects a meta property and auto-updes | |
# Use the factory to create the class which will be extended | |
# This makes it possible to be injected and extend in any file on the filesystem | |
app.factory 'EntityController', (MetaProvider) -> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This is required to prerender views for google indexing | |
app.directive 'prerenderReady', ($timeout, $window) -> | |
link: -> | |
$timeout( -> | |
$window.prerenderReady = true | |
, 5000) |