Skip to content

Instantly share code, notes, and snippets.

Avatar

Emre Aladağ aladagemre

View GitHub Profile
@aladagemre
aladagemre / d_social_login.php
Created May 21, 2014
Dreamvention Social Login Turkish translation
View d_social_login.php
<?php
// Heading
$_['heading_title'] = 'Hesap';
// Text
$_['text_sign_in_with_google'] = 'Giriş Yap';
$_['text_sign_in_with_facebook'] = 'Giriş Yap';
$_['text_sign_in_with_twitter'] = 'Giriş Yap';
$_['text_sign_in_with_live'] = 'Giriş Yap';
$_['text_sign_in_with_linkedin'] = 'Giriş Yap';
@aladagemre
aladagemre / quickcheckout.php
Created May 21, 2014
Dreamvention Ajax Quick Checkout Turkish translation
View quickcheckout.php
<?php
$_['option_register_payment_address_title'] = 'Ödeme detayları';
$_['option_register_payment_address_description'] = '';
$_['option_register_shipping_address_title'] = 'Teslimat detayları';
$_['option_register_shipping_address_description'] = '';
$_['option_register_shipping_method_title'] = 'Teslimat yöntemi';
$_['option_register_payment_method_title'] = 'Ödeme yöntemi';
$_['option_guest_payment_address_title'] = 'Ödeme detayları';
@aladagemre
aladagemre / raspberry_temperature.py
Last active Aug 29, 2015
Raspberrypy Temperature Logger
View raspberry_temperature.py
import time
import datetime
period = 1 # secs between each measurement
filename = "output.csv" # filename to write data.
def get_temperature():
# Open the file that we viewed earlier so that python can see what is in it. Replace the serial number as before.
tfile = open("/sys/bus/w1/devices/10-000802824e58/w1_slave")
# Read all of the text in the file.
@aladagemre
aladagemre / jekyll2pelican.py
Created Feb 10, 2015
Jekyll to Pelican convertor. Only fixes categories, tags list to comma separated tags and single category
View jekyll2pelican.py
# encoding: utf-8
import os
filenames = filter(lambda x: x.endswith(".md"), os.listdir("."))
def parse(filename):
print filename
lines = open(filename).read().split("\n")
tags_i = None
last_tag_i = None
tags = []
@aladagemre
aladagemre / tdk-esanlam.py
Created Jun 24, 2015
TDK'dan bir küme kelimenin eş anlamlılarını çeken betik
View tdk-esanlam.py
# coding: utf-8
# TDK sözlüğünden eş anlamlıları çeker.
# words.txt dosyasında her satırda bir kelime olacak şekilde girdi listelenir.
# meanings.txt dosyasına her kelime için eş anlamlılarını bulur ve satır satır yazar.
import requests
import codecs
from bs4 import BeautifulSoup
@aladagemre
aladagemre / mp4_total_duration.py
Created Aug 24, 2015
Recursive mp4 duration counter
View mp4_total_duration.py
"""
When you have lots of mp4 files in a folder recursively (lots of subfolders and mp4s residing inside),
You can use this script to measure total duration of all mp4 files.
Useful in estimating the total course duration.
Run this script in folder where you want to start counting from.
"""
import subprocess
@aladagemre
aladagemre / image_pull_latex.py
Created Jun 27, 2011
Image downloader for Latex
View image_pull_latex.py
"""Asks for image URL, downloads it to images folder.
Generates bibtex record and appends it to the end of the bib file.
Prints the figure LaTeX code."""
import urllib
import shutil
import os
def download_file(url, binary=True):
filename = url.split('/')[-1].split("?")[0]
@aladagemre
aladagemre / lib_igraph.cr
Created Dec 9, 2015
igraph c binding code
View lib_igraph.cr
@[Link("igraph")]
@[Link("glpk")]
@[Link("stdarg")]
@[Link("c++")]
lib IGraph
VS_ALL = 0
VS_ADJ = 1
VS_NONE = 2
VS_1 = 3
VS_VECTORPTR = 4
@aladagemre
aladagemre / mptt-load
Created Mar 2, 2013
Easy way of MPTT Fixtures: parsing tree and creating objects manually
View mptt-load
"""
Parses a given file as a category tree and saves each item as MPTT Objects.
Example format of the input file:
- Books
-- Novel
-- Tech
--- Science-Fiction
--- Documentary
-- Fun
View DbUpdaterJob
public Map<String,Object> run(Map<String,Object> args) throws Exception {
String crawlId = (String)args.get(Nutch.ARG_CRAWL);
numJobs = 1;
currentJobNum = 0;
currentJob = new NutchJob(getConf(), "update-table");
if (crawlId != null) {
currentJob.getConfiguration().set(Nutch.CRAWL_ID_KEY, crawlId);
}
//job.setBoolean(ALL, updateAll);
ScoringFilters scoringFilters = new ScoringFilters(getConf());