Skip to content

Instantly share code, notes, and snippets.

View mz1988's full-sized avatar

Morteza Zandieh mz1988

View GitHub Profile
{
"Inst": null,
"Err": null,
"Data": [
{
"node": {
"__typename": "GraphImage",
"display_resources": [
{
"config_height": 799,
@mz1988
mz1988 / Utilities.java
Created June 11, 2016 09:29
Android, Jalali Date Convertor
package ir.begokie.helper;
import java.util.Date;
import java.util.Locale;
public class Utilities {
private class SolarCalendar {
@mz1988
mz1988 / main.go
Created July 14, 2015 22:04
Confidence Comment Algorithm by Go (golang)
package main
import (
"fmt"
"math"
)
func _confidence(ups int32, downs int32) float64 {
d := ups + downs
var n float64 = float64(d)
@mz1988
mz1988 / gist:963479a188cfab7b7cc6
Last active December 19, 2015 09:45
Persian (farsi) Text Normalizer
import re
import os
from collections import Counter
class Farsi:
PUNCTS = r"""'".,/?\!@#$%^&*()_\-+~`:;{}\[\]"""
LOCAL_PUNCTS = '،!٪:؛“”‘ـ٬؟'
@mz1988
mz1988 / main.go
Last active December 19, 2015 09:45
Reddit ranking algorithms by Go
package main
import (
"fmt"
"math"
"time"
)
func epoch_seconds(date time.Time) (sec float64) {
/* Returns the number of seconds from the epoch to date. */