Skip to content

Instantly share code, notes, and snippets.

View Frikki's full-sized avatar
Welcome to the Thunder Dome

Frederik Krautwald Frikki

Welcome to the Thunder Dome
View GitHub Profile
@paulirish
paulirish / what-forces-layout.md
Last active April 26, 2024 05:24
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
@staltz
staltz / introrx.md
Last active April 25, 2024 04:18
The introduction to Reactive Programming you've been missing
anonymous
anonymous / sublime_text3_crack.md
Created June 7, 2015 04:58
Sublime Text 3092 3083 latest crack Win32 Win64 Linux64 Linux32 OSX Mac MacOS

cat

For pupil: all binary can be downloaded http://pan.baidu.com/s/1hqH2Pko

After overwriting, maybe need to run chmod +x /path/to/sublime_text. For linux default installation, need to add sudo.

For programmer:

VERSION PLATFORM OFFSET ORIGINAL CRACKED
@RadValentin
RadValentin / yarn.unlock.md
Last active August 1, 2023 11:58
Solve `yarn.lock` or `package.json` conflicts without losing your mind

NOTE: This guide is ONLY for devs who don't want to edit their yarn.lock file by hand. If you don't care about that please carry on.


So you've pulled the latest master

git checkout master
git pull
@BenMorel
BenMorel / viewport-units-ios.scss
Last active March 11, 2022 13:15
SCSS mixin to support vh and vw units on all iOS Safari versions. Based on an idea by Patrick Burtchaell's: https://gist.github.com/pburtchaell/e702f441ba9b3f76f587
/**
* Fix for vw, vh, vmin, vmax on iOS 7.
* http://caniuse.com/#feat=viewport-units
*
* This fix works by replacing viewport units with px values on known screen sizes.
*
* iPhone 6 and 6 Plus cannot run iOS 7, so are not targeted by this fix.
* Target devices running iOS 8+ will incidentally execute the media query,
* but this will still produce the expected result; so this is not a problem.
@dmitriid
dmitriid / svg-to-virtual-dom.js
Created September 11, 2015 10:30
Convert svg files to virtual-dom's VTree
/*
Convert svg files to virtual-dom's VTree
To use the resulting tree
import svg from 'virtual-dom/virtual-hyperscript/svg'
if you use Cycle.js:
import {svg} from '@cycle/dom';
*/
import fs from 'fs';
@wclr
wclr / cycle-state-ramda.md
Last active April 6, 2018 15:06
A way to handle state in cycle.js

A way to handle state in cycle.js

Simple state management with xstream and ramda, in more transparent fashion than onionify

import * as R from 'ramda'

// first we create factory for making special state stream 
// that will hold our stream value and will be modified with supplied streams of reducers
type StateReducer<T> = (state: T) => T
@briancavalier
briancavalier / lazy-pair.js
Last active October 12, 2017 13:23
Fun with a Lazy type and pairs
// Pair helpers
// Map the first element of a pair
const first = <A, B, C> (f: A => B, [a, c]: [A, C]): [B, C] =>
[f(a), c]
// Map the second element of a pair
const second = <A, B, C> (f: B => C, [a, b]: [A, B]): [A, C] =>
[a, f(b)]
@briancavalier
briancavalier / except.js
Last active September 7, 2017 15:52
A simple Either with added exception semantics, like Haskell ExceptT
// @flow
import { curry2, curry3 } from '@most/prelude'
export type Except<E, A> = Exception<E, A> | Result<E, A>
export const result = <E, A> (a: A): Except<E, A> =>
new Result(a)
export const throwError = <E, A> (e: E): Except<E, A> =>
new Exception(e)
@TylorS
TylorS / perfect_functional_language.md
Last active February 26, 2017 23:01
The perfect functional web application language, according to me :)

Language Specification Wishes

The desire to create a new language has come from my own experiences in programming in a framework I’ve built, Motorcycle.js and the language TypeScript. Motorcycle is very similar to the more popular project Cycle.js. In my current place of employment we are building a rather large and complex application and we have felt the language barriers of ECMAScript and TypeScript much more than we have the programming patterns we have come to use.

This is, currently, a very informal and non-exhaustive list of things I wish a single programming language would have. This language would likely to be very opinionated, and geared towards functional and reactive web applications. In many ways, but not all, I’d like to see a language designed around the programming patterns of Cycle and Motorcycle.

I hope to develop this language in the future, unless someone else beats me to it! Following this is a