Skip to content

Instantly share code, notes, and snippets.

View keybase.md

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:

View MockTest.groovy
import static org.junit.Assert.*
import static org.mockito.Mockito.*
import org.junit.Test
class MockTest {
class Dto {
String val = 'data'
}
View vertical-merge.sh
#!/bin/bash
awk '
FNR==NR {
l = length($0);
if (l > ml) {
ml = l
}
}
FNR!=NR {
View TagTrait.patch
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 Dec 3, 2014
Example how to wait for a letter
View waiting for ~
<?php
echo "pause\n";
$stdin = fopen('php://stdin', 'r');
$c = -1;
while ($c != '~') {
if ($c != -1) {
@fejese
fejese / gen_cert.sh
Created Oct 16, 2014
Generate self-signed ca signed certificate
View gen_cert.sh
#!/bin/bash
if [ -z "$1" ]; then
echo "Name???"
exit 1
fi
name=$1;
: ${CA_FORM:="PEM"}
View installMobileProvisionFile.sh
#!/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)
#