Skip to content

Instantly share code, notes, and snippets.

View juandazapata's full-sized avatar

Juanda juandazapata

View GitHub Profile
@juandazapata
juandazapata / web-fonts-asset-pipeline.md
Created June 10, 2018 15:38 — forked from anotheruiguy/web-fonts-asset-pipeline.md
Custom Web Fonts and the Rails Asset Pipeline

Web fonts are pretty much all the rage. Using a CDN for font libraries, like TypeKit or Google Fonts, will be a great solution for many projects. For others, this is not an option. Especially when you are creating a custom icon library for your project.

Rails and the asset pipeline are great tools, but Rails has yet to get caught up in the custom web font craze.

As with all things Rails, there is more then one way to skin this cat. There is the recommended way, and then there are the other ways.

The recommended way

Here I will show how to update your Rails project so that you can use the asset pipeline appropriately and resource your files using the common Rails convention.

set nocompatible
filetype off
filetype plugin indent on
syntax enable
call plug#begin('~/.local/share/nvim/plugged')
Plug 'SirVer/ultisnips'
Plug 'honza/vim-snippets'
Plug 'w0rp/ale'
# Remap prefix from 'C-b' to 'C-t'
unbind C-b
set -g prefix C-t
bind-key -r C-t send-prefix
bind-key r source-file ~/.tmux.conf \; display-message "~/.tmux.conf reloaded."
# Split panes using / and -
bind / split-window -h -c "#{pane_current_path}"
bind - split-window -v -c "#{pane_current_path}"
$ cd /usr/local/Cellar/imagemagick/6.8.0-10/lib
$ ln -s libMagick++-Q16.7.dylib libMagick++.dylib
$ ln -s libMagickCore-Q16.7.dylib libMagickCore.dylib
$ ln -s libMagickWand-Q16.7.dylib libMagickWand.dylib

Keybase proof

I hereby claim:

  • I am juandazapata on github.
  • I am juanda (https://keybase.io/juanda) on keybase.
  • I have a public key whose fingerprint is 2384 E377 EF78 8611 7B02 8681 29F3 A273 9086 4C0E

To claim this, I am signing this object:

# =============================================================
# REQUIREMENTS
# =============================================================
# - Heroku toolbelt installed in your system
# - A heroku remote named `staging`.
# - A heroku remote named `production`.
# =============================================================
namespace :h do
# -------------------------------------------------------------
@juandazapata
juandazapata / localized-models.md
Last active December 16, 2015 08:38
Localized model
class Hostel < ActiveRecord::Base
  attr_accessible :name, :address_1...
  
  # Model definition...
  has_one :conditions, class_name: 'Hostel::Condition'
  has_one :directions, class_name: 'Hostel::Direction'
end

class Hostel::Condition &lt; ActiveRecord::Base
cd ~
sudo apt-get update
sudo apt-get install openjdk-7-jre-headless -y
wget https://github.com/elasticsearch/elasticsearch/archive/v0.20.1.tar.gz -O elasticsearch.tar.gz
tar -xf elasticsearch.tar.gz
rm elasticsearch.tar.gz
sudo mv elasticsearch-* elasticsearch
sudo mv elasticsearch /usr/local/share
@juandazapata
juandazapata / redis.sh
Created March 22, 2013 15:57
Redis setup
apt-get -y update
apt-get -y upgrade
apt-get -y install redis-server
@juandazapata
juandazapata / memcached.sh
Last active December 15, 2015 05:59
Memcached script
apt-get -y update
apt-get -y install build-essential
apt-get -y install make
apt-get install memcached
#cd /tmp
#wget ftp://ftp.ruby-lang.org/pub/ruby/1.9/ruby-1.9.3-p327.tar.gz
#tar -xvzf ruby-1.9.3-p327.tar.gz
#cd ruby-1.9.3-p327/
#./configure --prefix=/usr/local