Skip to content

Instantly share code, notes, and snippets.

@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 / 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 / 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 / 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 / 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
<?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 / 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;
}
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
------------------------------------------------------------------------------