Skip to content

Instantly share code, notes, and snippets.

View spences10's full-sized avatar
💭
SvelteKit is bae!

Scott Spence spences10

💭
SvelteKit is bae!
View GitHub Profile
@spences10
spences10 / script.md
Last active April 26, 2018 11:28
Install fish shell on CentOS via Vagrant

Install fish and oh my fish on CentOS

If you haven't updated to the latest version of git take a look at this SO post on [installing Git on CentOS] also take a look at the [full post here] for installing fish on other OS'

# switch back with 'su - vagrant' or preferred user when needed
sudo -i
cd /etc/yum.repos.d/
# install wget
yum -y install wget
@spences10
spences10 / script.md
Created April 26, 2018 09:12
Install fish shell on CentOS via Vagrant

Install fish and oh my fish on CentOS

If you haven't updated to the latest version of git take a look at this SO post on [installing Git on CentOS]

# switch back with 'su - vagrant' or preferred user when needed
sudo -i
cd /etc/yum.repos.d/
# for CentOS 7
wget http://download.opensuse.org/repositories/shells:fish:release:2/CentOS_7/shells:fish:release:2.repo
export const Button = styled.button`
font-size: 1rem;
border-radius: 5px;
padding: 0.25rem 1rem;
margin: 0 1rem;
background: transparent;
color: ${props => props.theme.primary};
border: 2px solid ${props => props.theme.primary};
${props =>
@spences10
spences10 / slugIt.js
Last active March 30, 2018 12:44
Slug helper!
export const slugIt = text => {
if (!text) return
return text
.toString()
.toLowerCase()
.replace(/\s+/g, '-') // Replace spaces with -
.replace(/[^\w\-]+/g, '') // Remove all non-word chars
.replace(/\-\-+/g, '-') // Replace multiple - with single -
.replace(/^-+/, '') // Trim - from start of text
.replace(/-+$/, '') // Trim - from end of text
@spences10
spences10 / README.md
Last active March 22, 2018 17:16
Readme pattern

README pattern

Optimal README layout from Kent Dodds [source]:

  1. Title + tagline + logo?
  2. Badges
  3. The problem
  4. The solution
  5. TOC
  6. Installation
@spences10
spences10 / fontFace.js
Last active March 2, 2018 18:35
styled-components helper function
// credit: https://github.com/styled-components/styled-components/issues/233#issuecomment-292602734
export function fontFace(name, src, fontWeight = 'normal', fontStyle = 'normal'){
return `
@font-face{
font-family: "${name}";
src: url(${require('../../public/fonts/' + src + '.eot')});
src: url(${require('../../public/fonts/' + src + '.eot')}?#iefix) format("embedded-opentype"),
url(${require('../../public/fonts/' + src + '.woff')}) format("woff"),
const originalArray = [1, 2, 3];
const newArray = originalArray.map(item => item * 2);
console.log(newArray);
@spences10
spences10 / uniqueFromArray.js
Created November 11, 2017 08:18
Unique items from array
const arr = [1,2,2,3,3,3,4,5,6,6,6,7,7,8]
const uniqueArray = [...new Set(arr)]
console.log(uniqueArray)
@spences10
spences10 / oi_dictionary.js
Last active November 7, 2017 18:18
Office ipsum dictionary
const dictionary = {
words: [
`accountable talk`,
`action item`,
`after I ran into Helen at a restaurant, I realized she was just office pretty`,
`anti-pattern`,
`are there any leftovers in the kitchen?`,
`are we in agreeance`,
`at the end of the day`,
`back of the net`,
@spences10
spences10 / listOutFollowers.js
Created October 7, 2017 06:01
List Twitter user account followers
const Twit = require('twit')
const config = require('./config')
const bot = new Twit(config)
const listOutFollowers = userName => {
bot.get(
'followers/ids',
{
screen_name: userName,