Skip to content

Instantly share code, notes, and snippets.

View mohammadkarbalaee's full-sized avatar

Mohammad Karbalaee Shabani mohammadkarbalaee

View GitHub Profile
const prompt = require("prompt-sync")();
let rowsQuantity;
let columnsQuantity;
let matrix = [];
function getRowAndColumn(){
rowsQuantity = parseInt(prompt('how many rows does your matrix have? '));
columnsQuantity = parseInt(prompt('how many columns does your matrix have? '));
you either rule yourself for your own passion,
or there is someone out there who will rule you
for his own passion.
That's up to YOU!
import com.google.gson.Gson;
import java.io.DataOutput;
import java.io.DataOutputStream;
import java.io.IOException;
import java.net.Socket;
public class Client {
public static void main(String[] args) throws IOException {
Socket socket = new Socket("localhost",5000);
/*
this is how you pass arguments when assigning a callback in React
*/
const callback = (event,argument) => {
console.log(argument) //will print yess
}
<div onClick={this.callback.bind(this,"yes")}>
hello world!
</div>
@mohammadkarbalaee
mohammadkarbalaee / background-clip-text-example.markdown
Last active July 13, 2022 17:52
background-clip: text example

background-clip: text example

heroku ps:scale web=0
heroku ps:scale web=1
or
heroku maintenance:on
heroku maintenance:off
# http://stackoverflow.com/questions/2811453/how-to-stop-an-app-on-heroku
@mohammadkarbalaee
mohammadkarbalaee / xdotool.sh
Created January 10, 2023 23:55
To hide the sidebar of android emulator on Ubuntu
xdotool selectwindow
#type in the number you get from the previous command instead of <window id>
xdotool windowminimize <window id>
@mohammadkarbalaee
mohammadkarbalaee / installing-postman.md
Created January 12, 2023 20:42 — forked from pmkay/installing-postman.md
Installing Postman on Ubuntu/Gnome

Since Chrome apps are now being deprecated. Download postman from https://dl.pstmn.io/download/latest/linux

Although I highly recommend using a snap

sudo snap install postman

Installing Postman

tar -xzf Postman-linux-x64-5.3.2.tar.gz
@mohammadkarbalaee
mohammadkarbalaee / v2ray.md
Last active May 22, 2024 21:12
The steps I followed that let me install and run v2ray on linux successfully

1st

install v2ray via snap

sudo snap install v2ray

2nd

go to the installed directory of v2ray:

 cd /var/lib/snapd/void/
@mohammadkarbalaee
mohammadkarbalaee / extension.md
Last active February 10, 2023 05:22
How to install gnome extensions.