Skip to content

Instantly share code, notes, and snippets.

var s = new Set();
s.add({"prop": "value"});
_.find(s, { "prop": "value" }) // undefined
var arr = [];
arr.push({"prop": "value"});
_.find(arr, { "prop": "value"}); // Object {prop: "value"}
def parse_constant(contents)
results = []
# REMOVE_PROSPECT_LIST: "remove_prospect_list",
regex = /(\w*):\s["'](\w*)["']/
contents.scan(regex) do |constant, id|
results << { constant: constant, id: id }
end
return results;
[
{
"id": 1,
"name": "Leanne Graham",
"username": "Bret",
"email": "Sincere@april.biz",
"address": {
"street": "Kulas Light",
"suite": "Apt. 556",
"city": "Gwenborough",
[
{ "date": "Jun 12", "count": 541586, "description": "Jun 11 : 541,200 prospects" },
{ "date": "Jun 13", "count": 551024, "description": "Jun 12 : 541,586 prospects" },
{ "date": "Jun 14", "count": 556024, "description": "Jun 12 : 551,024 prospects" },
{ "date": "Jun 15", "count": 536024, "description": "Jun 12 : 551,024 prospects" },
{ "date": "Jun 16", "count": 566024, "description": "Jun 12 : 551,024 prospects" },
{ "date": "Jun 17", "count": 535024, "description": "Jun 12 : 551,024 prospects" }
]
[
{
"title": "Wake up",
"id": 1,
"start": "2015-06-18T11:07:30-04:00",
"end": "2015-06-18T11:08:30-04:00",
"allDay": false,
"custom": true,
"icon": "globe",
"color": "#FCDCAE",
[
{
"title": "Poop",
"id": 3,
"start": "2015-06-19T10:07:30-04:00",
"end": "2015-06-19T11:08:30-04:00",
"allDay": false,
"custom": true,
"icon": "globe",
"color": "#FCDCAE",
{
"headers":[
"Name",
"Company"
],
"rows":[
{
"Name":{
"text":"Grace Kelly",
"url":"\/prospect\/read\/id\/5"
[
{
"Name":{
"text":"Grace Kelly",
"url":"\/prospect\/read\/id\/5"
},
"Company":{
"text":"Kelly Online",
"url":"http:\/\/www.gracekelly.com"
}
[
{ "date": "Aug 23", "count": 2343 },
{ "date": "Aug 24", "count": 4545 },
{ "date": "Aug 25", "count": 7342 },
{ "date": "Aug 26", "count": 994 },
{ "date": "Aug 27", "count": 1500 },
{ "date": "Aug 28", "count": 4234 },
{ "date": "Aug 29", "count": 7233 },
{ "date": "Aug 30", "count": 2233 },
{ "date": "Aug 31", "count": 100 }
var _this = this;
items.map(function(item) {
return _this.massageSomething(item);
});