Skip to content

Instantly share code, notes, and snippets.

View lelandsmith's full-sized avatar

Leland Smith lelandsmith

View GitHub Profile
@lelandsmith
lelandsmith / gist:7403821366fa129fb96310eb8e6d05db
Created September 1, 2016 20:37
Next Previous Post Links
<div class="row">
<div class="col-md-12">
<span class="pull-right">
<?php next_post_link(); ?>
</span>
<span class="pull-left">
<?php previous_post_link(); ?>
</span>
@lelandsmith
lelandsmith / 0_reuse_code.js
Last active August 29, 2015 14:22
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
#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/
# Don't include any temporary files and other unimportant things
*.log
*.bak
*.bak.*
*.thumbs/
.DS_Store
Thumbs.db
.svn
*.swp
apt-get update
apt-get upgrade
apt-get install mysql-server
mysql_secure_installation
apt-get install nginx
apt-get install git-core
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;
.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/
@lelandsmith
lelandsmith / gist:e60de756904c742fdd20
Created October 30, 2014 23:17
Wordpress Htaccess
# 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 April 4, 2014 22:44
rails:password_protected_page
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 March 13, 2014 22:34
HTML: Keep Footer on Bottom
<div id="wrap">
<div id="main" class="container clear-top">
<p>Your content here</p>
</div>
</div>
<footer class="footer"></footer>
<style>
html, body {