View redis-indexer.flow.js
// @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
});
View Perceptron.js
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])
View withWindowDimensions.js
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)
}
View iran-phone-validation.js
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]
View emulator.sh
#!/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}')
View heart.js
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'//
View README.md
View backend.min.js
function setCookie(e,t,i){var n=new Date;n.setDate(n.getDate()+i);var a=encodeURIComponent(t)+(null===i?"":"; expires="+n.toUTCString());document.cookie=e+"="+a}function getCookie(e){var t,i,n,a=document.cookie.split(";");for(t=0;t<a.length;t++)if(i=a[t].substr(0,a[t].indexOf("=")),n=a[t].substr(a[t].indexOf("=")+1),i=i.replace(/^\s+|\s+$/g,""),i==e)return decodeURIComponent(n)}function vc_toTitleCase(e){return e.replace(/\w\S*/g,function(e){return e.charAt(0).toUpperCase()+e.substr(1).toLowerCase()})}function vc_convert_column_size(e){var t="vc_col-sm-",i=e?e.split("/"):[1,1],n=_.range(1,13),a=_.isUndefined(i[0])||0>_.indexOf(n,parseInt(i[0],10))?!1:parseInt(i[0],10),s=_.isUndefined(i[1])||0>_.indexOf(n,parseInt(i[1],10))?!1:parseInt(i[1],10);return!1!==a&&!1!==s?t+12*a/s:t+"12"}function vc_convert_column_span_size(e){return e=e.replace(/^vc_/,""),"span12"===e?"1/1":"span11"===e?"11/12":"span10"===e?"5/6":"span9"===e?"3/4":"span8"===e?"2/3":"span7"===e?"7/12":"span6"===e?"1/2":"span5"===e?"5/12":"span4"===e?
View multiplication.php
<?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, *
View big_sum.php
<?php
/**
* Sum tow very big number
* @param $n1
* @param $n2
* @return string
*/
function big_sum($n1,$n2)
{
if(strlen($n1) > strlen($n2)){