Skip to content

Instantly share code, notes, and snippets.

View f's full-sized avatar
:octocat:
open sourcing

Fatih Kadir Akın f

:octocat:
open sourcing
View GitHub Profile
if (input.is('textarea.rich')) {
$(input).tinymce({
theme_advanced_toolbar_location : "top",
theme_advanced_toolbar_align : "left",
theme_advanced_resizing : true,
theme : "advanced",
script_url : 'js/tinymce/jscripts/tiny_mce/tiny_mce.js',
setup : function(editor){
editor.onEvent.add(function(editor) {
var hidden = translation(input);
SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";
CREATE TABLE IF NOT EXISTS `exam_classes` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`name` varchar(255) NOT NULL,
`school_id` int(11) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;
function Ordek() {}
Ordek.prototype = {
vak : function()
{
alert('vak vak');
},
yuz : function()
{
alert('yüz..');
}
if (data.join)
alert('Join yapabildiğine göre bu bir array olabilir.');
@f
f / gist:829765
Created February 16, 2011 17:26
Math.php
<?php
class Math {
/**
* Toplama işlemi
*
* @param $a
* @param $b
* @return int Sonuç
*/
@f
f / gist:829780
Created February 16, 2011 17:35
MathTest.php
<?php
require_once 'Math.php';
class MathTest extends PHPUnit_Framework_TestCase {
/**
* @var Math
*/
protected $object;
@f
f / gist:829850
Created February 16, 2011 18:16
MathTest.php
<?php
require_once 'Math.php';
class MathTest extends PHPUnit_Framework_TestCase {
/**
* @var Math
*/
protected $object;
@f
f / gist:829858
Created February 16, 2011 18:23
Math.php
<?php
class Math {
/**
* Toplama işlemi
*
* @param $a
* @param $b
* @return int Sonuç
*/
<?php
//...
$this->assertEquals(26, $this->object->add(5,3,2,1,5,10), '5+3+2+1+5+10=26 olmalı');
//...
?>
<?php
//...
public function add(/* sınırsız değer alabilir... */)
{
//fonksiyona gelen parametrelerin tümünü array olarak alalım.
$values = func_get_args();
//gelen arrayın değerlerini toplayarak geri dönelim
return array_sum($values);
}
//...