Skip to content

Instantly share code, notes, and snippets.

@ywarnier
ywarnier / firefox-profiles-ini-rebuild.php
Created October 5, 2017 03:10
Rebuild Firefox's profiles.ini from the profile cache directories
<?php
/**
* This script provide a way to rebuild the profiles.ini file
* in your ~/.mozilla/firefox/ directory in case, like me, the
* update to Firefox 56 on Ubuntu wiped your profiles.ini out
* and placed a fresh "default" profile instead, but luckily
* left all the profiles directories in place.
* To use it, you need php-cli and you need to place this file
* inside the ~/.mozilla/firefox/ directory.
* Execute it with "php firefox-profiles-ini-rebuild.php" and
@ywarnier
ywarnier / g2-convert.php
Created May 23, 2017 23:36
Script to convert files in a Gallery2 database and directories to avoid spaces, so they can be imported in Piwigo
<?php
/**
* This script converts files in a Gallery2 database and directories structure
* to avoid spaces, so that they can be imported in Piwigo (which doesn't tolerate spaces)
* It gives a substantial amount of output, so we recommend executing with
* php g2-convert.php > output.txt
* to be able to analyse it afterwards.
* This script has been used successfully on a database of 249K pictures
* @author @ywarnier @BeezNest
* @date 2017

Swoole - Asynchronous & concurrent & distributed networking framework for PHP.

Swoole is an event-based & concurrent framework for internet applications, written in C, for PHP.

event-based

The network layer in Swoole is event-based and takes full advantage of the underlaying epoll/kqueue implementation, making it really easy to serve thousands of connections.

@ywarnier
ywarnier / README.md
Created January 11, 2014 22:24 — forked from lovasoa/README.md

Ophir.php

PHP script that converts ODT to HTML

ophir.php is a lightweight script that parses an open document file and outputs a simple HTML file, with very few tags (contrarily to most other tools that do the same).

Features

Currently, the script parses bold (b tag), italic (i tag), underline (u tag), quotations (blockquote tag), images (using data URIs), links, headings (h1, h2, ...), lists (ul and li), tables (table tr and td) annotations and footnotes. Ophir.php can also ignore or remove some tags on demand. This can be useful if you want to extract only unformatted text from a document, or if you don't want tables, footnotes or annotations in the resulting HTML, or if the application that generated the ODT file produced unnecessary formatting informations ...

Limitations

Everything that is not mentioned in the feature section is not supported.