Skip to content

Instantly share code, notes, and snippets.

@umayr
umayr / recover-deleted-branch.sh
Created April 1, 2016 11:41
How to recover a deleted branch
## Pre-requisite: You have to know your last commit message from your deleted branch.
git reflog
# Search for message in the list
# a901eda HEAD@{18}: commit: <last commit message>
# Now you have two options, either checkout revision or HEAD
git checkout a901eda
# Or
git checkout HEAD@{18}
@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

@paulirish
paulirish / what-forces-layout.md
Last active May 8, 2025 05:49
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
@loderunner
loderunner / 01-mac-profiling.md
Last active March 4, 2025 03:02
Profiling an application in Mac OS X

Profiling an application in Mac OS X

Finding which process to profile

If your system is running slowly, perhaps a process is using too much CPU time and won't let other processes run smoothly. To find out which processes are taking up a lot of CPU time, you can use Apple's Activity Monitor.

The CPU pane shows how processes are affecting CPU (processor) activity:

@fboudra
fboudra / github-issues-to-phabricator-tasks.py
Created May 31, 2015 07:51
Simple python script to import github issues (including comments) to phabricator tasks. It depends on pygithub, arc and requires some basic configuration.
#!/usr/bin/python
import collections
import json
import os
import signal
import sys
import subprocess
# require pygithub installed
from github import Github
<!doctype html>
<html>
<head>
<title></title>
<style>
body {
background: white;
text-align: center;
padding: 20px;
font-family: Georgia, serif;
@trevorparscal
trevorparscal / TransplantStyles.js
Last active August 29, 2015 14:14
Transplant the CSS styles from as parent document to a frame's document
/**
* Transplant the CSS styles from as parent document to a frame's document.
*
* This loops over the style sheets in the parent document, and copies their nodes to the
* frame's document. It then polls the document to see when all styles have loaded, and once they
* have, resolves the promise.
*
* If the styles still haven't loaded after a long time (5 seconds by default), we give up waiting
* and resolve the promise anyway. This protects against cases like a display: none; iframe in
* Firefox, where the styles won't load until the iframe becomes visible.
import json
import collections
records = [json.loads(line) for line in open('deprecated-js.json')]
def iter_modules():
for record in records:
for module in record.get('modules', ()):
yield module
@rxaviers
rxaviers / gist:7360908
Last active May 8, 2025 03:01
Complete list of github markdown emoji markup

People

:bowtie: :bowtie: πŸ˜„ :smile: πŸ˜† :laughing:
😊 :blush: πŸ˜ƒ :smiley: ☺️ :relaxed:
😏 :smirk: 😍 :heart_eyes: 😘 :kissing_heart:
😚 :kissing_closed_eyes: 😳 :flushed: 😌 :relieved:
πŸ˜† :satisfied: 😁 :grin: πŸ˜‰ :wink:
😜 :stuck_out_tongue_winking_eye: 😝 :stuck_out_tongue_closed_eyes: πŸ˜€ :grinning:
πŸ˜— :kissing: πŸ˜™ :kissing_smiling_eyes: πŸ˜› :stuck_out_tongue: