Skip to content

Instantly share code, notes, and snippets.

View alanpcurrie's full-sized avatar

Alan P Currie alanpcurrie

View GitHub Profile
function alphabetPosition(text) {
const alphabetArray = []
text = text.replace(/[^a-zA-Z]/g, "").toLowerCase();
for(let letter of text) {
let number = (letter.charCodeAt() - 96)
alphabetArray.push(number)
}
text = alphabetArray.toString().replace(/,/g , " ");
@alanpcurrie
alanpcurrie / gist:75e6c7b5607d4c407ed6174726f07f1b
Created November 18, 2019 20:28
git rebase - squashing commits
alisas to  - git squash
git fetch
git rebase -i origin/master
choose s - squash
update git messages
git push (combined commits)
!!nb. destructive destroys history!!
repo state git rebase --abortc (return to original)
npx devpun -t javascript | npx cowsay -f vader | npx lolcatjs
@alanpcurrie
alanpcurrie / GitCommitEmoji.md
Last active June 27, 2018 19:32 — forked from parmentf/GitCommitEmoji.md
Git Commit message Emoji
@alanpcurrie
alanpcurrie / index.html
Created December 25, 2017 14:15
JS Fundamentals JavaScript Fundamentals: Objects, Arrays and Functions // source https://jsbin.com/jagaru
<!doctype html>
<html class="no-js" lang="">
<head>
<meta charset="utf-8">
<title>JS Fundamentals</title>
<meta name="description" content="JavaScript Fundamentals: Objects, Arrays and Functions">
</head>
<body>
<div>
<p> This Page is intentionally left blank. Please open the javascript console in your developer tools</p>
@alanpcurrie
alanpcurrie / index.html
Created December 24, 2017 23:48
JS Fundamentals JavaScript Fundamentals: Objects, Arrays and Functions // source https://jsbin.com/jagaru
<!doctype html>
<html class="no-js" lang="">
<head>
<meta charset="utf-8">
<title>JS Fundamentals</title>
<meta name="description" content="JavaScript Fundamentals: Objects, Arrays and Functions">
</head>
<body>
<div>
<p> This Page is intentionally left blank. Please open the javascript console in your developer tools</p>
  • 🎨 when improving the format/structure of the code
  • 🚀 when improving performance
  • ✏️ when writing docs
  • 💡 new idea
  • 🚧 work in progress
  • ➕ when adding feature
  • ➖ when removing feature
  • 🔈 when adding logging
  • 🔇 when reducing logging
  • 🐛 when fixing a bug
// adds blade and PHP to emmet tab
'atom-text-editor[data-grammar="text html php blade"]:not([mini])':
'tab': 'emmet:expand-abbreviation-with-tab'
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Ex1 Operators</title>
</head>
<body>