Skip to content

Instantly share code, notes, and snippets.


Will Wright willwright82

View GitHub Profile
willwright82 /
Created Jan 31, 2020
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.




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 /
Created Jul 22, 2019 — forked from noelboss/
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 or and pull or export it to a production server. Or you use a service like to act upon a Web-Hook that's triggered that service.

willwright82 / safari-flicker-fix.css
Created Mar 7, 2019
To fix Safari flickering force GPU acceleration by adding transform translate3d(0,0,0) to your element (via
View safari-flicker-fix.css
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 / mobileCheck.js
Last active Jan 29, 2019
Detects mobile devices — Usage: if ( mobileCheck.ios ) { // Code }
View mobileCheck.js
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 /
Created Dec 12, 2017
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 / getLanguage.js
Created Nov 28, 2017
Get user language based on Locale
View getLanguage.js
// To get the language of your visitor:
var language = window.navigator.userLanguage || window.navigator.language;
willwright82 / randomSHA1.js
Created Oct 26, 2017
Generate a random SHA1 token in browser
View randomSHA1.js
// str byteToHex(uint8 byte)
// converts a single byte to a hex string
function byteToHex(byte) {
return ('0' + byte.toString(16)).slice(-2);
// str generateId(int len);
// len - must be an even number (default: 40)
function generateId(len) {
var arr = new Uint8Array((len || 40) / 2);