Skip to content

Instantly share code, notes, and snippets.

FWIW: I (@rondy) am not the creator of the content shared here, which is an excerpt from Edmond Lau's book. I simply copied and pasted it from another location and saved it as a personal note, before it gained popularity on news.ycombinator.com. Unfortunately, I cannot recall the exact origin of the original source, nor was I able to find the author's name, so I am can't provide the appropriate credits.


Effective Engineer - Notes

What's an Effective Engineer?

The issue:

..mobile browsers will wait approximately 300ms from the time that you tap the button to fire the click event. The reason for this is that the browser is waiting to see if you are actually performing a double tap.

(from a new defunct https://developers.google.com/mobile/articles/fast_buttons article)

touch-action CSS property can be used to disable this behaviour.

touch-action: manipulation The user agent may consider touches that begin on the element only for the purposes of scrolling and continuous zooming. Any additional behaviors supported by auto are out of scope for this specification.

@javierarques
javierarques / protractorAPICheatsheet.md
Last active January 31, 2023 08:51
Protractor API Cheatsheet
@sjmueller
sjmueller / BarcodeScanner.swift
Created June 22, 2015 01:10
Example of a custom react-native component, written in swift. Original author @euforic
// Barcode.swift
import UIKit;
import AVFoundation;
@objc(BarcodeScanner)
public class BarcodeScanner: UIView, AVCaptureMetadataOutputObjectsDelegate {
let session : AVCaptureSession = AVCaptureSession()
var previewLayer : AVCaptureVideoPreviewLayer!
@shadcn
shadcn / gist:de147c42d7b3063ef7bc
Last active September 17, 2022 11:50
Convert a Hex string to UIColor in Swift
// Creates a UIColor from a Hex string.
func colorWithHexString (hex:String) -> UIColor {
var cString:String = hex.stringByTrimmingCharactersInSet(NSCharacterSet.whitespaceAndNewlineCharacterSet()).uppercaseString
if (cString.hasPrefix("#")) {
cString = cString.substringFromIndex(1)
}
if (countElements(cString) != 6) {
return UIColor.grayColor()
# More Info here: http://unicorn.bogomips.org/Unicorn/OobGC.html
# require 'unicorn/oob_gc'
# GC every two requests that hit /expensive/foo or /more_expensive/foo
# in your app. By default, this will GC once every 5 requests
# for all endpoints in your app
# Example:
# use Unicorn::OobGC, 2, %r{\A/(?:admin/work_items/ast|admin/work_items/lp)}
# Use at least one worker per core if you're on a dedicated server,
# more will usually help for _short_ waits on databases/caches.
@piscisaureus
piscisaureus / pr.md
Created August 13, 2012 16:12
Checkout github pull requests locally

Locate the section for your github remote in the .git/config file. It looks like this:

[remote "origin"]
	fetch = +refs/heads/*:refs/remotes/origin/*
	url = git@github.com:joyent/node.git

Now add the line fetch = +refs/pull/*/head:refs/remotes/origin/pr/* to this section. Obviously, change the github url to match your project's URL. It ends up looking like this: