Skip to content

Instantly share code, notes, and snippets.

@sijad
sijad / convertToPersian.js
Created March 5, 2017 10:36
conveer English to Persian number
function convertToPersian(str) {
var newStr = '';
for (var i = 0; i < str.length; i++)
{
var c = str.charCodeAt(i);
if (c >= 48 && c <= 57) {
c += 1728;
}
newStr += String.fromCharCode(c);
}
@sijad
sijad / ir
Last active December 16, 2016 16:44
modified /usr/share/X11/xkb/symbols/ir to be similar to macOS layout
// Iranian keyboard layout
////////////////////////////////////////
// Persian layout,
// based on
// Information Technology – Layout of Persian Letters and Symbols on Computer Keyboards
// ISIRI 9147 – 1st Edition
// Institute of Standards and Industrial Research of Iran
// http://www.isiri.org/UserStd/DownloadStd.aspx?id=9147
// http://behnam.esfahbod.info/standards/isiri-keyboard-9147.pdf
#!/usr/bin/env bash
sudo chown nginx:nginx -R $1
cd $1
# File permissions, recursive
find . -type f -exec chmod 0644 {} \;
# Dir permissions, recursive
find . -type d -exec chmod 0755 {} \;
@sijad
sijad / .vimrc
Last active November 5, 2016 17:38
My Vim instalaltion
set nocompatible
set backspace=2
filetype off
execute pathogen#infect()
filetype plugin indent on
syntax on
set background=dark
#!/usr/bin/env bash
# if [[ $(id -u) -ne 0 ]] ; then sudo -s ; fi
CONFIG="$HOME/proximac.json"
if [ ! -z $1 ]; then
CONFIG="$1"
fi

Keybase proof

I hereby claim:

  • I am sijad on github.
  • I am sijad (https://keybase.io/sijad) on keybase.
  • I have a public key whose fingerprint is 7311 4431 117B 6A51 4282 414C E538 A6D3 41A6 177D

To claim this, I am signing this object:

@sijad
sijad / story.md
Created March 21, 2016 18:35
Disaster with disabled csrutil Mac OS X EL Capitan 10.11
  • accidently run chmod 644 -R /
  • csrutil was disabled

solution:

  • command + s on boot
  • run mount -u / to allow writing
  • change chmod etc to make its content run-able
  • sudo /usr/libexec/repair_packages --verify --standard-pkgs /
  • sudo /usr/libexec/repair_packages --repair --standard-pkgs /