Skip to content

Instantly share code, notes, and snippets.

Maciej Lebkowski mlebkowski

Block or report user

Report or block mlebkowski

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@mlebkowski
mlebkowski / Procfile
Created Feb 14, 2014
Bless as a Service
View Procfile
web: node index.js
View updateRTIndexes.php
<?php
function updateSphinxRTIndex($isDelete = false)
{
$indexer = Xplod::getInstance()->getContainer()->get('search.listener.realtime_indexer');
$propelModel = $this->toPropelModel();
if ($this->isNew())
{
$indexer->queueInsert($propelModel);
}
View SeasonalityFactor.php
<?php
class SeasonalityFactor
{
const FORMAT = 'M';
/**
* @var array
*/
private $modifiers = array ();
View reach.sql
INSERT INTO `reach` (`id`, `day`, `value`)
VALUES
(1, 1, 0.0743),
(2, 2, 0.1244),
(3, 3, 0.1682),
(4, 4, 0.2060),
(5, 5, 0.2407),
(6, 6, 0.2780),
(7, 7, 0.3153),
(8, 8, 0.3496),
View diff.sql
DROP TABLE IF EXISTS `address_service_copy`;
DROP TABLE IF EXISTS `address_service_temp2`;
ALTER TABLE `crm_gratis_commercial` CHANGE `trader_id` `trader_id` INTEGER(10) NOT NULL;
ALTER TABLE `disease_section` ADD CONSTRAINT `disease_section_FK_1`
FOREIGN KEY (`disease_id`)
REFERENCES `disease` (`id`);
View index.php
<?php
header('Content-type: text/plain; charset=UTF-8');
$config = array(
'emails' => ['ener@mailinator.com'],
'subject' => "Nowe zgloszenie Energia",
'fields' => array (
'name' => array ('label' => 'Imię i nazwisko'),
'email' => array ('label' => 'Adres e-mail'),
'phone' => array ('label' => 'Telefon'),
View SortableInterface.php
<?php
interface SortableInterface {
public function getSortValues();
}
class A implements SortableInterface {
private $order, $price, $id;
public function __construct($price, $id, $order) {
$this->id = $id;
View httpd-vhosts.conf
# /etc/apache2/extra/httpd-vhosts.conf
<Directory /Volumes/Dev>
Require all granted
AllowOverride All
</Directory>
<VirtualHost *:80>
ServerName dev
ServerAlias *.dev
View combined-ids.php
<?php
function compositeId($calendarId, \DateTime $start) {
static $startOfTime = 1410963347;
$time = ($start->getTimestamp() - $startOfTime) / 60 / 5;
if ($time & 0xFFFF0000) {
throw new RuntimeException(sprintf('We have ran out of time: %s!', $start->format('Y-m-d H:i:s')));
}
if ($calendarId & 0xFFFF0000) {
throw new RuntimeException(sprintf('We are too successful (calendarId: %d)', $calendarId));
View keybase.md

Keybase proof

I hereby claim:

  • I am mlebkowski on github.
  • I am puck (https://keybase.io/puck) on keybase.
  • I have a public key whose fingerprint is AFB4 769E 17CE 7A93 AB41 B313 DB1B 67F7 129A 7370

To claim this, I am signing this object:

You can’t perform that action at this time.