Skip to content

Instantly share code, notes, and snippets.

Steve Mc SteveMcArthur

Block or report user

Report or block SteveMcArthur

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@SteveMcArthur
SteveMcArthur / scrape-flags.js
Last active Sep 15, 2016
Scrape and download wikipedia's country flags from http://commons.wikimedia.org/wiki/Sovereign-state_flags (and other pages) using nodejs. Most of Wikipedia's country flags are stored as SVG, so they can be scaled. Their width is stored in the flag's URL, so this can be changed to download whatever size of a flag you'd like.
View scrape-flags.js
/* global require */
/*This is basically a port from php of the gist: https://gist.github.com/nickbuddendotcom/5792710*/
var cheerio = require('cheerio');
var fs = require('fs');
var path = require('path');
var request = require('request');
var pageURL = 'http://commons.wikimedia.org/wiki/Sovereign-state_flags';
//var pageURL = 'https://commons.wikimedia.org/wiki/Flags_of_active_autonomist_and_secessionist_movements';
var outDir = path.resolve("..", 'flags');
@SteveMcArthur
SteveMcArthur / mongo_windows-service.bat
Created Apr 9, 2014
Install mongodb as a windows service
View mongo_windows-service.bat
"C:\MongoDB\bin\mongod.exe" --config "C:\MongoDB\mongod.cfg" --install
::mongod.cfg requires the logpath to be specified otherwise the service will no start
@SteveMcArthur
SteveMcArthur / Scan With Windows Defender.bat
Created Apr 9, 2014
Regedit - add right click context menu
View Scan With Windows Defender.bat
::Create the following batch file and put it in your SendTo folder.
::Will scan both folders or single files and wont close after running
@ECHO OFF
Echo %1
"C:\Program Files\Windows Defender\MpCmdRun.exe" -Scan -ScanType 3 -File %1
PAUSE
@SteveMcArthur
SteveMcArthur / start_mongo.bat
Created Apr 8, 2014
Mongodb - starting up and setting dbpath
View start_mongo.bat
::start mongo db - navigate to location of mongodb\bin and run the mongod exe
mongod
::startup and set db data path
mongod --dbpath F:\mongodb\data
::bat file to do the same without closing after its executed
cmd /k mongod --dbpath F:\mongodb\data
You can’t perform that action at this time.