Skip to content

Instantly share code, notes, and snippets.

@Remigr
Remigr / .htaccess
Created December 14, 2015 15:22
My .htaccess for angular SEO with snapshots
RewriteEngine On
Options +FollowSymLinks
RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^ - [L]
RewriteCond %{HTTP_USER_AGENT} baiduspider|facebookexternalhit|twitterbot|rogerbot|linkedinbot|embedly|quora\ link\ preview|showyoubot|outbrain|pinterest [NC,OR]
RewriteCond %{QUERY_STRING} _escaped_fragment_
RewriteRule ^(.*)$ snapshots%{REQUEST_URI}? [NC,L]
@Remigr
Remigr / gist:7e4d57620bce1467cd41
Created January 26, 2015 21:42
Hook to leaflet to add ID to icon markers
(function () {
var original_initIcon = L.Marker.prototype._initIcon,
originalsetIcon = L.Marker.prototype.setIcon;
L.Marker.include({
setIcon: function (icon, id) {
this.options.id = id;
originalsetIcon.call(this, icon);
},
_initIcon: function () {
//from http://www.wearesicc.com/quick-tips-5-column-layout-with-twitter-bootstrap/
.col-xs-15,
.col-sm-15,
.col-md-15,
.col-lg-15 {
position: relative;
min-height: 1px;
padding-right: 10px;
padding-left: 10px;
@Remigr
Remigr / html snapshot example
Last active August 29, 2015 14:02
html snapshot example
htmlSnapshot: {
all: {
options: {
snapshotPath: 'snapshots/',
sitePath: 'http://<your-website>/',
fileNamePrefix: '',
sanitize: function(requestUri) {
return requestUri.replace(/\//g, '/').replace(/#!\//g, '');
},
urls: [
1) Run in the project folder :
$ npm install grunt-contrib-less --save-dev
2) Add less to config/env/all.js :
less: [
'public/modules/*/less/*.less'
],
and modify the css config to this :
css: [
'public/modules/*/less/*.css'