Skip to content

Instantly share code, notes, and snippets.

View keskad's full-sized avatar

Damian Kęska keskad

  • Poland
View GitHub Profile
@keskad
keskad / README.md
Last active March 4, 2022 09:54
Building `lighthouse-tekton-controller` and swapping it on live K8s cluster running on remote machine

Building lighthouse-tekton-controller and swapping it on live K8s cluster running on remote machine

@ololobus
ololobus / create-and-fill-up-table.sql
Last active March 12, 2025 17:35
Create large ~1 GB random dataset in PostgreSQL
CREATE TABLE large_test (num1 bigint, num2 double precision, num3 double precision);
INSERT INTO large_test (num1, num2, num3)
SELECT round(random()*10), random(), random()*142
FROM generate_series(1, 20000000) s(i);
EXPLAIN (analyse, buffers)
SELECT num1, avg(num3) as num3_avg, sum(num2) as num2_sum
FROM large_test
GROUP BY num1;
@nishantmodak
nishantmodak / nginx.conf.default
Last active October 27, 2025 14:27
Default Nginx Conf
#user nobody;
#Defines which Linux system user will own and run the Nginx server
worker_processes 1;
#Referes to single threaded process. Generally set to be equal to the number of CPUs or cores.
#error_log logs/error.log; #error_log logs/error.log notice;
#Specifies the file where server logs.
@callado4
callado4 / behat-phantomjs-webdriver.md
Last active January 24, 2021 17:10
Instructions on how to make behat (with mink) use the phantomjs webdriver to run headless browser tests

Making behat use phantomjs for the tests

If you want to run it on phantomjs (a headless browser) you can add this profile to your behat.yml and you need phantomjs >= 1.8.0

phantomjs:
    extensions:
        Behat\MinkExtension\Extension:
            base_url: http://dev.local
            goutte: ~
            selenium2:
 wd_host: "http://localhost:8643/wd/hub" 
@Ocramius
Ocramius / User.php
Last active December 17, 2025 23:36
Doctrine 2 ManyToMany - the correct way
<?php
use Doctrine\ORM\Mapping as ORM;
use Doctrine\Common\Collections\ArrayCollection;
/**
* @ORM\Entity()
* @ORM\Table(name="user")
*/
class User
@blazarecki
blazarecki / PopupDictionary.php
Last active February 3, 2026 14:12
Alert, confirm and prompt with mink
<?php
namespace Widop\Mink\Extension;
/**
* Dictionary to manage popups.
*
* @author Benjamin Lazarecki <benjamin.lazarecki@gmail.com>
*/
trait PopupDictionary
@vicb
vicb / gist:1596588
Created January 11, 2012 20:25
substr vs strpos
<?php
$str = str_repeat('*!', 10);
$start = microtime(true);
for ($i = 0; $i < 100000; $i++) {
substr($str, 0, 1);
}
@iiska
iiska / Autostart.sh
Created January 9, 2012 14:05
Using KWallet and ksshaskpass with ssh-agent
#! /bin/bash
# Put this in ~/.kde/Autostart/ssh-agent.sh
export SSH_ASKPASS=/usr/bin/ksshaskpass
/usr/bin/ssh-add