Skip to content

Instantly share code, notes, and snippets.

View moeinrahimi's full-sized avatar
💪

Moein Rahimi moeinrahimi

💪
View GitHub Profile
@moeinrahimi
moeinrahimi / Matrix.js
Last active June 20, 2023 03:35
using matrix-js-sdk on react-native
import React, { Component } from 'react';
import Promise from 'bluebird';
Promise.config({
warnings: false
});
import {
TextInput,
Button,
StyleSheet,
@moeinrahimi
moeinrahimi / node_setup.sh
Last active July 22, 2022 08:04
add new teleport node
#!/bin/bash
CLIENT=teleport_7.3.3_amd64.deb
if ! hash teleport 2>/dev/null
then
wget https://get.gravitational.com/$CLIENT
sudo dpkg -i $CLIENT
fi
echo going to add a new new teleport node
AUTH_TOKEN=$1
CA_PIN=$2
@moeinrahimi
moeinrahimi / app.js
Last active November 18, 2021 19:26
pure function
const R = require('ramda');
const filterFood = (food) => R.gt(food.amount, 0);
const cleaner = (day) =>
R.map((item) => R.filter(filterFood, item.foods), day.meals);
const removeZeroAmounts = (diet) => {
const dietClone = R.clone(diet);
const cleanDays = R.map(cleaner, dietClone.days);
return { ...dietClone, days: cleanDays };
};
@moeinrahimi
moeinrahimi / install.bat
Created October 15, 2021 18:46
oh.my.posh.bat
winget install JanDeDobbeleer.OhMyPosh
Install-Module z -AllowClobber
Install-Module -Name PSReadLine -RequiredVersion 2.2.0-beta1 -AllowPrerelease
Install-Module -Name Terminal-Icons -Repository PSGallery
@moeinrahimi
moeinrahimi / docker-compose.yml
Created September 5, 2021 14:28
metabase and postgres docker-compose production ready
version: '3.9'
services:
metabase:
image: metabase/metabase:latest
container_name: metabase
hostname: metabase
ports:
- 127.0.0.1:3000:3000
environment:
MB_DB_TYPE: postgres
@moeinrahimi
moeinrahimi / cloudSettings
Last active June 23, 2020 15:21
Visual Studio Code Settings Sync Gist
{"lastUpload":"2020-06-23T15:21:31.893Z","extensionVersion":"v3.4.3"}
@moeinrahimi
moeinrahimi / docker-help.md
Last active March 27, 2020 09:38 — forked from bradtraversy/docker-help.md
Docker Commands, Help & Tips

Docker Commands, Help & Tips

Show commands & management commands

$ docker

Docker version info

Keybase proof

I hereby claim:

  • I am moeinrahimi on github.
  • I am moeinrahimi (https://keybase.io/moeinrahimi) on keybase.
  • I have a public key ASDuEzxfiu5Fz5QK_b3NaylE6ga1oRbhPf7TvszbFGrWiAo

To claim this, I am signing this object:

@moeinrahimi
moeinrahimi / index.js
Created February 14, 2019 09:04
extract texts from webpage and save as a json file
function save(data,filename){
if(!data) {
console.error('Console.save: No data')
return;
}
if(!filename) filename = 'console.json'
if(typeof data === "object"){
@moeinrahimi
moeinrahimi / regex.js
Last active January 23, 2019 06:05
handy regex statements for iran datasets
// اعتبار سنجی شماره همراه
var mobileNumber = '989407422058'
var checkMobile = mobileNumber.match(/0?9[0-9]{9}/i)
/* output
["9893510000", index: 0, input: "989351000000", groups: undefined]
*/
// اعتبار سنجی کد ملی