$ rails new my-i8n --webpack
Gemfile
gem 'i18n-js'
/* | |
* Stripe WebGl Gradient Animation | |
* All Credits to Stripe.com | |
* ScrollObserver functionality to disable animation when not scrolled into view has been disabled and | |
* commented out for now. | |
* https://kevinhufnagl.com | |
*/ | |
/* | |
* Stripe WebGl Gradient Animation | |
* All Credits to Stripe.com | |
* ScrollObserver functionality to disable animation when not scrolled into view has been disabled and | |
* commented out for now. | |
* https://kevinhufnagl.com | |
*/ | |
$ rails new my-i8n --webpack
Gemfile
gem 'i18n-js'
const hoverTime = 400 | |
const fetchers = {} | |
const doc = document.implementation.createHTMLDocument('prefetch') | |
function fetchPage (url, success) { | |
const xhr = new XMLHttpRequest() | |
xhr.open('GET', url) | |
xhr.setRequestHeader('VND.PREFETCH', 'true') | |
xhr.setRequestHeader('Accept', 'text/html') | |
xhr.onreadystatechange = () => { |
# Docker Compose for WordPress with Data Persistence | |
# | |
# Resources | |
# https://medium.com/@tatemz/local-wordpress-development-with-docker-3-easy-steps-a7c375366b9 | |
# https://hub.docker.com/_/wordpress/ | |
# https://hub.docker.com/r/_/mariadb/ | |
# https://stackoverflow.com/a/39208187/648844 | |
# https://github.com/nezhar/wordpress-docker-compose | |
# | |
version: "2" |
/* | |
* decaffeinate suggestions: | |
* DS102: Remove unnecessary code created because of implicit returns | |
* Full docs: https://github.com/decaffeinate/decaffeinate/blob/master/docs/suggestions.md | |
*/ | |
const OldHttpRequest = Turbolinks.HttpRequest; | |
Turbolinks.CachedHttpRequest = class CachedHttpRequest extends Turbolinks.HttpRequest { | |
constructor(_, location, referrer) { | |
super(); |
'use strict'; | |
const GEOLOCATION_TYPE = { | |
GEOPOSITION: 'GEOPOSITION', | |
FREEGEOIP: 'FREEGEOIP' | |
}; | |
class Localizer { | |
constructor() { |
Optimizing the delivery of CSS is one way to improve user experience, load speed and SEO of your web app. This involves determining the "critical path CSS" and embeding it into the html of your page. The rest of the CSS for the site is loaded asynchronously so it does not block the rendering of your "above the fold" content. This Gist will show you how to dynamically generate critical path CSS for your Rails app.
In this example we will use the mudbugmedia/critical-path-css gem.
You will need to set up caching and Active Job in your Rails app. I recommend using a thread-safe background job manager like resque.
var siteUrl = 'https://luckey.herokuapp.com/'; | |
var apiUrl = 'https://luckey.herokuapp.com/api/v1/'; | |
angular | |
.module('luckey-plugin', ['ngResource', 'ui.router', 'satellizer', 'templates', 'algoliasearch', 'uiGmapgoogle-maps']) | |
.config(['$stateProvider', '$urlRouterProvider', '$authProvider', function($stateProvider, $urlRouterProvider, $authProvider) { | |
// Satellizer configuration that specifies which API | |
// route the JWT should be retrieved from | |
$authProvider.loginUrl = apiUrl + 'authenticate'; |