Skip to content

Instantly share code, notes, and snippets.

View lstrojny's full-sized avatar

Lars Strojny lstrojny

View GitHub Profile
{
description = "ufff";
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable";
phps.url = "github:loophp/nix-shell";
systems.url = "github:nix-systems/default";
};
outputs = inputs@{ self, flake-parts, systems, ... }:
@lstrojny
lstrojny / match.php
Created March 16, 2023 23:05
Single return expression only
<?php
$v = match ($pop) {
default => [++$pops[$pop], $marker][1],
null => match ($pops[$marker]) {
0 => '',
default => [--$pops[$marker], $marker][1],
}
};
@lstrojny
lstrojny / grafana-dashboard-dev.py
Created November 3, 2022 18:14
A development loop for jsonnet based grafana dashboard
#!/usr/bin/env python3
from watchdog.observers import Observer # type: ignore
from watchdog.events import LoggingEventHandler, RegexMatchingEventHandler # type: ignore
import logging
import sys
import time
import subprocess
import os
import re
diff --git a/alacritty/src/display/window.rs b/alacritty/src/display/window.rs
index 2d473999c8..cf10f81182 100644
--- a/alacritty/src/display/window.rs
+++ b/alacritty/src/display/window.rs
@@ -27,7 +27,9 @@ use {
use std::fmt::{self, Display, Formatter};
use std::ops::{Deref, DerefMut};
+use std::sync::atomic::{AtomicU8, Ordering};
@lstrojny
lstrojny / git-filter-repo-lfs-import.py
Last active June 30, 2022 17:19
Use git-filter-repo to import lfs objects
import os
from os import path
import shutil
import subprocess
from functools import lru_cache
import re
from fnmatch import translate
from hashlib import sha256
from tempfile import NamedTemporaryFile
from collections.abc import Iterable
<?php
namespace Test;
use PHPUnit\Framework\TestCase;
interface SystemUnderTest {
public function first(int $arg): int;
public function second(string $arg): string;
}
final class CallOrderTest extends TestCase
{
private $sut;
@lstrojny
lstrojny / FunctionTest.php
Created March 22, 2020 16:52
SF functional test example
public function testSomething(): void
{
$client = static::createClient();
$entity = self::$container->get('em')->find(…, 1);
$entity->setState(1);
self::$container->get('em')->persist($entity);
self::$container->get('em')->flush();
$client->request(…, …);
@lstrojny
lstrojny / build.diff
Created January 30, 2018 16:12
Build difference on Symfony 3.4
This file has been truncated, but you can view the full file.
diff -ru dev/appDevDebugProjectContainer.php dev-old/appDevDebugProjectContainer.php
--- dev/appDevDebugProjectContainer.php 2018-01-30 17:07:56.000000000 +0100
+++ dev-old/appDevDebugProjectContainer.php 2018-01-30 17:07:31.000000000 +0100
@@ -16,6 +16,6 @@
return new \ContainerZ99qfrx\appDevDebugProjectContainer(array(
'container.build_hash' => 'Z99qfrx',
- 'container.build_id' => 'c7ecd1d9',
- 'container.build_time' => 1517328475,
class Klass
{
private $timezone = new DateTimeZone('UTC');
private $date = new DateTime('NOW', $this->timezone);
}

Keybase proof

I hereby claim:

  • I am lstrojny on github.
  • I am lstrojny (https://keybase.io/lstrojny) on keybase.
  • I have a public key ASD6MQdqO36ZDJv1hvWVMrExmNfTLt6QMWiGyjiqM7sJ_wo

To claim this, I am signing this object: