Skip to content

Instantly share code, notes, and snippets.

View twome's full-sized avatar
💼
Looking for a job

Tom Kenny twome

💼
Looking for a job
View GitHub Profile
@twome
twome / bem.md
Created April 15, 2013 05:23 — forked from dmfrancisco/bem.md

BEM – meaning block, element, modifier – is a front-end naming methodology. CSSWizardry uses a naming scheme based on BEM, but honed by Nicolas Gallagher. The naming convention follows this pattern:

.block {}
.block__element {}
.block--modifier {}
  • .block represents the higher level of an abstraction or component
  • .block__element represents a descendent of .block that helps form .block as a whole
  • .block--modifier represents a different state or version of .block
@jpmckinney
jpmckinney / bar.js
Last active December 16, 2015 05:19
Unexpected Yepnope callback order
console.log('bar.js is run (should run 2nd)');
yepnope({
load: 'https://gist.github.com/jpmckinney/5383575/raw/7e4ee538dd6059eea12e207652cf48f1de819364/foo.js',
callback: function () {
console.log('callback in bar.js is run (should run 4th)');
},
complete: function () {
console.log('complete in bar.js is run (should run 5th)');
window.divide = function (a, b) {
@datagrok
datagrok / git-serve.md
Last active April 21, 2023 07:33
How to easily launch a temporary one-off git server from any local repository, to enable a peer-to-peer git workflow.
anonymous
anonymous / image_size.rb
Created June 16, 2012 14:09
Nanoc filter that computes image dimensions and injects height and width attributes into img tags for much faster and smoother image loading in browsers
# vim: set ts=2 sw=2 et ai ft=ruby:
# Idea from here:
# http://userprimary.net/posts/2011/01/10/optimizing-nanoc-based-websites/
# Also uses code from other filters that are shipped with Nanoc itself.
#
# Implementation enhanced by Pascal Bleser <loki@fosdem.org>,
# under either GPL2 (GNU General Public License) or ASL2.1 (Apache Software License)
# or BSD-3-Clause, as you wish (short version: do whatever you want with it ;)).
#
@haschek
haschek / .jshintrc
Created May 4, 2012 16:08
JSHint Configuration, Strict Edition
{
// --------------------------------------------------------------------
// JSHint Configuration, Strict Edition
// --------------------------------------------------------------------
//
// This is a options template for [JSHint][1], using [JSHint example][2]
// and [Ory Band's example][3] as basis and setting config values to
// be most strict:
//
// * set all enforcing options to true
@textarcana
textarcana / git-log2json.sh
Last active March 1, 2024 05:26
Convert Git logs to JSON. The first script (git-log2json.sh) is all you need, the other two files contain only optional bonus features 😀THIS GIST NOW HAS A FULL GIT REPO: https://github.com/context-driven-testing-toolkit/git-log2json
#!/usr/bin/env bash
# Use this one-liner to produce a JSON literal from the Git log:
git log \
--pretty=format:'{%n "commit": "%H",%n "author": "%aN <%aE>",%n "date": "%ad",%n "message": "%f"%n},' \
$@ | \
perl -pe 'BEGIN{print "["}; END{print "]\n"}' | \
perl -pe 's/},]/}]/'
@liuwen-lvtu
liuwen-lvtu / tutorial.mkdn
Created October 18, 2011 03:19 — forked from mirisuzanne/tutorial.mkdn
A new Susy tutorial

Susy Tutorial

For this tutorial I'm assuming you are already comfortable with CSS, Sass (I'll use the SCSS syntax) and Compass. Please get set up with each one of those before attempting to use Susy. Sass and Compass both have their own setup instructions and tutorials that you can use.

There is also reference documentation in the works.

What Susy Does

CSS Systems