Skip to content

Instantly share code, notes, and snippets.

View jdudek's full-sized avatar

Jan Dudek jdudek

View GitHub Profile
@alekseykulikov
alekseykulikov / index.md
Last active October 12, 2024 17:02
Principles we use to write CSS for modern browsers

Recently CSS has got a lot of negativity. But I would like to defend it and show, that with good naming convention CSS works pretty well.

My 3 developers team has just developed React.js application with 7668 lines of CSS (and just 2 !important). During one year of development we had 0 issues with CSS. No refactoring typos, no style leaks, no performance problems, possibly, it is the most stable part of our application.

Here are main principles we use to write CSS for modern (IE11+) browsers:

@jakub-g
jakub-g / _1_"script async defer" blocks "load" event.md
Last active August 22, 2023 10:10
Beware of "script async defer" blocking HTML "load" event

Beware of <script async defer> blocking HTML "load" event

2015.10.07 t

On the importance of simulated latency testing, and bulletproofing your page from the third-party JS load failures

TL;DR

@jdudek
jdudek / avl.c
Created April 2, 2012 20:06
AVL trees
#include <stdio.h>
#include <stdlib.h>
#define AVL_AS_LIST
typedef int AvlKey;
struct AvlNode {
AvlKey key;
char balance;
@jdudek
jdudek / gist:2136360
Created March 20, 2012 14:45
Jasmine: suite [] instead of nested describe
# suite ["shooter", "acceptance"], -> ...
# is equivalent to:
# describe "shooter", ->
# describe "acceptance", -> ...
window.suite = (names, block) ->
name = names.shift()
if names.length > 0
describe(name, -> suite(names, block))
else
@jdudek
jdudek / gist:1539919
Created December 30, 2011 13:43
Clock in JS tests
class Countdown
constructor: (@clock, @seconds) ->
$.extend(this, new Observable)
@finished = false
start: =>
fn = =>
this.trigger("updated", @seconds)
@seconds--
if @seconds >= 0
#!/bin/sh
git "$@"
@jdudek
jdudek / testing-rich-client-v2-pub.coffee
Created November 24, 2011 22:27
A few thoughts on testing rich-client applications (meet.js)
# A few thoughts on testing rich-client applications
# Jan Dudek, Arkency
# We've created a game that has some animations, uses Facebook API. Almost no rendering on the server. Client-server communication through JSON REST API.
@jdudek
jdudek / game_screen_controller_spec.js.coffee
Created November 5, 2011 14:44
Given/when/then in Jasmine
test = (suite) ->
self = {}
steps = []
last = null
run = (suite, steps) ->
return if steps.length == 0
[step, msg, fn] = steps.shift()
if step == describe
describe.call suite, msg, ->