I hereby claim:
- I am ebraminio on github.
- I am ebrahim (https://keybase.io/ebrahim) on keybase.
- I have a public key whose fingerprint is EE83 C31D DD17 A4AB D26B CC8D A26B C87F 3FAC C264
To claim this, I am signing this object:
| // Check Iranian National Code Validity - Clojure, C#, F#, Ruby, JavaScript, Dart, Python, Scala, Java 8, PHP, C, Go, Swift, Kotlin, Groovy, Rust, Haskell, Erlang, Elixir, Power Query M Language, VBA, R, Lua, Fortran, Pascal/Delphi, Excel, Stored Procedure / MySQL | |
| // بررسی صحت کد ملی ایران - کلوژر، سیشارپ، افشارپ، روبی، جاوااسکریپت، دارت، پایتون، اسکالا، جاوا ۸، پیاچپی، سی، گو، سوئیفت، کاتلین، گرووی، راست، هسکل، ارلنگ، الکسیر، پاورکوئری ام، ویبی ای، آر، لوآ، فرترن، پاسکال/دلفی، اکسل، مایاسکیوال | |
| // در نسخههای قبل یکسان بودن اعداد نا معتبر تشخیص داده میشد ولی | |
| // اعداد یکسان نامعتبر نیست https://web.archive.org/web/20170706081048/http://www.fardanews.com/fa/news/127747/رندترین-شماره-ملی-بلای-جان-صاحبش-شد | |
| // بعضی از پیادهسازیها سریع نیستند، میتوانید نسخهٔ خود را بر پایهٔ | |
| // نسخهٔ سی یا گو ایجاد کنید که بهترین سرعت را داشته باشد | |
| /** |
| # -*- coding: utf-8 -*- | |
| # Genereated from https://raw.github.com/wikimedia/pywikibot-core/master/pywikibot/userinterfaces/transliteration.py | |
| import json | |
| def dictgen(): | |
| dict = {} | |
| for char in u"ÀÁÂẦẤẪẨẬÃĀĂẰẮẴẶẲȦǠẠḀȂĄǍẢ": | |
| dict[char] = u"A" | |
| for char in u"ȀǞ": | |
| dict[char] = u"Ä" |
| // ES6 | |
| [1, 2, 3] | |
| .map(x => () => new Promise((resolve, reject) => { console.log(x); setTimeout(resolve, 1000); })) | |
| .reduce((promise, next) => promise.then(next), Promise.resolve()) | |
| .then(() => console.log('Async Job Queue done')); | |
| // jQuery | |
| [1, 2, 3].map(function (val) { | |
| return function () { | |
| console.log(val); |
| var months = 'فروردین اردیبهشت خرداد تیر مرداد شهریور مهر آبان آذر دی بهمن اسفند'.split(' '); | |
| var result = []; | |
| $("#wpTextbox1").val().replace(/علیهالسلام/g, 'علیهالسلام').split('\n').forEach(function (x) { | |
| var p = x.split(' '); | |
| result.push('<holiday day="' + p.splice(-1)[0].replace(/[۰-۹]/g, function (x) { return String.fromCharCode(x.charCodeAt(0) - '۰'.charCodeAt(0) + '0'.charCodeAt(0)); }) + '" month="' + (months.indexOf(p.splice(-1)[0]) + 1) + '" year="1394">' + p.join(' ') + '</holiday>'); | |
| }); | |
| result.join('\n'); |
I hereby claim:
To claim this, I am signing this object:
| // https://maktabkhooneh.org/course/%D9%85%D8%A8%D8%A7%D9%86%DB%8C-%D8%A7%D9%82%D8%AA%D8%B5%D8%A7%D8%AF-mk170/ | |
| [...document.querySelectorAll('a.chapter__unit')] | |
| .map(x => () => fetch(x.href) | |
| .then(x => x.text()) | |
| .then(x => new DOMParser().parseFromString(x, 'text/html').querySelector('meta[property="og:video"]').content) | |
| .then(y => console.log(y, x.children[1].innerText.trim().replace(/\s/g, '_') + '.mp4')) | |
| ) | |
| .reduce((promise, next) => promise.then(next), Promise.resolve()) | |
| .then(() => console.log('Finished!')); |
| #! /usr/bin/env python3 | |
| # python3 script to retrieve Iran and Afghnistan provinces' capital cities coordinates. | |
| # Written by Ebrahim Byagowi | |
| import json | |
| import re | |
| import requests | |
| query_result = requests.get('https://query.wikidata.org/sparql', { | |
| "query": """ |
| #include <stdio.h> | |
| #include <ft2build.h> | |
| #include FT_FREETYPE_H | |
| #include FT_GLYPH_H | |
| #include <hb.h> | |
| #include <hb-ft.h> | |
| #include <dirent.h> |
| // https://gist.github.com/DavidWittman/b7a509632ed92fccf237 (SuperMicro) | |
| package main | |
| import ( | |
| "fmt" | |
| "net" | |
| "github.com/vmware/goipmi" | |
| ) |
| // http://hg.nginx.org/nginx/raw-file/default/conf/mime.types | |
| var result = {}; | |
| $('pre').textContent.split('\n').filter(x => /;/.exec(x)).map(x => x.trim().replace(';', '').split(/ +/)).forEach(x => x.slice(1).forEach(y => result[y] = x[0])); | |
| copy(JSON.stringify(result)); |