Skip to content

Instantly share code, notes, and snippets.

View duruyao's full-sized avatar
🏢
Coding in office

Ryan Du duruyao

🏢
Coding in office
View GitHub Profile
@duruyao
duruyao / cross-compile-ldd
Created June 3, 2021 09:27 — forked from jerome-pouiller/cross-compile-ldd
ldd drop-in replacement for cross-compilation toolchains.
#!/bin/bash
# ldd drop-in replacement for cross-compilation toolchains.
# This file is a slightly modified version of xldd.in from
# crosstool-ng 1.22.0
# In order to use it, copy it in same directory than other
# toolchain binaries and rename it with same tuple.
# (i.e. /opt/arm-sysmic-linux-gnueabihf/bin/arm-sysmic-linux-gnueabihf-ldd)
@duruyao
duruyao / insertion_sort.cpp
Last active October 7, 2021 03:15
Insert sorting algorithm implemented by C++ and Go.
/*
* @author duruyao
* @file insertion_sort.cpp
* @desc
* @date 2021-10-02
* @version 1.0
*/
#include <vector>
#include <iostream>
@duruyao
duruyao / quick_sort.cpp
Last active October 7, 2021 03:15
Quick sorting algorithm implemented by C++ and Go.
/*
* @author duruyao
* @file quick_sort.cpp
* @desc
* @date 2021-10-02
* @version 1.0
*/
#include <vector>
#include <iostream>
@duruyao
duruyao / heap_sort.cpp
Last active October 7, 2021 03:16
Heap sorting algorithm implemented by C++.
/*
* @author duruyao
* @file heap_sort.cpp
* @desc
* @date 2021-10-02
* @version 1.0
*/
#include <vector>
#include <iostream>
@duruyao
duruyao / merge_sort.cpp
Last active October 7, 2021 03:17
Merge sorting algorithm implemented by C++.
/*
* @author duruyao
* @file merge_sort.cpp
* @desc
* @date 2021-10-02
* @version 1.0
*/
#include <vector>
#include <iostream>
@duruyao
duruyao / top_k_by_BFPRT.cpp
Last active October 7, 2021 03:18
Selecting Top-K elements algorithm implemented by C++.
/*
* @author duruyao
* @file top_k_by_BFPRT.cpp
* @desc
* @date 2021-10-02
* @version 1.0
*/
#include <vector>
#include <iostream>
@duruyao
duruyao / binary_search.cpp
Created October 7, 2021 03:20
Binary search implemented by C++.
/*
* @author duruyao
* @file binary_search.cpp
* @desc
* @date 2021-10-07
* @version 1.0
*/
#include <vector>
#include <iostream>
@duruyao
duruyao / BST.cpp
Last active October 7, 2021 08:12
Binary search tree implemented by C++.
/*
* @author duruyao
* @file BST.cpp
* @desc
* @date 2021-10-07
* @version 1.0
*/
#include <vector>
#include <iostream>
@duruyao
duruyao / dk-attach
Last active February 23, 2022 02:28
The shortcut to run docker container.
#!/usr/bin/env bash
## date: 2021-12-06
## author: duruyao@gmail.com
## desc: the shortcut to attach docker container
##
## usage: dk-attach [CONTAINER]
##
@duruyao
duruyao / qwer.py
Last active July 11, 2022 07:51
Command line game for typing practice.
#!/usr/bin/env python3
# date: 2022-07-08
# author: duruyao@gmail.com
# desc: command line game for typing practice
import os
import sys
import time
import random
import string