Skip to content

Instantly share code, notes, and snippets.

View Srokap's full-sized avatar

Paweł Sroka Srokap

View GitHub Profile
@Srokap
Srokap / test.php
Created May 9, 2013 19:29
Timestamp in int or string memory consumption
$mx = 10000;
$mem = memory_get_usage();
$data1 = array();
$i = $mx;
while ($i-- >0) {
$data1[] = 1368118712;
}
$i1 = (memory_get_usage() - $mem);
echo ' ';
Exception #1364526180: exception 'DatabaseException' with message 'Elgg couldn't select the database '', please check that the database is created and you have access to it.' in /home/travis/build/Srokap/Elgg/engine/classes/ElggDatabase.php:120
Stack trace:
#0 /home/travis/build/Srokap/Elgg/engine/classes/ElggDatabase.php(72): ElggDatabase->establishLink('readwrite')
#1 /home/travis/build/Srokap/Elgg/engine/classes/ElggDatabase.php(51): ElggDatabase->setupConnections()
#2 /home/travis/build/Srokap/Elgg/engine/lib/database.php(118): ElggDatabase->getLink('read')
@Srokap
Srokap / amd_bug
Created March 24, 2013 13:42
Problem with AMD in Elgg 1.9 and 1.8 standard of JS assets loading.
Error: Mismatched anonymous define() module: function (punycode, IPv6, SLD) {
"use strict";
function URI(url, base) {
// Allow instantiation without the 'new' keyword
if (!(this instanceof URI)) {
return new URI(url, base);
}
if (url === undefined) {
@Srokap
Srokap / travis_notices.txt
Created March 1, 2013 04:08
Notices thrown in Travis worker by ElggInstaller
1Using worker: bluebox-linux-2.worker.travis-ci.org:travis-linux-12
2
3$ git clone --depth=100 --quiet --branch=ticket_5167 git://github.com/Srokap/Elgg.git Srokap/Elgg
4$ cd Srokap/Elgg
5$ git checkout -qf 72beba9995f587a1ea277364c49ceb9a1a7ef0f8
6$ sudo service mysql start
7start: Job is already running: mysql
8$ sleep 3
9$ phpenv global 5.3
<?php
/**
* @var array Nazwy datalist'ów wystpujacych tylko w kodzie API
*/
$aliasesL = array (
7 => 'sejm_glosowania_glosy_wyniki',
22 => 'sp_ludzie_stanowiska',
27 => 'poslowie_glosy',
32 => 'poslowie_wspolpracownicy',
46 => 'sa_sedziowie_orzeczenia',
@Srokap
Srokap / aliases.php
Last active December 14, 2015 03:28
Nazwy dataset'ów wydługane z dataset'u _datasets.
<?php
$aliases = array (
0 => 'wybory_samorzadowe_rady_gmin_kandydaci',
1 => 'pisma_adresaci',
2 => 'poslowie_aktywnosci',
3 => '_datasets',
4 => 'sn_orzeczenia_ludzie',
5 => 'bdl_wskazniki_podgrupy',
6 => 'bdl_wskazniki_grupy',
7 => 'bdl_wskazniki_kategorie',
@Srokap
Srokap / aliases.php
Created February 23, 2013 18:08
Wydłubane z `ep_Object::$_aliases`
<?php
$aliases = array (
0 => 'nik_raporty',
1 => 'bdl_wskazniki_podgrupy',
2 => 'bdl_wskazniki_kategorie',
3 => 'bdl_wskazniki_grupy',
4 => 'bdl_wskazniki_wariacje',
6 => 'bip_instytucje',
7 => 'sejm_glosowania_glosy_wyniki',
8 => 'gminy',
@Srokap
Srokap / pr.md
Created November 5, 2012 20:27 — forked from piscisaureus/pr.md
Checkout github pull requests locally

Locate the section for your github remote in the .git/config file. It looks like this:

[remote "origin"]
	fetch = +refs/heads/*:refs/remotes/origin/*
	url = git@github.com:joyent/node.git

Now add the line fetch = +refs/pull/*/head:refs/remotes/origin/pr/* to this section. Obviously, change the github url to match your project's URL. It ends up looking like this:

@Srokap
Srokap / templates.md
Created October 23, 2012 01:23
Community responses templates ;-)

In case of:

  • Unclear questions
Hi NNN,

Thanks for posting!

My name is NNN and I understand your issue to be: