Skip to content

Instantly share code, notes, and snippets.

View Changes729's full-sized avatar
🎨

步丶丶 Changes729

🎨
View GitHub Profile
#include <Arduino.h>
#include <SoftwareSerial.h>
SoftwareSerial soft_serial(10, 11);
void setup() {
soft_serial.begin(9600);
Serial.begin(9600);
while (!Serial) {
}
## mp3 to pcm
ffmpeg -y -i xxx.mp3 -acodec pcm_s16le -f s16le -ac 1 -ar 16000 output.pcm
## play pcm
ffplay -f s16le -ar 16k -ac 1 output.pcm
@Changes729
Changes729 / 入参指针操作.cpp
Last active February 3, 2021 01:10
wrong topic files
/** << CSAPP >> Cap.5.1 */
// 当要对入参指针进行操作时,还需要考虑入参指针相同的特殊情况:
void twiddle(long *xp, long *yp)
{
*xp += *yp;
*xp += *yp;
}
void twiddle2(long *xp, long *yp)
@Changes729
Changes729 / Search my gists.md
Created January 18, 2021 04:03 — forked from santisbon/Search my gists.md
How to search gists

Enter this in the search box along with your search terms:

Get all gists from the user santisbon.
user:santisbon

Find all gists with a .yml extension.
extension:yml

Find all gists with HTML files.
language:html

@Changes729
Changes729 / guide-to-x86_64.txt
Created January 12, 2021 02:10 — forked from jrelo/guide-to-x86_64.txt
x86_64 assembly guide
x86-64 (also known as just x64 and/or AMD64) is the 64-bit version of the x86/IA32 instruction set. Below is our overview of its features that are relevant to CS107. There is more extensive coverage on these topics in Chapter 3 of the B&O textbook. See also our x86-64 sheet for a compact one-page reference.
Registers
The table below lists the commonly used registers (sixteen general-purpose plus two special). Each register is 64 bits wide; the lower 32-, 16- and 8-bit portions are selectable by a pseudo-register name. Some registers are designated for a certain purpose, such as %rsp being used as the stack pointer or %rax for the return value from a function. Other registers are all-purpose, but have a conventional use depending on whether caller-saved or callee-saved. If the function binky calls winky, we refer to binky as the caller and winky as the callee. For example, the registers used for the first 6 arguments and return value are all caller-saved. The callee can freely use those registers, overwriting
@Changes729
Changes729 / djb2.hpp
Last active March 17, 2021 08:37
[ C++ ] Some utils in c++
/**
* @see http://www.cse.yorku.ca/~oz/hash.html.
* @see https://api.riot-os.org/group__sys__hashes__djb2.html.
*/
@Changes729
Changes729 / basic reference
Last active January 6, 2021 09:30
check memory usage process on linux.
# https://linuxhint.com/check_memory_usage_process_linux/
# https://stackoverflow.com/questions/18845857/what-does-anon-rss-and-total-vm-mean
-mfloat-abi=hard #soft, softfp, hard
@Changes729
Changes729 / center align.html
Last active January 10, 2021 13:42
Some HTML style practive.
<div
style="
display: flex;
justify-content: center;
align-items: center;
height: 100%;
width: 100%;
margin: auto;
text-align: center;
"
@Changes729
Changes729 / [ valgrind ] memory leak check.
Created November 27, 2020 01:51
[ valgrind ] valgrind usage
valgrind --leak-check=full $exe $ARGS