Phoenix 1.5 requires Elixir >= 1.7. Be sure your existing version is up to date by running elixir -v on the command line.
$ mix archive.uninstall phx_new
$ mix archive.install hex phx_new 1.5.0| #!/bin/bash | |
| # Author: Maxwel Leite | |
| # Website: http://needforbits.wordpress.com/ | |
| # Description: Script to install Microsoft Vista TrueType Fonts (TTF) aka Microsoft’s ClearType fonts on Ubuntu distros | |
| # Microsoft added a group of new "ClearType Fonts" to Windows with Windows Vista and Office 2007. | |
| # These fonts are named Constantia, Corbel, Calibri, Cambria (and Cambria Math), Candara, and Consolas. | |
| # Calibri became the default font on Microsoft Word 2007, and it’s still the default font on Word 2016 today. | |
| # Dependencies: wget, fontforge and cabextract | |
| # Note: Microsoft no longer provides the PowerPoint Viewer 2007 (v12.0.4518.1014) or any version anymore for download | |
| # Tested: Ubuntu Saucy/Trusty/Xenial/Bionic |
| <?php | |
| function cif_validation ($cif) { | |
| $cif = strtoupper($cif); | |
| if (preg_match('~(^[XYZ\d]\d{7})([TRWAGMYFPDXBNJZSQVHLCKE]$)~', $cif, $parts)) { | |
| $control = 'TRWAGMYFPDXBNJZSQVHLCKE'; | |
| $nie = array('X', 'Y', 'Z'); | |
| $parts[1] = str_replace(array_values($nie), array_keys($nie), $parts[1]); | |
| $cheksum = substr($control, $parts[1] % 23, 1); | |
| return ($parts[2] == $cheksum); | |
| } elseif (preg_match('~(^[ABCDEFGHIJKLMUV])(\d{7})(\d$)~', $cif, $parts)) { |
| -- (This code was run in PostgreSQL 9.6.1) | |
| -- Demonstration of how serializable isolation for PostgreSQL, which detects possible | |
| -- interference between concurrent transactions, can produce false positives | |
| -- in psql, create the following table | |
| CREATE TABLE users( | |
| id SERIAL NOT NULL PRIMARY KEY, | |
| username VARCHAR NOT NULL | |
| ); |
| def join_game(user_id, game_id) do | |
| with {:ok, user} <- Users.get(user_id), | |
| {:ok, game} <- Games.get(game_id), | |
| false <- Game.is_full?(game), | |
| false <- Game.is_started?(game), | |
| true <- User.has_permission?(user, game) | |
| do | |
| Game.add_user(game, user) | |
| else | |
| # Don't care what specific thing failed |
| use std::str; | |
| fn main() { | |
| // -- FROM: vec of chars -- | |
| let src1: Vec<char> = vec!['j','{','"','i','m','m','y','"','}']; | |
| // to String | |
| let string1: String = src1.iter().collect::<String>(); | |
| // to str | |
| let str1: &str = &src1.iter().collect::<String>(); | |
| // to vec of byte |
| // Zed settings | |
| // | |
| // For information on how to configure Zed, see the Zed | |
| // documentation: https://zed.dev/docs/configuring-zed | |
| // | |
| // To see all of Zed's default settings without changing your | |
| // custom settings, run the `open default settings` command | |
| // from the command palette or from `Zed` application menu. | |
| { | |
| "buffer_font_family": "Liga Hack", |