Skip to content

Instantly share code, notes, and snippets.

View xhy279's full-sized avatar
🎯
Focusing

Jeremy xhy279

🎯
Focusing
  • N/A
View GitHub Profile
var list = [{ x: 1, y: 2 }, { x: 3, y: 4 }, { x: 5, y: 6 }, { x: 1, y: 2 }];
var uniq = new Set(list.map(e => JSON.stringify(e)));
var res = Array.from(uniq).map(e => JSON.parse(e));
document.write(JSON.stringify(res));
@xhy279
xhy279 / deepcopy in python
Created July 29, 2017 02:14
deepcopy in python
http://www.python-course.eu/deep_copy.php
@xhy279
xhy279 / subtract days from date
Created July 20, 2017 15:07
subtract days from date
https://stackoverflow.com/questions/1296358/subtract-days-from-a-date-in-javascript
@xhy279
xhy279 / date sorting
Created July 17, 2017 16:02
date sorting
https://stackoverflow.com/questions/10123953/sort-javascript-object-array-by-date/10124053
@xhy279
xhy279 / Javascript module pattern
Created June 22, 2017 20:31
Javascript module pattern
https://toddmotto.com/mastering-the-module-pattern/
@xhy279
xhy279 / websocket
Last active September 6, 2017 14:12
websocket
http://www.ruanyifeng.com/blog/2017/05/websocket.html
We couldn’t find that file to show.