Skip to content

Instantly share code, notes, and snippets.

View hkdeven's full-sized avatar
💭
☕️🍷

Deven Blackburn hkdeven

💭
☕️🍷
View GitHub Profile
@anotheruiguy
anotheruiguy / web-fonts-asset-pipeline.md
Last active May 24, 2023 22:08
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.

@sandorjanssen
sandorjanssen / html5-template-semantic-tags
Created August 14, 2013 14:00
Basic HTML5 template using semantic tags
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<title>Title</title>
</head>
<body>
<header>Header</header>
<nav>
<a href="#">Home</a>
@hellerbarde
hellerbarde / latency.markdown
Created May 31, 2012 13:16 — forked from jboner/latency.txt
Latency numbers every programmer should know

Latency numbers every programmer should know

L1 cache reference ......................... 0.5 ns
Branch mispredict ............................ 5 ns
L2 cache reference ........................... 7 ns
Mutex lock/unlock ........................... 25 ns
Main memory reference ...................... 100 ns             
Compress 1K bytes with Zippy ............. 3,000 ns  =   3 µs
Send 2K bytes over 1 Gbps network ....... 20,000 ns  =  20 µs
SSD random read ........................ 150,000 ns  = 150 µs

Read 1 MB sequentially from memory ..... 250,000 ns = 250 µs

@raulb
raulb / gist:1091554
Created July 19, 2011 07:14 — forked from javierarce/gist:1090744
Color Picker bookmarklet for Dribbble.com
javascript: void((function() {
var colors = [];
var title = document.title.replace(/Dribbble - /g, '');
var li = document.getElementsByClassName('color');
if (li.length > 0) {
for (var i = 0; i < li.length; i++) {
var c = li[i].getElementsByTagName('a')[0].getAttribute('title');
colors.push('<li><div style="display:inline-block; width:20px; height:20px;background:' + c + '"></div> ' + c + '</li>');
}
# Configure colors, if available.
if [ -x /usr/bin/tput ] && tput setaf 1 >&/dev/null; then
c_reset='\[\e[0m\]'
c_user='\[\e[0;32m\]'
c_path='\[\e[1;34m\]'
c_git_clean='\[\e[0;37m\]'
c_git_staged='\[\e[0;32m\]'
c_git_unstaged='\[\e[0;31m\]'
else
c_reset=