Ember's official documentation describes a number of low-level APIs, but doesn't talk much about how to put them together. As a result, a simple task such as creating a simple CRUD application is not obvious to a newcomer.
1 -> lsblk | |
2 -> umount /dev/sdb | |
3 -> mkdosfs -F 32 -I /dev/sdb |
// Examples | |
// Yes, "router.router" twice - this assumes that the router is being injected | |
// into the component. Otherwise lookup 'router:main' | |
// One of these will be of interest, figure out which one you want: | |
this.get('router.router.state'); | |
this.get('router.router.state.params'); | |
this.get('container').lookup('controller:application').currentPath; |
Version numbers should be the ones you want. Here I do it with the last ones available at the moment of writing.
The simplest way to install elixir is using your package manager. Sadly, at the time of writing only Fedora shows
the intention to keep its packages up to date. There you can simply sudo dnf install erlang elixir
and you are good to go.
Anyway, if you intend to work with several versions of erlang or elixir at the same time, or you are tied to
a specific version, you will need to compile it yourself. Then asdf
is your best friend.
Finally, Simple Form support Boostrap 3. 👏
But I found it still dosen't support some components in Bootstrap 3. Or may be in the future. But I can't wait, so I find a solution to support them. It was inspired by heartcombo/simple_form#531 (comment) .
This is a final solution and I used in my project.
<?php | |
//source: http://stackoverflow.com/questions/1019076/how-to-search-by-key-value-in-a-multidimensional-array-in-php | |
function search($array, $key, $value) { | |
$results = array(); | |
if (is_array($array)) { | |
if (isset($array[$key]) && $array[$key] == $value) { | |
$results[] = $array; | |
} |
# http://ruby-doc.org/stdlib-2.0.0/libdoc/open-uri/rdoc/OpenURI.html | |
require 'open-uri' | |
# https://github.com/flori/json | |
require 'json' | |
# http://stackoverflow.com/questions/9008847/what-is-difference-between-p-and-pp | |
require 'pp' | |
# Construct the URL we'll be calling | |
request_uri = 'http://localhost:3000/users.json' | |
request_query = '' |
function truncText (text, maxLength, ellipseText){ | |
ellipseText = ellipseText || '…'; | |
if (text.length < maxLength) | |
return text; | |
//Find the last piece of string that contain a series of not A-Za-z0-9_ followed by A-Za-z0-9_ starting from maxLength | |
var m = text.substr(0, maxLength).match(/([^A-Za-z0-9_]*)[A-Za-z0-9_]*$/); | |
if(!m) return ellipseText; | |