Skip to content

Instantly share code, notes, and snippets.

View batuhan's full-sized avatar
🏳️‍🌈

batuhan batuhan

🏳️‍🌈
View GitHub Profile
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>{Title}</title>
{block:Description}<meta name="description" content="{MetaDescription}" />{/block:Description}
<link rel="shortcut icon" href="{Favicon}" />
<link rel="apple-touch-icon" href="{PortraitURL-128}"/>
<link rel="alternate" type="application/rss+xml" href="http://geceninsarkisi.tumblr.com/rss" />
@batuhan
batuhan / custom.html
Created May 25, 2011 19:51
erakbas_tumblr
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>{Title}</title>
{block:Description}<meta name="description" content="{MetaDescription}" />{/block:Description}
<link rel="shortcut icon" href="{Favicon}" />
<link rel="apple-touch-icon" href="{PortraitURL-128}"/>
<link rel="alternate" type="application/rss+xml" href="http://geceninsarkisi.tumblr.com/rss" />
@batuhan
batuhan / convert_test.php
Created August 1, 2011 14:35
convert time (broken)
<?php
error_reporting(E_ALL);
//second test
$zaman = 'Fri, 01 Jul 2011 16:24:27 +0000';
$dateResult = date( 'y-m-d', strtotime($zaman) );
echo $dateResult;
@batuhan
batuhan / makeslug.php
Created August 15, 2011 13:58
Make slug
<?php
// source: http://neo22s.com/
function friendly_url($url) {
// everything to lower and no spaces begin or end
$url = strtolower(trim($url));
//replace accent characters, depends your language is needed
//$url=replace_accents($url);
@batuhan
batuhan / is_offensive.php
Created August 17, 2011 17:11
Is offensive?
<?php
//checks if text contains any offensive words, returns boolean.
function is_offensive($text){
$data = file_get_contents('http://www.wdyl.com/profanity?q='.$text);
$data = json_decode($data);
@batuhan
batuhan / tw_follow.php
Created August 21, 2011 20:18
twitter follow /for erdinç
<?php
include 'twitter.class.php'; // http://svn.strawp.net/lib/twitter.class.php
$tw = new TwitterClient();
$users_to_follow = 'batuhanicoz,razyocom,kaloglu,razyocom';
$users = explode(',', $users_to_follow);
foreach($users as $user){
@batuhan
batuhan / simple_contact.php
Created September 9, 2011 23:32
simple contact form shortcode (for wp)
<?php
/*
Plugin Name: Simple Contact Form (Shortcode)
Plugin URI: http://beyn.org/
Description: A simple contact form. Usage: [b_form email="send@form.here"]
Version: 0.1.1
Author: Barış Ünver
Author URI: http://beyn.org/
*/
@batuhan
batuhan / httpd.conf
Created October 10, 2011 19:28
OS X Lion Apache2 Default httpd.conf
#
# Mac OS X / Mac OS X Server
# The <IfDefine> blocks segregate server-specific directives
# and also directives that only apply when Web Sharing or
# server Web Service (as opposed to other services that need Apache) is on.
# The launchd plist sets appropriate Define parameters.
# Generally, desktop has no vhosts and server does; server has added modules,
# custom virtual hosts are only activated when Web Service is on, and
# default document root and personal web sites at ~username are only
# activated when Web Sharing is on.
function parsePageSignedRequest() {
if (isset($_REQUEST['signed_request'])) {
$encoded_sig = null;
$payload = null;
list($encoded_sig, $payload) = explode('.', $_REQUEST['signed_request'], 2);
$sig = base64_decode(strtr($encoded_sig, '-_', '+/'));
$data = json_decode(base64_decode(strtr($payload, '-_', '+/'), true));
return $data;
}
return false;
@batuhan
batuhan / file1.php
Created October 29, 2011 23:43
kategori
<?php
echo 'contents';