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
// @ts-check | |
/** | |
* Forward local port to an external port through a local network proxy | |
* | |
* @author Masoud Zohrabi <[email protected]> | |
*/ | |
let net = require('net'); | |
let invariant = (expr, error) => { if (!expr) throw Error(error); }; |
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 startDate = new Date('2010-01-01'); | |
let endDate = new Date('2060-12-29'); | |
let date = new Date(startDate); | |
let result = ''; | |
while (date < endDate) { | |
let monthName = new Intl.DateTimeFormat('fa-IR-u-nu-latn', { month: 'long' }).format(date); | |
let month = new Intl.DateTimeFormat('fa-IR-u-nu-latn', { month: 'numeric' }).format(date); | |
let weekDayName = new Intl.DateTimeFormat('fa-IR-u-nu-latn', { weekday: 'long' }).format(date); | |
let weekDay = ['شنبه','یکشنبه','دوشنبه','سهشنبه','چهارشنبه','پنجشنبه','جمعه'].indexOf(weekDayName) + 1; |
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
/** | |
* Forward local port to an external port through a local network proxy | |
* | |
* @author Masoud Zohrabi <[email protected]> | |
*/ | |
let net = require('net'); | |
let invariant = (expr, error) => { if (!expr) throw Error(error); }; | |
let log = console.log.bind(console); |
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
/** | |
* Strapi Restrict User to Retrieve data only related to him (Strapi V4.0) | |
* | |
* @author Masoud Zohrabi <[email protected]> | |
*/ | |
module.exports = (ctx, config, {strapi}) => { | |
// Assert user logged-in | |
if (!ctx.state.user) return false; |
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
package mdzzohrabi.adapter | |
import android.support.v7.widget.RecyclerView | |
import java.util.ArrayList | |
/** | |
* Endless Recycler view adapter | |
* @author Masoud Zohrabi <[email protected]> | |
*/ | |
abstract class EndlessAdapter<VH: RecyclerView.ViewHolder, T>: RecyclerView.Adapter<VH>() { |
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 net = require( 'net' ); | |
const process = require( 'process' ); | |
const [ nodePath , scriptPath , port ] = process.argv; | |
if ( port === undefined ) { | |
console.error( 'Port not defined' ); | |
return; | |
} |
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 | |
/** | |
* (c) Masoud Zohrabi <[email protected]> | |
* | |
* For the full copyright and license information, please view the LICENSE | |
* file that was distributed with this source code. | |
*/ | |
namespace Mdzzohrabi\Form; |
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
package com.example.android.basicnotifications; | |
import android.app.Activity; | |
import android.app.NotificationManager; | |
import android.app.PendingIntent; | |
import android.content.Intent; | |
import android.graphics.BitmapFactory; | |
import android.net.Uri; | |
import android.os.Bundle; | |
import android.support.v4.app.NotificationCompat; |
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 | |
/** | |
* Controller | |
*/ | |
abstract class Controller { | |
/** | |
* Render view | |
* @param string $view View file | |
* @param array $params View parameters | |
* @return string Rendered view |
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
# Orginal methods and variable | |
Base = { | |
jQuery: | |
append: jQuery.fn.append | |
val: jQuery.fn.val | |
remove: jQuery.fn.remove | |
} | |
window.Base = Base |