Skip to content

Instantly share code, notes, and snippets.

@idiomer
idiomer / termux_mxrig.md
Created April 30, 2021 03:50 — forked from 2niuhe/termux_mxrig.md
install XMRig on termux

Monero XMR mining via termux ;ubuntu

  1. install ubuntu in termux command; (ubuntu is optional)
pkg install update && upgrade
apt install git
apt install wget
apt install proot
@littlecodersh
littlecodersh / main.py
Last active June 26, 2024 11:41
Main script behind itchat robot
#coding=utf8
import itchat
# tuling plugin can be get here:
# https://github.com/littlecodersh/EasierLife/tree/master/Plugins/Tuling
from tuling import get_response
@itchat.msg_register('Text')
def text_reply(msg):
if u'作者' in msg['Text'] or u'主人' in msg['Text']:
return u'你可以在这里了解他:https://github.com/littlecodersh'
@olih
olih / jq-cheetsheet.md
Last active July 2, 2024 12:10
jq Cheet Sheet

Processing JSON using jq

jq is useful to slice, filter, map and transform structured json data.

Installing jq

On Mac OS

brew install jq

@karpathy
karpathy / min-char-rnn.py
Last active July 7, 2024 10:14
Minimal character-level language model with a Vanilla Recurrent Neural Network, in Python/numpy
"""
Minimal character-level Vanilla RNN model. Written by Andrej Karpathy (@karpathy)
BSD License
"""
import numpy as np
# data I/O
data = open('input.txt', 'r').read() # should be simple plain text file
chars = list(set(data))
data_size, vocab_size = len(data), len(chars)
@hfeeki
hfeeki / imgcompare.py
Last active September 8, 2022 01:11
利用opencv做图片相似度比较
# coding: utf8
'''
对于图片相似度比较有很多方法,我们这以RGB直方图为例。
我们以一种规则,使得每个图片生成一组描述的特征向量。
opencv的直方图比较函数我们可以巧妙的利用,其有若干比较规则,但只支持直方图的数据结构,我们可以将特征向量拟合成直方图的数据结构,然后使用其的相似度比较函数。
具体的数学计算方法有兴趣的可以看opencv的官方教程,这里我们期望生成百分比形式的相似度参数,所以使用CV_COMP_CORREL
以下是代码,以python编写
'''
import cv2.cv as cv
@hrldcpr
hrldcpr / tree.md
Last active June 8, 2024 18:11
one-line tree in python

One-line Tree in Python

Using Python's built-in defaultdict we can easily define a tree data structure:

def tree(): return defaultdict(tree)

That's it!