Skip to content

Instantly share code, notes, and snippets.

View podhy's full-sized avatar

Jakub Podhorský podhy

  • Freelancer
  • Jihlava, Czech republic
View GitHub Profile
@arantius
arantius / create-test-container.script
Last active April 6, 2019 12:38
How To Install Gentoo Onto Any OpenVZ VPS
# vzctl create 200 --config unlimited --ostemplate \
> debian-6.0-x86 --ipadd 192.168.202.200 --hostname guest
Creating container private area (debian-6.0-x86)
Performing postcreate actions
CT configuration saved to /etc/vz/conf/200.conf
Container private area was created
# vzctl start 200
Starting container...
Container is mounted
Adding IP address(es): 192.168.202.200
@aqualungdesign
aqualungdesign / gist:4612802
Created January 23, 2013 20:35
Changing the photoshop cs6 language. MAC OS
#go to folder:
/Applications/Adobe Photoshop CS6/Locales/pt_BR/Support Files/tw10428.dat
#rename the file tw10428.dat for tw10428.bak
@rejsmont
rejsmont / AclFilter.php
Last active February 14, 2019 08:10
ACL filter for Doctrine QueryBuilder and Query. Supports multiple filters applied to a single query, entity inheritance and role hierarchies.
<?php
/*
* Copyright 2013 Radoslaw Kamil Ejsmont <radoslaw@ejsmont.net>
*
* Original code by mailaneel is available at
* https://gist.github.com/mailaneel/1363377
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@kevin-smets
kevin-smets / iterm2-solarized.md
Last active July 2, 2024 12:33
iTerm2 + Oh My Zsh + Solarized color scheme + Source Code Pro Powerline + Font Awesome + [Powerlevel10k] - (macOS)

Default

Default

Powerlevel10k

Powerlevel10k

@matheusoliveira
matheusoliveira / random.sql
Created February 21, 2015 16:32
A very optimized way of getting random rows of a table on PostgreSQL (gets by "id" in a fast and non-biased way, if with gaps)
/* One random row from table "tbl" */
WITH RECURSIVE r AS (
SELECT NULL::int AS id, min(id) AS min_id, max(id) AS max_id, 0 AS cnt
FROM tbl
UNION ALL
SELECT tbl.id, r.min_id, r.max_id, r.cnt + 1
FROM r LEFT JOIN tbl
ON tbl.id = (SELECT floor(random() * (r.max_id - r.min_id + 1))::int)
WHERE r.id IS NULL
)
@alimbada
alimbada / Export-Chocolatey.ps1
Last active April 21, 2024 11:39
Export installed Chocolatey packages as packages.config - thanks to Matty666
#Put this in Export-Chocolatey.ps1 file and run it:
#.\Export-Chocolatey.ps1 > packages.config
#You can install the packages using
#choco install packages.config -y
Write-Output "<?xml version=`"1.0`" encoding=`"utf-8`"?>"
Write-Output "<packages>"
choco list -lo -r -y | % { " <package id=`"$($_.SubString(0, $_.IndexOf("|")))`" version=`"$($_.SubString($_.IndexOf("|") + 1))`" />" }
Write-Output "</packages>"
@jakubkulhan
jakubkulhan / rpc_client.php
Created June 2, 2015 21:00
BunnyPHP RPC example
<?php
namespace Example;
use Bunny\Channel;
use Bunny\Client;
use Bunny\Message;
use React\Promise\Deferred;
use React\Promise\PromiseInterface;
require_once __DIR__ . "/vendor/autoload.php";
@oal
oal / webpack.config.js
Last active October 26, 2017 09:49
Webpack config for Pixi.js using Babel.
'use strict';
var webpack = require('webpack');
var path = require('path');
module.exports = {
entry: './src/game.js',
output: {
filename: 'build/game.js'
},
@boekkooi
boekkooi / ConstructorMapper.php
Last active December 11, 2020 02:28
Symfony Form DataMapper using object constructors
<?php
namespace Acme\Symfony\Form\DataMapper;
use Symfony\Component\Form\Exception\TransformationFailedException;
use Symfony\Component\Form\Extension\Core\DataMapper\PropertyPathMapper;
use Symfony\Component\PropertyAccess\PropertyAccessorInterface;
use Symfony\Component\Serializer\NameConverter\NameConverterInterface;
class ConstructorMapper extends PropertyPathMapper
{
@fsevestre
fsevestre / README.md
Last active March 26, 2017 16:58
Symfony 2 breadcrumbs based on KnpMenuBundle (KnpMenu 2.1)