Skip to content

Instantly share code, notes, and snippets.

View Hywan's full-sized avatar
🦀
Oxidising every bit

Ivan Enderlin Hywan

🦀
Oxidising every bit
View GitHub Profile
@Hywan
Hywan / Progress.php
Created November 30, 2013 06:47
A simple progress bar with Hoa\Console.
<?php
require '/usr/local/lib/Hoa/Core/Core.php';
$progress = 1;
$width = Hoa\Console\Window::getSize()['x'] - 2;
$pattern = '%s' . "\n" . '[%-' . $width . 's]';
do {
@Hywan
Hywan / Tput.php
Last active December 30, 2015 23:49
Hoa\Console\Tput POC
<?php
/**
* Hoa
*
*
* @license
*
* New BSD License
*
@Hywan
Hywan / gist:b72b59581279f9b68055
Created May 14, 2014 10:53
Highlight PHP source code
<?php
require '/usr/local/lib/Hoa/Core/Core.php';
use Hoa\Console;
class Formatter {
protected $_colors = array(
T_ABSTRACT => 'foreground(#5fafd7)',
==> Installing hhvm from hhvm/homebrew-hhvm
Building from source because Library/Taps/hhvm/homebrew-hhvm/hhvm.rb has local changes
To install from a bottle instead, run with --force-bottle
==> Cloning https://github.com/facebook/hhvm.git
git --git-dir /Library/Caches/Homebrew/hhvm--git/.git status -s
Updating /Library/Caches/Homebrew/hhvm--git
git config remote.origin.url https://github.com/facebook/hhvm.git
git config remote.origin.fetch +refs/heads/master:refs/remotes/origin/master
git fetch origin
git checkout -f master --
This file has been truncated, but you can view the full file.
==> Installing hhvm from hhvm/homebrew-hhvm
Building from source because Library/Taps/hhvm/homebrew-hhvm/hhvm.rb has local changes
To install from a bottle instead, run with --force-bottle
==> Cloning https://github.com/facebook/hhvm.git
git --git-dir /Library/Caches/Homebrew/hhvm--git/.git status -s
Updating /Library/Caches/Homebrew/hhvm--git
git config remote.origin.url https://github.com/facebook/hhvm.git
git config remote.origin.fetch +refs/heads/master:refs/remotes/origin/master
git fetch origin
git checkout -f master --
<img src="https://static.hoa-project.net/Image/Hoa.svg" alt="Hoa" width="280px" />
[![Help on IRC](https://img.shields.io/badge/help-%23hoaproject-ff0066.svg)](https://webchat.freenode.net/?channels=#hoaproject)
[![Help on Gitter](https://img.shields.io/badge/help-gitter-ff0066.svg)](https://gitter.im/hoaproject/central)
[![Documentation](https://img.shields.io/badge/documentation-hack_book-ff0066.svg)](https://hoa-project.net/Literature/Hack/Ruler.html)
[![Board](https://img.shields.io/badge/organisation-board-ff0066.svg)](https://waffle.io/hoaproject/ruler)
[![Build status](https://img.shields.io/travis/hoaproject/ruler/master.svg)](https://travis-ci.org/hoaproject/ruler)
[![Coverage](https://img.shields.io/coveralls/hoaproject/ruler/master.svg)](https://coveralls.io/github/hoaproject/ruler?branch=master)
[![Packagist](https://img.shields.io/packagist/dt/hoa/ruler.svg)](https://packagist.org/packages/hoa/ruler)
[![License](https://img.shields.io/packagist/l/hoa/ruler.svg)](https://hoa-project.net/LICENSE)
@Hywan
Hywan / Pi.php
Last active March 4, 2017 15:04
Address RFC 52 from Hoa
<?php
require 'vendor/autoload.php';
use Hoa\File;
use League\CommonMark;
const DIRECTORY_TO_SCAN = '../Acl';
const NAMESPACE_TO_SCAN = 'Hoa\\\Acl\\\\';
const DOCUMENTATION_SECTION = 'Examples';
This file has been truncated, but you can view the full file.
(module
(type $t0 (func (param i32)))
(type $t1 (func (param i32 i32) (result i32)))
(type $t2 (func (param i32) (result i32)))
(type $t3 (func))
(type $t4 (func (result i32)))
(type $t5 (func (param i32 i32 i32 i32)))
(type $t6 (func (param i32 i32)))
(type $t7 (func (param i32 i32 i32) (result i32)))
(type $t8 (func (param i32 i32 i32)))
@Hywan
Hywan / gutenberg-post-parser.wasm
Created May 8, 2018 20:30
gutenberg-post-parser experiment
asm=
``````````/. p»»A∞fi m memory
__rg_alloc__rg_oom __rg_dealloc
__rg_realloc __rg_alloc_zeroed allocdeallocroot ŒA « !"((
˛h.Ó ~@#Ak"$ A@k! A4j! Aÿj! A–j! A‘j! A8j!A!
@@@@@@@@ A(j   (("AG (,"rE@ (!A!B+! !A! A!   AËj Aj)7  )7` (! (! (! )!A! ("! ! A0j( ! A j"
AËj" )7  )`7@ E  rr
(!@ ("E
A(l! !@ (@ A(j! AXj"
  Aj
@Hywan
Hywan / simple.php
Last active April 3, 2019 07:46
Wasm examples, PHP part
<?php
$instance = new Wasm\Instance('simple.wasm');
$result = $instance->sum(1, 2);
var_dump($result); // int(3)