Skip to content

Instantly share code, notes, and snippets.

View semihozkoroglu's full-sized avatar

Semih Özköroğlu semihozkoroglu

View GitHub Profile
@Override
protected void onScrollChanged(int l, int t, int oldl, int oldt) {
if(scrollListener != null) {
View view = (View) getChildAt(getChildCount()-1);
int diff = (view.getBottom()-(getHeight()+getScrollY()));
if(diff == 0) {
if (!scrollLock) {
setScrollLock(true);
scrollListener.onScrollChanged(l, t, oldl, oldt, diff);
}
# STEP 1: VERIFY THAT YOU DO NOT ALREADY HAVE POSTGRESQL INSTALLED ON YOUR SYSTEM
ps ax | grep postgres
# STEP 2: INSTALL POSTGRESQL ON YOUR SYSTEM
sudo apt-get update
sudo apt-get install postgresql-9.1
# List All Postgres related packages
dpkg -l | grep postgres
@semihozkoroglu
semihozkoroglu / findCtime
Created July 14, 2013 15:01
Dosyaların oluşturulma zamanını bulur
#!/bin/sh
ls -lc | awk '
BEGIN {
FS=" "
print "basladik"
}
{
print "Gün: "$6" --- Ay: "$7" --- Saat: "$8" --- DosyaAdi: "$9""
}
END {

Git Flow

  • Bu dökümanın Burdaki dökümandan sonra yazıldığı unutulmamalı.

  • Git flow mekanizmasını anlamak için SourceTree tool 'unda mevcut olan gitflow eklentisi kullanıldı.

  • Bu dökümanı oluşturmak için atlassian , nvie dökümanlarından yararlanıldı. Daha fazla bilgi için incelemenizi öneririm.

  • ilk olarak mevcut depomuzu Clone in SourceTree butonuna tıklayarak clone ediyoruz.

Git Kullanımı

İlk olarak SourceTree 'den github ile bağlantı kuracağımız tool 'u indiriyoruz.

Kurulum Aşamaları;

  • İlk gelen ekrandaki bilgiler commit aşamasında kullanılacak

İlk Aşama

@semihozkoroglu
semihozkoroglu / time2date.java
Last active December 18, 2015 14:09
Current Timestamp to datetime
Date date = new Date(System.currentTimeMillis());
DateFormat df = new SimpleDateFormat("yyyy/MM/dd HH:mm:ss");
Commons.infoLog("hm", df.format(date));
-------------------------
DateFormat dateFormat = new SimpleDateFormat("hh:mm:ss");
@semihozkoroglu
semihozkoroglu / backup.py
Created January 9, 2013 21:11
for google mail backup
import getpass, imaplib
M = imaplib.IMAP4_SSL('imap.googlemail.com', '993')
M.login('semihozkoroglu', getpass.getpass())
M.select()
typ, data = M.search(None, 'ALL')
for num in data[0].split():
typ, data = M.fetch(num, '(RFC822)')
print 'Message %s\n%s\n' % (num, data[0][1])
M.close()
@semihozkoroglu
semihozkoroglu / pagination.py
Created December 26, 2012 07:55
rest pagination
from rest_framework import serializers, pagination
# view.py
if request.method == 'GET':
queryset = Feed.objects.all()
paginator = Paginator(queryset, 5)
page = request.GET['page']
try:
feeds = paginator.page(page)
except PageNotAnInteger:
@semihozkoroglu
semihozkoroglu / derle
Created December 14, 2012 15:16
Objective-C derleme amaçlı
#!/usr/bin/env bash
if [ $# = 0 ]; then
echo "Kullanimi: ./derle <derlenecek isim> <dosya ismi>"
exit 0
fi
gcc `gnustep-config --objc-flags` -o $1 $2 -L /GNUstep/System/Library/Libraries -lobjc -lgnustep-base
if [ $? = 0 ]; then
#!/usr/bin/sh
for f in *[fFmM][lLpP][vV4]
do
basename="${f%.*}"
ffmpeg -i "$f" "$basename".mp3
done