https://fonts.google.com/?selection.family=Open+Sans
cd /usr/share/fonts
sudo mkdir googlefonts
cd googlefonts
sudo unzip -d . ~/Downloads/Open_Sans.zip
{ | |
"name": "project-name", | |
"description": "Template for static sites", | |
"version": "1.0.0", | |
"homepage": "http://www.project-name.com", | |
"author": { | |
"name": "Adam Reis", | |
"url": "http://adam.reis.nz" | |
}, | |
"license": "UNLICENSED", |
#!/bin/sh | |
# Written by: Keefer Rourke <https://krourke.org> | |
# Based on AUR package <https://aur.archlinux.org/cgit/aur.git/tree/PKGBUILD?h=ttf-google-fonts-git> | |
# dependancies: fonts-cantarell, ttf-ubuntu-font-family, git | |
sudo apt-get install fonts-cantarell ttf-ubuntu-font-family git | |
srcdir="/tmp/google-fonts" | |
pkgdir="/usr/share/fonts/truetype/google-fonts" | |
giturl="git://github.com/google/fonts.git" |
xlfd_tmpl = u"-%(maker)s-%(family)s-%(weight)s-%(slant)s-%(widthtype)s-%(style)s-%(pixels)s-%(height)s-%(horiz)s-%(vert)s-%(spacing)s-%(width)s-%(registry)s-%(encoding)s" | |
def make_xlfd(maker="unknown", family=None, weight="normal", slant="r", | |
widthtype="normal", style="*", pixels=8, height="*", | |
horiz="*", vert="*", spacing="m", width="*", registry="iso8859", | |
encoding=1): | |
""" | |
Usage Example:: | |
tom@desktop ~> python xlfd_maker.py --family "Input Mono" --size 9 |
# -*- encoding: utf-8 -*- | |
# | |
# Copyright © 2016 Red Hat, Inc. | |
# | |
# Licensed under the Apache License, Version 2.0 (the "License"); you may | |
# not use this file except in compliance with the License. You may obtain | |
# a copy of the License at | |
# | |
# http://www.apache.org/licenses/LICENSE-2.0 | |
# |
;; image at: http://take.ms/VaXll | |
(def g {:a {:white :a :black :b} | |
:b {:white :d :black :c} | |
:c {:white :g :black :d} | |
:d {:white :c :black :e} | |
:e {:white :f :black :f} | |
:f {:white :b :black :g} | |
:g {:white :e :black :a}}) |
ZigZag-Encoding | |
--------------- | |
Maps negative values to positive values while going back and | |
forth (0 = 0, -1 = 1, 1 = 2, -2 = 3, 2 = 4, -3 = 5, 3 = 6 ...) | |
(i >> bitlength-1) ^ (i << 1) | |
with "i" being the number to be encoded, "^" being | |
XOR-operation and ">>" would be arithemtic shifting-operation |
#!/usr/bin/env python | |
# gpu_stat.py [DELAY [COUNT]] | |
# dump some gpu stats as a line of json | |
# {"util":{"PCIe":"0", "memory":"11", "video":"0", "graphics":"13"}, "used_mem":"161"} | |
import json, socket, subprocess, sys, time | |
try: | |
delay = int(sys.argv[1]) | |
except: | |
delay = 1 |
;; See: http://en.wikipedia.org/wiki/Stern%E2%80%93Brocot_tree | |
(def stern-brocot-sequence | |
(map (fn [nums] | |
(/ (first nums) (second nums))) | |
(iterate | |
(fn [nums] | |
(let [a (first nums) | |
b (second nums) | |
r (rest (rest nums))] | |
(vec (flatten (conj [] b r (+ a b) b))))) |
gremlin> g = TitanFactory.open("berkeleyje:/tmp/test") | |
==>titangraph[berkeleyje:/tmp/test] | |
gremlin> mgmt = g.getManagementSystem(); | |
==>com.thinkaurelius.titan.graphdb.database.management.ManagementSystem@27c04377 | |
gremlin> id = mgmt.makePropertyKey("uid").dataType(Long.class).make() | |
==>uid | |
gremlin> mgmt.buildIndex('byUID',Vertex.class).addKey(id).buildCompositeIndex() | |
==>com.thinkaurelius.titan.graphdb.database.management.TitanGraphIndexWrapper@14f3c6fc | |
gremlin> mgmt.commit() | |
gremlin> for (int i=0;i<200;i++) { v = g.addVertex([uid:(int)Math.floor(i/2)])} |