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 / _.md
Last active February 18, 2018 19:15
brew tap ebraminio/apps && brew reinstall persian-calendar && brew services restart persian-calendar
@ebraminio
ebraminio / 1-index.php
Last active May 11, 2018 10:17
Remote access to your PC
<?php
header('Content-Type: text/plain');
if (isset($_POST['ip'])) {
$ip = $_POST['ip'];
if (isValidIP($ip)) {
fwrite(fopen('ip.txt', 'w'), $_POST['ip']);
}
} else {
$ip = fgets(fopen('ip.txt', 'r'));
@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",
@ebraminio
ebraminio / persian-braille.json
Last active November 14, 2018 09:54
Persian Braille
{
"آ": "",
"ا": "",
"ب": "",
"پ": "",
"ت": "",
"ث": "",
"ج": "",
"ﭺ": "",
"ح": "",
Loading
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 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
@ebraminio
ebraminio / Dagger2SimpleExample.java
Last active September 26, 2018 17:44 — forked from vestrel00/Dagger2SimpleExample.java
A: Dagger.android 2.11 simple example with support for Singleton, PerActivity, PerFragment, and PerChildFragment scopes
// This is a super simplified example of how to use the new dagger.android framework
// Forked from https://gist.github.com/vestrel00/64be913f954989fe52c674247e093218/
// but changed to have less boilerplate using the new features.
// Used on https://github.com/ebraminio/DroidPersianCalendar also
// App.java
public class App extends DaggerApplication {
@Override
protected AndroidInjector<? extends DaggerApplication> applicationInjector() {
return DaggerAppComponent.builder().create(this);