Skip to content

Instantly share code, notes, and snippets.


Maciej Sobaczewski Sobak

View GitHub Profile
Sobak /
Last active June 19, 2018 04:54
Basic checklist for migrating the PHP Manual from SVN to Git

PHP Manual's SVN->Git transition status


Most of the current workflow remains unchanged. The notable changes include:

  1. Switching from SVN sequential revision number in EN-Revision to Git hashes. It means we need to run the migration script on each of the translations to port that EN-Revision value and make it understandable for the tooling
  2. Dropping the use of $Revision$ (so whole top XML comments) in the English
View PeselValidate.rb
class PeselValidate
@@weights = [1, 3, 7, 9, 1, 3, 7, 9, 1, 3, 1]
def initialize(str1)
@pesel = str1
def validate
numbers = @pesel.split(//).map(&:to_i)
sum = 0
Sobak / factorial.php
Created December 28, 2014 21:56
Innovative implementation of factorial. Result of boredom and too much free time.
View factorial.php
function factorial($num) {
return eval('return '.implode(range(1, $num), '*').';');
// more readable form
function factorial2($num) {
$operation = implode(range(1, $num), '*');
return eval("return $operation;");