Skip to content

Instantly share code, notes, and snippets.

📸
GitHub's new owners gave all their private user data to the NSA 👎

Tom Kenny twome

📸
GitHub's new owners gave all their private user data to the NSA 👎
Block or report user

Report or block twome

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@twome
twome / Ancient HTML cleaning regexes
Last active Sep 23, 2018
Regexes for finding and cleaning up ancient/bad/deprecated HTML for manual archaeology
View Ancient HTML cleaning regexes
# Exclude from find-all
-tmp/*, -.sass-cache/*, -*.min.*, -*-min.*
# Deprecated attributes
\s*(width|height|border|cellpadding|cellspacing|bordercolor|bgcolor|color|valign|align|hspace|vspace)="[^"]*"
# If there's no quotes, you can also hit their values
\s*(width|height|hspace|vspace)=\d*\%?
\s*(bordercolor|bgcolor|color)=#?\d{3,6}
View 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
@twome
twome / crossbrowser-alpha-colour.scss
Last active Sep 23, 2018
Sass colour helpers, for the frontend folk on the go.
View crossbrowser-alpha-colour.scss
// This lets you specify the colour of the backdrop behind your transparent
// foreground colour - ideally with a variable - so that Sass can use its
// `mix` function to get fake transparency. It looks identical to real
// transparency (for solid-on-solid colour). IE8 can use `filter` to get real
// *background* transparency, but if you use this you can also get
// "transparency" on border-color, font color, and everything else. It
// defaults to the most legitimate transparency available.
// It doesn't expect Modernizr, but it does expect some kind of similar 'IE8'
// class in the `<html>` element, like H5BP's. Can Modernizr detect the old MS
View i-pledge-to-be-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.
@twome
twome / today.compiled.css
Last active Oct 28, 2016
Trello - Stronger "today" indicator for date-select mini-calendar
View today.compiled.css
/*
Stronger "today" indicator for date-select mini-calendar.
The current "today" indicator already has bold text, but that might be a bit subtle
for some users (especially those with vision impairments or poor font rendering).
This uses a coloured background and a faint light rim that remains when "today"
is also the selected day, to save users from having to select a different
day to double-check they have correctly selected "today". This also helps
for more instantly noticing the current day when skimming through months.
@twome
twome / labour-statement.md
Last active Mar 7, 2019
Where did this code's labour come from?
View labour-statement.md

This work was done using my spare time, using skills I had learned in employment and in more spare time. I have experienced very little oppression in this industry due to gender, age, sexual orientation & identity, and ethnicity. These are privileges & advantages not afforded to the global majority of people.

I have experienced, alongside all other working-class people, oppression due to class: my time and energy that could have been spent writing socially-useful, open-source code (or developing my skills in order to do so) has instead been commanded by private business owners and sapped by landlords. Profit comes from, in any long-term successful business, paying employees less than the employees produce for the owner. Rent comes from a preexisting imbalance of capital ownership, and takes money without productive work being done by the rent-seeker.

Always keep in mind the social context in which code is written, what k

View keybase.md

Keybase proof

I hereby claim:

  • I am twome on github.
  • I am twome (https://keybase.io/twome) on keybase.
  • I have a public key ASAXwV-Wr67CXM5yej_r4T0UDwqIFxTxQml453uoRijAlgo

To claim this, I am signing this object:

@twome
twome / close_deleted_files.py
Last active Jan 30, 2019 — forked from michaelkonecny/close_deleted_files.py
Sublime Text plugin - close tabs containing deleted files on refocus
View close_deleted_files.py
"""
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 macOS 10.14.2
"""
import sublime_plugin
import sublime
import time
import os
@twome
twome / destructured-parameters.js
Last active Mar 16, 2019
Clean optional parameters using destructuring
View destructured-parameters.js
function fn(mandatoryParameter, {
optionalA = 'a value',
optionalB = 'another value',
optionalC = 'notice that this is using destructured assignment syntax, not object literal syntax'
} = {} /* unfortunately, we need to specify an empty object default if the consumer provides no object argument */){
// Configuration
this.configurationPropertyNamespace = {
optionalA,
hardCodedConfig: 'we can use the object literal "default" property naming trick to be more terse'
@twome
twome / README.md
Last active Apr 2, 2019
Browser patch: [Twitter] Boring Tweet Remover
View README.md

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)

J4cK-r3l473d Gr33tZ

You can’t perform that action at this time.