Skip to content

Instantly share code, notes, and snippets.

nate daily nzajt

Block or report user

Report or block nzajt

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@nzajt
nzajt / speed_test_two_fer.rb
Last active Aug 20, 2018
Testing if a module or class is faster when only using one method. requires gem 'benchmark-ips' from https://github.com/evanphx/benchmark-ips
View speed_test_two_fer.rb
require 'benchmark/ips'
# test for modules
module TwoFer
# Takes name or no name and returns statement
def self.two_fer(name = 'you')
"One for #{name}, one for me."
end
end
View nginx-installer.sh
echo "Started"
brew tap homebrew/dupes
brew tap homebrew/versions
brew tap homebrew/homebrew-php
brew update
brew install --without-apache --with-fpm --with-mysql --whith-mcrypt php55
brew install nginx mariadb
echo "done"
@nzajt
nzajt / magenot-host.conf
Created Jul 2, 2014
Magento Nginx host file
View magenot-host.conf
server {
listen 80 default;
listen 443 ssl;
ssl_certificate PATHTOSSL.crt;
ssl_certificate_key PATHTOSSL.key;
server_name www.SITEURL.com *.SITEURL.com; ## Domain is here twice so server_name_in_redirect will favour the www
root PATH TO MAGENTO ROOT;
autoindex off;
@nzajt
nzajt / nginx.conf
Last active Aug 29, 2015
nginx.conf for osx
View nginx.conf
worker_processes 4;
events {
worker_connections 1024;
multi_accept on;
}
http {
default_type application/octet-stream;
include /usr/local/etc/nginx/mime.types;
@nzajt
nzajt / gist:cfe7c5514ed662adda4b
Last active Feb 2, 2016
Magento on osx Mavricks with nginx, php-fmp
View gist:cfe7c5514ed662adda4b

#Magento on osx Mavricks with nginx, php-fmp

##Step 1

###Make sure that brew is up to date and installed.

If you do not have home brew installed, go to the link below and install it.

@nzajt
nzajt / livereloadmagento
Last active Aug 29, 2015
A Live sample of guard live reload for magento
View livereloadmagento
# A sample Magento Guardfile
# More info at https://github.com/guard/guard#readme
guard 'livereload' do
watch(%r{magento/app/design/frontend/netmedia/lgl2014/template/.+\.(phtml)$})
watch(%r{magento/app/design/frontend/netmedia/lgl2014/layout/.+\.(xml)$})
watch(%r{magento/app/code/local/.+\.php})
watch(%r{magento/skin/frontend/netmedia/lgl2014/.+\.(css|js)})
watch(%r{magento/js/.+\.js})
end
@nzajt
nzajt / Vimrc
Created May 2, 2014
My Vimrc File
View Vimrc
filetype off
call pathogen#incubate()
filetype plugin indent on
set encoding=utf-8
" Maps
nmap nt :NERDTreeToggle<return>
nmap Nt :NERDTreeToggle<return>
imap <c-w> <esc>:w<return>
nmap <silent> cs /asdfasdfasdf<return>i
nmap ww <c-w><c-w>
View php-newrelicapp.sh
wget -O - http://download.newrelic.com/548C16BF.gpg | sudo apt-key add -;
sudo sh -c 'echo "deb http://apt.newrelic.com/debian/ newrelic non-free" > /etc/apt/sources.list.d/newrelic.list';
sudo apt-get update
sudo apt-get -y install newrelic-php5
sudo newrelic-install install
View NERDTree.mkd

NERDTree

o.......Open files, directories and bookmarks....................|NERDTree-o|
go......Open selected file, but leave cursor in the NERDTree.....|NERDTree-go|
t.......Open selected node/bookmark in a new tab.................|NERDTree-t|
T.......Same as 't' but keep the focus on the current tab........|NERDTree-T|
i.......Open selected file in a split window.....................|NERDTree-i|
gi......Same as i, but leave the cursor on the NERDTree..........|NERDTree-gi|
s.......Open selected file in a new vsplit.......................|NERDTree-s|
gs......Same as s, but leave the cursor on the NERDTree..........|NERDTree-gs|
O.......Recursively open the selected directory..................|NERDTree-O|
@nzajt
nzajt / gist:8466723
Created Jan 17, 2014
Ubuntu vsftpd.conf -- For Passive ftp. Good for them Gui Clients.
View gist:8466723
# Example config file /etc/vsftpd.conf
#
# The default compiled in settings are fairly paranoid. This sample file
# loosens things up a bit, to make the ftp daemon more usable.
# Please see vsftpd.conf.5 for all compiled in defaults.
#
# READ THIS: This example file is NOT an exhaustive list of vsftpd options.
# Please read the vsftpd.conf.5 manual page to get a full idea of vsftpd's
# capabilities.
#
You can’t perform that action at this time.