Skip to content

Instantly share code, notes, and snippets.

@zzh1996
zzh1996 / solve_mod_mathematica.sage
Last active May 12, 2021 09:03
solve_mod_mathematica
from wolframclient.evaluation import WolframLanguageSession
from wolframclient.language import wl
def solve_mma(eqn, modulus):
if eqn.number_of_arguments() != 1:
raise NotImplementedError('Not univariate')
if eqn.is_polynomial(eqn.args()[0]):
poly = eqn
elif eqn.is_relational() and eqn.operator() is operator.eq:
poly = eqn.lhs() - eqn.rhs()
@zzh1996
zzh1996 / macos_sudo_touchid.sh
Created July 5, 2020 07:59
Enable sudo with Touch ID on macOS
#!/bin/bash
set -e
set -x
set -u
set -o pipefail
f="/etc/pam.d/sudo"
/bin/cat "$f" | /usr/bin/grep pam_tid && exit
@zzh1996
zzh1996 / keybase.md
Created March 2, 2020 14:52
keybase.md

Keybase proof

I hereby claim:

  • I am zzh1996 on github.
  • I am zzh1996 (https://keybase.io/zzh1996) on keybase.
  • I have a public key ASDjOE12tVg-4mEM4Mpj4_MVZEUqwQsV9XQPS4hztZ34Two

To claim this, I am signing this object: