Skip to content

Instantly share code, notes, and snippets.

View TonyPepeBear's full-sized avatar

TonyPepe TonyPepeBear

View GitHub Profile
@TonyPepeBear
TonyPepeBear / main.ipynb
Created May 13, 2023 14:36
教育部閩南語語言能力認證-各年齡層報名及通過人數
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@TonyPepeBear
TonyPepeBear / heic2jpg.py
Last active October 5, 2022 19:21
jpg -> heic. Require ImageMagick in PATH
import os
heics = list(filter(lambda f : f.endswith(".heic") or f.endswith(".HEIC"), os.listdir(".")))
l = len(heics)
for i in range(l):
heic = heics[i]
print(heic + " (" + str(i+1) + "/" + str(l) + ")")
os.system("magick convert " + heic + " " + "".join(heic.split(".")[0:-1]) + ".jpg")
os.remove(heic)
@TonyPepeBear
TonyPepeBear / Dockerfile
Last active May 17, 2022 09:43
ubuntu-ssh
ARG UBUNTU_VERSION=latest
FROM ubuntu:${UBUNTU_VERSION}
ENV DEBIAN_FRONTEND noninteractive
RUN apt update \
&& apt install -y openssh-server ssh sudo git vim \
&& useradd -rm -d /home/ubuntu -s /bin/bash -g root -G sudo -u 1000 ubuntu \
&& echo "ubuntu:ubuntu" | chpasswd \
#include <iostream>
#include <list>
using namespace std;
string convert(int n, int m) {
list<int> num;
while (n > 0) {
num.push_front(n % m);
n /= m;
@TonyPepeBear
TonyPepeBear / AndroidKotlin.xml
Created May 9, 2019 14:14
Android Kotlin Template
<templateSet group="AndroidKotlin">
<template name="logd" value="logd(&quot;$METHOD_NAME$: $content$&quot;)" description="Log.d(String)" toReformat="true" toShortenFQNames="true">
<variable name="METHOD_NAME" expression="kotlinFunctionName()" defaultValue="" alwaysStopAt="true" />
<variable name="content" expression="" defaultValue="" alwaysStopAt="true" />
<context>
<option name="KOTLIN_STATEMENT" value="true" />
</context>
</template>
<template name="todo" value="//TODO $todo$" description="" toReformat="false" toShortenFQNames="true">
<variable name="todo" expression="" defaultValue="" alwaysStopAt="true" />