Skip to content

Instantly share code, notes, and snippets.

@jrk
jrk / newpost.rb
Created May 5, 2009 06:48 — forked from al3x/newpost.rb
Creates a new Jekyll post, opens it in TextMate, and adds to the git index
#!/usr/bin/env ruby
require Dir
unless ARGV[0]
puts 'Usage: newpost "the post title"'
exit(-1)
end
blog_root = "/Users/jrk/proj/blog"
@khamidou
khamidou / Rakefile
Created February 3, 2012 19:39
Rakefile to concatenate templates and js files together
require 'rake'
task :default => :compile_templates
task :clean_compiled_file do
if File.exist?('release.js')
File.unlink('release.js')
end
end
@yoavweiss
yoavweiss / Sites using picturefill
Created May 12, 2013 20:27
Sites using picturefill to implement art-direction
alistapart.com
animoto.com
behance.net
cato.org
ceskatelevize.cz
creativemarket.com
dribbble.com
evernote.com
extra.cz
flavorwire.com
---
layout: invoice
status: paid | unpaid | late
deliverables:
item:
description: made site responsive
price: $1,000
item:
description: changed logo color
price: $300
@opattison
opattison / aws-s3-policy-with-ip-limit.json
Last active December 21, 2015 06:09
AWS S3 bucket with IP limits, for basic development testing on S3.
{
"Version": "2008-10-17",
"Statement": [
{
"Sid": "AddPermissions",
"Effect": "Allow",
"Principal": {
"AWS": "*"
},
"Action": "s3:GetObject",
@opattison
opattison / 2016-02-13-example.md
Last active April 25, 2016 20:34
Jekyll srcset imgix implementation with include file, srcset/sizes in config, YAML-provided images, and temporarily assigned variables
title image
example srcset implementation
src alt
/images/example.jpg
Don’t forget alt text.

{% assign image = page.image[0] %} {% include srcset.html %}

@tmcw
tmcw / code_style.md
Last active June 3, 2016 19:06
On Code Style

You might be expecting a long rant on why code style matters and tabs are sinful in your JavaScript code. This isn't that, thankfully.

If you've been snooping around ★★REDACTED★★★, you may have noticed that, in contrast to our other projects, it uses 2 spaces for indentation instead of 4. This was a decision Eden, Lauren, and I made, given that we kind of just started out that way, and that two-tab indentation makes our somewhat absurd functional chains easier on the eyes and the widths.

This also allows us to say that we simply use the Airbnb code style rather than saying we use it with a carveout as we've written for mapbox.js and iD.

This isn't an announcement that we're switching to 2 spaces, but rather a statement of how we treat code style and deal with these differences:

Use one code style for your whole project, and be consistent

@adactio
adactio / postforms.js
Created March 2, 2014 23:42
Show a progress bar when a form is submitted (and prevent more than one submission per document).
/*
Show a progress element for any form submission via POST.
Prevent the form element from being submitted twice.
*/
(function (win, doc) {
'use strict';
if (!doc.querySelectorAll || !win.addEventListener) {
// doesn't cut the mustard.
return;
}
@mrmrs
mrmrs / github-display-none.css
Last active November 2, 2019 03:09
Single purpose rulesets to set an element to display none from githubs production css
.table-list-triage {
display: none;
}
.triage-mode .table-list-non-triage, .triage-mode .table-list-filters {
display: none;
}
.boxed-group-list>li.approved .btn-sm, .boxed-group-list>li.rejected .btn-sm {
display: none;
}
.repo-list .participation-graph.disabled {
# An example Jekyll Liquid tag. Utilizes the new plugin system.
#
# 1. Make a _plugins directory in your jekyll site, and put this class in a file there.
# 2. In anyone of your pages, you can use the 'render_time' liquid tag like so:
# {% render_time Page generated at: %}
module Jekyll
class RenderTimeTag < Liquid::Tag
def initialize(tag_name, text, tokens)