Skip to content

Instantly share code, notes, and snippets.

View MetaiR's full-sized avatar

Seyed Ali Roshan MetaiR

  • Snapp Fintech
  • Iran - Tehran
View GitHub Profile
@MetaiR
MetaiR / Program.cs
Created December 12, 2020 06:22 — forked from mattjohnsonpint/Program.cs
Airport Time Zones
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text.RegularExpressions;
using GeoTimeZone; // Import from Nuget package "GeoTimeZone" (https://github.com/mj1856/GeoTimeZone)
using TimeZoneConverter; // Import from Nuget package "TimeZoneConverter" (https://github.com/mj1856/TimeZoneConverter)
namespace AirportTimeZones.DataBuilder
{
@MetaiR
MetaiR / Laravel-Container.md
Created September 8, 2019 11:28
Laravel's Dependency Injection Container in Depth

Laravel's Dependency Injection Container in Depth

Translations: Korean (by Yongwoo Lee)

Laravel has a powerful Inversion of Control (IoC) / Dependency Injection (DI) Container. Unfortunately the official documentation doesn't cover all of the available functionality, so I decided to experiment with it and document it for myself. The following is based on Laravel 5.4.26 - other versions may vary.

Introduction to Dependency Injection

I won't attempt to explain the principles behind DI / IoC here - if you're not familiar with them you might want to read What is Dependency Injection? by Fabien Potencier (creator of the Symfony framework).

@MetaiR
MetaiR / date.helper.ts
Created June 9, 2019 02:08
Jalali date converter (needs jalali-moment library)
import * as moment from 'jalali-moment';
export class DateHelper {
static monthsNames = [
'فروردین',
'اردیبهشت',
'خرداد',
'تیر',
'مرداد',
'شهریور',
@MetaiR
MetaiR / .htaccess
Created April 27, 2019 15:21 — forked from julianpoemp/.angular-htaccess.md
Optimal .htaccess configuration for Angular 7, Angular 6, Angular 5 (and older) app in production incl. fix for the angular browser caching issue.
# INSTRUCTION:
# Place this file next to the app's index.html.
# There are two options for the redirection:
# Option 1) (default): Your app is directly on the root of the domain.
# Option 2): Your app is placed in a subfolder from the root of the domain.
#
# If you have issues with browser caching you can uncomment the BROWSER CACHING part
# For new versions of this Gist go to:
# https://gist.github.com/julianpoemp/bcf277cb56d2420cc53ec630a04a3566
@MetaiR
MetaiR / jwtRS256.sh
Created February 20, 2019 13:16 — forked from ygotthilf/jwtRS256.sh
How to generate JWT RS256 key
ssh-keygen -t rsa -b 4096 -m PEM -f jwtRS256.key
# Don't add passphrase
openssl rsa -in jwtRS256.key -pubout -outform PEM -out jwtRS256.key.pub
cat jwtRS256.key
cat jwtRS256.key.pub
@MetaiR
MetaiR / shell.sh
Created October 7, 2018 04:26
my java vm options
java -jar -XmxSIZEm -XmsSIZEm -XX:+AggressiveHeap -server -XX:+UseLargePages -XX:+UseCondCardMark -XX:+UseParallelGC the-jar-file.jar
@MetaiR
MetaiR / livestream.component.ts
Created August 15, 2018 22:19 — forked from shah-smit/livestream.component.ts
Angular 4, Live Streaming
import { Component, OnInit, OnDestroy } from '@angular/core';
import { Router } from '@angular/router';
import { LoginService, AzureService } from '../services'
import { User, LiveSession } from '../models'
import { SharedService } from "app/services/shared.service";
//declare var SimpleWebRTC;
declare var io;
declare var conference;
@Component({
@MetaiR
MetaiR / any.component.html
Created May 27, 2018 18:55 — forked from arniebradfo/any.component.html
Angular *ngFor recursive list tree template
<h1>Angular 2 Recursive List</h1>
<ul>
<ng-template #recursiveList let-list>
<li *ngFor="let item of list">
{{item.title}}
<ul *ngIf="item.children.length > 0">
<ng-container *ngTemplateOutlet="recursiveList; context:{ $implicit: item.children }"></ng-container>
</ul>
</li>
</ng-template>
@MetaiR
MetaiR / API.md
Created May 10, 2018 20:08 — forked from iros/API.md
Documenting your REST API

Title

<Additional information about your API call. Try to use verbs that match both request type (fetching vs modifying) and plurality (one vs multiple).>

  • URL

    <The URL Structure (path only, no root url)>

  • Method:

@MetaiR
MetaiR / Example1.ts
Created February 18, 2018 07:17
simple-storage-tools examples
import { Storage } from 'simple-storage-tools';
enum StorageKeys {
KEY1 = 'fist-storage',
KEY2 = 'second-storage',
localKey = 'key-for-local-storage',
sessionKey = 'key-for-session-storage'
}
/**