Skip to content

Instantly share code, notes, and snippets.

View stephenscaff's full-sized avatar

Stephen Scaff stephenscaff

View GitHub Profile
@stephenscaff
stephenscaff / Local-network-viewing
Created February 14, 2020 20:12
Accessing local node server on computer from another computer or device (like phone). Good for device testing and so on.
# First, Get Ip of the computer running your node server
ifconfig |grep inet
# returns several inet lines. Find your ip on a line like:
# inet 192.161.1.2 netmask ....
# Start node server on whatever port
# ie: port 8080
chmod 700 ~/.ssh
chmod 644 ~/.ssh/authorized_keys
chmod 644 ~/.ssh/known_hosts
chmod 644 ~/.ssh/config
chmod 600 ~/.ssh/id_rsa
chmod 644 ~/.ssh/id_rsa.pub
chmod 600 ~/.ssh/github_rsa
chmod 644 ~/.ssh/github_rsa.pub
chmod 600 ~/.ssh/mozilla_rsa
chmod 644 ~/.ssh/mozilla_rsa.pub
@stephenscaff
stephenscaff / showhidden.bash
Created February 4, 2020 20:21
show hidden files in osx
defaults write com.apple.Finder AppleShowAllFiles true
killall Finder
/**
* Emoji Rotator
*/
const Emoji = (() => {
const emojis = ["😮", "😀", "😁", "😐", "😑", "😬"]
const time = 200;
setInterval(_=>{
document.querySelector('.js-emoji').innerHTML =[
...emojis
@stephenscaff
stephenscaff / gulpfile.js
Created November 21, 2019 22:50
Splitting up Gulpfile tasks example.
const { task, parallel } = require( 'gulp' )
const test = require("./tasks/test")
exports.build = parallel(test.test)
exports.default = exports.build
@stephenscaff
stephenscaff / scrolling-direction.js
Created November 4, 2019 22:25
Detects scroll direction for Header enter and exit animations
/**
* Scroll Direction
* Detects scroll direction for Header enter and exit animations
*/
var ScrollDirection = (function() {
var html = document.querySelector('html');
var appHeader = document.querySelector('.app-header');
var appHeaderHeight = appHeader.clientHeight;
var scrollThrottle = 30;
@stephenscaff
stephenscaff / git-stuff
Created October 26, 2019 11:03
Useful Git stuff
# Remove all tracked files and start over
git rm -r --cached .
git add -A
git commit -am 'Removing ignored files'
@stephenscaff
stephenscaff / free-ip-from-fail2ban.bash
Last active October 2, 2019 12:26
Instructions for freeing an IP from fail2ban jail.
# First, use ip tables to find fail2ban rules
iptables -L -n
# Locate the block ip among the listed refs returned
...
Chain f2b-wordpress-hard (1 references)
target prot opt source destination
REJECT all -- 1.2.3.4.5 0.0.0.0/0 reject-with icmp-port-unreachable
RETURN all -- 0.0.0.0/0 0.0.0.0/0
<css-doodle>
:doodle {
@grid: 15 / 100vmax;
cursor: pointer;
background: #6427a3;
position: absolute;
top: 0;
left: 0;
opacity:0.4;
# npm i Node GYP Erros
npm explore npm -g -- npm install node-gyp@latest
nvm use 10.16.0
# Unhandled rejection Error: EACCES: permission denied
sudo chown -R $USER:$GROUP ~/.npm
sudo chown -R $USER:$GROUP ~/.config