Skip to content

Instantly share code, notes, and snippets.

@jalberto
jalberto / web_typography.md
Last active August 29, 2015 14:02
Notes on web typography

Web Typography Tips

http://blog.typekit.com/2013/05/01/hi-dpi-typography/

What makes a device “hi-DPI” or not. In general, a device is hi-DPI if it has both of these things:

  • A display with a (relatively) high pixel density, say, over 200 pixels per inch (PPI) for mobile devices or over 150 PPI for laptops.
  • Pixel scaling, where the on-screen graphics are rendered using extra physical pixels so that they appear sharper and clearer than on a standard display.

Font Weight

@jalberto
jalberto / ngram.rb
Last active August 29, 2015 14:06
Ngram library base in Tony Byrne code
#
# Extract uni, bi, and trigrams.
#
# "one two three".ngram(1) # unigrams
# "one two three".ngram(2) # bigrams
# "one two three".ngram(3) # trigrams
#
module Ngram
TOKENIZER_REGEX = /[[:word:]'’\-\£\€]+/
@jalberto
jalberto / zpreztorc
Last active August 29, 2015 14:09
My ZSH config
#
# Sets Prezto options.
#
# Authors:
# Sorin Ionescu <sorin.ionescu@gmail.com>
#
#
# General
#
@jalberto
jalberto / dashboard.sh
Created January 16, 2015 14:08
Basic console dashboard (tmux/byobu)
#!/bin/bash
plexer=byobu
$plexer send-keys -t 0.0 '' C-m
$plexer send-keys -t 0.0 nice\ goaccess\ -f\ /var/log/nginx/access.log C-m
$plexer splitw -t 0
$plexer select-layout -t 0 main-horizontal
@jalberto
jalberto / gitconfig
Created February 6, 2015 12:02
GIT configuration with some useful aliases
# Just drop this file in ~/.gitconfig
[user]
name = Jose Alberto
email = ja@josealberto.org
[giggle]
main-window-view = HistoryView
history-view-vpane-position = 501
main-window-maximized = true
main-window-geometry = 0x0+0+0
@jalberto
jalberto / git-utils
Created March 21, 2015 23:49
Untrack files from Git usgin gitignore
git rm --cached `git ls-files -i -X .gitignore`
@jalberto
jalberto / terminator_config
Created October 3, 2015 18:03
Terminator configuration. F12 to show/hide ~/.config/terminator/config
[global_config]
focus = mouse
suppress_multiple_term_dialog = True
title_transmit_bg_color = "#ffad00"
dbus = True
enabled_plugins = LaunchpadCodeURLHandler, APTURLHandler, LaunchpadBugURLHandler
always_on_top = True
tab_position = bottom
sticky = True
[keybindings]

Keybase proof

I hereby claim:

  • I am jalberto on github.
  • I am jasl (https://keybase.io/jasl) on keybase.
  • I have a public key whose fingerprint is 289E B9CE 63A1 8F8D C546 DA05 FA07 E62A 9716 EDDE

To claim this, I am signing this object:

@jalberto
jalberto / shrc
Created August 31, 2017 09:35
Run azure cli using docker
az () {
docker run -v ${HOME}/.ssh:/root/.ssh azuresdk/azure-cli-python:latest az "$@"
}
#!/bin/sh
# Install Azure File Storage in a docker swarm from master
DRV_VER="v0.5.1"
AZURE_ACCOUNT="myaccount"
AZURE_KEY="mykey"
install_driver () {
sudo apt-get install -q -y cifs-utils
wget -q https://github.com/Azure/azurefile-dockervolumedriver/releases/download/${DRV_VER}/azurefile-dockervolumedriver