Skip to content

Instantly share code, notes, and snippets.

Avatar

Sound Sun codeskyblue

View GitHub Profile
@codeskyblue
codeskyblue / html2image.js
Created Feb 19, 2019
Convert html file into image using Google puppeteer
View html2image.js
const puppeteer = require('puppeteer');
const resolve = require("path").resolve;
// node html2image.js -i input.html -o output.png
(async () => {
var program = require("commander");
program
.version("0.1.0")
.option("-i, --input <path>", "input html")
@codeskyblue
codeskyblue / http-proxy.go
Created Jan 18, 2019
HTTP Proxy implement in go
View http-proxy.go
package main
import (
"encoding/base64"
"flag"
"fmt"
"io"
"net"
"net/http"
"strings"
@codeskyblue
codeskyblue / notch_screenshot.py
Created Sep 10, 2018
uiautomator2刘海屏截图代码
View notch_screenshot.py
# coding: utf-8
#
from PIL import Image, ImageDraw
class Notch(object):
def __init__(self, d):
self.d = d
self.brand = self.d.device_info['brand']
self.model = self.d.device_info['model']
@codeskyblue
codeskyblue / OUTPUT.txt
Created Dec 27, 2017
study of levenshtein_distance
View OUTPUT.txt
[[0 1 2 3 4 5 6]
[1 2 3 4 5 6 7]
[2 3 2 4 6 7 8]
[3 4 3 2 4 6 8]
[4 5 4 3 2 4 6]
[5 6 5 4 3 5 7]
[6 7 6 5 4 6 5]
[7 8 7 6 5 7 6]]
[[1 1 1 1 1 1 1]
[0 0 0 0 0 0 0]
@codeskyblue
codeskyblue / websocket-relay.go
Last active Jul 5, 2017
Convert https://github.com/phoboslab/jsmpeg websocket-relay.js to Go language
View websocket-relay.go
package main
import (
"log"
"net/http"
"sync"
"github.com/gorilla/websocket"
)
@codeskyblue
codeskyblue / README.md
Last active Jul 21, 2016
run command and kill by env
View README.md

Install

pip install psutil

Usage

./safe_run.py bash long_script.sh
View MainActivityTester.java
package com.example.hzsunshx.helloworld;
import android.content.Context;
import android.content.Intent;
import android.support.test.InstrumentationRegistry;
import android.support.test.uiautomator.By;
import android.support.test.uiautomator.UiDevice;
import android.support.test.uiautomator.UiObject;
import android.support.test.uiautomator.UiObject2;
import android.support.test.uiautomator.Until;
@codeskyblue
codeskyblue / which.py
Created Jul 28, 2015
Find python lib path
View which.py
#! /usr/bin/env python
# -*- coding: utf-8 -*-
#
# Author: hzsunshx
# Created: 2015-06-01 15:56
"""
find python lib path
"""
@codeskyblue
codeskyblue / save_button.html
Created Jun 18, 2015
Button: Edit --> Saving --> Saved
View save_button.html
<!DOCTYPE html>
<html>
<head>
<script src="bower_components/angularjs/angular.min.js"></script>
<style>
.button {
margin: 0;
padding: 5px 10px;
min-width: 54px;
font-size: 13px;
You can’t perform that action at this time.