Skip to content

Instantly share code, notes, and snippets.

@ohmerhe
ohmerhe / scala-to-kotlin.kts
Last active August 17, 2022 05:48 — forked from oshai/scala-to-kotlin.kts
Stupid and simple convert a Scala file (already renamed to .kt extension) to Kotlin
#!/usr/bin/env kscript
import java.io.File
// usage - one argument a .kt file (Scala file that was only renamed)
// or a directory
try {
main(args)
} catch (e: Exception) {
e.printStackTrace()
@ohmerhe
ohmerhe / dimens.xml
Created April 3, 2020 03:45 — forked from MarkMjw/dimens.xml
Android default resource dimens.xml.
<?xml version="1.0" encoding="utf-8"?>
<!--
/* //device/apps/common/assets/res/any/dimens.xml
**
** Copyright 2006, The Android Open Source Project
**
** Licensed under the Apache License, Version 2.0 (the "License");
** you may not use this file except in compliance with the License.
** You may obtain a copy of the License at
**
@ohmerhe
ohmerhe / proxy_for_terminal.md
Created March 24, 2020 15:54 — forked from fearblackcat/proxy_for_terminal.md
Set proxy for terminal on mac

Shadowsocks Proxy

apt-get install python-pip
pip install shadowsocks

sudo ssserver -p 443 -k password -m aes-256-cfb --user nobody -d start
@ohmerhe
ohmerhe / pylist-to-markdown.py
Created July 25, 2019 09:07 — forked from m0neysha/pylist-to-markdown.py
Python lists to markdown table
def make_markdown_table(array):
""" Input: Python list with rows of table as lists
First element as header.
Output: String to put into a .md file
Ex Input:
[["Name", "Age", "Height"],
["Jake", 20, 5'10],
["Mary", 21, 5'7]]
@ohmerhe
ohmerhe / rm-none-docker
Created November 6, 2018 06:59 — forked from fojuth/rm-none-docker
Remove <none> Docker images
docker rmi $(docker images | grep "^<none>" | awk "{print $3}")
#proxy
alias openTProxy="export http_proxy='http://127.0.0.1:8123/' \
export https_proxy='http://127.0.0.1:8123/' \
export ftp_proxy='http://127.0.0.1:8123/' \
export no_proxy='localhost,127.0.0.1,localaddress,.localdomain.com' \
export HTTP_PROXY='http://127.0.0.1:8123/' \
export HTTPS_PROXY='http://127.0.0.1:8123/' \
export FTP_PROXY='http://127.0.0.1:8123/' \
export NO_PROXY='localhost,127.0.0.1,localaddress,.localdomain.com' \
polipo socksParentProxy=127.0.0.1:1080"
@ohmerhe
ohmerhe / RPi-aria2-with-webui.sh
Created November 26, 2017 12:08 — forked from akaxxi/RPi-aria2-with-webui.sh
Install Aria2 and webui on Raspberry Pi with one simple script.
#!/bin/sh
DOWNLOAD_DIR="${HOME}/MiniDLNA"
CONFIG_DIR="${HOME}/.aria2"
RPC_TOKEN="changeIt"
RPC_PORT="6800"
change_apt_source(){
if [ -f /etc/apt/sources.list ]; then
sudo cp /etc/apt/sources.list /etc/apt/sources.list.bak
@ohmerhe
ohmerhe / mysql_db_sync
Created June 11, 2016 02:58 — forked from vasiliishvakin/mysql_db_sync
Simple bash script to sync remote mysql db to local
#!/bin/bash
LOCAL_DB=""
REMOTE_DB=""
LOCAL_USER="root"
LOCAL_PASS=""
REMOTE_USER="root"
REMOTE_PASS=''
@ohmerhe
ohmerhe / removeLintUnusedRes.py
Created December 14, 2015 10:32
解析AS的UnusedRes分析并删除对应图片资源
import os
import os.path
import xml.etree.ElementTree as ET
tree = ET.parse('AndroidLintUnusedResources.xml')
root = tree.getroot()
def deleteFile():
today = datetime.datetime.today()
return xmlrpclib.DateTime(today)