Skip to content

Instantly share code, notes, and snippets.

Ebrahim Byagowi ebraminio

Block or report user

Report or block ebraminio

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View allwords.js
var fs = require('fs');
var lineReader = require('readline').createInterface({
input: require('fs').createReadStream('fawiki-20190920-pages-articles.xml')
});
var m = new Map();
var i = 0;
lineReader.on('line', function (line) {
View gist.c
// void _start (void) { }
int main(int argc, char **argv) { }
unsigned int errno = 0;
typedef unsigned long size_t;
#define NULL ((void*) 0)
float roundf(float x) { return (int) x; }
// unsigned int errno = 0;
View gist:6176cebec99bfe52a1db41f06b5a4f3c
#ifndef STDLIB_H
#define STDLIB_H
#ifdef __cplusplus
extern "C" {
#endif
#define assert(test)
extern int *__errno(void);
#define errno (*__errno())
@ebraminio
ebraminio / result.txt
Created Mar 7, 2019
10.14.2 fonts tables
View result.txt
bash-3.2$ ipython
Python 3.7.2 (default, Feb 12 2019, 08:15:36)
Type 'copyright', 'credits' or 'license' for more information
IPython 7.3.0 -- An enhanced Interactive Python. Type '?' for help.
In [1]:
...: import os, hashlib, re
...:
...: for f in ['/System/Library/Fonts/' + x for x in os.listdir('/System/Library/Fonts')] + ['/Library/Fonts/' + x for x in os.listdir('/Library/Fonts')]:
...: # this is jupyter notebook...
@ebraminio
ebraminio / code.cc
Last active Dec 21, 2018
Extract script properties
View code.cc
#include <DWrite_1.h>
#include <stdio.h>
#include <stdint.h>
int main(int argc, char **argv) {
IDWriteFactory1* dwriteFactory;
DWriteCreateFactory(DWRITE_FACTORY_TYPE_SHARED, __uuidof (IDWriteFactory),
(IUnknown**)&dwriteFactory);
HRESULT hr;
@ebraminio
ebraminio / code.py
Created Dec 16, 2018
fontfolio fonts tables
View code.py
import os, hashlib, re
files = !ls **/*.{ttf,otf}
for f in files:
# this is jupyter notebook...
msg = !/home/ebrahim/Desktop/harfbuzz/build/src/main "{f}"
print(f, hashlib.sha1(open(f, 'rb').read()).hexdigest(), re.findall(r': (....) \(', str(msg)))
@ebraminio
ebraminio / code.py
Last active Nov 29, 2018
10.12.6 fonts tables
View code.py
import os, hashlib, re
for f in ['/System/Library/Fonts/' + x for x in os.listdir('/System/Library/Fonts')] + ['/Library/Fonts/' + x for x in os.listdir('/Library/Fonts')]:
# this is jupyter notebook...
msg = !harfbuzz/src/main '{f}'
print(f, hashlib.sha1(open(f, 'rb').read()).hexdigest(), re.findall(r': (....) \(', str(msg)))
# old code
#!pip3 install fonttools
#
@ebraminio
ebraminio / code.py
Last active Nov 29, 2018
10.13.6 fonts tables
View code.py
import os, hashlib, re
for f in ['/System/Library/Fonts/' + x for x in os.listdir('/System/Library/Fonts')] + ['/Library/Fonts/' + x for x in os.listdir('/Library/Fonts')]:
# this is jupyter notebook...
msg = !harfbuzz/src/main '{f}'
print(f, hashlib.sha1(open(f, 'rb').read()).hexdigest(), re.findall(r': (....) \(', str(msg)))
# old code
#!pip3 install fonttools
#
@ebraminio
ebraminio / code.py
Last active Nov 18, 2018
fontlibrary.org fonts tables
View code.py
#!/bin/python3
# needs `pip install cssselect fonttools`
import lxml.etree, lxml.cssselect, requests, re, fontTools.ttLib, gc
from io import StringIO, BytesIO
pages = [requests.get('https://fontlibrary.org/en/search?query=.&page=%d' % p) for p in range(1, 54)]
links_selector = lxml.cssselect.CSSSelector('.family-name a')
parser = lxml.etree.HTMLParser()
View Dockerfile
FROM ubuntu:trusty
RUN apt-get update
RUN DEBIAN_FRONTEND=noninteractive apt-get install -y build-essential bison flex curl gcc g++ make texinfo zlib1g-dev g++ unzip curl git
WORKDIR /root
RUN git clone https://github.com/andrewwutw/build-djgpp.git
WORKDIR /root/build-djgpp
RUN ./build-djgpp.sh 7.2.0
VOLUME /root/src
You can’t perform that action at this time.