View cipher
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 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); | |
} |
View gist:f8565c079e48d496b3e1
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 | |
$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', |
View gist:8562be54f4559080a507
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 | |
$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', |
View gist:6a53c88d8ffb64744751
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 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); |
View gist:c5c22a4c4aee7b00345e
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 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); | |
View gist:63f1c4d05f75d8115efa
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 | |
return array( | |
'basePath' => dirname(__FILE__) . DS . '..' , | |
'language' => 'fa' , | |
'theme' => 'dream' , | |
'name' => 'پرشین مگز', | |
'import' => array( | |
'application.controllers.*', | |
'application.models.*', |
View gist:88d10dfc72e25b875fe1
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
/* | |
* get user roles | |
*/ | |
public function getRoles(){ | |
$roles = array(); | |
$sql = sprintf('select itemname from %s where userid = %d', Yii::app()->authManager->assignmentTable, Yii::app()->user->id); | |
//cache dependency |
View font-face
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
@font-face { | |
font-family: "nassim"; | |
src: url('../fonts/nassim-regular.eot?1387626872'); | |
src: url('../fonts/nassim-regular.eot?&1387626872#iefix') format('embedded-opentype'), url('../fonts/nassim-regular.woff?1387626920') format('woff'), url('../fonts/nassim-regular.ttf?1387626940') format('truetype'); | |
font-weight: "normal"; | |
font-style: "normal"; | |
} |
View concat.bash
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
# | |
# How to use | |
# ./concat main_video.mp4 prefix_video.mp4 output.mp4 | |
# | |
# | |
rm -rf $3 | |
SILENT="-loglevel panic" | |
SILENT="" |
View concat.bash
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
rm -rf $3 | |
START=$(($(date +%s)*1000)) | |
SILENT="-loglevel panic" | |
SILENT="" | |
# get video size | |
eval $(ffprobe -v error -of flat=s=_ -select_streams v:0 -show_entries stream=height,width $1) | |
size=${streams_stream_0_width}:${streams_stream_0_height} |
OlderNewer