Skip to content

Instantly share code, notes, and snippets.

@ebraminio
ebraminio / hijrijd.js
Last active February 9, 2017 08:00
Calculate Hijri Years Months Jd Number
var data = {
"version": [1439, 6],
"startDate": [1426, 2, 1],
"startJd": 2453442 + 325,
"monthLen": [
//[1426, 0, 29, 30, 29, 30, 30, 30, 30, 29, 30, 29, 29],
[1427, 30, 29, 29, 30, 29, 30, 30, 30, 30, 29, 29, 30],
[1428, 29, 30, 29, 29, 29, 30, 30, 29, 30, 30, 30, 29],
[1429, 30, 29, 30, 29, 29, 29, 30, 30, 29, 30, 30, 29],
[1430, 30, 30, 29, 29, 30, 29, 30, 29, 29, 30, 30, 29],
@ebraminio
ebraminio / code.js
Last active May 14, 2017 11:01
nginx mime types
// 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));
@ebraminio
ebraminio / mime-db.json
Created May 14, 2017 11:05
https://github.com/jshttp/mime-db var result = {}; Object.keys(mimes).map(x => (mimes[x].extensions || []).forEach(y => result[y] = x)); copy(JSON.stringify(result, 0, 1).replace(/\n/g, '')); then `fmt`
{
"123": "application/vnd.lotus-1-2-3", "ez": "application/andrew-inset",
"aw": "application/applixware", "atom": "application/atom+xml",
"atomcat": "application/atomcat+xml", "atomsvc": "application/atomsvc+xml",
"bdoc": "application/x-bdoc", "ccxml": "application/ccxml+xml",
"cdmia": "application/cdmi-capability", "cdmic":
"application/cdmi-container", "cdmid": "application/cdmi-domain",
"cdmio": "application/cdmi-object", "cdmiq": "application/cdmi-queue",
"cu": "application/cu-seeme", "mpd": "application/dash+xml",
"davmount": "application/davmount+xml", "dbk": "application/docbook+xml",
// https://gist.github.com/DavidWittman/b7a509632ed92fccf237 (SuperMicro)
package main
import (
"fmt"
"net"
"github.com/vmware/goipmi"
)
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@ebraminio
ebraminio / _.md
Last active February 18, 2018 19:15
brew tap ebraminio/apps && brew reinstall persian-calendar && brew services restart persian-calendar
@ebraminio
ebraminio / _.md
Last active February 19, 2018 12:00
Which fonts on macOS (10.13.3) have "mort", "morx", "kerx" or "trak" tables? successor to https://gist.github.com/ebraminio/3ff370da82f0e33b489752cc178cfcd0
mort morx kerx trak Font Name
x /Library/Fonts/AlBayan.ttc
x /Library/Fonts/Zapfino.ttf
x /Library/Fonts/Silom.ttf
x x /Library/Fonts/Kefa.ttc
x /Library/Fonts/Nadeem.ttc
x /Library/Fonts/KufiStandardGK.ttc
x x /Library/Fonts/Kannada Sangam MN.ttc
x /Library/Fonts/Papyrus.ttc
@ebraminio
ebraminio / abiprocess.py
Created March 14, 2018 11:24
Not completed ABI processor
# coding: utf-8
# In[102]:
get_ipython().system('wget https://36-24718300-gh.circle-artifacts.com/0/root/project/ABI.json')
#https://github.com/ldo/harfpy/blob/master/harfbuzz.py
@ebraminio
ebraminio / dfont.py
Last active April 12, 2018 12:48
dfont and resourcefork parsing, ported fonttools code
# Derived from fonttools, all rights of this goes to fonttools projects
from fontTools.misc import sstruct
import struct
ResourceForkHeader = """
> # big endian
dataOffset: L
mapOffset: L
dataLen: L