Skip to content

Instantly share code, notes, and snippets.

umpirsky /
Last active Nov 6, 2022
Install Ubuntu on RAID 0 and UEFI/GPT system
sudo -s
apt-get -y install mdadm
apt-get -y install grub-efi-amd64
sgdisk -z /dev/sda
sgdisk -z /dev/sdb
sgdisk -n 1:0:+100M -t 1:ef00 -c 1:"EFI System" /dev/sda
sgdisk -n 2:0:+8G -t 2:fd00 -c 2:"Linux RAID" /dev/sda
umpirsky / A.markdown
Last active Jan 14, 2022 — forked from olivierlacan/An_example.markdown
Sublime Text Monokai Sidebar Theme.
View A.markdown
View TokenBasedRememberMeServices.php
namespace Umpirsky\MyBundle\Security\Http\RememberMe;
use Symfony\Component\Security\Http\RememberMe\TokenBasedRememberMeServices as BaseTokenBasedRememberMeServices;
use Symfony\Component\HttpFoundation\Cookie;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\Security\Core\Exception\AuthenticationException;
use Symfony\Component\Security\Core\User\UserInterface;
View File.php
* @Assert\Callback(methods={"validateFile"})
class File
public function validateFile(ExecutionContext $context)
if (null !== $this->getId()) {
View userContent.css
input:not(.tactile-searchbox-input):not(.urlbar-input):not(.textbox-input):not(.form-control):not([type='checkbox']) {
-moz-appearance: none !important;
background-color: white;
color: black;
#downloads-indicator-counter {
color: white;
View getErrorMessages.php
private function getErrorMessages(\Symfony\Component\Form\Form $form) {
$errors = array();
foreach ($form->getErrors() as $key => $error) {
$errors[$key] = $error->getMessage();
if ($form->hasChildren()) {
foreach ($form->getChildren() as $child) {
umpirsky / Application.php
Created Nov 2, 2012
Enable query logging for Doctrine in Silex
View Application.php
if ($this['debug']) {
$logger = new DebugStack();
$this->extend('doctrine_orm.configuration', function(Configuration $configuration) use ($logger) {
return $configuration;
View ORMUuidQueryBuilderLoader.php
namespace Umpirsky\Form\ChoiceList;
use Doctrine\ORM\QueryBuilder;
use Doctrine\DBAL\Connection;
use Doctrine\DBAL\Types\Type;
use Doctrine\DBAL\Platforms\AbstractPlatform;
use Symfony\Bridge\Doctrine\Form\ChoiceList\EntityLoaderInterface;
use Symfony\Component\Form\Exception\LogicException;
umpirsky / convert
Last active Jan 25, 2018
Nautilus script for converting subtitle encoding from Windows-1250 to utf-8
View convert
# chardetect orignial
iconv -f Windows-1250 -t utf-8//IGNORE $line > $line.tmp