Skip to content

Instantly share code, notes, and snippets.

View tevko's full-sized avatar
🇺🇲

Tim tevko

🇺🇲
  • NY
View GitHub Profile
@miguelmota
miguelmota / fingerprint.sh
Created March 26, 2021 04:51
SSH generate sha256 fingerprint of public key using ssh-keygen
ssh-keygen -lf ~/.ssh/id_rsa.pub -E sha256
# output:
# 3072 SHA256:dxQGxpXYbvfa6mk2I3XC17aT3jh6gbF7YPsOwusHGpU user@linux (RSA)
@jacwright
jacwright / link-accounts.js
Created May 8, 2017 15:40
Auth0: Link Accounts with Same Email Address while Merging Metadata
@yossorion
yossorion / what-i-wish-id-known-about-equity-before-joining-a-unicorn.md
Last active April 7, 2024 22:55
What I Wish I'd Known About Equity Before Joining A Unicorn

What I Wish I'd Known About Equity Before Joining A Unicorn

Disclaimer: This piece is written anonymously. The names of a few particular companies are mentioned, but as common examples only.

This is a short write-up on things that I wish I'd known and considered before joining a private company (aka startup, aka unicorn in some cases). I'm not trying to make the case that you should never join a private company, but the power imbalance between founder and employee is extreme, and that potential candidates would

@Rich-Harris
Rich-Harris / service-workers.md
Last active April 9, 2024 08:18
Stuff I wish I'd known sooner about service workers

Stuff I wish I'd known sooner about service workers

I recently had several days of extremely frustrating experiences with service workers. Here are a few things I've since learned which would have made my life much easier but which isn't particularly obvious from most of the blog posts and videos I've seen.

I'll add to this list over time – suggested additions welcome in the comments or via twitter.com/rich_harris.

Use Canary for development instead of Chrome stable

Chrome 51 has some pretty wild behaviour related to console.log in service workers. Canary doesn't, and it has a load of really good service worker related stuff in devtools.

@dijs
dijs / jsdom-iframe-test.js
Created July 20, 2016 18:30
Example of testing iframe messaging using jsdom
import { expect } from 'chai';
import jsdom from 'jsdom';
describe('JSDOM', () => {
it('should communicate with inner iframes', done => {
jsdom.env({
url: "http://bar.com/",
done (err, window) {
var frame = window.document.createElement('iframe');
window.document.body.appendChild(frame);
@tevko
tevko / respsizes.js
Last active January 31, 2016 10:31
Dev Tools Snippet to auto-calculate responsive image sizes value on window resize
/**
*
* Paste image class / identifier in IIFE parenthesis at end of function
*
* */
(function(i){"use strict";var img=$(i),sizes=[];window.addEventListener("resize",()=>{var vw=Math.round(((img.offsetWidth*100)/window.innerWidth))+"vw",mq="(min-width: "+window.innerWidth+"px)",value=vw;vw!=="0vw"&&sizes.indexOf(vw)===-1&&(sizes.push(value),console.log(mq,vw))})})("PASTE CLASS OR IDENTIFIER HERE");
@jennschiffer
jennschiffer / github_annoyance.js
Last active October 2, 2015 16:16
put this in your damn console to hide annoying files in your github pr diff
// replace "wp-content/plugins" in the annoyance variable unless that is your annoyance like it is mine
$('.user-select-contain').each(function(){var annoyance="wp-content/plugins";var title=$(this).attr('title');if(title&&title.indexOf(annoyance)!=-1){$(this).closest('.file').hide();}});
@paulirish
paulirish / what-forces-layout.md
Last active April 19, 2024 14:42
What forces layout/reflow. The comprehensive list.

What forces layout / reflow

All of the below properties or methods, when requested/called in JavaScript, will trigger the browser to synchronously calculate the style and layout*. This is also called reflow or layout thrashing, and is common performance bottleneck.

Generally, all APIs that synchronously provide layout metrics will trigger forced reflow / layout. Read on for additional cases and details.

Element APIs

Getting box metrics
  • elem.offsetLeft, elem.offsetTop, elem.offsetWidth, elem.offsetHeight, elem.offsetParent
@chantastic
chantastic / on-jsx.markdown
Last active March 20, 2024 01:03
JSX, a year in

Hi Nicholas,

I saw you tweet about JSX yesterday. It seemed like the discussion devolved pretty quickly but I wanted to share our experience over the last year. I understand your concerns. I've made similar remarks about JSX. When we started using it Planning Center, I led the charge to write React without it. I don't imagine I'd have much to say that you haven't considered but, if it's helpful, here's a pattern that changed my opinion:

The idea that "React is the V in MVC" is disingenuous. It's a good pitch but, for many of us, it feels like in invitation to repeat our history of coupled views. In practice, React is the V and the C. Dan Abramov describes the division as Smart and Dumb Components. At our office, we call them stateless and container components (view-controllers if we're Flux). The idea is pretty simple: components can't

@funzeye
funzeye / WordPress Advanced Custom Field - Responsive Image Field
Last active November 26, 2015 21:53
How To Use Responsive Images in WordPress using Advanced Custom Field's image field and the wp-tevko-responsive-images Plugin
<figure>
<?php
$image = get_field('your_image_field_name');
$atts = array(
'imageid' => $image,
'size1' => '0',
'size2' =>'600',
'size3' =>'1000'
);
echo tevkori_responsive_shortcode($atts) ; ?>