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 {Pipe, PipeTransform} from 'angular2/core'; | |
import * as moment from 'moment'; | |
/* | |
* Time helper using momentjs | |
* Usage: | |
* timestamp | moment:'DD.MM.YYYY' | |
* Defaults to 'L' - locale ie. '01/24/2016' | |
*/ |
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
_sortRank(a, b) { | |
if (a.sumPoints > b.sumPoints) { | |
return -1; | |
} else if (a.sumPoints < b.sumPoints) { | |
return 1; | |
} else { | |
return 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
# Correct way to save related model data with transaction | |
# A transaction is required if we want validation of related model data | |
# Sequelize docs don't provide exact instructions for this | |
await db.sequelize.transaction((t) -> | |
return db.User.create(data, { transaction: t, fields: ['email', 'password'] }).then((user) -> | |
return user.createOrganization(data.org, { transaction: t, fields: ['name'] }); | |
) | |
).nodeify defer err, user |
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
curl 'http://www.najdi.si/sms/smsController.jsp?sms_action=4&sms_so_ac_1379610636358=FIRST_PART_OF_NUMBER(IE.04)&sms_so_l_1379610636358=SND_PART(123)%20TRD_PART(123)&myContacts=&sms_message_1379610636358=MESSAGE_HERE' -H 'Host: www.najdi.si' -H 'User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.8; rv:23.0) Gecko/20100101 Firefox/23.0' -H 'Accept: text/javascript, text/html, application/xml, text/xml, */*' -H 'Accept-Language: en-US,en;q=0.5' -H 'Accept-Encoding: gzip, deflate' -H 'X-Requested-With: XMLHttpRequest' -H 'X-Prototype-Version: 1.6.0.3' -H 'Referer: http://www.najdi.si/index.jsp?sms_show' -H 'Cookie: JSESSIONID=806BA833D63D03994F895F6A1EC500C2; poll=""; MAdUTCID=0c8572cb.IP_HERE.1379610620813; chkcookie=1379610636816; iduseron=USER_NAME; adp_partner=1' |