Skip to content

Instantly share code, notes, and snippets.

View Dragod's full-sized avatar
🎲
Ma le spegnene?

Fabio Dragod

🎲
Ma le spegnene?
View GitHub Profile
@paulirish
paulirish / what-forces-layout.md
Last active April 25, 2024 18:58
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
@jasonrudolph
jasonrudolph / git-branches-by-commit-date.sh
Created February 12, 2012 20:40
List remote Git branches and the last commit date for each branch. Sort by most recent commit date.
# Credit http://stackoverflow.com/a/2514279
for branch in `git branch -r | grep -v HEAD`;do echo -e `git show --format="%ci %cr" $branch | head -n 1` \\t$branch; done | sort -r
@lmcneel
lmcneel / remove-node-modules.md
Last active April 21, 2024 19:39
How to remove node_modules after they have been added to a repo

How to remove node_modules

Create a .gitignore file

  1. Check for an existing .gitignore file in the project directory
ls -a
@steven2358
steven2358 / ffmpeg.md
Last active April 21, 2024 02:08
FFmpeg cheat sheet
@dcode
dcode / GitHub Flavored Asciidoc (GFA).adoc
Last active April 20, 2024 13:55
Demo of some useful tips for using Asciidoc on GitHub

GitHub Flavored Asciidoc (GFA)

@codebytes
codebytes / DevMachineSetup.ps1
Last active April 8, 2024 17:25
DevMachineSetup
#Install WinGet
#Based on this gist: https://gist.github.com/crutkas/6c2096eae387e544bd05cde246f23901
$hasPackageManager = Get-AppPackage -name 'Microsoft.DesktopAppInstaller'
if (!$hasPackageManager -or [version]$hasPackageManager.Version -lt [version]"1.10.0.0") {
"Installing winget Dependencies"
Add-AppxPackage -Path 'https://aka.ms/Microsoft.VCLibs.x64.14.00.Desktop.appx'
$releases_url = 'https://api.github.com/repos/microsoft/winget-cli/releases/latest'
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
function Measure-ChildItem {
<#
.SYNOPSIS
Recursively measures the size of a directory.
.DESCRIPTION
Recursively measures the size of a directory.
Measure-ChildItem uses win32 functions, returning a minimal amount of information to gain speed. Once started, the operation cannot be interrupted by using Control and C. The more items present in a directory structure the longer this command will take.
This command supports paths longer than 260 characters.
@windyinsc
windyinsc / vlc_ts_error_fix.md
Created March 19, 2017 00:12
Fix for VLC: ts error: libdvbpsi error (PSI decoder): TS duplicate

FIX FOR VLC ERROR BELOW

The following changes to VLC were successful in fixing all playback issues.

  • VLC Version 2.2.4 Weatherwax (Intel 64bit) on OS X 10.9

ISSUE:

ts error: libdvbpsi error (PSI decoder): TS duplicate (received 0, expected 1) for PID 0 ts error: libdvbpsi error (PSI decoder): TS duplicate (received 0, expected 1) for PID 4095

@yazinsai
yazinsai / Android-Emulator-on-AWS-EC2.md
Last active March 29, 2024 07:45 — forked from atyachin/Android-Emulator-on-AWS-EC2.txt
Installing and running Android Emulator on Amazon AWS EC2 (Ubuntu 16.04 / m5.xlarge)

Getting the Android Emulator running on EC2 📱

# @ your EC2 instance
sudo apt update
sudo apt install openjdk-8-jre unzip
wget https://dl.google.com/android/repository/sdk-tools-linux-4333796.zip
unzip sdk-tools-linux-4333796.zip -d android-sdk
sudo mv android-sdk /opt/
export ANDROID_SDK_ROOT=/opt/android-sdk
@adamwdraper
adamwdraper / Node.js File Looper
Created December 5, 2012 04:46
Loop through all files in a given directory with node.js
var fs = require('fs');
var walkPath = './';
var walk = function (dir, done) {
fs.readdir(dir, function (error, list) {
if (error) {
return done(error);
}