Skip to content

Instantly share code, notes, and snippets.

View snorpey's full-sized avatar

georg fischer snorpey

View GitHub Profile
@swalkinshaw
swalkinshaw / tutorial.md
Last active November 13, 2023 08:40
Designing a GraphQL API
@meshula
meshula / 3d-formats.md
Last active March 30, 2022 18:45
3d file formats, last mile vs. interchange

FWIW: I (@rondy) am not the creator of the content shared here, which is an excerpt from Edmond Lau's book. I simply copied and pasted it from another location and saved it as a personal note, before it gained popularity on news.ycombinator.com. Unfortunately, I cannot recall the exact origin of the original source, nor was I able to find the author's name, so I am can't provide the appropriate credits.


Effective Engineer - Notes

What's an Effective Engineer?

@bastianallgeier
bastianallgeier / external.js
Last active March 23, 2016 14:04
For those "external links should open in new tabs" clients…
$('a').each(function() {
if(this.host !== window.location.host) {
$(this).attr('target', '_blank');
}
});

Kirby + Patterns = <3

When I heard about Brad Frost's Patternlab for the first time at beyond tellerrand I was intrigued. The idea of splitting your design work for a website into simple modules or patterns isn't new and starts to become more and more of a standard. But organizing this into a very visual styleguide/patternlab seemed to make so much sense. Brad also introduced a very interesting approach with his separation of modules into categories, such as atoms, molecules and organisms.

I started porting Brad's patternlab app to Kirby, but it never really made it to something polished and it turned out for me after using it for Kirby's panel UI, that it's actually a pain in the ass to maintain such a pattern collection.

The problem of patternlab

The problem with such a styleguide or patternlab is that it exists next to the real thing. When you change something in your code base you also have to update the particular code for the pattern in patternlab. To be honest I went very quickly from being

When I was a beginner…

This is a little exercise to try remember the things I struggled with, when I got started with web development. It's too easy to forget about those things after years in business. I think it's super important to keep the ability to put yourself back into the position of a beginner from time to time in order to not overcomplicate your own work and to not throw the typical "just" and "simply" sentences at other people, who get started.

The following list is not complete or very detailed. It's really all about writing down some memories quickly. Feel free to follow this experiment for yourself if you think it's useful.

HTML

  • Breaks. Why the hell doesn't text wrap in the browser when I add a line break to the source code?
  • Paths: I absolutely struggled with the basic concept of absolute and relative paths and why stuff doesn't get loaded correctly when I messed paths up in URLs.
@paulirish
paulirish / what-forces-layout.md
Last active July 3, 2024 16:54
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
@IgorMuzyka
IgorMuzyka / GLGlitchEffect.h
Last active December 19, 2017 18:17
Objective-C UIImage Glitch
//
// GLGLitchEffect.h
// Glitch
//
// Created by Igor on 27.08.14.
// Copyright (c) 2014 Igor Muzyka. All rights reserved.
//
#import <Foundation/Foundation.h>
@snorpey
snorpey / load-file.js
Last active August 29, 2015 14:00
AMD module for loading a file asynchronously. It also stores the file in the browsers local storage for quicker access. I mostly use it for loading GLSL shader files
/*global define*/
/*
AMD module for loading files asynchronously. It also stores the contents of the files
in the browsers local storage for quicker access. I mostly use it for loading GLSL
shader files. Note: This has not been tested extensively, so use with caution.
MIT License
*/
define(
function()
{
@aurri
aurri / getTransitionDuration.js
Created January 11, 2014 22:24
Get transition duration in pure JavaScript, without jQuery
// Based on https://gist.github.com/snorpey/7230329
function getTransitionDuration(el){
var res = 0
prefix('transition-duration', function(v, pfx){
duration = el.style[v]
if(!duration) return
duration = parseTime(duration) + parseTime(el.style[pfx('transition-delay')] || 0)
function parseTime(s){ return parseFloat(s) * (s.indexOf('ms') >- 1 ? 1 : 1000) }
})