UPDATE a fork of this gist has been used as a starting point for a community-maintained "awesome" list: machine-learning-with-ruby Please look here for the most up-to-date info!
- liblinear-ruby: Ruby interface to LIBLINEAR using SWIG
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.ObjectControllerEmber.Controller, otherwise a proxy will be generated. You can use Ember.RSVP.hash to simulate setting normal props on your controller.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.
| // 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) { |
| #!/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 |
| <% | |
| 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 %> |
| # 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: |
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) { |
| -- show running queries (pre 9.2) | |
| SELECT procpid, age(query_start, clock_timestamp()), usename, current_query | |
| FROM pg_stat_activity | |
| WHERE current_query != '<IDLE>' AND current_query NOT ILIKE '%pg_stat_activity%' | |
| ORDER BY query_start desc; | |
| -- show running queries (9.2) | |
| SELECT pid, age(query_start, clock_timestamp()), usename, state, application_name, query | |
| FROM pg_stat_activity | |
| WHERE query != '<IDLE>' AND query NOT ILIKE '%pg_stat_activity%' AND state != 'idle' |