Skip to content

Instantly share code, notes, and snippets.

View hydrosquall's full-sized avatar

Cameron Yick hydrosquall

View GitHub Profile
@paulirish
paulirish / what-forces-layout.md
Last active June 19, 2025 14:36
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
@stuartlynn
stuartlynn / index.md
Last active December 12, 2016 18:45
CartoDB Internet of Things and Big Data

CartoDB, Big Data and the Internet of Things

Creating an account

Set you up with accounts here. This will give you a free upgrade with double the storage space and some neat features!

Creating your first map

Making maps that explore data

To get used to work with CartoDB we are first going to make a map that will help us explore crime data in Boston.

What kind of iteration to use when in JavaScript

For loops

for (var i = 0; i < array.length; i++) {
}
  • Code has to run in old versions of IE.
@staltz
staltz / introrx.md
Last active June 18, 2025 06:22
The introduction to Reactive Programming you've been missing
The Yale VPN uses Cisco AnyConnect.
If Cisco's Linux client works for you, congratulations.
If, like me, the official client leaves you stranded, then you need to install
OpenConnect and (assuming you are using Network Manager) the appropriate add-on for the NM applet.
On a Debian-based system, you can type the following command:
$ sudo apt-get install openconnect network-manager-openconnect network-manager-openconnect-gnome
@madjar
madjar / scrapper.py
Last active March 5, 2023 15:02
A example of scrapper using asyncio and aiohttp
import asyncio
import aiohttp
import bs4
import tqdm
@asyncio.coroutine
def get(*args, **kwargs):
response = yield from aiohttp.request('GET', *args, **kwargs)
return (yield from response.read_and_close(decode=True))
@jeremy-w
jeremy-w / Working Effectively with Legacy Code.md
Last active April 17, 2025 09:46
Notes on Michael Feathers' *Working Effectively with Legacy Code*.

Working Effectively with Legacy Code

Notes by Jeremy W. Sherman, October 2013, based on:

Feathers, Michael. Working Effectively with Legacy Code. Sixth printing, July 2007.

Foreword:

  • Software systems degrade into a mess.
  • Requirements ALWAYS change.
  • Your goal as a software developer: Create designs that tolerate change.
@yanofsky
yanofsky / LICENSE
Last active May 26, 2025 05:04
A script to download all of a user's tweets into a csv
This is free and unencumbered software released into the public domain.
Anyone is free to copy, modify, publish, use, compile, sell, or
distribute this software, either in source code form or as a compiled
binary, for any purpose, commercial or non-commercial, and by any
means.
In jurisdictions that recognize copyright laws, the author or authors
of this software dedicate any and all copyright interest in the
software to the public domain. We make this dedication for the benefit
@MohamedAlaa
MohamedAlaa / tmux-cheatsheet.markdown
Last active June 19, 2025 06:54
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
@hrldcpr
hrldcpr / tree.md
Last active June 19, 2025 08:17
one-line tree in python

One-line Tree in Python

Using Python's built-in defaultdict we can easily define a tree data structure:

def tree(): return defaultdict(tree)

That's it!