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");
/*!
* toggleHtml
* $(element).toggleHtml( [html] );
*
* mit license. sercan cakir. 2012.
*/
$(function () {
$.fn.toggleHtml = function (html) {
var string = this.attr('data-toggle-html');
/*!
* toggleText
* $(element).toggleText ( [text] );
*
* mit license. sercan cakir. 2012.
*/
$(function () {
$.fn.toggleText = function (text) {
var string = this.attr('data-toggle-text');
@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',
);
/*!
* upperCase
* $(element).upperCase( [text] );
*
* mit license. sercan cakir. 2013.
*/
$(function () {
$.fn.upperCase = function() {
return this.each(function() {
var $self = $(this),
@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
@mayoz
mayoz / dabblet.css
Created December 21, 2013 11:20
The first commented line is your dabblet’s title
/**
* The first commented line is your dabblet’s title
*/
body{font:14px/20px arial; margin:50px;}
.box{float:left; margin-right:25px; }
article{background:#eee no-repeat 50% 50%; background-size:cover; border-radius:3px; height:256px; overflow:hidden; position:relative; width:193px;}
article > a{background:linear-gradient(0, rgba(0,0,0,.4), transparent, transparent); color:#fff; display:block; height:100%; text-shadow:1px 1px 0 rgba(0,0,0,.65); width:100%; }