Skip to content

Instantly share code, notes, and snippets.

View Fauntleroy's full-sized avatar

Timothy Kempf Fauntleroy

View GitHub Profile

Eliminating aliasing for elements with 3D rotation applied

Sometimes, when you apply a 3D rotation to an element within a perspective parent, it will have aliased edges.

image

This can be fixed by adding outline: 1px solid transparent to the element with the transform:

.rotatedElement {
@Fauntleroy
Fauntleroy / Code.gs
Last active April 25, 2023 05:19
A basic "Multiselect" Apps Script for Google Sheets
// SCRIPT CONFIGURATION
// Change the configuration values below to make everything work.
// MULTI_CHOICE_CELLS
// This is a string in "A1 Notation". Simply specify which cells you would
// like to have "multiselect" functionality the same way you specify cells
// inside Google Sheets
//
// const MULTI_CHOICE_CELLS = 'Sheet1!A1:C3,Sheet2!D5:E6';
@Fauntleroy
Fauntleroy / gist:b2fb4cc12a93805b942bfb7d306e7790
Created July 21, 2020 20:41
Onfleet Google Geocoding Doc
Problem
Due new requirements from Google Geocoding API guideline, they are categorizing strictness on the apartment/office buildings.
They are now qualified as GEOMETRIC_CENTER. However, due to their own guideline, we can’t accept geometric_center as a valid address.
There is some situation with our system that we are in the process of changing but not quite there.
Depending on how the address field is sent in. We can tackle this problem using my workaround for now.
Here’s a valid address that would used to work:
@Fauntleroy
Fauntleroy / gist:5167736
Created March 15, 2013 05:48
Convert the YouTube v3 API's insane duration to something reasonable
var convertYouTubeDuration = function( yt_duration ){
var time_extractor = /([0-9]*)M([0-9]*)S$/;
var extracted = time_extractor.exec( yt_duration );
var minutes = parseInt( extracted[1], 10 );
var seconds = parseInt( extracted[2], 10 );
var duration = ( minutes * 60 ) + seconds;
return duration;
};
@Fauntleroy
Fauntleroy / index.js
Last active July 21, 2017 18:30
requirebin sketch
// Welcome! require() some modules from npm (like you were using browserify)
// and then hit Run Code to run your code on the right side.
// Modules get downloaded from browserify-cdn and bundled in your browser.
const decomp = require('poly-decomp');
window.decomp = decomp;
const Matter = require('matter-js');
const { PI } = Math;
@Fauntleroy
Fauntleroy / download-mortys.js
Last active September 9, 2016 00:30
Quick script for downloading mortys from a popular Pocket Mortys website for emoji purposes.
const fs = require('fs');
const _ = require('lodash');
const request = require('request');
const mortyData = require('./morty-data.js');
const MORTY_ICON_BASE_URL = 'https://pocketmortys.net/images/heads';
const downloadMorty = function (morty) {
@Fauntleroy
Fauntleroy / comment.js
Last active June 23, 2016 01:41
Get a random popular Dribbble comment.
var NO_OP = function(){};
// randomly choose one of dribbble's popular shots
// keep choosing until we get one with comments
var getRandomShotId = function( callback ){
var getRandomShot = function( shots ){
var random_index = Math.floor(Math.random()*shots.length);
var shot = shots[random_index];
if( shot.comments_count === 0 ){
return getRandomShot( shots );
@Fauntleroy
Fauntleroy / gist:6517551
Last active February 18, 2016 00:30
semicolon style
// Spaces are silly
// Github hates tabs
// Everyone love semicolons, right?
var semicolonStyle = function(){
;;;;setTimeout( function(){
;;;;;;;;alert('semicolon style rules!')
;;;;}, 50 )
}
;
semicolonStyle()
@Fauntleroy
Fauntleroy / convertOffset.js
Created January 25, 2014 02:20
Convert a time offset string -HHMM into offset minutes.
var convertOffset = function( offset ){
if( typeof offset !== 'string' ) return;
var hours = parseInt( offset.substr( -4, 2 ), 10 );
var minutes = parseInt( offset.substr( -2, 2 ), 10 );
var negative = ( offset.substr( -5, 1 ) === '-' );
var offset_in_minutes = hours * 60 + minutes;
if( negative ) offset_in_minutes = offset_in_minutes * -1;
return offset_in_minutes;
};
@Fauntleroy
Fauntleroy / (designated) auth.json
Last active December 29, 2015 01:29
resources + auth ideas for solidus
{
"storyteller": {
"headers": {
"Api-Key": "e801cf0a-ee44-42d3-a29f-aff82fd0521b"
}
}
}