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 / runtime-conf.xml
Created July 19, 2012 19:27
sample runtime-conf.xml file for blog post
<?xml version="1.0" encoding="UTF-8"?>
<config>
<propel>
<datasources default="shop">
<datasource id="shop">
<adapter>mysql</adapter>
<connection>
<dsn>mysql:host=localhost;dbname=shop;user=root;password=root</dsn>
<user>root</user>
<password>root</password>
@omerucel
omerucel / .vimrc
Created July 31, 2012 15:03
vimrc
" Map NERDTree to \p
nmap <silent> <Leader>p :NERDTreeToggle<CR>
" Show line number
set number
" Syntax on
syntax on
" Incremental search
@omerucel
omerucel / .vimrc
Created August 8, 2012 21:35
.vimrc
autocmd FileType php noremap <C-L> :!/Applications/MAMP/bin/php/php5.3.6/bin/php -l %<CR>
autocmd FileType php noremap <C-M> :w!<CR>:!/Applications/MAMP/bin/php/php5.3.6/bin/php %<CR>
package com.example.navigationstyle;
import android.app.Activity;
import android.graphics.Typeface;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
public class MainActivity extends Activity implements OnClickListener {
@omerucel
omerucel / AccountTest.java
Last active December 14, 2015 14:18
Farklı projelerdeki Entity dosyalarını kullanmak için junit ayarları.
package com.tutorial.client;
import static org.junit.Assert.assertTrue;
import org.hibernate.SessionFactory;
import org.hibernate.cfg.Configuration;
import org.junit.Test;
import com.tutorial.auth.model.User;
import com.tutorial.client.model.UserInfo;
@omerucel
omerucel / DatabaseTest.java
Last active December 14, 2015 17:48
Veritabanı ile ilgili işlemler içeren testlerde extend edilecek sınıf.
package com.risenlabs;
import java.io.File;
import java.io.IOException;
import java.util.List;
import java.util.Map;
import org.apache.commons.io.FileUtils;
import org.hibernate.SessionFactory;
import org.hibernate.cfg.Configuration;
@omerucel
omerucel / .bashrc
Last active December 15, 2015 15:49
bash function for virtualenv
function mood()
{
cmd=". $HOME/.env/$1/bin/activate"
$cmd
}
_mood()
{
local cur="${COMP_WORDS[COMP_CWORD]}"
local projects=$(ls -h $HOME/.env)
@omerucel
omerucel / shell-prompt.md
Created April 25, 2013 10:23
shell prompt with current git branch and current full path

Screenshot

 function parse_git_branch_and_add_brackets {
    git branch --no-color 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/\\[\1\]/'
 }
 PS1="\e[0;35m: \w\e[m \n\h:\u \[\033[0;32m\]\$(parse_git_branch_and_add_brackets)\[\033[0m\]\$ "
@omerucel
omerucel / ab_test.sh
Last active July 3, 2016 01:39
Phalcon vs Slim, very basic test
ab -n 1000 -c 10 http://localhost/slim.php > slim.log
ab -n 1000 -c 10 http://localhost/phalcon.php > phalcon.log
@omerucel
omerucel / FeatureContext.php
Last active December 20, 2015 03:49
Behat RestContext example
<?php
use Behat\Behat\Context\BehatContext;
require_once 'RestContext.php';
/**
* Features context.
*/
class FeatureContext extends BehatContext