Testing ephp
To test how can works ephp I do a escriptize and you can use it to execute simple php code:
git clone https://github.com/bragful/ephp
cd ephp
make
| #!/bin/bash | |
| if [ -z "$1" ]; then | |
| echo "Usage: $0 'text to encode'" | |
| exit 0 | |
| fi | |
| echo "$1" | perl -p -e 's/([^A-Za-z0-9])/sprintf("%%%02X", ord($1))/seg' | |
| echo |
| #!/usr/bin/env escript | |
| epoch() -> | |
| {Mega,Sec,Mili} = now(), | |
| (Mega * 1000000) + Sec + (Mili / 1000000). | |
| measure(F) -> | |
| Ini = epoch(), | |
| F(), | |
| epoch() - Ini. |
To test how can works ephp I do a escriptize and you can use it to execute simple php code:
git clone https://github.com/bragful/ephp
cd ephp
make
All the time I was working with XMPP I realized this protocol has a lot of flaws to use in mobile devices, even the lack of sync for the messages between several devices. This protocol tries to solve those flaws:
| # -*- mode: ruby -*- | |
| # vi: set ft=ruby : | |
| # Vagrantfile API/syntax version. Don't touch unless you know what you're doing! | |
| VAGRANTFILE_API_VERSION = "2" | |
| Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| | |
| config.vm.box = "centos-6.4" | |
| config.vm.box_url = | |
| "http://puppet-vagrant-boxes.puppetlabs.com/centos-64-x64-vbox4210.box" |
To continue testing ephp with the new features I release, first we need a fresh ephp version:
git clone https://github.com/altenwald/ephp
cd ephp
make
| defmodule AdjacentCells do | |
| @moduledoc """ | |
| This module is a way to search, mark and count the adjacent cells based on | |
| the post published by Kevin Ghadyani originally in JavaScript and showing | |
| that using Elixir the code could be simpler and powerful. | |
| https://medium.com/free-code-camp/bet-you-cant-solve-this-google-interview-question-4a6e5a4dc8ee | |
| Indeed, the original code run by Kevin is spending in the better case 229 ms | |
| with 3 random colors and more than 1 second with only one color. |
| [core] | |
| # delta requires installation (delta & bat) | |
| pager = delta | |
| [delta] | |
| plus-color = "#012800" | |
| minus-color = "#340001" | |
| # syntax-theme = gruvbox-light | |
| syntax-theme = gruvbox | |
| [interactive] |
| #!/bin/bash | |
| set -eo pipefail | |
| container=$1 | |
| image=$(docker inspect --format '{{.Config.Image}}' $container) | |
| cmd=$(docker inspect --format '{{.Config.Cmd}}' $container) | |
| if [[ $cmd == '<nil>' ]]; then cmd=''; fi | |
| binds=$(docker inspect --format '{{.HostConfig.Binds}}' $container | sed "s/\[//; s/\]//") | |
| if [[ $binds == '<nil>' ]]; then binds=''; fi | |
| envs=$(docker inspect --format '{{.Config.Env}}' $container | sed "s/\[//; s/\]//") |
| @doc """ | |
| Check local links, if there is a broken link the compilation fails. | |
| You can configure the kind of URLs to avoid to check. For example, if you | |
| want to avoid check dependencies like PDF or images: | |
| [links] | |
| exclude_uris = [ | |
| '^/pdf/', | |
| '^/images/' |