Skip to content

Instantly share code, notes, and snippets.

View zoghal's full-sized avatar
🏠
Working from home

Saleh Souzanchi zoghal

🏠
Working from home
View GitHub Profile
@zoghal
zoghal / gist:7ce49044c4a9a5acb755e5592ef81d68
Last active February 8, 2019 14:28
دادگان پردازش زبان/برای تجزیه و تحلیل احساسات-جهت شناسایی و روانکاوی پوپولیست‌های توییتر
آتيست
آداب
آدم
آدمیت
آدم‌ها
آزادی
آمریکا
آنقدر
احمق
احمق‌ها
@zoghal
zoghal / gist:06f9d8ffdbd82bbea4ce76e38a999d3b
Last active January 23, 2018 12:54 — forked from baghayi-gist/gist:4009084
PHP: Converting Numbers functions Persian To English & English To Persian
function convertNumbersFaToEn($number)
{
$persian = array('۰', '۱', '۲', '۳', '۴', '۵', '۶', '۷', '۸', '۹');
$num = range(0, 9);
return str_replace($persian, $num, $number);
}
function convertNumbersEnToFA($number)
{
$persian = array('۰', '۱', '۲', '۳', '۴', '۵', '۶', '۷', '۸', '۹');
$num = range(0, 9);
@zoghal
zoghal / gist:51abc81a20a69308039af46844babed7
Last active June 15, 2017 19:36
بهداد عبادی
<html dir="rtl">
<body>
<p>کمتر از دوسال پیش برای ساخت یک پوستر نیاز به قلم آزاد داشتم و پس از کمی جست‌وجو فهمیدم قلم‌های فارسی با مجوز آزاد بسیار کم هستند و آن‌هایی هم که هستند بسیار نامناسب!</p>
<p>این داستان هم زمان بود با حضور خواهرم در دو سالانه سرو نقره‌ای که نگاه ویژه‌ای به قلم داشت. همین طور که خواهرم درگیر دوسالانه بود و گاهی خبرهایی راجع به قلم‌ها بهم می‌داد با خودم گفتم چرا منتظر باشم تا شــــایـد یکی دیگر این مشکل را حل کند؟ چرا من برایش تلاش نکنم؟ این شد که تصمیم گرفتم تا حد توانم برای حل این مشکل دست به کار شوم.</p>
<p>برایم خیلی واضح بود که از ما برنامه‌نویس‌ها طراح قلم در نمی‌آید و این فکر که خودم بروم قلم طراحی کنم را هم کلا دور ریختم. از همان اول به دنبال راهی برای جذب طراح‌های قلم برای طراحی قلمی با مجوز آزاد بودم.</p>
<p>با کمی جست‌وجو و تحقیق فهمیدم مشکل تنها برای ما آزادکارها نیست و کلا قلم فارسی مناسب بسیار کم داریم حتی می‌شود گفت برای صفحه‌های نمایش اصلا نداریم.</p>
<p>شاید این مورد رو حس نکرده باشید بگذارید با چند مثال ساده مساله را باز کنم.</p>
<p>تا حالا چند بار شده خطی از متنی را ب
@zoghal
zoghal / debug.py
Created October 8, 2016 10:50 — forked from sah/debug.py
some handy functions for debugging python code
# Copyright © 2011, 2012, 2013, 2014 Sauce Labs Inc
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
@zoghal
zoghal / gist:2619eabdc65fa5725000
Created January 30, 2016 18:12
pfont meta information
copyright :
Copyright (c) 2016, Free and open-source software community <http://foss.ir|info@foss.ir>,with Reserved Font Name $pfont .
trademark:
$pfont is a service mark of foss.ir for use in Free and Open Source Software.
@zoghal
zoghal / فهرست
Created October 28, 2015 11:16
NameList for Persian Glyphs
/************************
# l = لیگچرز
# c = کاراکتر اصلی
# g = گلیف فرم‌های کاراکتر
# s = علامت ها
# m = اعراب یا مارک ها
*************************/
0x0020 s.space
0x000A s.eol
0x000D s.cr
@zoghal
zoghal / nginx.conf
Created October 17, 2015 00:15 — forked from plentz/nginx.conf
Best nginx configuration for improved security(and performance). Complete blog post here http://tautt.com/best-nginx-configuration-for-security/
# to generate your dhparam.pem file, run in the terminal
openssl dhparam -out /etc/nginx/ssl/dhparam.pem 2048
@zoghal
zoghal / gsub.js
Last active September 6, 2015 02:55 — forked from geowarin/gsub.js
Javascript implementation of ruby gsub
String.prototype.gsub = function (pattern, replacement) {
var match, result, source = this.toString();
if (pattern == null || replacement == null) {
return source;
}
result = '';
while (match = source.match(pattern)) {
result += source.slice(0, match.index);
result += typeof replacement === 'function' ? replacement(match[0]) : replacement;
source = source.slice(match.index + match[0].length);
@zoghal
zoghal / reverseWords
Created September 4, 2015 19:35
JavaStrings methods
function StringUtil() {
this.reverseWords = function(str) {
var result = "";
var wordArray = str.split(" ");
for(var i = wordArray.length - 1; i >= 0; i--) {
result += wordArray[i] + " ";
}
return result.trim();
}
@zoghal
zoghal / JS gsub
Last active August 29, 2015 14:26 — forked from varunkumar/JS gsub
JavaScript implementaion of ruby's gsub
gsub = function(source, pattern, replacement) {
var match, result;
if (!((pattern != null) && (replacement != null))) {
return source;
}
result = '';
while (source.length > 0) {
if ((match = source.match(pattern))) {
result += source.slice(0, match.index);
result += (typeof replacement === 'function') ? replacement(match[0]) : replacement;