Event details: https://www.meetup.com/East-Troy-Computer-Club/events/277017910/
This file contains 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
/** | |
* Capture a screenshot of a given URL | |
* | |
* USAGE: $ node ./capture_screenshot.js my-page-slug 34sdg-252gsg-23dsg-2234 https://mysite.com/my-page-slug/ | |
* | |
*/ | |
const puppeteer = require("puppeteer"); | |
let pageSlug = process.argv[2]; |
This file contains 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
const getserial = () => { | |
const fs = require('fs'); | |
const content = fs.readFileSync('/proc/cpuinfo', 'utf8'); | |
const cont_array = content.split("\n"); | |
const serial_line = cont_array[cont_array.length-2]; | |
const serial = serial_line.split(":"); | |
return serial[1].slice(1); | |
} |
This file contains 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
{ | |
"editor.fontFamily": "OperatorMonoLig-Book", | |
"editor.fontLigatures": true, | |
"files.eol": "\n", | |
"workbench.colorTheme": "One Dark Pro", | |
"breadcrumbs.enabled": false, | |
"editor.suggestSelection": "first", | |
"vsintellicode.modify.editor.suggestSelection": "automaticallyOverrodeDefaultValue", | |
"indentRainbow.tabmixColor": "rgba(128,32,96,0.2)", | |
"workbench.tree.indent": 20, |
This file contains 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
#!/usr/bin/python | |
"""Simple HTTP Server. | |
This module builds on BaseHTTPServer by implementing the standard GET | |
and HEAD requests in a fairly straightforward manner. | |
""" | |
__version__ = "0.6" |
This file contains 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
{ | |
"editor.fontFamily": "OperatorMonoLig-Book", | |
"editor.fontLigatures": true, | |
"eslint.autoFixOnSave": true, | |
"files.eol": "\n", | |
"workbench.colorTheme": "One Dark Pro", | |
"breadcrumbs.enabled": false, | |
"editor.suggestSelection": "first", | |
"vsintellicode.modify.editor.suggestSelection": "automaticallyOverrodeDefaultValue", | |
"indentRainbow.tabmixColor": "rgba(128,32,96,0.2)", |
This file contains 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
#!/usr/bin/python | |
"""Simple HTTP Server. | |
This module builds on BaseHTTPServer by implementing the standard GET | |
and HEAD requests in a fairly straightforward manner. | |
""" | |
__version__ = "0.6" |
This file contains 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
/** | |
* String.capitalize - Capitalize the first character of a string. | |
* | |
* Example: | |
* const foo = "this is a headline" | |
* foo.capitalize() | |
* This is a headline | |
*/ | |
String.prototype.capitalize = function() { | |
return this.charAt(0).toUpperCase() + this.slice(1); |
This file contains 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
/** | |
* Find the average color of an image | |
* | |
* USAGE: getAvgColorOfImg('<url to image file>') | |
*/ | |
getAvgColorOfImg = (u,i = new Image) => { | |
i.crossOrigin = ''; | |
i.src = u; | |
i.onload = e => { | |
x = (c = document.createElement('canvas')).getContext('2d'); |
This file contains 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
const chokidar = require('chokidar'); | |
// Initialize watcher. | |
const watcher = chokidar.watch('/Users/kea1080/Documents/nmdiary', { | |
ignored: /(^|[\/\\])\../, // ignore dotfiles | |
persistent: true | |
}); | |
// Something to use when events are received. | |
const log = console.log.bind(console); |
NewerOlder