Skip to content

Instantly share code, notes, and snippets.

View zumoshi's full-sized avatar

Borhan Hafez zumoshi

View GitHub Profile
@zumoshi
zumoshi / backtrace.log
Last active May 11, 2020 08:40
ReSpeak-tsclient-crash
May 10 21:07:32.341 INFO TsClientlib, tsproto-version: 0.1.0+135 (5facf71ad 2020-04-25) dirty 1 modification, profile: Debug, version: 0.1.0+135 (5facf71ad 2020-04-25) dirty 1 modification
addr: 213.232.x.x:8600
module: resolver
May 10 21:07:32.381 DEBG Starting resolve, address: 213.232.x.x:8600
May 10 21:07:32.383 DEBG Connecting, address: 213.232.x.x:8600
local_addr: 0.0.0.0:62709
remote_addr: 213.232.x.x:8600
May 10 21:07:32.500 INFO Solve RSA puzzle, y: 8723936990881646971634718538142609102355251916986973944432589766401949068486423461886395290859036201612429790782526491046960631694579471096541769720493184, n: 11123400745562958910244492490827953852572440103989553562167402963531575601608560797501435186671157100790399862727380181776554078832306932328534646034810183, x: 2734392063954191350664097231331798576250127772103965844421157207037545396495144005205222611970307297540547386323150397440565322634966676290871737460374830, level: 1000
name: Solve RSA puzzle
May 10 21:07:32.508 INFO time repo
@zumoshi
zumoshi / debug.cpp
Created January 14, 2019 09:07
companion code for `Playing around with window's clipboard` article
#include <iostream>
#include <string>
#include <sstream>
#include <windows.h>
#include <Winuser.h>
using namespace std;
string clipboardFormat(UINT type) {
switch (type) {
// standard types, since GetClipboardFormatName doesn't return their name
/**
* Algoritm from : https://gist.github.com/reza-farhadian/9807316
* Georgian To Jalali Programming Algorithm
* By Reza Farhadian <irezafarhadian@gmail.com>
*/
function g2j(timestamp){
// G = ~~(Georgian)
// J = ~~(Jalali)
var G_Y = ~~(new Date(timestamp*1000).getFullYear())
@zumoshi
zumoshi / version2.js
Last active August 6, 2020 10:56
Convert Persian Numbers to Latin Numbers
/*
tabdil('۲۰۲۷۰۱-۱-۳۸۱-۹۴۳۸۲') => "202701138194382"
*/
var tabdil=function(m){
var num=JSON.parse('{"۰":"0","۱":"1","۲":"2","۳":"3","۴":"4","۵":"5","۶":"6","۷":"7","۸":"8","۹":"9"}');
return m.replace(/./g,function(c){
return (typeof num[c]==="undefined")?
((/\d+/.test(c))?c:''):
num[c];