Skip to content

Instantly share code, notes, and snippets.

View chenyukang's full-sized avatar
💭
I may be slow to respond.

Yukang chenyukang

💭
I may be slow to respond.
View GitHub Profile
@chenyukang
chenyukang / justfile
Last active March 12, 2024 05:20
rustc-justfile
alias ba := build-all
alias b := build
alias ts := test-one
alias l := log
alias d := dev
alias d21 := dev21
build-all:
x b
@chenyukang
chenyukang / backup.md
Last active June 14, 2023 14:14
Backup website with mirror

use wget to download website

wget --reject-regex "(.*)\?(.*)" --mirror --no-parent --convert-links -p -U Mozilla https://program-think.blogspot.com/

replace abs path to relative path

find . -type f -name '*.html' -exec sed -i '' 's|https://program-think.blogspot.com/|/|g' {} +
@chenyukang
chenyukang / gist:0f67b9ef0a8c32aa8f95
Last active July 16, 2022 16:00
网络安装Ubuntu 14.04 server
@chenyukang
chenyukang / gist:8265615
Last active October 8, 2019 11:01
DFA construction for a simple regular expression match question.
#include <iostream>
#include <string>
#include <vector>
#include <set>
#include <stdio.h>
#include <assert.h>
using namespace std;
enum OpType {
package main
import (
"flag"
"fmt"
"go/ast"
"go/parser"
"go/token"
"io/ioutil"
"os"
@chenyukang
chenyukang / gist:5364515
Created April 11, 2013 15:46
xor link list
//http://en.wikipedia.org/wiki/XOR_linked_list
//use one pointer to construct double-link list
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <assert.h>
struct item{
void* nextprev;
# Class Tree
# ruby prog.rb > class.dot;dot -Tpng class.dot -o class.png;
def readable(str)
if str.length >= 30
return false
end
for k in 0..str.length-1
s = str[k]
if not ((s>='a' and s<='z') or (s>='A' and s<='Z') or (s >='0' and s<='9'))
@chenyukang
chenyukang / mysql dump
Created November 1, 2015 04:12
mysql dump
mysqldump --opt -h192.168.0.156 -uusername -ppassword --skip-lock-tables databasename > database.sql
@chenyukang
chenyukang / gist:3900077
Created October 16, 2012 15:46
Peng's delegate
/*******************************************************************************
*
* @name : DELEGATE_H
*
* @author : BigBird (peng@nextopsoftware.com)
* @date : 2012-10-16 21:58:04
*
* @brief :
*
@chenyukang
chenyukang / gist:3090254
Created July 11, 2012 12:59
branch-pre
#include <algorithm>
#include <ctime>
#include <iostream>
int main()
{
// generate data
const unsigned arraySize = 32768;
int data[arraySize];