Skip to content

Instantly share code, notes, and snippets.

@adamthebig
adamthebig / .htaccess
Last active August 29, 2015 14:13
Default .htaccess file for all ExpressionEngine sites
RewriteEngine On
RewriteBase /
RewriteCond $1 !\.(gif|jpe?g|png|pdf)$ [NC]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /index.php?/$1 [L]
# Prevent file access
RedirectMatch 403 ^/test
@adamthebig
adamthebig / .editorconfig
Last active August 29, 2015 14:13
Default .editorconfig
# EditorConfig helps developers define and maintain consistent
# coding styles between different editors and IDEs
# editorconfig.org
root = true
[*]
indent_style = space
indent_size = 4
end_of_line = lf
@adamthebig
adamthebig / using-git.md
Last active August 29, 2015 14:13 — forked from hofmannsven/README.md
Using Git
@adamthebig
adamthebig / .ee-bootstrap-pagination
Last active October 9, 2019 06:48
ExpressionEngine Pagination with Bootstrap 3
{paginate}
{pagination_links}
<ul class="pagination">
{first_page}
<li><a href="{pagination_url}" aria-label="Previous"><span aria-hidden="true">&laquo;</span></a></li>
{/first_page}
{page}
<li{if current_page} class="active"{/if}><a href="{pagination_url}">{pagination_page_number}</a></li>
{/page}
{last_page}
@adamthebig
adamthebig / gist:fdb4179e42e61354a71c
Last active August 29, 2015 14:13
.htaccess force HTTPS
RewriteEngine On
RewriteCond %{HTTPS} !=on
RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
@adamthebig
adamthebig / ee-copyright
Last active August 29, 2015 14:13
ExpressionEngine Copyright Footer
@adamthebig
adamthebig / npm-errors.sh
Last active August 29, 2015 14:14
A fix if you are having to run sudo npm and can't run npm without errors
# this way is best if you want to stay up to date
# or submit patches to node or npm
mkdir ~/local
echo 'export PATH=$HOME/local/bin:$PATH' >> ~/.bashrc
. ~/.bashrc
# could also fork, and then clone your own fork instead of the official one
git clone git://github.com/joyent/node.git
@adamthebig
adamthebig / .bowerrc
Created January 26, 2015 17:34
Change the default "bower_components" install location (Add a .bowerrc file in the root)
{
"directory" : "public/assets/lib"
}
@adamthebig
adamthebig / readme.md
Last active August 29, 2015 14:14 — forked from coolaj86/how-to-publish-to-npm.md
Publishing an NPM module

Getting Started with NPM (as a developer)

If you haven't already set your NPM author info, now you should:

npm set init.author.name "Your Name"
npm set init.author.email "[email protected]"
npm set init.author.url "http://yourblog.com"

npm adduser

Deploying a subfolder to GitHub Pages

Sometimes you want to have a subdirectory on the master branch be the root directory of a repository’s gh-pages branch. This is useful for things like sites developed with Yeoman, or if you have a Jekyll site contained in the master branch alongside the rest of your code.

For the sake of this example, let’s pretend the subfolder containing your site is named dist.

Step 1

Remove the dist directory from the project’s .gitignore file (it’s ignored by default by Yeoman).