Skip to content

Instantly share code, notes, and snippets.

View nzajt's full-sized avatar

nate daily nzajt

View GitHub Profile
@nzajt
nzajt / speed_test_two_fer.rb
Last active August 20, 2018 23:21
Testing if a module or class is faster when only using one method. requires gem 'benchmark-ips' from https://github.com/evanphx/benchmark-ips
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
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 July 2, 2014 22:03
Magento Nginx host file
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 August 29, 2015 14:03
nginx.conf for osx
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 February 2, 2016 08:35
Magento on osx Mavricks with nginx, php-fmp

#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 August 29, 2015 14:03
A Live sample of guard live reload for magento
# 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 23:14
My Vimrc File
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>
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
@nzajt
nzajt / NERDTree.mkd
Last active August 29, 2015 13:56 — forked from m3nd3s/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 January 17, 2014 01:12
Ubuntu vsftpd.conf -- For Passive ftp. Good for them Gui Clients.
# 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.
#