Skip to content

Instantly share code, notes, and snippets.

View mk0x9's full-sized avatar

Mikhail Kuryshev mk0x9

  • Berlin, Germany
  • 12:36 (UTC +02:00)
View GitHub Profile
@gcanti
gcanti / io-ts2form.ts
Created August 25, 2018 13:37
Automatically building a form from a `io-ts` type
import * as t from 'io-ts'
import * as React from 'react'
import { render } from 'react-dom'
type Field = t.StringType | t.NumberType | t.BooleanType
interface Form extends t.InterfaceType<{ [key: string]: Field }> {}
const toReactElement = (f: Form | Field): React.ReactElement<any> => {
// f is a tagged union
switch (f._tag) {
@cryzed
cryzed / fix-infinality.md
Last active April 30, 2024 22:01
A set of instructions on how to fix the harfbuzz + Infinality issue and restoring good-looking, Infinality-like font rendering.

Disclaimer: Please follow this guide being aware of the fact that I'm not an expert regarding the things outlined below, however I made my best attempt. A few people in IRC confirmed it worked for them and the results looked acceptable.

Attention: After following all the steps run gdk-pixbuf-query-loaders --update-cache as root, this prevents various gdk-related bugs that have been reported in the last few hours. Symptoms are varied, and for Cinnamon the DE fails to start entirely while for XFCE the icon theme seemingly can't be changed anymore etc.

Check the gist's comments for any further tips and instructions, especially if you are running into problems!

Screenshots

Results after following the guide as of 11.01.2017 13:08:

@Rich-Harris
Rich-Harris / service-workers.md
Last active April 21, 2024 16:24
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.

@nl5887
nl5887 / readme.md
Created April 29, 2016 08:17
Modern.IE Windows XP download
@bishboria
bishboria / springer-free-maths-books.md
Last active April 25, 2024 06:27
Springer made a bunch of books available for free, these were the direct links
@Olegas
Olegas / readme.md
Last active October 15, 2018 19:54
  1. Спецификация requestAnimationFrame: http://www.w3.org/TR/animation-timing/
  2. Справочник свойств, приводящих к reflow/restyle/repaint: http://csstriggers.com
  3. Ян Бородецкий, Оптимизация рендеринга веб-страницы: https://www.youtube.com/watch?v=-uMZDzIhcHQ
  4. Avoid Large, Complex Layouts and Layout Thrashing https://developers.google.com/web/fundamentals/performance/rendering/avoid-large-complex-layouts-and-layout-thrashing#avoid-forced-synchronous-layouts
@staltz
staltz / introrx.md
Last active May 6, 2024 01:44
The introduction to Reactive Programming you've been missing
@tummychow
tummychow / readme.md
Created June 19, 2014 06:03
Bugzilla on nginx (except without the questionable perl wrapper scripts)

Just a brief proof of concept for running bugzilla on nginx using fcgiwrap

Software development needs issue tracking cause there's too much stuff to remember. Raise issues and manage tasks. Get stuff done. Keep track of backlogs without losing yourself in the ocean of stuff that needs doing. Real life is quite similar, so lately I have been experimenting with small self-hosted instances of various issue tracking solutions. Bugzilla is one of the most mature and feature-complete foss options in this area so obviously I had to try it.

The server that I run all my personal toys on is using nginx exclusively (with passenger for my numerous ruby and python applications, more on that in another gist? perhaps!). Unfortunately bugzilla does not support nginx out of the box. It mainly targets apache's mod_perl (or mod_cgi). However since bugzilla is ultimately a cgi application, we can find ways to serve it on nginx.

Basically the solution is to wrap bugzilla's cgi scripts in a fastcgi server so that nginx can

// tanuki 2019
havka = [];
s = __NEXT_DATA__.props.initialState.products.data
for (key of Object.keys(s)) {
p = s[key];
havka.push([p.title, p.weight/p.price, p.price, p.weight, p.calories])
}
havka = havka.sort(function(a, b){ var x=a[1]; var y=b[1]; return y-x; });
eblo = "";
@lox
lox / Makefile
Last active March 28, 2018 12:55
Replaced Grunt/Gulp with a Makefile
SASSC = sass --style compact
COMPSDIR = resources/assets/components
SASSDIR = resources/assets/css
JSDIR = resources/assets/js
DISTDIR = web/dist
CSSDIR = $(DISTDIR)/css
SASSINC = $(SASSDIR) \
$(COMPSDIR)/asimov/src/scss \
$(COMPSDIR)/asimov-contests/src/scss \
$(COMPSDIR)/asimovicons/src/scss