sudo vim /etc/default/locale
LANGUAGE=en_US.UTF-8
LANG=en_US.UTF-8
LC_TYPE=en_US.UTF-8
LC_ALL=en_US.UTF-8
reconfigure locales
| module AuthHelper | |
| def http_login | |
| user = 'username' | |
| pw = 'password' | |
| request.env['HTTP_AUTHORIZATION'] = ActionController::HttpAuthentication::Basic.encode_credentials(user,pw) | |
| end | |
| end | |
| module AuthRequestHelper | |
| # |
| // If you want inserted images in a CKEditor to be responsive | |
| // you can use the following code. It creates a htmlfilter for the | |
| // image tag that replaces inline "width" and "style" definitions with | |
| // their corresponding attributes and add's (in this example) the | |
| // Bootstrap "img-responsive" class. | |
| CKEDITOR.on('instanceReady', function (ev) { | |
| ev.editor.dataProcessor.htmlFilter.addRules( { | |
| elements : { | |
| img: function( el ) { | |
| // Add bootstrap "img-responsive" class to each inserted image |
| var gulp = require('gulp'), | |
| sass = require('gulp-sass'), | |
| browserify = require('gulp-browserify'), | |
| concat = require('gulp-concat'), | |
| embedlr = require('gulp-embedlr'), | |
| refresh = require('gulp-livereload'), | |
| lrserver = require('tiny-lr')(), | |
| express = require('express'), | |
| livereload = require('connect-livereload') | |
| livereloadport = 35729, |
| /* This is a small sampling of the various approaches to media queries. The | |
| point is: they're all over the board. Part of the "issue" (if you can call | |
| it that) may be due to the intended audience of each site/framework. Another | |
| may be that it's really difficult to test for a lot of different devices. | |
| Regardless, it would be really nice if there was standard baseline that | |
| could be used as a starting point for maximum compatibility and coverage. */ | |
| /* ========================================================================== | |
| Frameworks | |
| ========================================================================== */ |
| // Modern Scale for Web Typography | |
| // Ref: http://typecast.com/blog/a-more-modern-scale-for-web-typography | |
| // ----------------------------------------------------------------------------- | |
| // Mobile | |
| // ----------------------------------------------------------------------------- | |
| // Elem | Font | Line | |
| // ----------------------------------------------------------------------------- | |
| // Body | 16px | 20px | |
| // h1 | 32px | 40px | |
| // h2 | 26px | 30px |
| .blur { | |
| -webkit-filter: blur(3px); | |
| -moz-filter: blur(3px); | |
| -ms-filter: blur(3px); | |
| -o-filter: blur(3px); | |
| /* FF doesn't support blur filter, but SVG */ | |
| filter: url("data:image/svg+xml;utf8,<svg height='0' xmlns='http://www.w3.org/2000/svg'><filter id='svgBlur' x='-5%' y='-5%' width='110%' height='110%'><feGaussianBlur in='SourceGraphic' stdDeviation='5'/></filter></svg>#svgBlur"); | |
| filter: progid: DXImageTransform.Microsoft.Blur(PixelRadius = '3'); | |
| filter: blur(3px); | |
| } |
So one of the painful points of using docker on OS X is that you need to run a virtualbox VM, which often suffers from performance issues. With xhyve, a OS X virtualization system, and docker-machine-xhyve you can now have docker use the native OS X hypervisor to run containers.
No more dealing with virtualbox shenanigans!
In this script, I've also set up a way to autoconfigure terminal sessions to load docker's environment vars (dependent on docker-machine) so you do not have to run eval $(docker-machine env whatever) every time you open a new terminal window.
| namespace :factories do | |
| task :generate => :environment do | |
| # Make a new factory file, moving the old one to factories_old.rb if one exists. | |
| factory_file = "#{Rails.root}/spec/factories" | |
| FileUtils.mv("#{factory_file}.rb", "#{factory_file}_old.rb") if File.exists?("#{factory_file}.rb") | |
| fixture_file = File.open("#{factory_file}.rb", 'w') do |file| | |
| From http://linux.die.net/man/3/strftime | |
| %a - The abbreviated weekday name (``Sun'') | |
| %A - The full weekday name (``Sunday'') | |
| %b - The abbreviated month name (``Jan'') | |
| %B - The full month name (``January'') | |
| %c - The preferred local date and time representation | |
| %d - Day of the month (01..31) | |
| %e - Day of the month without leading 0 (1..31) | |
| %g - Year in YY (00-99) |