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
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 ;)).
#
@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) {
@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
@robfletcher
robfletcher / _safe-rgba.scss
Created May 17, 2013 08:45
SASS mixin that uses modernizr to output fallback color property for browsers that don't support RGBA.
/*
* Outputs a color property with an opaque fallback for browsers that do not support RGBA.
*/
@mixin safe-rgba($property, $color, $fallback-color: opacify($color, 1)) {
@if opacity($color) == 1 {
#{$property}: $color;
} @else {
#{$property}: $fallback-color;
.rgba & {
#{$property}: $color;
@KuraFire
KuraFire / i-pledge-to-be-better
Last active December 25, 2015 15:59
A pledge for people who want to make a statement about making our industry better.
# I Pledge To Be Better
I want our industry to be a safe, welcoming and inclusive place for everyone, regardless of
their gender, abilities, skin color, sexual orientation, age, class, neuro-diversity or any other attribute.
I acknowledge that this is not currently the case, and will do my best, to the extent that I can
afford to dedicate to this, to help make ours a better community and industry.
I value the diversity of perspectives that people with different backgrounds bring to the table.
I will call out exclusionary practices, behaviors or cultures and see how, together, we can perhaps
reshape them to be inclusive and supportive instead.
@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

@john-science
john-science / OOCheatSheet.java
Last active January 14, 2021 09:36
Java: an Objected Oriented Cheat Sheet
/**
* The basic class syntax.
*/
public class BasicClass {
public BasicClass() {
// This is the constructor.
}
@michaelkonecny
michaelkonecny / close_deleted_files.py
Created October 10, 2017 15:02
Sublime Text plugin - close tabs containing deleted files on refocus
"""
When a view is focused, goes through all open tabs and closes those, whose files don't exist anymore.
Tested in Sublime Text 3.0
"""
import sublime_plugin
import sublime
import time
import os
@twome
twome / README.md
Last active August 2, 2022 10:16
Browser patch: [Twitter] Boring Tweet Remover

Hide Twitter users unless they're getting ratio'd. This allows you to effectively hate-follow odious individuals without exhausting your irony supply.

Reveals:

  • "Classic" ratios
  • Coward's Ratios
  • Public Service Announcements (huge RT:fav ratio; also applies to "they beating ur ass in the QRTs"-type scenarios)

J4cK-r3l473d Gr33tZ

@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