Skip to content

Instantly share code, notes, and snippets.

Avatar

Leland Smith lelandsmith

View GitHub Profile
@lelandsmith
lelandsmith / README.md
Created Sep 25, 2018 — forked from hofmannsven/README.md
Virtual Hosts with MAMP on OS X
View README.md

Virtual Hosts

Update the hosts file in /etc/hosts to maintain multiple domains/hostnames on a local machine for 127.0.0.1 and setup a VirtualHost container in /Applications/MAMP/conf/apache/extra/httpd-vhost.conf via /Applications/MAMP/conf/apache/httpd.conf for a name-based virtual host.

Only suitable for MAMP users under OS X Lion, OS X Mountain Lion, and OS X Mavericks on Apache-Port 80 and MySQL-Port 3306.

@lelandsmith
lelandsmith / wp-config.php
Created Sep 25, 2018 — forked from ifamily/wp-config.php
A universal WordPress wp-config.php which works on local development to staging and production server environments.
View wp-config.php
<?php
/*
One wp-config for local development to staging to production.
*/
// Define Environments
$environments = array(
View Custom Trigger Event
/* place inside function */
jQuery.event.trigger('OverlayBoxonOpen');
/* call custom event */
$(document).bind('OverlayBoxonOpen', function () { alert('test') });
@lelandsmith
lelandsmith / README.md
Created Feb 16, 2018 — forked from joyrexus/README.md
Vanilla JS equivalents of jQuery methods
View README.md

Sans jQuery

Events

// jQuery
$(document).ready(function() {
  // code
})
@lelandsmith
lelandsmith / app.js
Last active Feb 16, 2018 — forked from sogko/app.js
gulp + expressjs + nodemon + browser-sync
View app.js
'use strict';
// simple express server
var express = require('express');
var app = express();
var router = express.Router();
app.use(express.static('public'));
app.get('/', function(req, res) {
res.sendfile('./public/index.html');
View Wordpress Localhost FTP Connection Information.md

Bypass Wordpress Localhost FTP Connection Information

Do chown / chmod wordpress folder:

    $ sudo chown -R :_www wordpress
    $ sudo chmod -R g+w wordpress

Add the following line into wp-config.php:

@lelandsmith
lelandsmith / 0_reuse_code.js
Last active Aug 29, 2015
Here are some things you can do with Gists in GistBox.
View 0_reuse_code.js
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
View .htaccess
#301 Redirects for .htaccess
#Redirect a single page:
Redirect 301 /pagename.php http://www.domain.com/pagename.html
#Redirect an entire site:
Redirect 301 / http://www.domain.com/
#Redirect an entire site to a sub folder
Redirect 301 / http://www.domain.com/subfolder/
View .gitignore
# Don't include any temporary files and other unimportant things
*.log
*.bak
*.bak.*
*.thumbs/
.DS_Store
Thumbs.db
.svn
*.swp
View magento-setup.steps
apt-get update
apt-get upgrade
apt-get install mysql-server
mysql_secure_installation
apt-get install nginx
apt-get install git-core
You can’t perform that action at this time.