Skip to content

Instantly share code, notes, and snippets.

View mcansh's full-sized avatar
🤠

Logan McAnsh mcansh

🤠
View GitHub Profile
@mcansh
mcansh / iNoBounce.js
Last active May 26, 2017 19:10
iNoBounce as an es6 module
function iNoBounce() {
let startY = 0;
const enabled = false;
const handleTouchMove = (e) => {
let el = e.target;
while (el !== document.body) {
const style = window.getComputedStyle(el);
if (!style) {
@mcansh
mcansh / toTitleCase.js
Last active May 31, 2017 20:09
Converts a String to Titlecase.
function toTitleCase(string) {
if (!string) {
return 'no string was found';
}
let newString = string;
const lowers = ['A', 'An', 'The', 'And', 'But', 'Or', 'For', 'Nor', 'As', 'At', 'By', 'For', 'From', 'In', 'Into', 'Near', 'Of', 'On', 'Onto', 'To', 'With'];
const uppers = ['TV'];
newString = newString.replace(/([^\W_]+[^\s-]*) */g, (txt) => {
return `${txt.charAt(0).toUpperCase()}${txt.substr(1).toLowerCase()}`;
});
@mcansh
mcansh / slackmoji
Last active April 7, 2017 20:36
resize image for slack emojis
alias slackmoji="sips -Z 128 $1"

Keybase proof

I hereby claim:

  • I am mcansh on github.
  • I am loganmcansh (https://keybase.io/loganmcansh) on keybase.
  • I have a public key whose fingerprint is ADE4 9096 BA29 0737 ED87 D1FC 29FD FABF F3C4 3C79

To claim this, I am signing this object: