Skip to content

Instantly share code, notes, and snippets.

@anotheruiguy
anotheruiguy / web-fonts-asset-pipeline.md
Last active June 6, 2025 08:03
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.

@cristianoc72
cristianoc72 / propel.yaml
Last active March 21, 2022 20:32
Propel sample configuration file
## Sample Propel configuration file ##
propel:
## General settings ##
general:
# The name of your project.
# This affects names of generated files, etc.
project:
version: 2.0.0-dev
@stuart11n
stuart11n / gist:9628955
Created March 18, 2014 20:34
rename git branch locally and remotely
git branch -m old_branch new_branch # Rename branch locally
git push origin :old_branch # Delete the old branch
git push --set-upstream origin new_branch # Push the new branch, set local branch to track the new remote
@edouard-lopez
edouard-lopez / gulpfile.js
Created May 5, 2014 15:18
Gulp copy font-awesome files to dist/ directory
'use strict';
// Generated on 2014-04-14 using generator-leaflet 0.0.14
var gulp = require('gulp');
var open = require('open');
var wiredep = require('wiredep').stream;
// Load plugins
var $ = require('gulp-load-plugins')();
@staltz
staltz / introrx.md
Last active June 28, 2025 13:44
The introduction to Reactive Programming you've been missing
@julesjanssen
julesjanssen / mailsync.sh
Last active December 4, 2023 18:27
imapsync from Gmail / Google apps to Fastmail
#!/bin/sh
imapsync --host1 imap.gmail.com --user1 [email protected] --ssl1 --password1 "xxxx" \
--host2 mail.messagingengine.com --user2 [email protected] --ssl2 --password2 "xxxx" \
--prefix1 "[Gmail]/" \
--exclude "All Mail" \
--nofoldersizes \
--skipcrossduplicates \
--folderlast "[Gmail]/All Mail" \
--regextrans2 's/\[Gmail\]/Gmail/' \
@wwitzel3
wwitzel3 / mailsync.sh
Created January 2, 2015 20:55
imapsync for fastmail to local Maildir
#!/bin/bash
set +x
imapsync --host1 mail.messagingengine.com --user1 USERNAME --password1 PASSWORD \
--host2 localhost --user2 USERNAME --password2 PASSWORD \
--ssl1 --noauthmd5 --split1 100 --split2 100 \
--useheader 'Message-Id' --syncinternaldates --skipsize --allowsizemismatch \
--include "Sent Mail|Sent|Sent Items" --exclude "All Mail" \
--delete2 --expunge2 --nolog
@paulirish
paulirish / what-forces-layout.md
Last active July 1, 2025 19:45
What forces layout/reflow. The comprehensive list.

What forces layout / reflow

All of the below properties or methods, when requested/called in JavaScript, will trigger the browser to synchronously calculate the style and layout*. This is also called reflow or layout thrashing, and is common performance bottleneck.

Generally, all APIs that synchronously provide layout metrics will trigger forced reflow / layout. Read on for additional cases and details.

Element APIs

Getting box metrics
  • elem.offsetLeft, elem.offsetTop, elem.offsetWidth, elem.offsetHeight, elem.offsetParent
@fntlnz
fntlnz / i3wm-fedora.md
Last active December 23, 2024 08:47
i3wm fedora lightdm

Install i3

dnf install i3

Add exec i3 to xinitrc

echo "exec i3" > ~/.xinitrc