Skip to content

Instantly share code, notes, and snippets.

View number23's full-sized avatar
🎯
Focusing

number23 number23

🎯
Focusing
View GitHub Profile
@number23
number23 / fromScalaConsole.scala
Last active March 18, 2017 18:44 — forked from Centaur/fromScalaConsole.scala
get case class properties using reflection
import scala.reflect.runtime.{universe => ru}
import ru._
def getProperties[T: TypeTag]: Iterable[String] = {
val tpe = ru.typeTag[T].tpe
tpe.decls.collect {
case m: MethodSymbol if m.isCaseAccessor => m.name.toString
}
}
@number23
number23 / README.md
Last active June 28, 2016 04:21 — forked from chuangbo/README.md
Python dynamic DNSPod DNS Script

替换上你的login_token,域名ID,记录ID等参数,就可以运行了。 会在后台一直运行,每隔30秒检查一遍IP,如果修改了就更新IP。

获得domain_id可以用curl curl -k https://dnsapi.cn/Domain.List -d "login_token=xxxxx,xxxxxxxx&format=json" | python -m json.tool

获得record_id类似 curl -k https://dnsapi.cn/Record.List -d "login_token=xxxxx,xxxxxxxx&domain_id=xxx&format=json" | python -m json.tool