Skip to content

Instantly share code, notes, and snippets.

View willwright82's full-sized avatar
👾
parsleybox.com

Will Wright willwright82

👾
parsleybox.com
View GitHub Profile
@willwright82
willwright82 / mac-overflow-scroll.css
Created April 4, 2022 14:25
Force display scrollbar on Mac OS using CSS — Source: https://davidwalsh.name/osx-overflow
::-webkit-scrollbar {
-webkit-appearance: none;
width: 7px;
}
::-webkit-scrollbar-thumb {
border-radius: 4px;
background-color: rgba(0, 0, 0, .5);
-webkit-box-shadow: 0 0 1px rgba(255, 255, 255, .5);
}
<!DOCTYPE html>
<html lang="en" class="no-js">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width">
<title>Unique page title - My Site</title>
<script type="module">
document.documentElement.classList.remove('no-js');
@willwright82
willwright82 / ag-search-replace.sh
Created January 31, 2020 15:03
Search and Replace using AG — The Silver Surfer
ag -l "search string" | xargs sed -i '' -e 's/from/to/g'

Project Title

One Paragraph of project description goes here

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.

Prerequisites

Contributing

When contributing to this repository, please first discuss the change you wish to make via issue, email, or any other method with the owners of this repository before making a change.

Please note we have a code of conduct, please follow it in all your interactions with the project.

Pull Request Process

  1. Ensure any install or build dependencies are removed before the end of the layer when doing a
@willwright82
willwright82 / git-deployment.md
Last active March 4, 2022 12:09 — forked from noelboss/git-deployment.md
Simple automated GIT Deployment using Hooks

Simple automated GIT Deployment using GIT Hooks

Here are the simple steps needed to create a deployment from your local GIT repository to a server based on this in-depth tutorial.

How it works

You are developing in a working-copy on your local machine, lets say on the master branch. Most of the time, people would push code to a remote server like github.com or gitlab.com and pull or export it to a production server. Or you use a service like deepl.io to act upon a Web-Hook that's triggered that service.

@willwright82
willwright82 / safari-flicker-fix.css
Created March 7, 2019 14:20
To fix Safari flickering force GPU acceleration by adding transform translate3d(0,0,0) to your element (via https://muffinman.io/ios-safari-scroll-position-fixed/)
/*
If you ever had to fix element on scroll,
you probably had an issue on iOS Safari
(and other mobile devices). Element will
usually flicker, and disappear until scrolling
has stopped completely.
Just force GPU acceleration by adding transform:
translate3d(0,0,0); to your element.
*/
@willwright82
willwright82 / mobileCheck.js
Last active January 29, 2019 15:13
Detects mobile devices — Usage: if ( mobileCheck.ios ) { // Code }
var mobileCheck = {
ios: (function(){
return navigator.userAgent.match(/iPhone|iPad|iPod/i);
}()),
android: (function(){
return navigator.userAgent.match(/Android/i);
}()),
blackBerry: (function(){
return navigator.userAgent.match(/BB10|Tablet|Mobile/i);
}()),
@willwright82
willwright82 / chmod.sh
Created December 12, 2017 10:43
Recursive chmod for files or folders
# To recursively give directories read&execute privileges:
chmod 755 $(find /path/to/base/dir -type d)
# To recursively give files read privileges:
chmod 644 $(find /path/to/base/dir -type f)
#Or, to reduce chmod spawning:
find /path/to/base/dir -type d -print0 | xargs -0 chmod 755
find /path/to/base/dir -type f -print0 | xargs -0 chmod 644
@willwright82
willwright82 / getLanguage.js
Created November 28, 2017 10:32
Get user language based on Locale
// To get the language of your visitor:
var language = window.navigator.userLanguage || window.navigator.language;
console.log(language);