Skip to content

Instantly share code, notes, and snippets.

View xiaozi's full-sized avatar
🎯
Focusing

小子欠扁 xiaozi

🎯
Focusing
View GitHub Profile
@stowball
stowball / example-input.html
Last active July 7, 2024 06:43
Fetch a remote SVG as an <img> and convert it to an inline SVG
<img
alt="accessible text"
class="fill-color-red"
height="16"
src="some.svg"
width="16"
onload="fetchSvgInline(this)"
/>
@Integ
Integ / unwxapkg.py
Last active July 10, 2024 15:27 — forked from feix/unwxapkg.py
A useful tool for unpack wxapkg file with python3 surport.
# coding: utf-8
# py2 origin author lrdcq
# usage python3 unwxapkg.py filename
__author__ = 'Integ: https://github.com./integ'
import sys, os
import struct
class WxapkgFile(object):
@deyindra
deyindra / ArrayIndexOf
Created January 19, 2017 21:08
KMP for Sub Array Search
private static <T> int[] computeTemporaryArray(T pattern[]){
int [] lps = new int[pattern.length];
int index =0;
for(int i=1; i < pattern.length;){
if(equals(pattern[i],pattern[index])){
lps[i] = index + 1;
index++;
i++;
}else{
if(index != 0){
@BobbyRyterski
BobbyRyterski / base62.sh
Last active January 18, 2023 07:36
BASH base 62 encode / decode
#!/usr/bin/env bash
# https://gist.github.com/BobbyRyterski/7a511b96ece47655b17d
# based on http://stackoverflow.com/q/14471692
readonly BASE62=($(echo {0..9} {a..z} {A..Z}))
base62_encode() {
local out=
for i in $(bc <<< "obase=62; $1"); do
@v5tech
v5tech / ffmpeg.md
Last active January 16, 2024 09:19
ffmpeg视频合并、格式转换、截图

使用ffmpeg合并MP4文件

ffmpeg -i "Apache Sqoop Tutorial Part 1.mp4" -c copy -bsf:v h264_mp4toannexb -f mpegts intermediate1.ts
ffmpeg -i "Apache Sqoop Tutorial Part 2.mp4" -c copy -bsf:v h264_mp4toannexb -f mpegts intermediate2.ts
ffmpeg -i "Apache Sqoop Tutorial Part 3.mp4" -c copy -bsf:v h264_mp4toannexb -f mpegts intermediate3.ts
ffmpeg -i "Apache Sqoop Tutorial Part 4.mp4" -c copy -bsf:v h264_mp4toannexb -f mpegts intermediate4.ts
ffmpeg -i "concat:intermediate1.ts|intermediate2.ts|intermediate3.ts|intermediate4.ts" -c copy -bsf:a aac_adtstoasc "Apache Sqoop Tutorial.mp4"
@yankchina
yankchina / bkpj_report1.html
Created May 9, 2014 10:47
Jinja中创建 rowspan 的样例
{% extends "base.html" %}
{% block title %}{{report.title}}{% endblock %}
{% block titledemo %}{{report.demo_string}}{% endblock %}
{% block content %}
<div class="table-responsive" id="report">
<table class='table table-striped'>
<thead>
{% for item in report.columes %}
<th>{{item}}</th>
{% endfor %}
@jdiaz5513
jdiaz5513 / ascii_arty.py
Last active December 30, 2023 02:32
Console ASCII Art Generator
#! /usr/bin/env python2
# Requires: PIL, colormath
#
# Improved algorithm now automatically crops the image and uses much
# better color matching
from PIL import Image, ImageChops
from colormath.color_conversions import convert_color
from colormath.color_objects import LabColor
from colormath.color_objects import sRGBColor as RGBColor
@hofmannsven
hofmannsven / README.md
Last active July 16, 2024 01:30
Git CLI Cheatsheet
@pirhoo
pirhoo / jquery.loading.css
Created September 8, 2012 16:17
A jQuery function to add a relative overlay on the current element
.js-loading-overlay {
position:absolute;
top:0; bottom:0;
left:0; right:0;
z-index:199;
background:#fff;
opacity:0.5;
@limitedmage
limitedmage / arduino.ino
Created March 30, 2012 02:23
Arduino Soundlight
int pin = 11;
int val;
void setup() {
Serial.begin(9600);
}
void loop() {
if (Serial.available() > 0) {
val = Serial.read();