This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sudo visudo | |
# At the bottom of the file, add the following: | |
username ALL=(ALL) NOPASSWD: ALL |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
find "$1" -depth -print0 | while IFS= read -r -d '' file; do | |
d="$( dirname "$file" )" | |
f="$( basename "$file" )" | |
new=$(sed "s/[<>:;\"/\\|?*]/-/g" <<< "$f") | |
if [ "$f" != "$new" ]; then | |
if [ -e "$d/$new" ]; then | |
echo "Notice: \"$new\" and \"$f\" both exist in "$d":" | |
ls -ld "$d/$new" "$d/$f" | |
else |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Heading styles | |
@each $size, $headers in $header-styles { | |
@include breakpoint($size) { | |
@each $header, $header-defs in $headers { | |
$font-size-temp: 1rem; | |
.#{$header} { | |
@if map-has-key($header-defs, font-size) { | |
$font-size-temp: rem-calc(map-get($header-defs, font-size)); | |
font-size: $font-size-temp; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
wget -nd -H -p -A jpg,jpeg,png,gif -e robots=off http://sitetoscrape.com/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Will create backup file (e.g. file1.txt.bak) | |
sed -i.bak 's/oldword/newword/' file1.txt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Open mysql launch file | |
vim ~/Library/LaunchAgents/homebrew.mxcl.mariadb.plist | |
And change this line: | |
`--bind-address=127.0.0.1` | |
to: | |
`--bind-address=0.0.0.0` | |
# And finally reload MySQL |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Instructions | |
## Save this file to the root of where your projects are stored | |
## cd to the projects root directory and run chmod +x _timelog.sh | |
## Change Michael Bonner to your name as it's set in your git config | |
# | |
AUTHOR="Michael Bonner" | |
ONE_MONTH_AGO=`date -j -v-1m` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function maybe_start_session(){ | |
if( php_sapi_name() == 'cli' ) return; | |
if( version_compare( phpversion(), '5.4.0', '>=' ) ) { | |
if( session_status() != PHP_SESSION_ACTIVE ) session_start(); | |
} else { | |
if( session_id() === '' ) session_start(); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Key: | |
## {YOUR_USER_NAME} replace with the user you log in to the system as | |
## {APPLICATION_DIRECTORY} : replace with the project directory name | |
# Installing bindfs (just the first time) | |
$ sudo apt-get update | |
$ sudo apt-get -y install bindfs | |
# Creating the application mountpoint | |
$ mkdir -p /home/{YOUR_USER_NAME}/sites/{APPLICATION_DIRECTORY} |