Skip to content

Instantly share code, notes, and snippets.

@amolk
amolk / remove-rubber-band-web-apps-ios
Last active May 8, 2024 17:47
Remove rubberband scrolling from web apps on mobile safari (iOS)
<!DOCTYPE html>
<html>
<head>
<title>Remove rubberband scrolling from web apps on mobile safari (iOS)</title>
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-touch-fullscreen" content="yes">
<meta id="extViewportMeta" name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, user-scalable=no">
<script type="text/javascript" src="http://code.jquery.com/jquery-1.6.4.min.js"></script>
<style>
html, body {margin: 0; padding: 0; overflow: hidden}
@boTux
boTux / ubuntu-touch_owncloud-sync_contact-calendar.sh
Last active June 7, 2019 10:17
[Ubuntu-Phone] Owncloud Contact & Calendar Sync - Carddav & Caldav via syncevolution.
#!/bin/bash
# ---------------------------------------------------------------------------
# Ubuntu Phone - Sync Owncloud Contacts & Calendar Account
# Carddav & Caldav.
# Tested on : Ubuntu-touch vivid - ubuntu-touch/rc-proposed/bq-aquaris.en/vegetahd/
# Last edit : 2015/10/07.
# Author : Romain Fluttaz, boTux.fr, <[email protected]>
# ============= [ Configuration ] ============= #
@paulirish
paulirish / what-forces-layout.md
Last active November 14, 2024 11:03
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
@roadrunner2
roadrunner2 / 0 Linux-On-MBP-Late-2016.md
Last active October 1, 2024 02:06
Linux on MacBook Pro Late 2016 and Mid 2017 (with Touchbar)

Introduction

This is about documenting getting Linux running on the late 2016 and mid 2017 MPB's; the focus is mostly on the MacBookPro13,3 and MacBookPro14,3 (15inch models), but I try to make it relevant and provide information for MacBookPro13,1, MacBookPro13,2, MacBookPro14,1, and MacBookPro14,2 (13inch models) too. I'm currently using Fedora 27, but most the things should be valid for other recent distros even if the details differ. The kernel version is 4.14.x (after latest update).

The state of linux on the MBP (with particular focus on MacBookPro13,2) is also being tracked on https://github.com/Dunedan/mbp-2016-linux . And for Ubuntu users there are a couple tutorials (here and here) focused on that distro and the MacBook.

Note: For those who have followed these instructions ealier, and in particular for those who have had problems with the custom DSDT, modifying the DSDT is not necessary anymore - se

@dannote
dannote / final-cut-pro-trial-reset.swift
Last active November 15, 2024 15:21
Final Cut Pro X trial reset
#!/usr/bin/swift
import Foundation
let path = URL(fileURLWithPath: NSString(string: "~/Library/Application Support/.ffuserdata").expandingTildeInPath)
let data = try! NSData(contentsOf: path) as Data
let dictionary = try! NSKeyedUnarchiver.unarchiveTopLevelObjectWithData(data) as! NSDictionary
let mutableDictionary = dictionary.mutableCopy() as! NSMutableDictionary
for (key, value) in mutableDictionary {
@JeremyRH
JeremyRH / event-delegation-performance.md
Last active October 22, 2024 19:42
Does event delegation actually improve performance?

Does event delegation actually improve performance?

Event delegation works by attaching a single event listener to a parent element to catch events bubbling up from the children. Many people believe this is more performant than attaching event listeners to each child. I am not convinced this is always true.

Let's start with a common example of event delegation. Here we have a list of elements:

<ul id="item-list">
  <li data-cost="12">Item 1</li>
  <li data-cost="18">Item 2</li>
  <li data-cost="6">Item 3</li>
 ...
@mollymerp
mollymerp / sshfs-gcp-instance-osx.md
Last active January 10, 2024 14:52
How to mount a GCP compute instance filesystem locally using `sshfs` on MacOS

How to mount a GCP compute instance filesystem locally using sshfs

This guide assumes that:

  • you already have an instance set up on GCP that you want to mount locally
  • the GCP CLI (gcloud) is installed on your local machine
  • you have authenticated locally to your google account gcloud auth login
  1. make sure your gcloud config is correct for the instance you're trying to access:
@joevt
joevt / EDIDUtil.sh
Last active July 23, 2024 03:03
A set of shell functions used to view and edit EDIDs.
#!/bin/bash
#!/bin/zsh
# by joevt May 24/2023
#=========================================================================================
edid_decode=edid-decode
#=========================================================================================
# Modify EDID
@ifilipis
ifilipis / Tweak.x
Created February 18, 2020 18:13
iPhone XS night mode
/*
-------------------------------------------------
Here's the progress to date:
- Night mode UI is showing night mode controls
- Night mode triggers in low light automatically
- Core functionality of AVFoundation and Celestial does recognize Night mode
- All the logic is already implemented for XS and 11 (they even share the same ipsw for 13.3)
- iPhone X support could be significantly harder to get, plus I don't have it to test anyways
Here's what's not working:
@BourgonLaurent
BourgonLaurent / APPro_LMC_change.applescript
Last active August 7, 2022 03:58
AirPods Pro Listening Mode Changer. Copy-Paste the contents of the file "AirPods Pro Listening Mode Changer.json" inside BTT. The two other files are the scripts used by the widget. The last file (APPro_LMC_diag.applescript) retrieves the necessary information to add a new device, or debug a current one.
-- Change the listening mode of AirPods Pro, Laurent Bourgon 2020
-- Works in the background using private APIs, thanks to @smithumble
-- Frameworks to connect with Bluetooth
use framework "IOBluetooth"
use scripting additions
-- Get AirPods Name
tell application "BetterTouchTool" to set AIRPODS_PRO_NAME to get_string_variable "AirPodsWg_DevceName"