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:
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:
# -*- 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); |
#! /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> |
#include <stdlib.h> | |
#include <stdio.h> | |
#include <hb.h> | |
int main(int argc, char **argv) { | |
FILE *f = fopen("/Library/Fonts/Tahoma.ttf", "rb"); | |
fseek(f, 0, SEEK_END); | |
long fsize = ftell(f); | |
fseek(f, 0, SEEK_SET); |
#include "cuda_runtime.h" | |
#include "device_launch_parameters.h" | |
#include "device_functions.h" | |
#include <stdio.h> | |
void print(char*, int[], int); | |
__global__ void square(int *a) { // our computation logic, will be run on GPU | |
a[threadIdx.x] *= a[threadIdx.x]; |
#include "cuda_runtime.h" | |
#include "device_launch_parameters.h" | |
#define __CUDACC__ | |
#include "device_functions.h" | |
#include <stdio.h> | |
#include <stdlib.h> | |
void print(char*, int[], int); |