scripting / sendToSlack.js – a small node.js app that posts to Slack.

A tiny JavaScript app that sends a message to your default Slack channel. Can be customized with a name, icon, emoji or sent to a different channel. Runs in Node.js.


var request = require ("request");
var urlWebHook = "https://hooks.slack.com/services/abcdef"; //the URL you get on your "incoming web hooks" page.
function sendToSlack (s, theUsername, theIconUrl, theIconEmoji, theChannel) {
var payload = {
text: s
};
if (theUsername !== undefined) {
payload.username = theUsername;
}
if (theIconUrl !== undefined) {
payload.icon_url = theIconUrl;
}
if (theIconEmoji !== undefined) {
payload.icon_emoji = theIconEmoji;
}
if (theChannel !== undefined) {
payload.channel = theChannel;
}
var theRequest = {
url: urlWebHook,
method: "POST",
json: payload
};
request (theRequest, function (error, response, body) {
if (!error && (response.statusCode == 200)) {
console.log ("sendToSlack: " + s);
}
else {
console.log ("sendToSlack: error, code == " + response.statusCode + ", " + response.body + ".\n");
}
});
}
sendToSlack ("Hello World");

view raw

sendToSlack.js

hosted with ❤ by GitHub

Windows apps I use regularly

I recently had the opportunity to reinstall Windows 7 on my laptop and figured it was a good time to make a list of the programs and utilities I use regularly on Windows. Most stuff is open source and/or free. There are a few commercial packages that I use a lot that I really like so I’ve included those on the list too. I don’t work in Windows that often, but when I do these are the things I use.

  • Firefox – https://www.mozilla.org/en-US/firefox/
  • Chrome – http://www.google.com/chrome/
  • Classic Shell – http://classicshell.net/
  • Ditto Clipboard Manager – http://ditto-cp.sourceforge.net/
  • Gadwin PrintScreen – http://www.gadwin.com/printscreen/
  • 7 Zip – http://www.7-zip.org/
  • Notepad++ – http://notepad-plus-plus.org/
  • VirtuaWin – http://virtuawin.sourceforge.net/
  • Keepass 2.x – http://keepass.info/
  • Owncloud – http://owncloud.org/
  • Git – https://msysgit.github.io/
  • Putty – http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html
  • Filezilla – https://filezilla-project.org/ (watch for crapware installs)
  • LibreOffice – https://www.libreoffice.org/
  • Bitorrent – http://www.bittorrent.com/bittorrent-free
  • Tweak UI – http://www.thewindowsclub.com/ultimate-windows-tweaker-v2-a-tweak-ui-for-windows-7-vista
  • MySQL Workbench – https://www.mysql.com/products/workbench/
  • CALI Author – http://www.cali.org/content/cali-author-download
  • XAMPP – https://www.apachefriends.org/index.html
  • Skype – http://www.skype.com/
  • Dropbox – http://www.dropbox.com/
  • Komodo – http://komodoide.com/
  • Slack – https://slack.zendesk.com/hc/en-us/articles/201746897-Slack-apps-for-computers-phones-tablets