Skip to content

Instantly share code, notes, and snippets.

@faressoft
faressoft / dom_performance_reflow_repaint.md
Last active November 19, 2024 03:09
DOM Performance (Reflow & Repaint) (Summary)

DOM Performance

Rendering

  • How the browser renders the document
    • Receives the data (bytes) from the server.
    • Parses and converts into tokens (<, TagName, Attribute, AttributeValue, >).
    • Turns tokens into nodes.
    • Turns nodes into the DOM tree.
  • Builds CSSOM tree from the css rules.
@samueleastdev
samueleastdev / shell.sh
Last active May 15, 2018 09:47
Fixing Appc [ERROR] : An error occurred during build after 21s 27ms [ERROR] : pod install returned a non-zero exit code
sudo gem uninstall cocoapods
sudo gem install cocoapods
sudo rm -fr ~/.cocoapods/repos/master
pod setup
pod install
pod update
@thegitfather
thegitfather / vanilla-js-cheatsheet.md
Last active October 12, 2024 17:17
Vanilla JavaScript Quick Reference / Cheatsheet
@joyrexus
joyrexus / README.md
Last active January 21, 2024 21:51 — forked from btoone/curl.md
curl tutorial

An introduction to curl using GitHub's API.

Basics

Makes a basic GET request to the specifed URI

curl https://api.github.com/users/caspyin

Includes HTTP-Header information in the output

@staltz
staltz / introrx.md
Last active November 19, 2024 02:40
The introduction to Reactive Programming you've been missing
@mikaelbr
mikaelbr / destructuring.js
Last active August 20, 2024 11:27
Complete collection of JavaScript destructuring. Runnable demos and slides about the same topic: http://git.mikaelb.net/presentations/bartjs/destructuring
// === Arrays
var [a, b] = [1, 2];
console.log(a, b);
//=> 1 2
// Use from functions, only select from pattern
var foo = () => [1, 2, 3];
@raulriera
raulriera / PagingControl.js
Created April 19, 2012 02:13
Custom paging control for scrollableViews for Titanium Appcelerator
// I was unhappy about there was close to no control over the "pageControl"
// in scrollableViews, so I hacked my own
// -----
// Configuration
var pageColor = "#c99ed5";
PagingControl = function(scrollableView){
var container = Titanium.UI.createView({
height: 60
@devinus
devinus / gist:453520
Created June 25, 2010 22:09
A Natural Sorting Comparator for JavaScript's Array.prototype.sort
var NUMBER_GROUPS = /(-?\d*\.?\d+)/g;
var naturalSort = function (a, b) {
var aa = String(a).split(NUMBER_GROUPS),
bb = String(b).split(NUMBER_GROUPS),
min = Math.min(aa.length, bb.length);
for (var i = 0; i < min; i++) {
var x = parseFloat(aa[i]) || aa[i].toLowerCase(),
y = parseFloat(bb[i]) || bb[i].toLowerCase();