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 | |
/***************************************************************************** | |
* In the name of God the Most Beneficent the Most Merciful * | |
*___________________________________________________________________________* | |
* This program is free software: you can redistribute it and/or modify * | |
* it under the terms of the GNU General Public License as published by * | |
* the Free Software Foundation, either version 3 of the License, or * | |
* (at your option) any later version. * | |
*___________________________________________________________________________* | |
* This program is distributed in the hope that it will be useful, * |
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 | |
/** | |
* Sum tow very big number | |
* @param $n1 | |
* @param $n2 | |
* @return string | |
*/ | |
function big_sum($n1,$n2) | |
{ | |
if(strlen($n1) > strlen($n2)){ |
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
const w=(['isMa ster','length', | |
'random','fromCha rCode','send',/// | |
'splice','exit','cp us','push','fork'// | |
,'on','message','done ','write','stdout'//* | |
,'os','cluster'])['map' ](x=>x.replace(/ /g,'') | |
);const os=require(w[15]) ;const cluster=require(w[ | |
16]);if(cluster[w[0]]){let queue=['01001000','0110000' | |
+'1','01110000','01110000','0 1111001','00100000','0101000' | |
+'0','01110010','01101111','01100111','01110010','01100001' | |
,'01101101','01101101','01100101','01110010','01110011'// |
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
#!/bin/bash | |
if [[ $EUID -ne 0 ]]; then | |
echo "This script must be run as root" | |
exit 1 | |
fi | |
export HOME=/home/qti3e/ | |
cd /home/qti3e/Android/Sdk/tools/ | |
./emulator @Nexus_5X_API_26 -gpu on &> /dev/null & | |
sleep 5 | |
renice -n -30 -p $(ps aux | grep "@Nexus_5X_API_26" | grep -v grep | head -n 1 | awk '{print $2}') |
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
let persian = {'۰': 0, '۱': 1, '۲': 2, '۳': 3, '۴': 4, '۵': 5, '۶': 6, '۷': 7, '۸': 8 , '۹': 9} | |
function validateAndNormalizePhone(phone){ | |
if(!phone || typeof phone !== 'string') | |
return false | |
phone = phone.replace(/ /g, '') | |
let tmp = '' | |
for(let i = 0;i < phone.length;i++){ | |
let letter = phone[i] |
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
import React, {Component} from 'react' | |
import hoistNonReactStatic from 'hoist-non-react-statics' | |
export default function(WrappedComponent){ | |
class withWindowDimensions extends Component{ | |
constructor(props){ | |
super(props) | |
this.updateDimensions = this.updateDimensions.bind(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
import { Params, T } from "propel" | |
let params = new Params() | |
let trainingData = [ | |
[[0, 0, 1], 0], | |
[[0, 1, 1], 1], | |
[[1, 0, 1], 1], | |
[[1, 1, 1], 1] | |
] | |
let unit_step = x => x < 0 ? 0 : 1 | |
let w = params.randn("W", [3]) |
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
// @flow | |
import Redis from 'redis'; | |
import bluebird from 'bluebird'; | |
import type {RedisClient} from 'redis'; | |
import uuid from 'uuid/v4'; | |
import md5 from 'md5'; | |
bluebird.promisifyAll(Redis.RedisClient.prototype); | |
const SearchClient: RedisClient = Redis.createClient({ | |
db: 2 | |
}); |
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 | |
$time1 = microtime(true); | |
include "lib.php"; | |
try{ | |
$db = new array_db("db1"); | |
}catch(Exception $e){ | |
echo $e->getMessage(); | |
} | |
$db->install([ | |
"users" => [ |
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 | |
// 2015/07 :) | |
/** | |
* The core class of Template Engine | |
* Class templateEngine | |
*/ | |
class templateEngine{ | |
/** | |
* @type array | |
*/ |
OlderNewer