Skip to content

Instantly share code, notes, and snippets.

Keybase proof

I hereby claim:

  • I am erfun-kh on github.
  • I am erfun (https://keybase.io/erfun) on keybase.
  • I have a public key ASAMD8rTOCFNrfHi84JIXUUUa_CTQmuTfPiD8Ll2oyC5Lgo

To claim this, I am signing this object:

/// convert persian number to en
function persianToEnDigit(data) {
return data.replace(/[\u06F0-\u06F9]+/g, function (digit) {
var ret = '';
for (var i = 0, len = digit.length; i < len; i++) {
ret += String.fromCharCode(digit.charCodeAt(i) - 1728);
}
return ret;
});
syntax = "proto3";
message Person {
int32 age = 1;
string first_name = 2;
string last_name = 3;
bytes small_picture = 4;
bool is_profile_verified = 5;
float height = 6;
}
syntax = "proto3";
message Person {
int32 age = 1;
string first_name = 2;
string last_name = 3;
bytes small_picture = 4;
bool is_profile_verified = 5;
float height = 6;
// The syntax for this file is proto3
syntax = "proto3";
/* Person is used to identify users
* across our system */
message Person {
// the age as of the person's creation
int32 age = 1;
// the first name as documented in the signup form
string first_name = 2;
// The syntax for this file is proto3
syntax = "proto3";
/* Person is used to identify users
* across our system */
message Person {
// the age as of the person's creation
int32 age = 1;
// the first name as documented in the signup form
string first_name = 2;
// The syntax for this file is proto3
syntax = "proto3";
/* Person is used to identify users
* across our system */
message Person {
// the age as of the person's creation
int32 age = 1;
// the first name as documented in the signup form
string first_name = 2;
syntax = "proto3";
message Date {
// Year of date. Must be from 1 to 9999, or 0 if specifying a date without
// a year.
int32 year = 1;
// Month of year. Must be from 1 to 12.
int32 month = 2;
syntax = "proto3";
package my.date;
message Date {
// Year of date. Must be from 1 to 9999, or 0 if specifying a date without
// a year.
int32 year = 1;
// Month of year. Must be from 1 to 12.
@ErFUN-KH
ErFUN-KH / swap.sh
Last active March 19, 2023 18:50
Create 4GB swap memory
#!/bin/bash
touch /var/swap.img && \
chmod 600 /var/swap.img && \
dd if=/dev/zero of=/var/swap.img bs=1024k count=4000 && \
mkswap /var/swap.img && \
swapon /var/swap.img && \
echo "/var/swap.img none swap sw 0 0" >> /etc/fstab && \
ulimit -n 51200