Skip to content

Instantly share code, notes, and snippets.

@serefyarar
serefyarar / gist:8559903
Last active January 4, 2016 03:09
Transparent text with imagemagick
<?php
$position = 'waist';
$size = 'normal';
$letters = 'SRT';
$color = "000000";
$font = 'arial';
$positions = array(
'waist'=>array(358,440,-6)
);
@serefyarar
serefyarar / gist:11135878
Last active August 29, 2015 14:00
Renk Sadeleştirme
<?php
$filterColors = array(
'altin' => array('gold', 'altin', 'hardal', 'mustard', 'poppy', 'buttercup', 'candlelight', 'marigold', 'canary'),
'gumus' => array('silver', 'gumus'),
'beyaz' => array('white', 'beyaz', 'inci', 'fildisi', 'kemik','kırık beyaz','ecru','ekru', 'cream', 'eggshell', 'ghost white', 'honeydew', 'snow', 'vanilla', 'smoke'),
'siyah' => array('black', 'siyah', 'zebra', 'charcoal', 'ebony', 'ashes', 'mystery', 'coal', 'midnight', 'raven', 'darkenss', 'velvet', 'dusk', 'shadow', 'stygian', 'gunmetal'),
'yesil' => array('green', 'yesil', 'yesili', 'haki', 'yosun', 'zeytin', 'bataklik', 'harlquin', 'honeydew', 'lime', 'mint', 'shamrock'),
'kahverengi' => array('brown', 'kahverengi', 'bakir', 'bronz', 'camel', 'ceviz', 'kakao', 'leopar', 'taba', 'ma un', 'tutun', 'toprak', 'vizon', 'barut', 'asiboyasi', 'auburn', 'beaver', 'bole', 'bronze', 'burnt umber', 'chestnut', 'chocolate', 'cikolata', 'coffee', 'kahve', 'taupe', 'tawny'),
'mavi' => array('blue', 'mavi','civit
@serefyarar
serefyarar / gist:11255070
Created April 24, 2014 13:42
Array - Kartezyen
function cartesianProductOf() {
return Array.prototype.reduce.call(arguments, function(a, b) {
var ret = [];
a.forEach(function(a) {
b.forEach(function(b) {
ret.push(a.concat([b]));
});
});
return ret;
@serefyarar
serefyarar / gist:11352654
Last active August 29, 2015 14:00
Nebim Stok View
SELECT
s.nStokID as StokID,
sb.sBarkod as Barkod,
s.sModel as Model,
s.sKodu as StokKodu,
s.sAciklama as ModelAdi,
r.sRenkAdi as Renk,
s.sBeden as Beden,
r.sRenk as RenkID,
s.sBedenTipi as BedenTipi,
UPDATE tbStokSiraNo SET nSonID = nSonID+1 WHERE nSiraIndex = 2
__nStokFisiID = SELECT nSonID FROM tbStokSiraNo WHERE nSiraIndex = 2
INSERT INTO tbStokFisiMaster VALUES (__nStokFisiID , 'FS' , '__GG/AA/YYYY' , 3, __FATURANO, __FIRMAID, '' , '__GG/AA/YYYY' , 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, Null , Null, Null, Null , Null, '' , 0, 0, 0, Null, '' , 0, 'sa' , getdate(), '__YAZIYLA TOTAL' ,0, 0, 0, 0, 0, 0 )
INSERT INTO tbStokFisiAciklamasi VALUES (__nStokFisiID,'','','','','');
/*Foreach Item In Cart*/
UPDATE tbStokSiraNo SET nSonID = nSonID+1 WHERE nSiraIndex = 1
__nIslemID = SELECT nSonID FROM tbStokSiraNo WHERE nSiraIndex = 1
@serefyarar
serefyarar / definition.md
Last active August 29, 2015 14:08
Hobium Developer
We couldn’t find that file to show.
@serefyarar
serefyarar / gist:32bc92f0902ed7dbe9a3
Created May 3, 2015 17:17
Çalışması lazım
<?php
$films = Film::with('roles','genre');
$title = Input::get('title',false);
if($title){
$films->where('title',$title);
}
$genre = Input::get('genre',false);
if($genre){
function Advertisement(category,media_id,frequency,duration){
this.category = category,
this.media_id = media_id;
this.frequency = frequency;
this.duration = duration;
this.getAds = function(){
var ads = [{time : 0, adTagUrl : this.getVast("preRoll")}];
var midrollCount = parseInt(this.duration/this.frequency);
for(i=1;i<=midrollCount;i++){
var midroll = {
@serefyarar
serefyarar / DataArraySerializer.php
Created August 2, 2015 16:09
My Own Keyless Fractal Serializer
<?php
namespace App\Serializers;
use League\Fractal\Serializer\JsonApiSerializer;
use League\Fractal\Resource\ResourceInterface;
class DataArraySerializer extends JsonApiSerializer
{
/**
@serefyarar
serefyarar / FFmpeg Build Script (Amazon Linux)
Created October 4, 2015 18:24 — forked from thenadz/FFmpeg Build Script (Amazon Linux)
Downloads & builds FFmpeg along with all dependencies in parallel, enabling all features
#!/bin/bash -e
# Distro: Amazon Linux AMI release 2015.03
# Derived from https://trac.ffmpeg.org/wiki/CompilationGuide/Centos
# Builds the dependencies in parallel prior to starting FFmpeg build.
sudo yum update -y
sudo yum install -y autoconf automake cmake freetype-devel gcc gcc-c++ git libtool make mercurial nasm pkgconfig zlib-devel yasm libogg libvorbis-devel libvpx-devel