Skip to content

Instantly share code, notes, and snippets.

View alacritty-colors.diff
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 Jun 30, 2022
Use git-filter-repo to import lfs objects
View git-filter-repo-lfs-import.py
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
View CallOrderTest.php
<?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 Mar 22, 2020
SF functional test example
View FunctionTest.php
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 Jan 30, 2018
Build difference on Symfony 3.4
View build.diff
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,
View props.php
class Klass
{
private $timezone = new DateTimeZone('UTC');
private $date = new DateTime('NOW', $this->timezone);
}
View keybase.md

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:

View unicode-bidi.php
<?php
function normalizeBidirectionalTextMarkers($graphemes)
{
$regex = '/
\x{202A} # LEFT-TO-RIGHT EMBEDDING
|\x{202B} # RIGHT-TO-LEFT EMBEDDING
|\x{202D} # LEFT-TO-RIGHT OVERRIDE
|\x{202E} # RIGHT-TO-LEFT OVERRIDE
|\x{202C} # POP DIRECTIONAL FORMATTING
/ux';
@lstrojny
lstrojny / capture.php
Created Dec 2, 2015
Higher order capture
View capture.php
<?php
class Connection
{
public function transactional(callable $callback)
{
$callback();
}
}
function capture(&$result, callable $callback) {
View gist:9637743
<?php
class TestCase extends PHPUnit_Framework_TestCase
{
private $dep;
private $service;
public function setUp()
{
$this->service = new Service();