Skip to content

Instantly share code, notes, and snippets.

View iki's full-sized avatar

Jan Killian iki

View GitHub Profile
@staltz
staltz / introrx.md
Last active April 19, 2024 18:49
The introduction to Reactive Programming you've been missing
@scottjehl
scottjehl / noncritcss.md
Last active August 12, 2023 16:57
Comparing two ways to load non-critical CSS

I wanted to figure out the fastest way to load non-critical CSS so that the impact on initial page drawing is minimal.

TL;DR: Here's the solution I ended up with: https://github.com/filamentgroup/loadCSS/


For async JavaScript file requests, we have the async attribute to make this easy, but CSS file requests have no similar standard mechanism (at least, none that will still apply the CSS after loading - here are some async CSS loading conditions that do apply when CSS is inapplicable to media: https://gist.github.com/igrigorik/2935269#file-notes-md ).

Seems there are a couple ways to load and apply a CSS file in a non-blocking manner:

@callumacrae
callumacrae / build-tools.md
Last active October 25, 2023 15:14
Build tools written in JavaScript
@OverZealous
OverZealous / build.config.js
Last active June 21, 2021 04:12
Preliminary Gulpfile for replicating ngBoilerplate — Still a work in progress!
/**
* This file/module contains all configuration for the build process.
*/
/**
* Load requires and directory resources
*/
var join = require('path').join,
bowerrc = JSON.parse(require('fs').readFileSync('./.bowerrc', {encoding: 'utf8'})),
bowerJSON = bowerrc.json.replace(/^\.?\/?/, './'),
@sloria
sloria / bobp-python.md
Last active April 17, 2024 09:35
A "Best of the Best Practices" (BOBP) guide to developing in Python.

The Best of the Best Practices (BOBP) Guide for Python

A "Best of the Best Practices" (BOBP) guide to developing in Python.

In General

Values

  • "Build tools for others that you want to be built for you." - Kenneth Reitz
  • "Simplicity is alway better than functionality." - Pieter Hintjens
class RottenGzipFile(object):
"""
Standard library GzipFile replacement, since it has several issues with
files containing extra data after compressed stream.
See http://stackoverflow.com/questions/4928560/how-can-i-work-with-gzip-files-which-contain-extra-data
for details.
This class does not implement everything usually included in file-like
objects.
@leostera
leostera / ngseed.post
Created August 19, 2013 15:50
CleverStack ngSeed Blog Post
# CleverStack
## Angular Seed
### YAAS (Yet Another Angular Seed)
While know about the existence of `ng-boilerplate`, the `angular-app` repo on Github, or even Yeoman and it's `angular-generator`, none of those really fit the bill when it comes to structuring a medium to large application as it often is the case here at Clevertech.
This is not yet another angular seed: this is the collaborative effort of open source enthusiasts to solve the most of the problems in AngularJS development. Yes, we took the liberty of adding a bit of a bleak packaging but that allows us for dead-easy installing, upgrading and extending.
Let's dive into it.
@willurd
willurd / web-servers.md
Last active April 18, 2024 14:15
Big list of http static server one-liners

Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.

Discussion on reddit.

Python 2.x

$ python -m SimpleHTTPServer 8000
#!/usr/bin/python
#
# Requires libevent, greenlet, gevent and pyzmq.
#
# Exemplar run:
#
# $ ./poblano_backend.py
# GitHub handled by worker 1: OK
# Jenkins handled by worker 2: OK
# Review Board handled by worker 1: OK
@19h
19h / reset.js
Created February 19, 2013 22:51
Node.js — Clear Terminal / Console. Reset to initial state.
console.reset = function () {
return process.stdout.write('\033c');
}