Skip to content

Instantly share code, notes, and snippets.

View tkersey's full-sized avatar
👹

Tim Kersey tkersey

👹
View GitHub Profile
Remove file from git repository (history)
SOLUTION: This is the shortest way to get rid of the files:
1. check .git/packed-refs - my problem was that I had there a refs/remotes/origin/master line for a remote repository, delete it, otherwise git won't remove those files
2. (optional) git verify-pack -v .git/objects/pack/#{pack-name}.idx | sort -k 3 -n | tail -5 - to check for the largest files
3. (optional) git rev-list --objects --all | grep #{SHA_FROM_#_3} - to check what files those are
@tkersey
tkersey / Undo a commit and redo
Created October 8, 2010 22:36
Git: undo a commit and redo
http://stackoverflow.com/questions/927358/git-undo-last-commit
Undo a commit and redo
$ git commit ...
$ git reset --soft HEAD^ (1)
$ edit (2)
$ git commit -a -c ORIG_HEAD (3)
This is most often done when you remembered what you just committed is incomplete, or you misspelled your commit message, or both. Leaves working tree as it was before "reset".
@tkersey
tkersey / |ψ> = α|0> β|1>
Created February 26, 2011 00:23
|ψ> = α|0> β|1>
|ψ> = α|0> β|1>
@tkersey
tkersey / gist:1130675
Created August 7, 2011 19:16
Getting a Motorola SBG6580 into “Bridge” mode

found at: http://fascinated.fm/post/2379188731/getting-a-motorola-sbg6580-into-bridge-mode-on

Getting a Motorola SBG6580 into “Bridge” mode on TimeWarner Wideband

  1. Unplug coax cable from Motorola
  2. Hold down the white reset button on the back panel with a pen for 30s.  This resets all settings to factory defaults. The modem will be auto-reconfigured once you plug in the coax cable.
  3. When modem is back on plug in a computer with an Ethernet cable into the modem.
  4. Connect to http://192.168.0.1 and login with “admin” / “motorola”
  5. Now you will make some changes:
 
  • Wireless -> Primary Network -> Disabled

Keybase proof

I hereby claim:

  • I am tkersey on github.
  • I am twk (https://keybase.io/twk) on keybase.
  • I have a public key whose fingerprint is 53D0 44AE 9245 5BF9 ACB4 7ACF ACBE D759 C16F 62B7

To claim this, I am signing this object:

Verifying myself: My Bitcoin username is +tk. https://onename.io/tk
"fundamental constants of human-computer interaction", which can be split into the human and computer halves.
Very roughly:
~16 ms – frame budget for interactive animation
100 ms – user action feels instantaneous
200 ms – typical human reaction time
500+ ms – perceptible delay
3+ seconds – perceived sluggishness
10+ seconds – attention span is broken
@tkersey
tkersey / UIView.swift
Created November 16, 2015 01:12
Calculate preferred height of UIView
extension UIView {
func calculatePreferredHeight(preferredWidth: CGFloat? = nil) -> CGFloat {
let width = preferredWidth ?? frame.width
let widthConstraint = NSLayoutConstraint.constraintsWithVisualFormat("H:[view(==\(width)@999)]", options: .allZeros, metrics: nil, views: ["view": self])
addConstraints(contraint)
let height = systemLayoutSizeFittingSize(UILayoutFittingCompressedSize).height
removeConstraints(constraint)
return height
}
}
@tkersey
tkersey / links.md
Last active April 25, 2024 15:03
For future reference but maybe not.
Verifying my Blockstack ID is secured with the address 1Pgb6MVcG9qhJ6Tnu86FPs5MtY1znYC3wP https://explorer.blockstack.org/address/1Pgb6MVcG9qhJ6Tnu86FPs5MtY1znYC3wP