Skip to content

Instantly share code, notes, and snippets.

View omerucel's full-sized avatar
🎯
Focusing

Ömer ÜCEL omerucel

🎯
Focusing
View GitHub Profile
@omerucel
omerucel / TextView.java
Created December 18, 2016 18:53
Custom TextView with font support
package com.omerucel.widget;
import android.content.Context;
import android.content.res.TypedArray;
import android.graphics.Typeface;
import android.os.Build;
import android.support.annotation.RequiresApi;
import android.util.AttributeSet;
public class TextView extends android.widget.TextView {
@omerucel
omerucel / .bashrc
Last active December 12, 2016 14:41
Docker exec helper
autoload bashcompinit // for oh-my-zsh
bashcompinit // for oh-my-zsh
docker-exec() {
docker exec -it $1 /bin/bash
}
_dockerexec() {
local cur="${COMP_WORDS[COMP_CWORD]}"
local names=$(docker ps --format="{{.Names}}")
COMPREPLY=( $(compgen -W "${names}" ${cur}) )
<?php
namespace {
class Databasecontext extends BaseContext
{
/**
* @Then /^"([^"]*)" tablosunda aşağıdaki kayıtlar bulunmalı:$/
*/
public function tablosundaAsagidakiKayitlarBulunmali($arg1, \Behat\Gherkin\Node\TableNode $table)
@omerucel
omerucel / README.md
Created October 5, 2016 12:06
Clean gearmand job queue
php clear_queue.php --address=127.0.0.1 --port=4730
@omerucel
omerucel / pagination.html.twig
Last active January 25, 2018 12:34 — forked from SimonSimCity/pagination.html.twig
A gist for pagination in Twig, based on the total number of pages, the current page and some URL-settings.
{#
Source: http://dev.dbl-a.com/symfony-2-0/symfony2-and-twig-pagination/
Updated by: Simon Schick <simonsimcity@gmail.com>
Parameters:
* currentFilters (array) : associative array that contains the current route-arguments
* currentPage (int) : the current page you are in
* paginationPath (string) : the route name to use for links
* showAlwaysFirstAndLast (bool) : Always show first and last link (just disabled)
* lastPage (int) : represents the total number of existing pages
@omerucel
omerucel / EventConsumer.php
Created August 3, 2016 08:01
gearman worker
<?php
namespace Gearman;
class EventConsumer extends WorkerAbstract
{
/**
* @var string
*/
protected $token;
@omerucel
omerucel / GoogleSignInActivity.java
Created May 23, 2016 06:03
Google Sign in sample with webview
package com.omerucel.sample;
import android.content.Intent;
import android.graphics.Bitmap;
import android.net.Uri;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v7.app.AppCompatActivity;
import android.util.Log;
import android.view.MenuItem;
@omerucel
omerucel / Dockerfile
Last active August 1, 2021 15:40
Docker Centos 7 + PHP 7 + Phalcon 2.1.x
FROM centos:latest
MAINTAINER Ömer ÜCEL <omerucel@gmail.com>
RUN yum install -y --nogpgcheck epel-release && \
rpm -qa | grep -q remi-release || rpm -Uvh http://rpms.famillecollet.com/enterprise/remi-release-7.rpm && \
yum --enablerepo=remi,remi-php70 install -y --nogpgcheck \
git-core \
nginx \
gcc \
gcc-c++ \
@omerucel
omerucel / README.md
Created September 20, 2015 08:58
Table validate for behat tests
    /**
     * @Then /^"([^"]*)" tablosunda aşağıdaki kayıtlar bulunmalı:$/
     */
    public function tablosundaAsagidakiKayitlarBulunmali($arg1, \Behat\Gherkin\Node\TableNode $table)
    {
        $columns = implode(',', array_keys($table->getHash()[0]));
        $sql = 'SELECT ' . $columns . ' FROM ' . $arg1;
        $rows = $this->getDi()->getMySQLConnection()->fetchAll($sql);
        assertEquals(count($rows), count($table->getHash()));
@omerucel
omerucel / Activity.java
Created July 11, 2015 14:10
ListView multiple remove
package com.omerucel.test;
import android.content.Intent;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.util.SparseBooleanArray;
import android.view.ActionMode;
import android.view.Menu;
import android.view.MenuInflater;
import android.view.MenuItem;