How to `git pull` while ignoring local changes?

If you mean you want the pull to overwrite local changes, doing the merge as if the working tree were clean, well, clean the working tree: If there are untracked local files you could use git clean to remove them. git clean -f to remove untracked files -df to remove untracked files and directories -xdf … Read more

Installing ADB on macOS [duplicate]

Note for zsh users: replace all references to ~/.bash_profile with ~/.zshrc. Option 1 – Using Homebrew This is the easiest way and will provide automatic updates. Install the homebrew package manager /bin/bash -c “$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)” Install adb brew install android-platform-tools Start using adb adb devices Option 2 – Manually (just the platform tools) This … Read more

Why I get “ERR_RESPONSE_HEADERS_TOO_BIG” on chrome?

The following code is executed correctly on firefox, but not on Chrome. The later always displays “ERR_RESPONSE_HEADERS_TOO_BIG”. This error occurs when I iterate through a folder containing more than 10000 items (files) – it must be long task. Please can anyone explain me how to avoid this error? The error disappears if I “echo”-ing something … Read more

Get dictionary key by value

Values do not necessarily have to be unique, so you have to do a lookup. You can do something like this: If values are unique and are inserted less frequently than read, then create an inverse dictionary where values are keys and keys are values.

Casting a pointer to an int

I am writing my own functions for malloc and free in C for an assignment. I need to take advantage of the C sbrk() wrapper function. From what I understand sbrk() increments the program’s data space by the number of bytes passed as an argument and points to the location of the program break. If … Read more