This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Use built in or binary modules | |
var crypto = require('crypto'); | |
var hash = crypto.createHmac("sha1",key).update(signatureBase).digest("base64"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/*! | |
* toggleHtml | |
* $(element).toggleHtml( [html] ); | |
* | |
* mit license. sercan cakir. 2012. | |
*/ | |
$(function () { | |
$.fn.toggleHtml = function (html) { | |
var string = this.attr('data-toggle-html'); | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/*! | |
* toggleText | |
* $(element).toggleText ( [text] ); | |
* | |
* mit license. sercan cakir. 2012. | |
*/ | |
$(function () { | |
$.fn.toggleText = function (text) { | |
var string = this.attr('data-toggle-text'); | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class Controller_Twitter extends Controller { | |
public function action_index () { | |
// Load a consumer from config file. | |
$consumer = OAuth_Consumer::factory( Kohana::config( 'oauth.twitter' ) ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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', | |
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/*! | |
* upperCase | |
* $(element).upperCase( [text] ); | |
* | |
* mit license. sercan cakir. 2013. | |
*/ | |
$(function () { | |
$.fn.upperCase = function() { | |
return this.each(function() { | |
var $self = $(this), |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php namespace Tmb; | |
use Illuminate\Database\Eloquent\Model as Eloquent; | |
use Illuminate\Validation\Validator; | |
class BaseModel extends Eloquent | |
{ | |
/** | |
* Error message bag |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* 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%; } |
OlderNewer