This file contains 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
<button ng-click="toggleUserStatus(user.status)"> | |
<span ng-show="user.status == 'inactive'">Activate</span> | |
<span ng-show="user.status == 'active'">Deactivate</span> | |
</button> | |
//inside ctrl | |
$scope.user = { | |
status : 'active' | |
// more props here |
This file contains 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
/** | |
* | |
* @param items {Array} array of GM items | |
* @param eventType {String} | |
* @param handler {Function} | |
* @param handlerArgs {Function} | |
*/ | |
var addHandlers = function (items, eventType, handler, handlerArgs) { | |
_.forEach(items, function (item) { | |
google.maps.event.addListener(item, eventType, handler.bind.apply(handler, [null].concat(handlerArgs))); |
This file contains 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
url( | |
r'^forgot-password/$', | |
'django.contrib.auth.views.password_reset', | |
name="forgot password" | |
), | |
(r'^account/password/reset/(?P<uidb36>[0-9A-Za-z]+)-(?P<token>.+)/$', 'django.contrib.auth.views.password_reset_confirm', | |
{'post_reset_redirect' : '/account/password/done/'}), | |
(r'^account/password/done/$', 'django.contrib.auth.views.password_reset_complete'), |
This file contains 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
var reFirst = new RegExp("(\\d*\\.?\\d+)([*\\/])([-]?)(\\d*\\.?\\d+)", ""); | |
var reSecond = new RegExp("(\\d*\\.?\\d+)([+-])([-]?)(\\d*\\.?\\d+)", ""); | |
var brackets = /[(]([^(]+?)[)]/gm; | |
var prn = function (text) { | |
text.replace(/([-][-]|[-][+]|[+][-])/g,'-'); | |
text = calcOurs(reFirst, text); | |
text = calcOurs(reSecond, text); | |
return text; | |
}; |
This file contains 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
/** | |
* sort's | |
* @param entities {Array} | |
* @returns {Array} | |
*/ | |
ordering = function (entities) { | |
var sortedRes = _.sortBy(entities, 'originalIndex'); | |
var first = sortedRes.splice(0, 10); |
This file contains 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
var original = [ | |
{ | |
id: 11 | |
}, | |
{ | |
id: 5 | |
}, | |
{ | |
id: 6 | |
}, |
This file contains 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
#python 2.7 | |
i_str, i_lst, result = " bill == @0, john == @1, maria = @2", [234, "mple", 0], " bill == 234, john == mple, maria = 0" | |
def specsMatch(input_str,input_list): | |
r = [] | |
for index,i in enumerate(i_str.split(',')): | |
r.append(i.split('@')[0] + str(i_lst[index]) + ',') | |
r[-1] = r[-1][:-1] | |
return "".join(r) |
This file contains 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
#python 2.7 | |
i_str, i_lst, result = " bill == @0, john == @1, maria = @2", [234, "mple", 0], " bill == 234, john == mple, maria = 0" | |
def specsMatch(input_str,input_list): | |
r = [i.split('@')[0] + str(input_list[index]) + ',' for index,i in enumerate(input_str.split(','))] | |
r[-1] = r[-1][:-1] | |
return "".join(r) | |
if __name__ == '__main__': |
This file contains 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
info: jitsu v0.13.18, node v0.10.22 | |
info: It worked if it ends with Nodejitsu ok | |
info: Executing command snapshots create | |
info: Analyzing application dependencies in node server | |
info: Creating snapshot 0.0.0-1 | |
info: Uploading: [=============================] 100% | |
error: Error running command snapshots create | |
error: Error building snapshot | |
error: Nodejitsu Error (500): Internal Server Error | |
help: For help with this error contact Nodejitsu Support: |