Skip to content

Instantly share code, notes, and snippets.

View raminious's full-sized avatar

Ramin Mo raminious

View GitHub Profile
<?php
return array(
'basePath' => dirname(__FILE__) . DS . '..' ,
'language' => 'fa' ,
'theme' => 'dream' ,
'name' => 'پرشین مگز',
'import' => array(
'application.controllers.*',
'application.models.*',
var http = require('http');
var path = require('path');
var fs = require('fs');
//var stream = require('stream');
http.createServer(function (req, res) {
var filename = [__dirname, 'file.mp3'].join(path.sep);
@raminious
raminious / gist:6a53c88d8ffb64744751
Created October 6, 2014 20:13
my node streamer
var http = require('http');
var path = require('path');
var fs = require('fs');
var stream = require('stream');
http.createServer(function (req, res) {
//res.writeHead(200, {'Content-Type': 'text/plain'});
var filename = [__dirname, 'file.mp3'].join(path.sep);
<?php
$params = array_merge(
require(__DIR__ . '/../../common/config/params.php'),
require(__DIR__ . '/../../common/config/params-local.php'),
require(__DIR__ . '/params.php'),
require(__DIR__ . '/params-local.php')
);
return [
'id' => 'app-frontend',
@raminious
raminious / gist:f8565c079e48d496b3e1
Created September 29, 2014 19:20
Yii frontend config
<?php
$params = array_merge(
require(__DIR__ . '/../../common/config/params.php'),
require(__DIR__ . '/../../common/config/params-local.php'),
require(__DIR__ . '/params.php'),
require(__DIR__ . '/params-local.php')
);
return [
'id' => 'app-frontend',
<?php
class Cipher extends CApplicationComponent{
private $securekey, $iv;
public function init(){
$this->securekey = hash('sha256', 'SADFo92j!!zVnz@Sj!39IU%YGvi^6eL8&v6*Rv(JH8)Cytuiouh547vCytdyUFl76R', true);
$this->iv = mcrypt_create_iv(32);
}