Skip to content

Instantly share code, notes, and snippets.

Avatar

Leland Smith lelandsmith

View GitHub Profile
@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
View magento.conf
server {
listen *:8080;
server_name fanatik.redrokk.com www.fanatikbike.com fanatikbike.com;
root /home/production/www.fanatikbike.com/web/webroot/;
##
# redirect to www
##
#if ($host !~* ^www\.) {
# rewrite ^(.*)$ http://www.$host$1 permanent;
View gist:08851e6ddf5c9867a9a4
.modgit/
app/code/community/Phoenix/
app/code/community/Cm/
app/code/core/
app/design/adminhtml/default/default/
app/design/frontend/base/
app/design/frontend/rwd/
app/design/frontend/default/blank/
app/design/frontend/default/default/
app/design/frontend/default/iphone/
View gist:e60de756904c742fdd20
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
# END WordPress
@lelandsmith
lelandsmith / gist:9984514
Created Apr 4, 2014
rails:password_protected_page
View gist:9984514
before_filter :authenticate, :except => [ :index, :show ]
def authenticate
authenticate_or_request_with_http_basic do |name, password|
name == "admin" && password == "secret"
end
end
@lelandsmith
lelandsmith / gist:9538544
Created Mar 13, 2014
HTML: Keep Footer on Bottom
View gist:9538544
<div id="wrap">
<div id="main" class="container clear-top">
<p>Your content here</p>
</div>
</div>
<footer class="footer"></footer>
<style>
html, body {
View .gitignore WP
# This is a template .gitignore file for git-managed WordPress projects.
#
# Fact: you don't want WordPress core files, or your server-specific
# configuration files etc., in your project's repository. You just don't.
#
# Solution: stick this file up your repository root (which it assumes is
# also the WordPress root directory) and add exceptions for any plugins,
# themes, and other directories that should be under version control.
#
# See the comments below for more info on how to add exceptions for your
You can’t perform that action at this time.