Skip to content

Instantly share code, notes, and snippets.

@adriendumont
adriendumont / web-fonts-asset-pipeline.md
Created December 6, 2019 20:25 — 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.

@adriendumont
adriendumont / no-comments.js
Created December 11, 2017 23:06 — forked from Darep/no-comments.js
Remove all comments from GitHub Pull Request
// Sometimes it's necessary to do a bit of clean-up
Array.prototype.forEach.call(document.querySelectorAll('.js-comment-delete button'), function(el, i) {
el.removeAttribute('data-confirm');
el.click();
});
@adriendumont
adriendumont / hn_seach.js
Last active August 29, 2015 14:27 — forked from kristopolous/hn_seach.js
hn job query search
function query() {
var
total = 0, shown = 0,
job_list = Array.prototype.slice.call(document.querySelectorAll('.c00,.cdd')),
query_list = Array.prototype.slice.call(arguments);
// turn them all off
job_list.forEach(function(node) {
node.parentNode.parentNode.parentNode.style.display = 'none';
total ++;
@adriendumont
adriendumont / DO_Unicorn.md
Last active September 30, 2015 05:45
Digital Ocean(Ubuntu) - New Rails4 App deploy with Capistrano3, Unicorn, Nginx and MySQL
@adriendumont
adriendumont / README.md
Last active August 29, 2015 14:22 — forked from radarek/README.md
# part 1
tp = 0 #total paid
ub = balance # updated balance
for i in range(1, 13):
print("Month: " + str(i))
mmp = ub * monthlyPaymentRate
tp += mmp
up = ub-mmp
ub = up*(1+annualInterestRate/12)
# COUNTING VOWELS
c = 0
for i in s:
if (i in ['a', 'e', 'i', 'o', 'u']):
c+=1
print(c)
# COUNTING BOBS