Skip to content

Instantly share code, notes, and snippets.

View Alejandroem's full-sized avatar
🏠
Working from home

Alejandro Enríquez Alejandroem

🏠
Working from home
View GitHub Profile
@Alejandroem
Alejandroem / build.json
Created April 3, 2020 17:03
Build faild IOS, SWIFT_VERSION
{
"ios": {
"debug": {
"buildFlag": [
"SWIFT_VERSION = 3.0",
//Author: Alejandro Enríquez
//Email: alejandro@bixlabs.com
//Merge the group of values that overlap
//Input: [[1,3],[2,6],[8,10],[15,18]]
//Output: [[1,6],[8,10],[15,18]]
//Input: [[1,4],[4,5]]
return handlerInput.responseBuilder
.addDelegateDirective({
name: 'AddNewMedicine',
confirmationStatus: 'NONE',
slots: {}
})
.speak(language.ADD_MEDICINE_MSG)
.reprompt(language.ADD_MEDICINE_MSG)
.getResponse();
def inSecuence(compareArray, sequenceArray, index, depth):
#we found one ocurrence
if depth > len(sequenceArray) - 1:
return True
#we got to the end with no ocurrence
elif index > len(compareArray) - 1:
return False
#we found the next number on the secuence so we go deeper
elif compareArray[index] == sequenceArray[depth]:
return inSecuence(compareArray, sequenceArray, index + 1, depth + 1)
// have ready the icon as an SVG image.
// Get the icon in SVG format (from Font Awesome 34 or any similar site)
// save SVG file to folder: src/assets
// add css class to app.scss
/*custom Ionicon icon*/
ion-icon {
&[class*="custom-"] {
mask-size: contain;
mask-position: 50% 50%;
mask-repeat: no-repeat;
@Alejandroem
Alejandroem / Removed duplicates
Created August 22, 2018 00:12
Function to remove duplicates based on an object
function removeDuplicates(myArr, prop) {
return myArr.filter((obj, pos, arr) => {
return arr.map(mapObj => mapObj[prop]).indexOf(obj[prop]) === pos;
});
You have to pass it imperatively like:
loadChild(): void {
this._cr.resolveComponent(Child1Component).then(cmpFactory => {
let cmpRef = this.childContainer.createComponent(cmpFactory);
cmpRef.instance.var1 = someValue;
});
}
also similar with registering handlers for outputs.