View flatenArray.js
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
// [[1,2,[3]],4] -> [1,2,3,4] | |
var unflattenedArray = [[1,2,[3]],4], | |
flattenedArray = []; | |
flattenedArray = unflattenedArray.toString().split(',').map(function(arrayItem) { | |
return parseInt(arrayItem); | |
}); |
View jquery.unserialize.js
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
// https://gist.github.com/brucekirkpatrick/7026682 | |
/** | |
* $.unserialize | |
* | |
* Takes a string in format "param1=value1¶m2=value2" and returns an object { param1: 'value1', param2: 'value2' }. If the "param1" ends with "[]" the param is treated as an array. | |
* | |
* Example: | |
* | |
* Input: param1=value1¶m2=value2 | |
* Return: { param1 : value1, param2: value2 } |
View gist:b29c913a00d33bffc67f
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
{ | |
"meta": { | |
"code": 200 | |
}, | |
"notifications": [ | |
{ | |
"type": "notificationTray", | |
"item": { | |
"unreadCount": 0 | |
} |