Skip to content

Instantly share code, notes, and snippets.

View ggirtsou's full-sized avatar
🎯
Focusing

George Gkirtsou ggirtsou

🎯
Focusing
View GitHub Profile
@ggirtsou
ggirtsou / test_exception.php
Last active February 21, 2016 21:08
catch (Exception $e) is executed only in PHP 5.x, will not be reached in PHP 7, read: https://trowski.com/2015/06/24/throwable-exceptions-and-errors-in-php7/
<?php
error_reporting(E_ALL);
ini_set('display_errors', true);
class MyObject {
public function getMyObject() : MyObject
{
return null;
}
@ggirtsou
ggirtsou / ClickBanner experience
Created March 7, 2016 18:49
Technologies used while working for ClickBanner and achievements
- *PHP Frameworks:* Yii 1.1 and enchanced it with Pimple DI Container, Symfony2,
- PHP Versions: 5.4, 5.5, 5.6
- Dependency Management: Composer
- Version Control: Git hosted on BitBucket
- ORM: Doctrine2,
- Database: MySQL 5.6 (leveraged full text search for InnoDB tables)
- Template Engine: Twig,
- Build Tools: Apache ANT, Atlassian Bamboo
- Testing Frameworks: Behat 2.4, PHPUnit 3.7, and 4.2 + code coverage + filesystem mock,
- APIs consumed: Mandrill, Zanox AWS, Google, MatchesFashion, LinkShare, Clickatell API (to send SMS messages for campaigns, and conversions), TradeDoubler API (polling for transaction reports and add them to HasOffers API)
@ggirtsou
ggirtsou / fibonacci.php
Created March 10, 2016 19:24
Prints fibonacci sequence based on $numbersToShow starting from $startNumber
<?php
error_reporting(E_ALL);
ini_set('display_errors', true);
// 0, 1, 1, 2, 3, 5, 8, 13, 21, 34
$startNumber = 0;
$numbersToShow = 10;
@ggirtsou
ggirtsou / fibonacci-short-version.php
Created March 10, 2016 19:25
Prints fibonacci sequence based on $numbersToShow starting from $startNumber Raw
<?php
error_reporting(E_ALL);
ini_set('display_errors', true);
// 0, 1, 1, 2, 3, 5, 8, 13, 21, 34
$startNumber = 0;
$numbersToShow = 10;
@ggirtsou
ggirtsou / command
Created March 12, 2016 07:40
Use ffmpeg to fix mp4 files with no sound on mobile device
# 1. cd to your directory containing mp4 files first
# 2. will scan for mp4 files in that directory
# 3. will output new .mp4 file in parent directory with same name as original
for i in *.mp4; do ffmpeg -i "$i" -c:v copy -c:a libfdk_aac -b:a 384k ../"$i"; done;
# firefox 27
sudo mkdir -m 755 /opt
cd /opt
wget https://ftp.mozilla.org/pub/mozilla.org/firefox/releases/27.0/linux-x86_64/en-US/firefox-27.0.tar.bz2
sudo tar xjf firefox-7.0.1.tar.bz2
@ggirtsou
ggirtsou / build.xml
Created July 17, 2016 18:35
Sample Apache Ant configuration file
<?xml version="1.0" encoding="UTF-8"?>
<project name="My Project" basedir=".">
<property name="app" location="app" />
<property name="build" location="app/logs/build" />
<delete dir="${build}" />
<echo message="Create build dir"/>
<mkdir dir="${build}" />
<echo message="Drop test database"/>
package main
import (
"golang.org/x/tour/wc"
"strings"
)
func WordCount(s string) map[string]int {
var m = map[string]int{}
words := strings.Fields(s)
@ggirtsou
ggirtsou / client.go
Created October 29, 2016 09:10
Delete all fork repositories from your Github account in one go, using this Golang script :)
/*
* CAUTION!!! READ THIS VERY CAREFULLY!!!
* This will delete ALL your Github fork repositories.
* DO NOT use it if you don't know what it does!
*
* Usage:
* $ go get # get dependencies
* $ go run client.go # initiate chaos
*/
package main

Keybase proof

I hereby claim:

  • I am ggirtsou on github.
  • I am ggirtsou (https://keybase.io/ggirtsou) on keybase.
  • I have a public key whose fingerprint is 68BE 33D5 92AF 5EF1 8873 E9AC 5563 1C32 1936 0BE0

To claim this, I am signing this object: