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:
I hereby claim:
To claim this, I am signing this object:
alias slackmoji="sips -Z 128 $1" |
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()}`; | |
}); |
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) { |
let xDown = null; | |
let yDown = null; | |
function handleTouchStart(e) { | |
xDown = e.touches[0].clientX; | |
yDown = e.touches[0].clientY; | |
} | |
function handleTouchMove(e) { | |
if (!xDown || !yDown) { |
# add this to your `~/.bashrc` or `.zshrc` file | |
# clone repo, cd into it, fork it on github (if its a github repo), and open it in atom | |
# requires https://hub.github.com for forking and cloning (user/repos) | |
alias cloneOpen='f() { | |
urls=('github.com' 'bitbucket.org' 'gitlab.com') | |
url=$1 | |
for i in "${urls[@]}" | |
do | |
if [[ $url =~ $i ]] |
console.image = (url, scale = 1) => { | |
if (!url) return; | |
const img = new Image(); | |
img.onload = function () { | |
// way easier to see whats going on when its an array of styles | |
const styles = [ | |
`background: url("${url}")`, | |
`background-size: ${(this.width * this.scale)}px ${(this.height * this.scale)}px`, |
// copy a string | |
function copyToClipboard(string) { | |
const input = document.createElement('input') | |
input.type = 'text'; | |
input.value = string; | |
document.body.appendChild(input); | |
input.select(); | |
document.execCommand('copy'); | |
input.remove(); | |
} |
import React, { Component } from 'react'; | |
import PropTypes from 'prop-types'; | |
import styled from 'styled-components'; | |
const Image = styled.img` | |
height: 100%; | |
width: 100%; | |
${props => (props.loading ? 'filter: blur(10px)' : '')}; | |
${props => (props.loading ? 'transform: scale(1.03);' : '')}; | |
${props => (props.loading ? 'overflow: hidden' : '')}; |