Skip to content

Instantly share code, notes, and snippets.

@wujku
wujku / message-id.php
Created Oct 30, 2017 — forked from Robbert/message-id.php
Message-ID generator in PHP for mail headers.
View message-id.php
<?php
/**
* @see http://www.jwz.org/doc/mid.html
*/
function generateMessageID()
{
return sprintf(
"<%s.%s@%s>",
base_convert(microtime(), 10, 36),
View keybase.md

Keybase proof

I hereby claim:

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

To claim this, I am signing this object:

View gitlab_deployment_configuration.sh
#!/usr/bin/env bash
# Usage: repository=repository_name.git worktree=/home/user/domains/domain.name gitlab_deployment_configuration.sh
if [ -z ${repository+x} ]; then repository=gitlab.git; fi
if [ -z ${worktree+x} ]; then worktree=/home/ubuntu/domains/domain.name; fi
# create git --bare repository
git init --bare ${repository}
View liip_imagine_static_cache_urls.conf
location @cache_resolve {
return 301 /media/cache/resolve/$1;
}
location ~ ^/media/cache/(?!resolve/)(.*) {
root /var/www/public_html;
try_files $uri @cache_resolve;
}
View google-analytics-modify-transaction.js
$.ajax({
type: "POST",
url: 'https://ssl.google-analytics.com/collect',
async: false,
data: {
v: "1",
tid: "UA-XXXXXXX-XX",
cid: "Unique Client ID",
t: "transaction",
ti: "transaction ID",
@wujku
wujku / Ageno.pl_Code_Style.xml
Last active Apr 19, 2017
Code style for PHPStorm IDE
View Ageno.pl_Code_Style.xml
<code_scheme name="Ageno.pl_Code_Style">
<PHPCodeStyleSettings>
<option name="COMMA_AFTER_LAST_ARRAY_ELEMENT" value="true" />
<option name="LOWER_CASE_BOOLEAN_CONST" value="true" />
<option name="LOWER_CASE_NULL_CONST" value="true" />
<option name="ELSE_IF_STYLE" value="COMBINE" />
<option name="BLANK_LINE_BEFORE_RETURN_STATEMENT" value="true" />
<option name="KEEP_RPAREN_AND_LBRACE_ON_ONE_LINE" value="true" />
<option name="SPACE_AFTER_UNARY_NOT" value="true" />
<option name="FORCE_SHORT_DECLARATION_ARRAY_STYLE" value="true" />
@wujku
wujku / BooleanType.php
Created Apr 5, 2017 — forked from fsevestre/BooleanType.php
Boolean form type for Symfony2 + tests
View BooleanType.php
<?php
namespace AppBundle\Form\Type;
use AppBundle\Form\DataTransformer\BooleanTypeToBooleanTransformer;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\OptionsResolver\OptionsResolver;
class BooleanType extends AbstractType
View unique_select_value.js
$(this).on('change', '.folder-select', function (event) {
var $this = $(this);
var selected_mailbox = $this.val();
$('.folder-select').not($this).filter(function( index ) {
return $(this).val() === selected_mailbox;
}).each(function () {
$(this).val('');
});
});
View install_php_5.6.sh
LC_ALL=en_US.UTF-8 add-apt-repository -y ppa:ondrej/php5-5.6
apt-get update -y
apt-get install -y \
php5.6-fpm \
php5.6-intl \
php5.6-cli \
php5.6-json \
php5.6-readline \
php5.6-curl \
View install_php_7.sh
LC_ALL=en_US.UTF-8 add-apt-repository -y ppa:ondrej/php
apt-get update -y
apt-get install -y \
php7.0-fpm \
php7.0-intl \
php7.0-cli \
php7.0-json \
php7.0-readline \
php7.0-curl \