Skip to content

Instantly share code, notes, and snippets.

View pauljacobson's full-sized avatar
:octocat:

Paul Jacobson pauljacobson

:octocat:
View GitHub Profile
Verifying that +pauljacobson is my blockchain ID. https://onename.com/pauljacobson
Would you like to use emoji on your iPad or iPhone? Your device has an emoji keyboard that you need to activate to use emoji on your device. Here are three simple steps you can follow to add the emoji keyboard:
<h3>Step 1:</h3>
Open your ``Settings`` panel and select the ``General`` tab. Look for the ``International`` menu item and tap that.
<a title="View 'http://farm8.staticflickr.com/7097/7285178314_a8b3fb84c2_z.jpg' on Flickr.com" href="http://www.flickr.com/photos/73753110@N00/7285178314"><img style="display: block; margin-left: auto; margin-right: auto;" title="http://farm8.staticflickr.com/7097/7285178314_a8b3fb84c2_z.jpg" src="http://farm8.staticflickr.com/7097/7285178314_a8b3fb84c2_z.jpg" alt="http://farm8.staticflickr.com/7097/7285178314_a8b3fb84c2_z.jpg" width="640" height="480" border="0" /></a>
<h3>Step 2:</h3>
In the ``International window``, select the ``Keyboards`` option to view your current keyboards.
@pauljacobson
pauljacobson / array_iteration_thoughts.md
Created September 13, 2017 09:16 — forked from ljharb/array_iteration_thoughts.md
Array iteration methods summarized

While attempting to explain JavaScript's reduce method on arrays, conceptually, I came up with the following - hopefully it's helpful; happy to tweak it if anyone has suggestions.

Intro

JavaScript Arrays have lots of built in methods on their prototype. Some of them mutate - ie, they change the underlying array in-place. Luckily, most of them do not - they instead return an entirely distinct array. Since arrays are conceptually a contiguous list of items, it helps code clarity and maintainability a lot to be able to operate on them in a "functional" way. (I'll also insist on referring to an array as a "list" - although in some languages, List is a native data type, in JS and this post, I'm referring to the concept. Everywhere I use the word "list" you can assume I'm talking about a JS Array) This means, to perform a single operation on the list as a whole ("atomically"), and to return a new list - thus making it much simpler to think about both the old list and the new one, what they contain, and

@pauljacobson
pauljacobson / A Real-Time Date-Time Script in JavaScript (ES6)
Last active October 22, 2017 10:02
Sharing code for a JavaScript script that displays a real-time date-time field that updates automatically, without a browser refresh.
// The purpose of this block is to list the month names which will correspond with the
// corresponding numerical value of the particular month that is other derived from
// the getDate() method.
Date.prototype.monthName = function() {
const monthsOfYear = ['January', 'February', 'March', 'April', 'May', 'June',
'July', 'August', 'September', 'October', 'November', 'December'];
return monthsOfYear[this.getMonth()];
}
@pauljacobson
pauljacobson / A Real-Time Date-Time Script in JavaScript (ES6) - variation
Created October 25, 2017 08:29
This is a variation on my previous Real-Time Date-Time script
Date.prototype.dayName = function() {
const today = ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'];
return today[this.getDay()];
}
function time() {
const now = new Date().toLocaleTimeString('en-GB');
const dateNow = new Date().toLocaleDateString('en-GB', {year: 'numeric', month: 'long', day: 'numeric'});
const todayNow = new Date().dayName();
document.querySelector('.clock').innerHTML = `<p>Today is ${todayNow}, ${dateNow}. The current time is ${now}.</p>`;
@pauljacobson
pauljacobson / package.json build scripts
Created November 7, 2017 12:51
I've been working on npm build scripts to support my web development projects and finally came up with a series of scripts that cover my basic build requirements. This is a test file that I created. It isn't the most elegant set of scripts (or particularly feature-rich) but they're a start.
{
"name": "css-node_imports",
"version": "1.0.0",
"description": "",
"main": "index.html",
"scripts": {
"build": "npm run-script clean && npm run-script css && npm run-script files && npm run-script js",
"clean": "trash dist/**",
"postclean": "mkdir dist/ && mkdir dist/assets/",
"precss": "mkdir dist/assets/styles/",
@pauljacobson
pauljacobson / Table_template
Last active January 29, 2018 10:56
A basic table layout
<p>Table</p>
<table>
<colgroup>
<col/>
<col/>
</colgroup>
<tbody>
<tr>
@pauljacobson
pauljacobson / VSCode_MAiO_extension_logs
Created June 8, 2018 16:44
Error logs from VS Code when doing text expansion, with Markdown All in One enabled
/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/workbench.main.js:1311 ERR Invalid array length: RangeError: Invalid array length
at /Users/pauljacobson/.vscode/extensions/yzhang.markdown-all-in-one-1.4.0/out/src/toc.js:68:21
at Generator.next (<anonymous>)
at fulfilled (/Users/pauljacobson/.vscode/extensions/yzhang.markdown-all-in-one-1.4.0/out/src/toc.js:4:58)
at <anonymous>
/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/workbench.main.js:1311 WARN Error: listener failed
at file:///Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/workbench.main.js:3419:135
at Object.g [as _notify] (file:///Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/workbench.main.js:149:807)
at Object.enter (file:///Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/workbench.main.js:153:85)
@pauljacobson
pauljacobson / Python_file_rename.py
Created November 4, 2018 06:04
Rename files with Python
from pathlib import Path
for file in Path(".").glob("*.1"):
name, ext, _ = file.name.split(".") # There were no other .'s in the names
file.rename(f"{name}.sld{ext}")
# From https://dev.to/rpalo/automating-simple-things-with-python-is-awesome-3jlg
@pauljacobson
pauljacobson / keybase.md
Created December 14, 2019 07:33
Keybase authentication

Keybase proof

I hereby claim:

  • I am pauljacobson on github.
  • I am pauljacobson (https://keybase.io/pauljacobson) on keybase.
  • I have a public key whose fingerprint is B767 1A40 637B 27BF 53A3 B910 D424 1DB0 D2D6 AA5C

To claim this, I am signing this object: