Skip to content

Instantly share code, notes, and snippets.

@tfe
tfe / JTSSwiftTweener.swift
Last active June 22, 2021 03:36 — forked from JoshuaSullivan/JTSSwiftTweener.swift
A tweening library to animate arbitrary numerical values.
//
// JTSSwiftTweener.swift
// JTSSwiftTweener
//
// Created by Joshua Sullivan on 12/10/16.
// Copyright © 2016 Josh Sullivan. All rights reserved.
//
import UIKit
@tfe
tfe / keybase.md
Created February 25, 2015 07:23
Keybase.io Verification

Keybase proof

I hereby claim:

  • I am tfe on github.
  • I am tfe (https://keybase.io/tfe) on keybase.
  • I have a public key whose fingerprint is F2DD 3D50 78F8 8E9C B078 9E98 F9BF FDFE C16F D5E9

To claim this, I am signing this object:

@tfe
tfe / fluid_gmail.js
Last active December 16, 2015 02:59 — forked from kirbysayshi/fluid_gmail.js
Semicolons and style.
window.fluid.dockBadge = '';
setTimeout(updateDockBadge, 1000);
setTimeout(updateDockBadge, 3000);
setInterval(updateDockBadge, 5000);
function updateDockBadge() {
var navigation = document.querySelector('[role=navigation]');
var doc = navigation.contentDocument || navigation.ownerDocument;
@tfe
tfe / jquery.truncatelines.js
Created July 21, 2011 01:05 — forked from cscheng/jquery.truncatelines.js
A simple jQuery plugin to truncate a piece of text to a predefined amount of lines. It assumes pixel values of both the container and its line-height. Useful when you have multiple boxes with text in your design that require equal heights.
// https://gist.github.com/1096291
;(function ($) {
$.fn.truncateLines = function(options) {
options = $.extend($.fn.truncateLines.defaults, options);
return this.each(function(index, container) {
container = $(container);
var containerLineHeight = Math.ceil(parseFloat(container.css('line-height')));
@tfe
tfe / strip_zeros_from_date
Created February 28, 2011 23:46
Ruby function to remove leading zeros (useful with strftime, place in application helper in Rails)
# Ruby function to remove leading zeros.
# Just put an asterisk (*) in front of any possible leading zero you want to remove.
# http://www.nullislove.com/2007/05/16/time-for-strftime/
def strip_zeros_from_date(marked_date_string)
marked_date_string.gsub('*0', '').gsub('*', '') unless marked_date_string.nil?
end
# CDN-ify Assets
#
# This script will traverse all the objects in an S3 bucket and set ACLs and
# cache headers as appropriate for CDN (CloudFront) distribution. Specifically,
# it sets them to expire 10 years from now (far-future expiration) and ACLs to
# be publicly readable.
#
# Use this if you have an S3 bucket full of assets that didn't get proper settings
# set when you uploaded them, and you need an easy way to fix them now.
#
#!/bin/sh
#
# Will append the current Lighthouse ticket number to the commit message automatically
# when you use the ticket###-ticket-name branch naming convention (e.g. 206-fix-widget).
#
# Drop into .git/hooks/commit-msg
# chmod +x .git/hooks/commit-msg
exec < /dev/tty