Skip to content

Instantly share code, notes, and snippets.

View nateluzod's full-sized avatar
🎯
Focusing

Nate Luzod nateluzod

🎯
Focusing
View GitHub Profile
@nateluzod
nateluzod / gist:56de7392cbdcfcffc8be
Created November 14, 2015 01:09
OSX / Create ISO from folder
hdiutil makehybrid -o ~/Desktop/image.iso ~/path/to/folder/to/be/converted -iso -joliet
@nateluzod
nateluzod / scrub_email.py
Last active September 22, 2015 08:18
Mask an email address to show only the first letter of the name and the domain. Could be modified to work the same for credit card numbers.
def scrub_email(email):
""" Takes an email address and masks the left side. test@test.com becomes t***@test.com """
user, domain = email.split('@')
user = user[0].ljust(len(user), "*")
return("{}@{}".format(user, domain))
@nateluzod
nateluzod / gist:d2ce99fe2beb315ec657
Created June 23, 2015 08:13
Import DB with progress bar
pv mydump.sql.gz | gunzip | mysql -u root -p dbname
@nateluzod
nateluzod / gist:62e15031f2a65123ae7d
Last active September 7, 2016 17:59
Remove wp-content/uploads from git history
git filter-branch --index-filter "git rm -rf --cached --ignore-unmatch wp-content/uploads" HEAD
@nateluzod
nateluzod / gist:ef65f98e4d5d7e1a8ee1
Created August 24, 2014 10:21
Get public ssh key
pbcopy < ~/.ssh/id_rsa.pub
@nateluzod
nateluzod / gist:9263873
Created February 28, 2014 02:15
Gulp Install Base
npm install --save-dev gulp gulp-util gulp-uglify gulp-watch gulp-concat gulp-notify gulp-livereload gulp-ruby-sass
@nateluzod
nateluzod / gist:8048808
Created December 20, 2013 00:52
Installing MySQL via brew install, if errors on start
$ mkdir -p ~/Library/LaunchAgents
$ ln -sfv /usr/local/opt/mysql/*.plist ~/Library/LaunchAgents
$ launchctl load -w ~/Library/LaunchAgents/homebrew.mxcl.mysql.plist
$ mysql.server start
@nateluzod
nateluzod / gist:6543384
Created September 12, 2013 20:36
JS for mobile scaling
if (navigator.userAgent.match(/iPhone/i) || navigator.userAgent.match(/iPad/i)) {
var viewportmeta = document.querySelector('meta[name="viewport"]');
if (viewportmeta) {
viewportmeta.content = 'width=device-width, minimum-scale=1.0, maximum-scale=1.0, initial-scale=1.0';
document.body.addEventListener('gesturestart', function () {
viewportmeta.content = 'width=device-width, minimum-scale=0.25, maximum-scale=1.6';
}, false);
}
}
@nateluzod
nateluzod / gist:4645975
Created January 27, 2013 02:49
Show or hide things from users in admin panel in WordPress. Place in functions.php of your theme.
function remove_menus () {
global $menu;
$restricted = array(
// __('Dashboard'),
__('Posts'),
// __('Media'),
// __('Links'),
// __('Pages'),
// __('Appearance'),
// __('Tools'),
@nateluzod
nateluzod / gist:4645900
Last active December 11, 2015 18:59
Create custom post type in WordPress. This needs to go in the functions.php of your theme file.
add_action( 'init', 'create_type' );
function create_type() {
register_post_type( 'type',
array(
'labels' => array(
'name' => __( 'Types' ),
'singular_name' => __( 'Type' )
),
'public' => true,
'has_archive' => true,