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 / 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 "you@example.com"
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).

@adamthebig
adamthebig / gist:0980ea8fe510f7a27e30
Created March 28, 2015 18:20
Remove all instances of .DS_Store from git repo
find . -name .DS_Store -print0 | xargs -0 git rm -f --ignore-unmatch