(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
| // Lists of countries with ISO 3166 codes, presented in various formats. | |
| // Last Updated: July 30, 2020 | |
| // If you're using PHP, I suggest checking out: | |
| // https://github.com/thephpleague/iso3166 | |
| // or Laravel: https://github.com/squirephp/squire | |
| // | |
| // JS developers can check out: | |
| // https://www.npmjs.com/package/iso3166-2-db | |
| // |
| # unregister broken GHC packages. Run this a few times to resolve dependency rot in installed packages. | |
| # ghc-pkg-clean -f cabal/dev/packages*.conf also works. | |
| function ghc-pkg-clean() { | |
| for p in `ghc-pkg check $* 2>&1 | grep problems | awk '{print $6}' | sed -e 's/:$//'` | |
| do | |
| echo unregistering $p; ghc-pkg $* unregister $p | |
| done | |
| } | |
| # remove all installed GHC/cabal packages, leaving ~/.cabal binaries and docs in place. |
| import itertools | |
| import requests, lxml, lxml.html | |
| import json | |
| # 7603 Hard Drives | |
| # 7611 RAM | |
| # 6642 random store | |
| def newegg_stores_req(): | |
| r = requests.api.get('http://www.ows.newegg.com/Stores.egg/Menus') | |
| return [store['StoreID'] for store in json.loads(r.content)] |
(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
| var cheerio = require('cheerio'); | |
| var Crawler = require('simplecrawler'); | |
| var initialTopic = 'SpaceX'; | |
| var blacklist = ["#", "/w/", "/static/", "/api/", "/beacon/", "File:", | |
| "Wikipedia:", "Template:", "MediaWiki:", "Help:", "Special:", | |
| "Category:", "Portal:", "Main_Page", "Talk:", "User:", | |
| "User_talk:", "Template_talk:", "Module:"]; //useless special cases from wikipedia | |
| var url = '/wiki/' + initialTopic; |
| x(url, { | |
| poster: '.image img@src', | |
| videoLink: x('#player@src', 'body script'), | |
| }) | |
| (function (err, obj) { | |
| if (err) { | |
| console.log(err); | |
| } |