Skip to content

Instantly share code, notes, and snippets.

View mayoz's full-sized avatar
🧶
If you don't understand it, you can't change it!

Sercan Cakir mayoz

🧶
If you don't understand it, you can't change it!
View GitHub Profile
<?php
$one->one = 1;
$two->two->one = 21;
$two->two->two = 22;
$three->two->one = 31;
$return_obj = object_merge($one, $two, $three);
// returns:
// Array
// Use built in or binary modules
var crypto = require('crypto');
var hash = crypto.createHmac("sha1",key).update(signatureBase).digest("base64");
@mayoz
mayoz / app.js
Created June 14, 2013 20:10 — forked from p-baleine/app.js
var express = require('express')
, io = require('socket.io');
var app = express()
, server = require('http').createServer(app)
, io = io.listen(server);
server.listen(3000);
io.sockets.on('connection', function(socket) {
<?php
class Controller_Twitter extends Controller {
public function action_index () {
// Load a consumer from config file.
$consumer = OAuth_Consumer::factory( Kohana::config( 'oauth.twitter' ) );
<?php
// Resizer and Image Manipulation
// Based on: http://forums.laravel.com/viewtopic.php?id=2648
public function post_edit_logo($id)
{
$rules = array(
'image' => 'image',
);
@mayoz
mayoz / gist:7942198
Created December 13, 2013 09:58 — forked from JonoB/gist:6637861
<?php namespace Tmb;
use Illuminate\Database\Eloquent\Model as Eloquent;
use Illuminate\Validation\Validator;
class BaseModel extends Eloquent
{
/**
* Error message bag
[
{
"name":"Adana",
"slug":"adana",
"plate_code":1,
"districts":[
{
"name":"Alada\u011f",
"slug":"aladag"
},
<?php
App::after(function($request, $response)
{
/**
* HTML Minification
* https://gist.github.com/zmsaunders/5619519
* https://gist.github.com/garagesocial/6059962
*/
if (Config::get('project.minify.html', false) !== false)
<?php
namespace Mayoz\Service\Html;
use Illuminate\Html\FormBuilder as IlluminateFormBuilder;
class FormBuilder extends IlluminateFormBuilder {
/**
* An array containing the currently opened form groups.
/*!
* Grunt
* $ npm install grunt-contrib-uglify grunt-autoprefixer grunt-contrib-cssmin grunt-contrib-imagemin grunt-contrib-sass grunt-contrib-watch grunt-contrib-concat grunt-contrib-clean grunt-contrib-jshint grunt-notify --save-dev
*/
module.exports = function(grunt) {
grunt.initConfig({
// Sass