Skip to content

Instantly share code, notes, and snippets.

Keybase proof

I hereby claim:

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

To claim this, I am signing this object:

import static org.junit.Assert.*
import static org.mockito.Mockito.*
import org.junit.Test
class MockTest {
class Dto {
String val = 'data'
}
#!/bin/bash
awk '
FNR==NR {
l = length($0);
if (l > ml) {
ml = l
}
}
FNR!=NR {
@fejese
fejese / TagTrait.patch
Created January 12, 2015 14:26
fix for #99
diff --git a/src/*/AppBundle/Entity/TagTrait.php b/src/*/AppBundle/Entity/TagTrait.php
index 2024712..d7d2465 100644
--- a/src/*/AppBundle/Entity/TagTrait.php
+++ b/src/*/AppBundle/Entity/TagTrait.php
@@ -62,6 +62,6 @@ trait TagTrait
public function __toString()
{
- return ($this->getValue()) ? : '';
+ return (is_null($this->getValue())) ? '' : $this->getValue();
@fejese
fejese / waiting for ~
Created December 3, 2014 13:10
Example how to wait for a letter
<?php
echo "pause\n";
$stdin = fopen('php://stdin', 'r');
$c = -1;
while ($c != '~') {
if ($c != -1) {
@fejese
fejese / gen_cert.sh
Created October 16, 2014 00:00
Generate self-signed ca signed certificate
#!/bin/bash
if [ -z "$1" ]; then
echo "Name???"
exit 1
fi
name=$1;
: ${CA_FORM:="PEM"}
#!/bin/sh
# 2012 - Ben Clayton (benvium). Calvium Ltd
# Found at https://gist.github.com/2568707
#
# This script installs a .mobileprovision file without using Xcode. Unlike Xcode, it'll
# work over SSH.
#
# Requires Mac OS X (I'm using 10.7 and Xcode 4.3.2)
#