Skip to content

Instantly share code, notes, and snippets.

The following tasks need to be done to finish the i18n component:
------------------------------------------------------------------------------
To finish translator:
- Add Xliff translation loader with plural support if possible, see:
https://wiki.oasis-open.org/xliff/XLIFF2.0/Feature/Plural%20Entries
- Add Tmx translation loader (identify if plural support is available)
- Complete unit tests
------------------------------------------------------------------------------
@Maks3w
Maks3w / Actual.php
Created July 4, 2012 15:48
Actual way of treat URIs
<?php
function verifyUri($value) {
try {
$uri = Zend\Uri\UriFactory::factory($value)
} catch (Zend\Uri\Exception\InvalidUriPartException $e) {
return false;
}
<?php
/**
* Zend Framework
*
* LICENSE
*
* This source file is subject to the new BSD license that is bundled
* with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://framework.zend.com/license/new-bsd
@Maks3w
Maks3w / gist:3091197
Created July 11, 2012 15:35
DocBook tags
grep -oh "<[a-z]\+" * | sort | uniq -c
91 <a
3552 <acronym
6 <action
6 <active
5 <adapter
4 <add
1 <appnamespace
1 <atomurl
@Maks3w
Maks3w / gist:3097685
Created July 12, 2012 11:51
in_array vs foreach
<?php
$value = 'A';
$haystack = array('test', 0, 'A');
$strict = false;
$s = microtime(true);
in_array($value, $haystack, $strict);
$e = microtime(true);
echo ' ' . ($e - $s) . PHP_EOL;
@Maks3w
Maks3w / hotfix.bat
Created September 18, 2012 19:25 — forked from weierophinney/zf2-workflow.txt
proposed workflow
REM Use hotfix.bat <PR Number> <BRANCH name without hotfix preffix>
set PR=%1
set BRANCH=hotfix/%2
call git checkout master
call git pull upstream master
call git checkout -b %BRANCH% master
call git pull upstream refs/pull/%PR%/head
echo "Review the PR and fix it if needed"
pause
@Maks3w
Maks3w / composer.json
Created March 31, 2013 08:17
SimpleSAML composer repository
{
"require": {
"simplesamlphp/simplesamlphp": "*@dev"
},
"repositories": [
{
"type": "package",
"package": {
"name": "simplesamlphp/simplesamlphp",
"version": "dev-master",
@Maks3w
Maks3w / bulk_bilty.php
Created April 17, 2013 08:53
BitLy bulk actions. PHP script for bulk actions like archive, edit, etc using BitLy API
<?php
/**
* BitLy bulk actions
*
* PHP script for make bulk actions with BitLy.
*
* Instructions: Customize parameters and edit the foreach loop for more detailed filtering
*
* @author Maks3w
*/
@Maks3w
Maks3w / ghgfk.html
Last active December 19, 2015 07:59
GitHub Git Flow Killer first stub
<!DOCTYPE html>
<html>
<head>
<title>Merge GitHub's PRs with Git Flow style</title>
<link rel="stylesheet" href="css/bootstrap.css"/>
<link rel="stylesheet" href="css/bootstrap-responsive.min.css"/>
</head>
<body>
<div class="container">
Name: php-5.4
Cartridge-Short-Name: PHP
Display-Name: PHP 5.4.5
Description: "PHP is a general-purpose server-side scripting language originally designed for Web development to produce dynamic Web pages. The mod_php Apache module is used to execute PHP applications. Popular development frameworks include: CakePHP, Symfony, and Code Igniter. Popular applications include: Drupal, Wordpress, and Mediawiki."
Version: 5.4.5
Source-Url: https://github.com/nhymxu/openshift-origin-cartridge-php-5.4/archive/master.zip
License: "The PHP License, version 3.0"
License-Url: http://www.php.net/license/3_0.txt
Vendor: php.net
Cartridge-Vendor: getup