Skip to content

Instantly share code, notes, and snippets.

@4mitch
4mitch / gist:96aef7809bd1bbd544b87fa9f29cd0ae
Created August 31, 2017 10:09
Find uniq values of property in array of objects
var array = [
{ name: "Joe", age: 17 },
{ name: "Bob", age: 17 },
{ name: "Carl", age: 35 }
];
console.log(new Set( array.map((obj) => obj.age)) )
start = root
root = xml:xml { return {xml} }
xml = tag
tag = tagopen:tagopen innerHTML:(tag / text)* tagclose
{ let a = {}; a[tagopen.valueOf()]= innerHTML; return a }
tagopen = _ "<" text:text ">" _ { return text }
start = sql
sql = statement
statement = _ insert:insert
{ return {insert} }
insert = _ head:head _ M_WITH_ROWLOCK _
"(" _ column_list:(column_list) _ ")"
_ select:(select)
start =
comma
comma = left:additive "," right:comma
{ return {tag: ",", left, right}; } / additive
additive =
left:multiplicative "+" right:additive
{ return {tag: "+", left, right}; } / multiplicative
:root a[href^="http://www.drowle.com/"], :root #header + #content > #left > #rlblock_left, :root #\5f _mom_ad_2, :root a[href^="http://keep2share.cc/pr/"], :root #MAIN.ShowTopic > .ad, :root #\5f _mom_ad_12, :root #center_col > #main > .dfrd > .mnr-c > .c._oc._zs, :root .__y_elastic .__y_item, :root a[href^="http://ul.to/ref/"], :root #\5f _nq__hh[style="display:block!important"], :root a[href^="http://ads.pheedo.com/"], :root a[href^="http://landingpagegenius.com/"], :root .base-page_left-side > #left_ban, :root .inlineNewsletterSubscription + .inlineNewsletterSubscription div[class$="_item"], :root #ads > .dose > .dosesingle, :root a[href^="http://lp.ncdownloader.com/"], :root a[href^="http://www.getyourguide.com/?partner_id="], :root #assetsListings[style="display: block;"], :root a[href^="http://b.bestcompleteusa.info/"], :root #main-content > [style="padding:10px 0 0 0 !important;"], :root a[href*="media-rotate.com"], :root a[href^="https://www.spyoff.com/"], :root #center_col > #\5f Emc, :root .ob_conta