TL;DR
9.4 -> 9.5:
sudo pg_dropcluster 9.5 main --stop
sudo service postgresql stop
sudo pg_upgradecluster -m upgrade -k 9.4 main
sudo su postgres -c "/usr/lib/postgresql/9.5/bin/vacuumdb --all --analyze-in-stages"
sudo pg_dropcluster 9.4 main
<!doctype html> | |
<html lang="en"> | |
<head> | |
<title>Print ZPL from browser</title> | |
</head> | |
<body> | |
<h1>Test page for print ZPL from browser!</h1> | |
<script type="text/javascript"> | |
function printZpl(zpl) { |
TL;DR
9.4 -> 9.5:
sudo pg_dropcluster 9.5 main --stop
sudo service postgresql stop
sudo pg_upgradecluster -m upgrade -k 9.4 main
sudo su postgres -c "/usr/lib/postgresql/9.5/bin/vacuumdb --all --analyze-in-stages"
sudo pg_dropcluster 9.4 main
# Rake task to help migrating a rails 3 app to rails 4 strong_parameters. | |
# The task generates source code for helper methods for each model class | |
# to 'permit' the attributes. | |
# the generated methods are intended as starting point to copy&paste in the controller | |
# and than edit the permitted attributs. | |
# Some common names of non-editable attributes are already filtered, | |
# like 'id', 'password' or 'created_at'. | |
# The output is written to stdout so you can pipe it into a file | |
# | |
# Dependencies: |
<% | |
require 'config' | |
branch = `git rev-parse --abbrev-ref HEAD`.strip rescue nil | |
use_single_db = !Settings.db_per_branch || !branch || branch == 'master' | |
branch_spec = (use_single_db ? "" : "_#{branch}").underscore.gsub(/[\.\/\-]/, '_') | |
%> | |
development: | |
<<: *default | |
database: app_development<%= branch_spec %> |
#!/bin/bash | |
cat $(find app/assets/stylesheets/ -type f) | | |
grep -Eo '\.[a-z]+[a-z0-9_-]*' | sort | uniq | sed s/.// | | |
while read CSS; do | |
if ! grep -Erqi "([^(remove|has)]?class[(:|=|[:space:]*=>[:space:]*)]*[[:space:]\W]*[(\"|')]*[-a-z0-9[:space:]]*$CSS|\\.$CSS\b)" app/views/ vendor/assets/ app/assets/javascripts/; then | |
echo $CSS >> unused.scss; | |
fi | |
done |
// takes a {} object and returns a FormData object | |
var objectToFormData = function(obj, form, namespace) { | |
var fd = form || new FormData(); | |
var formKey; | |
for(var property in obj) { | |
if(obj.hasOwnProperty(property)) { | |
if(namespace) { |
I upgraded a small app from ember-cli from 0.1.11 to 0.2.0 today. It took a couple hours. Here are some notes.
First, I read the release notes.
I recommend committing your changes right before running ember init
. That way, you can accept all the overwrites and easily discard the ones you don't want. kellyselden maintains a repo called ember-cli-output that tracks the changes in what ember init
generates over time. You can find the v0.2.0 changes here.
This post is also on my blog, since Gist doesn't support @ notifications.
Components are taking center stage in Ember 2.0. Here are some things you can do today to make the transition as smooth as possible:
Ember.Controller
instead of Ember.ArrayController
or Ember.ObjectController
Ember.Controller
, otherwise a proxy will be generated. You can use Ember.RSVP.hash to simulate setting normal props on your controller.DS.RESTSerializer.extend({ | |
extractArray: function(store, type, payload) { | |
var inflector = Ember.Inflector.inflector, | |
data = payload || [], | |
modifiedPayload = {}; | |
modifiedPayload[inflector.pluralize(type.typeKey)] = data; | |
return this._super(store, type, modifiedPayload); | |
} |