git init
or
| # Change YOUR_TOKEN to your prerender token | |
| # Change http://example.com (at the end of the last RewriteRule) to your website url | |
| <IfModule mod_headers.c> | |
| RequestHeader set X-Prerender-Token "YOUR_TOKEN" | |
| </IfModule> | |
| <IfModule mod_rewrite.c> | |
| RewriteEngine On |
| # /config/initializers/sidekiq.rb | |
| current_web_concurrency = Proc.new do | |
| web_concurrency = ENV['WEB_CONCURRENCY'] | |
| web_concurrency ||= Puma.respond_to? | |
| (:cli_config) && Puma.cli_config.options.fetch(:max_threads) | |
| web_concurrency || 16 | |
| end | |
| local_redis_url = Proc.new do |
| # FCC's Census Block Conversions API | |
| # http://www.fcc.gov/developers/census-block-conversions-api | |
| latlong2fips <- function(latitude, longitude) { | |
| url <- "http://data.fcc.gov/api/block/find?format=json&latitude=%f&longitude=%f" | |
| url <- sprintf(url, latitude, longitude) | |
| json <- RCurl::getURL(url) | |
| json <- RJSONIO::fromJSON(json) | |
| as.character(json$County['FIPS']) | |
| } |
| /** | |
| * Changes value to past tense. | |
| * Simple filter does not support irregular verbs such as eat-ate, fly-flew, etc. | |
| * http://jsfiddle.net/bryan_k/0xczme2r/ | |
| * | |
| * @param {String} value The value string. | |
| */ | |
| Vue.filter('past-tense', function(value) { | |
| // Slightly follows http://www.oxforddictionaries.com/us/words/verb-tenses-adding-ed-and-ing | |
| var vowels = ['a', 'e', 'i', 'o', 'u']; |
| 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'; |
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.
| 'use strict'; | |
| const GEOLOCATION_TYPE = { | |
| GEOPOSITION: 'GEOPOSITION', | |
| FREEGEOIP: 'FREEGEOIP' | |
| }; | |
| class Localizer { | |
| constructor() { |
| /* | |
| * 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(); |
| # 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" |