If you're shipping iOS apps,
and dream of the bucks you'll make,
you might think of "going native",
but Xcode's a big headache.
I wrote a middleware (actually two, but they do the same with different implementations) that logs information about signed in scopes in a Rails + Devise application. The solution works with multiple logins (like having a person logged both as an Admin and a User). I tested against Rails 4 and Devise HEAD, but it should work fine in any Rails 3 application.
This solution doesn't use the log_tags configuration option since it isn't very helpful when you need to retrieve information stored in cookies/session. That information isn't 'ready' when the Rails::Rack::Logger is executed, since it happens way down in the middleware chain.
Add one of the following implementations to your application load path and use the following configuration to add the middleware to your application stack:
# application.rbstopBefore(document, 'getElementById')
stopBefore('document.getElementById') // the same as the previous
stopBefore(Element.prototype, 'removeChild')| sudo find /private/var/folders/ -name com.apple.dock.iconcache -exec rm {} \; |
One of the best ways to reduce complexity (read: stress) in web development is to minimize the differences between your development and production environments. After being frustrated by attempts to unify the approach to SSL on my local machine and in production, I searched for a workflow that would make the protocol invisible to me between all environments.
Most workflows make the following compromises:
Use HTTPS in production but HTTP locally. This is annoying because it makes the environments inconsistent, and the protocol choices leak up into the stack. For example, your web application needs to understand the underlying protocol when using the secure flag for cookies. If you don't get this right, your HTTP development server won't be able to read the cookies it writes, or worse, your HTTPS production server could pass sensitive cookies over an insecure connection.
Use production SSL certificates locally. This is annoying
In addition to the techniques described in the
Asynchronous Routing Guide,
the Ember Router provides powerful yet overridable
conventions for customizing asynchronous transitions
between routes by making use of error and loading
substates.
| module PgArrayHstoreFix | |
| def self.included(base) | |
| base.class_eval do | |
| before_save :serialize_array_hash | |
| end | |
| def serialize_array_hash | |
| self.class.attribute_names.each do |attribute| | |
| column_definition = self.column_for_attribute(attribute) | |
| if column_definition.array && column_definition.type == :hstore |
| // Credit to @steobrien from https://gist.github.com/rmehner/b9a41d9f659c9b1c3340#gistcomment-2940034 | |
| // for modern browsers, this works: | |
| const dbs = await window.indexedDB.databases() | |
| dbs.forEach(db => { window.indexedDB.deleteDatabase(db.name) }) | |
| // for older browsers, have a look at previous revisions of this gist. |