Let $X$ be a Riemann surface, and $D$ a divisor (we define a divisor to be a map $D:X \to \mathbb Z$ with closed and discrete support). Define the sheaf of $\mathcal O_X$-modules $\mathcal O_X(D)$ with sections
$$\mathcal O_X(D)(U)=\lbrace f:U\to\mathbb S : \forall x\in U,v_x(f)\geq -D(x)\rbrace.$$
If $D\geq 0$, then $\mathcal O_X(-D)$ is a sheaf of ideals of $\mathcal O_X$. We denote $\mathcal O_{D,x}$ the quotient sheaf. I am interested in the stalks of this sheaf.
I have proved that if $D(x)=0$, then $\mathcal O_X(-D)_x=\mathcal O_{X,x}$, so in this case, $\mathcal O_{D,x}=0$. If $D(x)\neq 0$, then $\mathcal O_X(-D)_x=\mathfrak m_{X,x}^{D(x)}$. Now the thing I don't understand is that, in this case, $\mathcal O_{D,x}$ is a $\mathbb C$-vector space of dimension $D(x)$, with $1,z,\dots,z^{D(x)-1}$ as a basis. Why is that?
My first and obvious try is to study the quotient itself. Using the exact sequence $$0\to\mathcal O_X(-D)\to\mathcal O_X\to\mathcal O_D\to 0$$ I have shown that $\left(\mathcal O_X\big/\mathcal O_X(-D)\right)_x$ is isomorphic to the quotient of the stalks, so now I can study the quotient $\mathcal O_{X,x}\big/\mathfrak m_{X,x}^{D(x)}$. And now I am lost. I've tried the brute force proof taking a linear combination etcetera and using a uniformizer at $x$ to maybe show that set is linearly independent but... I cannot proceed.
Edit: I am adding my try on showing that directly:
First, every element $f\in\mathcal O_{X,x}$ can be written like $f=uz^n$ with $z$ a uniformiser at $x$ and $u$ a unit. In the quotient, $n\leq D(x)-1$, and that is nice but, since I am trying to prove that the quotient is a vector space over $\mathbb C$, an element should be of the form $\sum \lambda_i z^i$ with $\lambda_i\in\mathbb C$. What do I do with the unit? This is my first problem.
In order to show that $1,z,\dots,z^{D(x)-1}$ is linearly independent, let us consider the following linear combination: $$\lambda_0+\lambda_1z+\dots+\lambda_{D-1}z^{D(x)-1}=0$$ And we have to show that all $\lambda_i=0$. Evaluating at $x$ we have $\lambda_0=0$, then writing $$\lambda_1+z(\lambda_2z+\dots+\lambda_{D-1}z^{D(x)-2})=0$$ we have $\lambda_1=0$... doing this inductively gives us linear independence! The only thing is left is proving that the set generates.
I think your proof of linear independence is correct, and proving that this set spans can be done along the same lines.
Let $f \in \mathcal{O}_{X,x}$. Then, the translate $f - f(x)$ vanishes at $x$ so it is in $\mathfrak{m}_{X, x}$, which is a principal ideal generated by $z$. (Here we consider $f(x)$ as a constant function.) Hence, taking $\lambda_0 = f(x) \in \mathbb{C}$ we may write $f = \lambda_0 + zg$ where $g \in \mathcal{O}_{X,x}$ and $\lambda_0 \in \mathbb{C}$.
We can then apply this to $g$ to get $$f = \lambda_0 + \lambda_1z + hz^2$$ for some $\lambda_1 \in \mathbb{C}$ and $h \in \mathcal{O}_{X,x}$. Repeating this enough times we eventually arrive at a decomposition $$f = \lambda_0 + \lambda_1z + \lambda_2z^2 + \cdots + \lambda_{r}z^r + sz^{D(x)}$$ where $\lambda_i \in \mathbb{C}$ and $s \in \mathcal{O}_{X, x}$. Since $f$ was arbitrary to begin with, $[1], ..., [z^{D(x) - 1}]$ are spanning in $\mathcal{O}_{X, x}/\mathfrak{m}_{X, x}^{D(x)}$.