Skip to content

Instantly share code, notes, and snippets.

@anotheruiguy
anotheruiguy / web-fonts-asset-pipeline.md
Last active June 24, 2024 22:11
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.

@bahelms
bahelms / merge_csv.rb
Last active May 9, 2022 19:46
Merge multiple csv files into one in Ruby
require "csv"
def csv_headers
["Your", "Headers", "Here"]
end
files = Dir["file_names_*.csv"].sort_by { |f| "if you want to sort the files" }
file_contents = files.map { |f| CSV.read(f) }
csv_string = CSV.generate do |csv|
@noln
noln / ffmpeg_commands.txt
Last active March 22, 2024 16:43
Handy FFMPEG Commands for Quickly Processing GoPro Videos
1) Concatenate a list of videos into one
ffmpeg -f concat -safe 0 -i tojoin.txt -c copy output.mp4
// Format of tojoin.txt:
file 'file0.MP4'
file 'file1.MP4'
file 'etc..
2) Scale down 4k video to
@dmitryfry
dmitryfry / books_list.txt
Created January 18, 2018 09:27 — forked from fedorkk/books_list.txt
Список книг для обучения
Алгоритмы:
1) Стивен Скиена "Алгоритмы. Руководство по разработке"
2) Томас Кормен "Алгоритмы. Построение и анализ"
3) Дональд Кнут "Искусство программирования" (никто в реальности не читал этот многотомный труд целиком...)
Общее:
1) Род Хаггарти "Дискретная математика для программистов"
2) Романовский И.В. "Дискретный анализ"
Паттерны проектирования: