The best way to do this would be to use a transistor as a comparator to make the transition sharp.
Here is an example circuit:
It uses the LDR as the upper part of a voltage divider. When the LDR resistance drops the voltage at the transistor base rises and turns it on. The transistor can be any general purpose NPN.
We can calculate the resistor value based on whereabouts we want the turn on to happen.
Let's say the LDR resistances goes from 200Ω (dark) to 10kΩ (dark). We want the transistor to turn on when the LDR is at 5kΩ. The supply (V+) is at 3.3V.
A typical NPN transistor turns on at around 0.7V, so if we do:
5,000 * (0.7 / 3.3) = 1060Ω needed for the base resistor. We can pick a 1kΩ resistor since it's near enough. Adjust your values to suit your turn on point.
Here is a simulation of the circuit:
The horizontal axis is the LDR resistance, and the blue line is the voltage at the Vout point (You connect this to the Rpi input pin - must be set to input. You can add a 1kΩ resistor between Vout and the Rpi pin to protect it in case of accidentally setting it to output)
We can see the transistor turns on at around 5kΩ as predicted (won't be exact as the transistor base-emitter voltage will vary with temperature, etc but near enough for your purposes)
Note that the transistor output is low when it's light and high when it's dark, you can swap the LDR and resistor around and use 5,000 * (3.3 / 0.7) = 23.5kΩ for the resistor if you want it the other way round - this is actually a better configuration as it draws less current (due to higher resistances) so if that's important use this version.
A GPIO pin, when in INPUT mode, can be thought of as a very very large resistor connected to ground. The GPIO pin is interested in the voltage that is across this resistor. Take the following circuit for example:
simulate this circuit – Schematic created using CircuitLab
A logic HIGH is seen by the Arduino when the voltage at the node labelled GPIO is at, or near, \$V_{CC}\$ (in this case 5V). A LOW is seen when the voltage at GPIO is at or near \$0V\$.
With the switch SW1 open, there are just the two resistors in play - the pull-up, and the internal GPIO port's resistor. So, using simple maths, we can calculate the voltage that would be at GPIO.
First we calculate the ratio of the two resistors, using \$\frac{R2}{R1 + R2}\$, and then multiply it by the voltage, which is \$5V\$. So we have the sum:
$$
\frac{10,000,000}{10,000 + 10,000,000}×5
$$
We can of course simplify that by doing the addition, then cancelling out trailing zeros above and below the line:
$$
\frac{10,000,000}{10,010,000}×5
$$
$$
\frac{1,000}{1,001}×5
$$
And so the answer comes out as \$4.995V\$ - pretty much the full \$5V\$. So the Arduino see that as being HIGH, since it is above its "input logic high threshold", also known as \$V_{IH}\$ in datasheets.
So now what happens when we press the button? Well, basically we create a short circuit across the internal GPIO resistor. So now we can completely ignore that resistor, since we have essentially put a wire across it to short circuit it.
So now our sum gets changed slightly, since \$R2\$ is now \$0\Omega\$ (the resistance of the wire shorting out \$R2\$).
$$
\frac{0}{0 + 10,000}×5 = 0V
$$
And of course, \$0V\$ is below the "input logic low threshold", or \$V_{IL}\$.
Another way of looking at it is that the GPIO, when the button is pressed, is directly connected to ground. No amount of tweaking of the resistor \$R1\$ will ever change the fact that the voltage at ground is \$0V\$. The only way you can change that is by short circuiting \$R1\$ so that becomes \$0\Omega\$ as well, and then you have basically short circuited your battery, and all your wires have now melted.
For reference, here is part of Table 28.2 from the ATMega328P data sheet detailing the input voltage thresholds:
We can see there the \$V_{IL}\$ and \$V_{IH}\$ voltages for the \$2.4V - 5.5V\$ \$V_{CC}\$ range listed as \$0.3V_{CC}\$ and \$0.6V_{CC}\$ respectively. Now, this doesn't refer to \$0.3V\$ and \$0.6V\$, but to \$0.3×V_{CC}\$ and \$0.6×V_{CC}\$.
If \$V_{CC}\$ is \$5V\$, then \$V_{IL}\$ is \$0.3 × 5 = 1.5V\$, and \$V_{IH}\$ is \$0.6 × 5 = 3V\$.
So any voltage seen on the GPIO pin that is below \$1.5V\$ is registered as a logic LOW, and any voltage see that is above \$3V\$ is registered as a logic HIGH.
Best Answer
The 22MOhm resistor is a pull-up so the GPIO isn't floating. The magnitude of the resistance is significant in this instance as you wish to use the human body to ground the GPIO pin and the human body has a resistance of 5MOhm (according to the video you linked @ 3:50). If you use a 100kOhm resistor the voltage at the pin is 3.23V ( R2/(R1+R2)*V = 5M/(100k+5M)*3.3 ) and the microcontroller can't see any change.